index.js 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197
  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/TAGS/')) {
  1956. result.ref = ref;
  1957. }
  1958. // refs/
  1959. else if (upperRef.startsWith('REFS/') && commit) {
  1960. result.ref = commit;
  1961. }
  1962. // Unqualified ref, check for a matching branch or tag
  1963. else {
  1964. if (yield git.branchExists(true, `origin/${ref}`)) {
  1965. result.ref = ref;
  1966. result.startPoint = `refs/remotes/origin/${ref}`;
  1967. }
  1968. else if (yield git.tagExists(`${ref}`)) {
  1969. result.ref = `refs/tags/${ref}`;
  1970. }
  1971. else {
  1972. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  1973. }
  1974. }
  1975. return result;
  1976. });
  1977. }
  1978. exports.getCheckoutInfo = getCheckoutInfo;
  1979. function getRefSpecForAllHistory(ref, commit) {
  1980. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  1981. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  1982. const branch = ref.substring('refs/pull/'.length);
  1983. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  1984. }
  1985. return result;
  1986. }
  1987. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  1988. function getRefSpec(ref, commit) {
  1989. if (!ref && !commit) {
  1990. throw new Error('Args ref and commit cannot both be empty');
  1991. }
  1992. const upperRef = (ref || '').toUpperCase();
  1993. // SHA
  1994. if (commit) {
  1995. // refs/heads
  1996. if (upperRef.startsWith('REFS/HEADS/')) {
  1997. const branch = ref.substring('refs/heads/'.length);
  1998. return [`+${commit}:refs/remotes/origin/${branch}`];
  1999. }
  2000. // refs/pull/
  2001. else if (upperRef.startsWith('REFS/PULL/')) {
  2002. const branch = ref.substring('refs/pull/'.length);
  2003. return [`+${commit}:refs/remotes/pull/${branch}`];
  2004. }
  2005. // refs/tags/
  2006. else if (upperRef.startsWith('REFS/TAGS/')) {
  2007. return [`+${commit}:${ref}`];
  2008. }
  2009. // Otherwise no destination ref
  2010. else {
  2011. return [commit];
  2012. }
  2013. }
  2014. // Unqualified ref, check for a matching branch or tag
  2015. else if (!upperRef.startsWith('REFS/')) {
  2016. return [
  2017. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2018. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2019. ];
  2020. }
  2021. // refs/heads/
  2022. else if (upperRef.startsWith('REFS/HEADS/')) {
  2023. const branch = ref.substring('refs/heads/'.length);
  2024. return [`+${ref}:refs/remotes/origin/${branch}`];
  2025. }
  2026. // refs/pull/
  2027. else if (upperRef.startsWith('REFS/PULL/')) {
  2028. const branch = ref.substring('refs/pull/'.length);
  2029. return [`+${ref}:refs/remotes/pull/${branch}`];
  2030. }
  2031. // refs/tags/
  2032. else {
  2033. return [`+${ref}:${ref}`];
  2034. }
  2035. }
  2036. exports.getRefSpec = getRefSpec;
  2037. /**
  2038. * Tests whether the initial fetch created the ref at the expected commit
  2039. */
  2040. function testRef(git, ref, commit) {
  2041. return __awaiter(this, void 0, void 0, function* () {
  2042. if (!git) {
  2043. throw new Error('Arg git cannot be empty');
  2044. }
  2045. if (!ref && !commit) {
  2046. throw new Error('Args ref and commit cannot both be empty');
  2047. }
  2048. // No SHA? Nothing to test
  2049. if (!commit) {
  2050. return true;
  2051. }
  2052. // SHA only?
  2053. else if (!ref) {
  2054. return yield git.shaExists(commit);
  2055. }
  2056. const upperRef = ref.toUpperCase();
  2057. // refs/heads/
  2058. if (upperRef.startsWith('REFS/HEADS/')) {
  2059. const branch = ref.substring('refs/heads/'.length);
  2060. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2061. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2062. }
  2063. // refs/pull/
  2064. else if (upperRef.startsWith('REFS/PULL/')) {
  2065. // Assume matches because fetched using the commit
  2066. return true;
  2067. }
  2068. // refs/tags/
  2069. else if (upperRef.startsWith('REFS/TAGS/')) {
  2070. const tagName = ref.substring('refs/tags/'.length);
  2071. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2072. }
  2073. // Unexpected
  2074. else {
  2075. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2076. return true;
  2077. }
  2078. });
  2079. }
  2080. exports.testRef = testRef;
  2081. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2082. return __awaiter(this, void 0, void 0, function* () {
  2083. var _a;
  2084. try {
  2085. // GHES?
  2086. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2087. return;
  2088. }
  2089. // Auth token?
  2090. if (!token) {
  2091. return;
  2092. }
  2093. // Public PR synchronize, for workflow repo?
  2094. if (fromPayload('repository.private') !== false ||
  2095. github.context.eventName !== 'pull_request' ||
  2096. fromPayload('action') !== 'synchronize' ||
  2097. repositoryOwner !== github.context.repo.owner ||
  2098. repositoryName !== github.context.repo.repo ||
  2099. ref !== github.context.ref ||
  2100. !ref.startsWith('refs/pull/') ||
  2101. commit !== github.context.sha) {
  2102. return;
  2103. }
  2104. // Head SHA
  2105. const expectedHeadSha = fromPayload('after');
  2106. if (!expectedHeadSha) {
  2107. core.debug('Unable to determine head sha');
  2108. return;
  2109. }
  2110. // Base SHA
  2111. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2112. if (!expectedBaseSha) {
  2113. core.debug('Unable to determine base sha');
  2114. return;
  2115. }
  2116. // Expected message?
  2117. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2118. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2119. return;
  2120. }
  2121. // Extract details from message
  2122. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2123. if (!match) {
  2124. core.debug('Unexpected message format');
  2125. return;
  2126. }
  2127. // Post telemetry
  2128. const actualHeadSha = match[1];
  2129. if (actualHeadSha !== expectedHeadSha) {
  2130. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2131. const octokit = github.getOctokit(token, {
  2132. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2133. 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})`
  2134. });
  2135. yield octokit.rest.repos.get({
  2136. owner: repositoryOwner,
  2137. repo: repositoryName
  2138. });
  2139. }
  2140. }
  2141. catch (err) {
  2142. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2143. }
  2144. });
  2145. }
  2146. exports.checkCommitInfo = checkCommitInfo;
  2147. function fromPayload(path) {
  2148. return select(github.context.payload, path);
  2149. }
  2150. function select(obj, path) {
  2151. if (!obj) {
  2152. return undefined;
  2153. }
  2154. const i = path.indexOf('.');
  2155. if (i < 0) {
  2156. return obj[path];
  2157. }
  2158. const key = path.substr(0, i);
  2159. return select(obj[key], path.substr(i + 1));
  2160. }
  2161. /***/ }),
  2162. /***/ 3120:
  2163. /***/ ((__unused_webpack_module, exports) => {
  2164. "use strict";
  2165. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2166. exports.escape = void 0;
  2167. function escape(value) {
  2168. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2169. return `\\${x}`;
  2170. });
  2171. }
  2172. exports.escape = escape;
  2173. /***/ }),
  2174. /***/ 2155:
  2175. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2176. "use strict";
  2177. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2178. if (k2 === undefined) k2 = k;
  2179. var desc = Object.getOwnPropertyDescriptor(m, k);
  2180. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2181. desc = { enumerable: true, get: function() { return m[k]; } };
  2182. }
  2183. Object.defineProperty(o, k2, desc);
  2184. }) : (function(o, m, k, k2) {
  2185. if (k2 === undefined) k2 = k;
  2186. o[k2] = m[k];
  2187. }));
  2188. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2189. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2190. }) : function(o, v) {
  2191. o["default"] = v;
  2192. });
  2193. var __importStar = (this && this.__importStar) || function (mod) {
  2194. if (mod && mod.__esModule) return mod;
  2195. var result = {};
  2196. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2197. __setModuleDefault(result, mod);
  2198. return result;
  2199. };
  2200. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2201. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2202. return new (P || (P = Promise))(function (resolve, reject) {
  2203. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2204. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2205. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2206. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2207. });
  2208. };
  2209. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2210. exports.execute = exports.RetryHelper = void 0;
  2211. const core = __importStar(__nccwpck_require__(2186));
  2212. const defaultMaxAttempts = 3;
  2213. const defaultMinSeconds = 10;
  2214. const defaultMaxSeconds = 20;
  2215. class RetryHelper {
  2216. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2217. this.maxAttempts = maxAttempts;
  2218. this.minSeconds = Math.floor(minSeconds);
  2219. this.maxSeconds = Math.floor(maxSeconds);
  2220. if (this.minSeconds > this.maxSeconds) {
  2221. throw new Error('min seconds should be less than or equal to max seconds');
  2222. }
  2223. }
  2224. execute(action) {
  2225. return __awaiter(this, void 0, void 0, function* () {
  2226. let attempt = 1;
  2227. while (attempt < this.maxAttempts) {
  2228. // Try
  2229. try {
  2230. return yield action();
  2231. }
  2232. catch (err) {
  2233. core.info(err === null || err === void 0 ? void 0 : err.message);
  2234. }
  2235. // Sleep
  2236. const seconds = this.getSleepAmount();
  2237. core.info(`Waiting ${seconds} seconds before trying again`);
  2238. yield this.sleep(seconds);
  2239. attempt++;
  2240. }
  2241. // Last attempt
  2242. return yield action();
  2243. });
  2244. }
  2245. getSleepAmount() {
  2246. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2247. this.minSeconds);
  2248. }
  2249. sleep(seconds) {
  2250. return __awaiter(this, void 0, void 0, function* () {
  2251. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2252. });
  2253. }
  2254. }
  2255. exports.RetryHelper = RetryHelper;
  2256. function execute(action) {
  2257. return __awaiter(this, void 0, void 0, function* () {
  2258. const retryHelper = new RetryHelper();
  2259. return yield retryHelper.execute(action);
  2260. });
  2261. }
  2262. exports.execute = execute;
  2263. /***/ }),
  2264. /***/ 4866:
  2265. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2266. "use strict";
  2267. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2268. if (k2 === undefined) k2 = k;
  2269. var desc = Object.getOwnPropertyDescriptor(m, k);
  2270. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2271. desc = { enumerable: true, get: function() { return m[k]; } };
  2272. }
  2273. Object.defineProperty(o, k2, desc);
  2274. }) : (function(o, m, k, k2) {
  2275. if (k2 === undefined) k2 = k;
  2276. o[k2] = m[k];
  2277. }));
  2278. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2279. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2280. }) : function(o, v) {
  2281. o["default"] = v;
  2282. });
  2283. var __importStar = (this && this.__importStar) || function (mod) {
  2284. if (mod && mod.__esModule) return mod;
  2285. var result = {};
  2286. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2287. __setModuleDefault(result, mod);
  2288. return result;
  2289. };
  2290. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2291. exports.setSafeDirectory = exports.setSshKnownHostsPath = exports.setSshKeyPath = exports.setRepositoryPath = exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2292. const core = __importStar(__nccwpck_require__(2186));
  2293. /**
  2294. * Indicates whether the POST action is running
  2295. */
  2296. exports.IsPost = !!core.getState('isPost');
  2297. /**
  2298. * The repository path for the POST action. The value is empty during the MAIN action.
  2299. */
  2300. exports.RepositoryPath = core.getState('repositoryPath');
  2301. /**
  2302. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2303. */
  2304. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2305. /**
  2306. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2307. */
  2308. exports.SshKeyPath = core.getState('sshKeyPath');
  2309. /**
  2310. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2311. */
  2312. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2313. /**
  2314. * Save the repository path so the POST action can retrieve the value.
  2315. */
  2316. function setRepositoryPath(repositoryPath) {
  2317. core.saveState('repositoryPath', repositoryPath);
  2318. }
  2319. exports.setRepositoryPath = setRepositoryPath;
  2320. /**
  2321. * Save the SSH key path so the POST action can retrieve the value.
  2322. */
  2323. function setSshKeyPath(sshKeyPath) {
  2324. core.saveState('sshKeyPath', sshKeyPath);
  2325. }
  2326. exports.setSshKeyPath = setSshKeyPath;
  2327. /**
  2328. * Save the SSH known hosts path so the POST action can retrieve the value.
  2329. */
  2330. function setSshKnownHostsPath(sshKnownHostsPath) {
  2331. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2332. }
  2333. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2334. /**
  2335. * Save the set-safe-directory input so the POST action can retrieve the value.
  2336. */
  2337. function setSafeDirectory() {
  2338. core.saveState('setSafeDirectory', 'true');
  2339. }
  2340. exports.setSafeDirectory = setSafeDirectory;
  2341. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2342. // This is necessary since we don't have a separate entry point.
  2343. if (!exports.IsPost) {
  2344. core.saveState('isPost', 'true');
  2345. }
  2346. /***/ }),
  2347. /***/ 9437:
  2348. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2349. "use strict";
  2350. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2351. if (k2 === undefined) k2 = k;
  2352. var desc = Object.getOwnPropertyDescriptor(m, k);
  2353. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2354. desc = { enumerable: true, get: function() { return m[k]; } };
  2355. }
  2356. Object.defineProperty(o, k2, desc);
  2357. }) : (function(o, m, k, k2) {
  2358. if (k2 === undefined) k2 = k;
  2359. o[k2] = m[k];
  2360. }));
  2361. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2362. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2363. }) : function(o, v) {
  2364. o["default"] = v;
  2365. });
  2366. var __importStar = (this && this.__importStar) || function (mod) {
  2367. if (mod && mod.__esModule) return mod;
  2368. var result = {};
  2369. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2370. __setModuleDefault(result, mod);
  2371. return result;
  2372. };
  2373. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2374. exports.isGhes = exports.getServerApiUrl = exports.getServerUrl = exports.getFetchUrl = void 0;
  2375. const assert = __importStar(__nccwpck_require__(9491));
  2376. const url_1 = __nccwpck_require__(7310);
  2377. function getFetchUrl(settings) {
  2378. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2379. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2380. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2381. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2382. const encodedName = encodeURIComponent(settings.repositoryName);
  2383. if (settings.sshKey) {
  2384. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2385. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2386. }
  2387. // "origin" is SCHEME://HOSTNAME[:PORT]
  2388. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2389. }
  2390. exports.getFetchUrl = getFetchUrl;
  2391. function getServerUrl(url) {
  2392. let urlValue = url && url.trim().length > 0
  2393. ? url
  2394. : process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2395. return new url_1.URL(urlValue);
  2396. }
  2397. exports.getServerUrl = getServerUrl;
  2398. function getServerApiUrl(url) {
  2399. let apiUrl = 'https://api.github.com';
  2400. if (isGhes(url)) {
  2401. const serverUrl = getServerUrl(url);
  2402. apiUrl = new url_1.URL(`${serverUrl.origin}/api/v3`).toString();
  2403. }
  2404. return apiUrl;
  2405. }
  2406. exports.getServerApiUrl = getServerApiUrl;
  2407. function isGhes(url) {
  2408. const ghUrl = getServerUrl(url);
  2409. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  2410. }
  2411. exports.isGhes = isGhes;
  2412. /***/ }),
  2413. /***/ 9568:
  2414. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2415. "use strict";
  2416. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2417. if (k2 === undefined) k2 = k;
  2418. var desc = Object.getOwnPropertyDescriptor(m, k);
  2419. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2420. desc = { enumerable: true, get: function() { return m[k]; } };
  2421. }
  2422. Object.defineProperty(o, k2, desc);
  2423. }) : (function(o, m, k, k2) {
  2424. if (k2 === undefined) k2 = k;
  2425. o[k2] = m[k];
  2426. }));
  2427. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2428. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2429. }) : function(o, v) {
  2430. o["default"] = v;
  2431. });
  2432. var __importStar = (this && this.__importStar) || function (mod) {
  2433. if (mod && mod.__esModule) return mod;
  2434. var result = {};
  2435. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2436. __setModuleDefault(result, mod);
  2437. return result;
  2438. };
  2439. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2440. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2441. return new (P || (P = Promise))(function (resolve, reject) {
  2442. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2443. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2444. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2445. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2446. });
  2447. };
  2448. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2449. exports.getOrganizationId = void 0;
  2450. const core = __importStar(__nccwpck_require__(2186));
  2451. const fs = __importStar(__nccwpck_require__(7147));
  2452. /**
  2453. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2454. */
  2455. function getOrganizationId() {
  2456. return __awaiter(this, void 0, void 0, function* () {
  2457. var _a, _b;
  2458. try {
  2459. const eventPath = process.env.GITHUB_EVENT_PATH;
  2460. if (!eventPath) {
  2461. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2462. return;
  2463. }
  2464. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2465. const event = JSON.parse(content);
  2466. 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;
  2467. if (typeof id !== 'number') {
  2468. core.debug('Repository owner ID not found within GITHUB event info');
  2469. return;
  2470. }
  2471. return id;
  2472. }
  2473. catch (err) {
  2474. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2475. }
  2476. });
  2477. }
  2478. exports.getOrganizationId = getOrganizationId;
  2479. /***/ }),
  2480. /***/ 7351:
  2481. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2482. "use strict";
  2483. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2484. if (k2 === undefined) k2 = k;
  2485. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2486. }) : (function(o, m, k, k2) {
  2487. if (k2 === undefined) k2 = k;
  2488. o[k2] = m[k];
  2489. }));
  2490. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2491. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2492. }) : function(o, v) {
  2493. o["default"] = v;
  2494. });
  2495. var __importStar = (this && this.__importStar) || function (mod) {
  2496. if (mod && mod.__esModule) return mod;
  2497. var result = {};
  2498. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2499. __setModuleDefault(result, mod);
  2500. return result;
  2501. };
  2502. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2503. exports.issue = exports.issueCommand = void 0;
  2504. const os = __importStar(__nccwpck_require__(2037));
  2505. const utils_1 = __nccwpck_require__(5278);
  2506. /**
  2507. * Commands
  2508. *
  2509. * Command Format:
  2510. * ::name key=value,key=value::message
  2511. *
  2512. * Examples:
  2513. * ::warning::This is the message
  2514. * ::set-env name=MY_VAR::some value
  2515. */
  2516. function issueCommand(command, properties, message) {
  2517. const cmd = new Command(command, properties, message);
  2518. process.stdout.write(cmd.toString() + os.EOL);
  2519. }
  2520. exports.issueCommand = issueCommand;
  2521. function issue(name, message = '') {
  2522. issueCommand(name, {}, message);
  2523. }
  2524. exports.issue = issue;
  2525. const CMD_STRING = '::';
  2526. class Command {
  2527. constructor(command, properties, message) {
  2528. if (!command) {
  2529. command = 'missing.command';
  2530. }
  2531. this.command = command;
  2532. this.properties = properties;
  2533. this.message = message;
  2534. }
  2535. toString() {
  2536. let cmdStr = CMD_STRING + this.command;
  2537. if (this.properties && Object.keys(this.properties).length > 0) {
  2538. cmdStr += ' ';
  2539. let first = true;
  2540. for (const key in this.properties) {
  2541. if (this.properties.hasOwnProperty(key)) {
  2542. const val = this.properties[key];
  2543. if (val) {
  2544. if (first) {
  2545. first = false;
  2546. }
  2547. else {
  2548. cmdStr += ',';
  2549. }
  2550. cmdStr += `${key}=${escapeProperty(val)}`;
  2551. }
  2552. }
  2553. }
  2554. }
  2555. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2556. return cmdStr;
  2557. }
  2558. }
  2559. function escapeData(s) {
  2560. return utils_1.toCommandValue(s)
  2561. .replace(/%/g, '%25')
  2562. .replace(/\r/g, '%0D')
  2563. .replace(/\n/g, '%0A');
  2564. }
  2565. function escapeProperty(s) {
  2566. return utils_1.toCommandValue(s)
  2567. .replace(/%/g, '%25')
  2568. .replace(/\r/g, '%0D')
  2569. .replace(/\n/g, '%0A')
  2570. .replace(/:/g, '%3A')
  2571. .replace(/,/g, '%2C');
  2572. }
  2573. //# sourceMappingURL=command.js.map
  2574. /***/ }),
  2575. /***/ 2186:
  2576. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2577. "use strict";
  2578. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2579. if (k2 === undefined) k2 = k;
  2580. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2581. }) : (function(o, m, k, k2) {
  2582. if (k2 === undefined) k2 = k;
  2583. o[k2] = m[k];
  2584. }));
  2585. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2586. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2587. }) : function(o, v) {
  2588. o["default"] = v;
  2589. });
  2590. var __importStar = (this && this.__importStar) || function (mod) {
  2591. if (mod && mod.__esModule) return mod;
  2592. var result = {};
  2593. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2594. __setModuleDefault(result, mod);
  2595. return result;
  2596. };
  2597. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2598. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2599. return new (P || (P = Promise))(function (resolve, reject) {
  2600. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2601. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2602. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2603. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2604. });
  2605. };
  2606. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2607. 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;
  2608. const command_1 = __nccwpck_require__(7351);
  2609. const file_command_1 = __nccwpck_require__(717);
  2610. const utils_1 = __nccwpck_require__(5278);
  2611. const os = __importStar(__nccwpck_require__(2037));
  2612. const path = __importStar(__nccwpck_require__(1017));
  2613. const oidc_utils_1 = __nccwpck_require__(8041);
  2614. /**
  2615. * The code to exit an action
  2616. */
  2617. var ExitCode;
  2618. (function (ExitCode) {
  2619. /**
  2620. * A code indicating that the action was successful
  2621. */
  2622. ExitCode[ExitCode["Success"] = 0] = "Success";
  2623. /**
  2624. * A code indicating that the action was a failure
  2625. */
  2626. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2627. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2628. //-----------------------------------------------------------------------
  2629. // Variables
  2630. //-----------------------------------------------------------------------
  2631. /**
  2632. * Sets env variable for this action and future actions in the job
  2633. * @param name the name of the variable to set
  2634. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2635. */
  2636. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2637. function exportVariable(name, val) {
  2638. const convertedVal = utils_1.toCommandValue(val);
  2639. process.env[name] = convertedVal;
  2640. const filePath = process.env['GITHUB_ENV'] || '';
  2641. if (filePath) {
  2642. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2643. }
  2644. command_1.issueCommand('set-env', { name }, convertedVal);
  2645. }
  2646. exports.exportVariable = exportVariable;
  2647. /**
  2648. * Registers a secret which will get masked from logs
  2649. * @param secret value of the secret
  2650. */
  2651. function setSecret(secret) {
  2652. command_1.issueCommand('add-mask', {}, secret);
  2653. }
  2654. exports.setSecret = setSecret;
  2655. /**
  2656. * Prepends inputPath to the PATH (for this action and future actions)
  2657. * @param inputPath
  2658. */
  2659. function addPath(inputPath) {
  2660. const filePath = process.env['GITHUB_PATH'] || '';
  2661. if (filePath) {
  2662. file_command_1.issueFileCommand('PATH', inputPath);
  2663. }
  2664. else {
  2665. command_1.issueCommand('add-path', {}, inputPath);
  2666. }
  2667. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2668. }
  2669. exports.addPath = addPath;
  2670. /**
  2671. * Gets the value of an input.
  2672. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2673. * Returns an empty string if the value is not defined.
  2674. *
  2675. * @param name name of the input to get
  2676. * @param options optional. See InputOptions.
  2677. * @returns string
  2678. */
  2679. function getInput(name, options) {
  2680. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2681. if (options && options.required && !val) {
  2682. throw new Error(`Input required and not supplied: ${name}`);
  2683. }
  2684. if (options && options.trimWhitespace === false) {
  2685. return val;
  2686. }
  2687. return val.trim();
  2688. }
  2689. exports.getInput = getInput;
  2690. /**
  2691. * Gets the values of an multiline input. Each value is also trimmed.
  2692. *
  2693. * @param name name of the input to get
  2694. * @param options optional. See InputOptions.
  2695. * @returns string[]
  2696. *
  2697. */
  2698. function getMultilineInput(name, options) {
  2699. const inputs = getInput(name, options)
  2700. .split('\n')
  2701. .filter(x => x !== '');
  2702. if (options && options.trimWhitespace === false) {
  2703. return inputs;
  2704. }
  2705. return inputs.map(input => input.trim());
  2706. }
  2707. exports.getMultilineInput = getMultilineInput;
  2708. /**
  2709. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2710. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2711. * The return value is also in boolean type.
  2712. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2713. *
  2714. * @param name name of the input to get
  2715. * @param options optional. See InputOptions.
  2716. * @returns boolean
  2717. */
  2718. function getBooleanInput(name, options) {
  2719. const trueValue = ['true', 'True', 'TRUE'];
  2720. const falseValue = ['false', 'False', 'FALSE'];
  2721. const val = getInput(name, options);
  2722. if (trueValue.includes(val))
  2723. return true;
  2724. if (falseValue.includes(val))
  2725. return false;
  2726. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  2727. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  2728. }
  2729. exports.getBooleanInput = getBooleanInput;
  2730. /**
  2731. * Sets the value of an output.
  2732. *
  2733. * @param name name of the output to set
  2734. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2735. */
  2736. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2737. function setOutput(name, value) {
  2738. const filePath = process.env['GITHUB_OUTPUT'] || '';
  2739. if (filePath) {
  2740. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  2741. }
  2742. process.stdout.write(os.EOL);
  2743. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  2744. }
  2745. exports.setOutput = setOutput;
  2746. /**
  2747. * Enables or disables the echoing of commands into stdout for the rest of the step.
  2748. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  2749. *
  2750. */
  2751. function setCommandEcho(enabled) {
  2752. command_1.issue('echo', enabled ? 'on' : 'off');
  2753. }
  2754. exports.setCommandEcho = setCommandEcho;
  2755. //-----------------------------------------------------------------------
  2756. // Results
  2757. //-----------------------------------------------------------------------
  2758. /**
  2759. * Sets the action status to failed.
  2760. * When the action exits it will be with an exit code of 1
  2761. * @param message add error issue message
  2762. */
  2763. function setFailed(message) {
  2764. process.exitCode = ExitCode.Failure;
  2765. error(message);
  2766. }
  2767. exports.setFailed = setFailed;
  2768. //-----------------------------------------------------------------------
  2769. // Logging Commands
  2770. //-----------------------------------------------------------------------
  2771. /**
  2772. * Gets whether Actions Step Debug is on or not
  2773. */
  2774. function isDebug() {
  2775. return process.env['RUNNER_DEBUG'] === '1';
  2776. }
  2777. exports.isDebug = isDebug;
  2778. /**
  2779. * Writes debug message to user log
  2780. * @param message debug message
  2781. */
  2782. function debug(message) {
  2783. command_1.issueCommand('debug', {}, message);
  2784. }
  2785. exports.debug = debug;
  2786. /**
  2787. * Adds an error issue
  2788. * @param message error issue message. Errors will be converted to string via toString()
  2789. * @param properties optional properties to add to the annotation.
  2790. */
  2791. function error(message, properties = {}) {
  2792. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2793. }
  2794. exports.error = error;
  2795. /**
  2796. * Adds a warning issue
  2797. * @param message warning issue message. Errors will be converted to string via toString()
  2798. * @param properties optional properties to add to the annotation.
  2799. */
  2800. function warning(message, properties = {}) {
  2801. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2802. }
  2803. exports.warning = warning;
  2804. /**
  2805. * Adds a notice issue
  2806. * @param message notice issue message. Errors will be converted to string via toString()
  2807. * @param properties optional properties to add to the annotation.
  2808. */
  2809. function notice(message, properties = {}) {
  2810. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2811. }
  2812. exports.notice = notice;
  2813. /**
  2814. * Writes info to log with console.log.
  2815. * @param message info message
  2816. */
  2817. function info(message) {
  2818. process.stdout.write(message + os.EOL);
  2819. }
  2820. exports.info = info;
  2821. /**
  2822. * Begin an output group.
  2823. *
  2824. * Output until the next `groupEnd` will be foldable in this group
  2825. *
  2826. * @param name The name of the output group
  2827. */
  2828. function startGroup(name) {
  2829. command_1.issue('group', name);
  2830. }
  2831. exports.startGroup = startGroup;
  2832. /**
  2833. * End an output group.
  2834. */
  2835. function endGroup() {
  2836. command_1.issue('endgroup');
  2837. }
  2838. exports.endGroup = endGroup;
  2839. /**
  2840. * Wrap an asynchronous function call in a group.
  2841. *
  2842. * Returns the same type as the function itself.
  2843. *
  2844. * @param name The name of the group
  2845. * @param fn The function to wrap in the group
  2846. */
  2847. function group(name, fn) {
  2848. return __awaiter(this, void 0, void 0, function* () {
  2849. startGroup(name);
  2850. let result;
  2851. try {
  2852. result = yield fn();
  2853. }
  2854. finally {
  2855. endGroup();
  2856. }
  2857. return result;
  2858. });
  2859. }
  2860. exports.group = group;
  2861. //-----------------------------------------------------------------------
  2862. // Wrapper action state
  2863. //-----------------------------------------------------------------------
  2864. /**
  2865. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  2866. *
  2867. * @param name name of the state to store
  2868. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2869. */
  2870. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2871. function saveState(name, value) {
  2872. const filePath = process.env['GITHUB_STATE'] || '';
  2873. if (filePath) {
  2874. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  2875. }
  2876. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  2877. }
  2878. exports.saveState = saveState;
  2879. /**
  2880. * Gets the value of an state set by this action's main execution.
  2881. *
  2882. * @param name name of the state to get
  2883. * @returns string
  2884. */
  2885. function getState(name) {
  2886. return process.env[`STATE_${name}`] || '';
  2887. }
  2888. exports.getState = getState;
  2889. function getIDToken(aud) {
  2890. return __awaiter(this, void 0, void 0, function* () {
  2891. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  2892. });
  2893. }
  2894. exports.getIDToken = getIDToken;
  2895. /**
  2896. * Summary exports
  2897. */
  2898. var summary_1 = __nccwpck_require__(1327);
  2899. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  2900. /**
  2901. * @deprecated use core.summary
  2902. */
  2903. var summary_2 = __nccwpck_require__(1327);
  2904. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  2905. /**
  2906. * Path exports
  2907. */
  2908. var path_utils_1 = __nccwpck_require__(2981);
  2909. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  2910. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  2911. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  2912. //# sourceMappingURL=core.js.map
  2913. /***/ }),
  2914. /***/ 717:
  2915. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2916. "use strict";
  2917. // For internal use, subject to change.
  2918. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2919. if (k2 === undefined) k2 = k;
  2920. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2921. }) : (function(o, m, k, k2) {
  2922. if (k2 === undefined) k2 = k;
  2923. o[k2] = m[k];
  2924. }));
  2925. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2926. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2927. }) : function(o, v) {
  2928. o["default"] = v;
  2929. });
  2930. var __importStar = (this && this.__importStar) || function (mod) {
  2931. if (mod && mod.__esModule) return mod;
  2932. var result = {};
  2933. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2934. __setModuleDefault(result, mod);
  2935. return result;
  2936. };
  2937. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2938. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  2939. // We use any as a valid input type
  2940. /* eslint-disable @typescript-eslint/no-explicit-any */
  2941. const fs = __importStar(__nccwpck_require__(7147));
  2942. const os = __importStar(__nccwpck_require__(2037));
  2943. const uuid_1 = __nccwpck_require__(8974);
  2944. const utils_1 = __nccwpck_require__(5278);
  2945. function issueFileCommand(command, message) {
  2946. const filePath = process.env[`GITHUB_${command}`];
  2947. if (!filePath) {
  2948. throw new Error(`Unable to find environment variable for file command ${command}`);
  2949. }
  2950. if (!fs.existsSync(filePath)) {
  2951. throw new Error(`Missing file at path: ${filePath}`);
  2952. }
  2953. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  2954. encoding: 'utf8'
  2955. });
  2956. }
  2957. exports.issueFileCommand = issueFileCommand;
  2958. function prepareKeyValueMessage(key, value) {
  2959. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  2960. const convertedValue = utils_1.toCommandValue(value);
  2961. // These should realistically never happen, but just in case someone finds a
  2962. // way to exploit uuid generation let's not allow keys or values that contain
  2963. // the delimiter.
  2964. if (key.includes(delimiter)) {
  2965. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  2966. }
  2967. if (convertedValue.includes(delimiter)) {
  2968. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  2969. }
  2970. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  2971. }
  2972. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  2973. //# sourceMappingURL=file-command.js.map
  2974. /***/ }),
  2975. /***/ 8041:
  2976. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2977. "use strict";
  2978. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2979. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2980. return new (P || (P = Promise))(function (resolve, reject) {
  2981. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2982. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2983. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2984. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2985. });
  2986. };
  2987. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2988. exports.OidcClient = void 0;
  2989. const http_client_1 = __nccwpck_require__(6255);
  2990. const auth_1 = __nccwpck_require__(5526);
  2991. const core_1 = __nccwpck_require__(2186);
  2992. class OidcClient {
  2993. static createHttpClient(allowRetry = true, maxRetry = 10) {
  2994. const requestOptions = {
  2995. allowRetries: allowRetry,
  2996. maxRetries: maxRetry
  2997. };
  2998. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  2999. }
  3000. static getRequestToken() {
  3001. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3002. if (!token) {
  3003. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3004. }
  3005. return token;
  3006. }
  3007. static getIDTokenUrl() {
  3008. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3009. if (!runtimeUrl) {
  3010. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3011. }
  3012. return runtimeUrl;
  3013. }
  3014. static getCall(id_token_url) {
  3015. var _a;
  3016. return __awaiter(this, void 0, void 0, function* () {
  3017. const httpclient = OidcClient.createHttpClient();
  3018. const res = yield httpclient
  3019. .getJson(id_token_url)
  3020. .catch(error => {
  3021. throw new Error(`Failed to get ID Token. \n
  3022. Error Code : ${error.statusCode}\n
  3023. Error Message: ${error.message}`);
  3024. });
  3025. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3026. if (!id_token) {
  3027. throw new Error('Response json body do not have ID Token field');
  3028. }
  3029. return id_token;
  3030. });
  3031. }
  3032. static getIDToken(audience) {
  3033. return __awaiter(this, void 0, void 0, function* () {
  3034. try {
  3035. // New ID Token is requested from action service
  3036. let id_token_url = OidcClient.getIDTokenUrl();
  3037. if (audience) {
  3038. const encodedAudience = encodeURIComponent(audience);
  3039. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3040. }
  3041. core_1.debug(`ID token url is ${id_token_url}`);
  3042. const id_token = yield OidcClient.getCall(id_token_url);
  3043. core_1.setSecret(id_token);
  3044. return id_token;
  3045. }
  3046. catch (error) {
  3047. throw new Error(`Error message: ${error.message}`);
  3048. }
  3049. });
  3050. }
  3051. }
  3052. exports.OidcClient = OidcClient;
  3053. //# sourceMappingURL=oidc-utils.js.map
  3054. /***/ }),
  3055. /***/ 2981:
  3056. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3057. "use strict";
  3058. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3059. if (k2 === undefined) k2 = k;
  3060. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3061. }) : (function(o, m, k, k2) {
  3062. if (k2 === undefined) k2 = k;
  3063. o[k2] = m[k];
  3064. }));
  3065. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3066. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3067. }) : function(o, v) {
  3068. o["default"] = v;
  3069. });
  3070. var __importStar = (this && this.__importStar) || function (mod) {
  3071. if (mod && mod.__esModule) return mod;
  3072. var result = {};
  3073. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3074. __setModuleDefault(result, mod);
  3075. return result;
  3076. };
  3077. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3078. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3079. const path = __importStar(__nccwpck_require__(1017));
  3080. /**
  3081. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3082. * replaced with /.
  3083. *
  3084. * @param pth. Path to transform.
  3085. * @return string Posix path.
  3086. */
  3087. function toPosixPath(pth) {
  3088. return pth.replace(/[\\]/g, '/');
  3089. }
  3090. exports.toPosixPath = toPosixPath;
  3091. /**
  3092. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3093. * replaced with \\.
  3094. *
  3095. * @param pth. Path to transform.
  3096. * @return string Win32 path.
  3097. */
  3098. function toWin32Path(pth) {
  3099. return pth.replace(/[/]/g, '\\');
  3100. }
  3101. exports.toWin32Path = toWin32Path;
  3102. /**
  3103. * toPlatformPath converts the given path to a platform-specific path. It does
  3104. * this by replacing instances of / and \ with the platform-specific path
  3105. * separator.
  3106. *
  3107. * @param pth The path to platformize.
  3108. * @return string The platform-specific path.
  3109. */
  3110. function toPlatformPath(pth) {
  3111. return pth.replace(/[/\\]/g, path.sep);
  3112. }
  3113. exports.toPlatformPath = toPlatformPath;
  3114. //# sourceMappingURL=path-utils.js.map
  3115. /***/ }),
  3116. /***/ 1327:
  3117. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3118. "use strict";
  3119. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3120. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3121. return new (P || (P = Promise))(function (resolve, reject) {
  3122. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3123. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3124. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3125. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3126. });
  3127. };
  3128. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3129. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3130. const os_1 = __nccwpck_require__(2037);
  3131. const fs_1 = __nccwpck_require__(7147);
  3132. const { access, appendFile, writeFile } = fs_1.promises;
  3133. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3134. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3135. class Summary {
  3136. constructor() {
  3137. this._buffer = '';
  3138. }
  3139. /**
  3140. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3141. * Also checks r/w permissions.
  3142. *
  3143. * @returns step summary file path
  3144. */
  3145. filePath() {
  3146. return __awaiter(this, void 0, void 0, function* () {
  3147. if (this._filePath) {
  3148. return this._filePath;
  3149. }
  3150. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3151. if (!pathFromEnv) {
  3152. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3153. }
  3154. try {
  3155. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3156. }
  3157. catch (_a) {
  3158. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3159. }
  3160. this._filePath = pathFromEnv;
  3161. return this._filePath;
  3162. });
  3163. }
  3164. /**
  3165. * Wraps content in an HTML tag, adding any HTML attributes
  3166. *
  3167. * @param {string} tag HTML tag to wrap
  3168. * @param {string | null} content content within the tag
  3169. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3170. *
  3171. * @returns {string} content wrapped in HTML element
  3172. */
  3173. wrap(tag, content, attrs = {}) {
  3174. const htmlAttrs = Object.entries(attrs)
  3175. .map(([key, value]) => ` ${key}="${value}"`)
  3176. .join('');
  3177. if (!content) {
  3178. return `<${tag}${htmlAttrs}>`;
  3179. }
  3180. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3181. }
  3182. /**
  3183. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3184. *
  3185. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3186. *
  3187. * @returns {Promise<Summary>} summary instance
  3188. */
  3189. write(options) {
  3190. return __awaiter(this, void 0, void 0, function* () {
  3191. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3192. const filePath = yield this.filePath();
  3193. const writeFunc = overwrite ? writeFile : appendFile;
  3194. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3195. return this.emptyBuffer();
  3196. });
  3197. }
  3198. /**
  3199. * Clears the summary buffer and wipes the summary file
  3200. *
  3201. * @returns {Summary} summary instance
  3202. */
  3203. clear() {
  3204. return __awaiter(this, void 0, void 0, function* () {
  3205. return this.emptyBuffer().write({ overwrite: true });
  3206. });
  3207. }
  3208. /**
  3209. * Returns the current summary buffer as a string
  3210. *
  3211. * @returns {string} string of summary buffer
  3212. */
  3213. stringify() {
  3214. return this._buffer;
  3215. }
  3216. /**
  3217. * If the summary buffer is empty
  3218. *
  3219. * @returns {boolen} true if the buffer is empty
  3220. */
  3221. isEmptyBuffer() {
  3222. return this._buffer.length === 0;
  3223. }
  3224. /**
  3225. * Resets the summary buffer without writing to summary file
  3226. *
  3227. * @returns {Summary} summary instance
  3228. */
  3229. emptyBuffer() {
  3230. this._buffer = '';
  3231. return this;
  3232. }
  3233. /**
  3234. * Adds raw text to the summary buffer
  3235. *
  3236. * @param {string} text content to add
  3237. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3238. *
  3239. * @returns {Summary} summary instance
  3240. */
  3241. addRaw(text, addEOL = false) {
  3242. this._buffer += text;
  3243. return addEOL ? this.addEOL() : this;
  3244. }
  3245. /**
  3246. * Adds the operating system-specific end-of-line marker to the buffer
  3247. *
  3248. * @returns {Summary} summary instance
  3249. */
  3250. addEOL() {
  3251. return this.addRaw(os_1.EOL);
  3252. }
  3253. /**
  3254. * Adds an HTML codeblock to the summary buffer
  3255. *
  3256. * @param {string} code content to render within fenced code block
  3257. * @param {string} lang (optional) language to syntax highlight code
  3258. *
  3259. * @returns {Summary} summary instance
  3260. */
  3261. addCodeBlock(code, lang) {
  3262. const attrs = Object.assign({}, (lang && { lang }));
  3263. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3264. return this.addRaw(element).addEOL();
  3265. }
  3266. /**
  3267. * Adds an HTML list to the summary buffer
  3268. *
  3269. * @param {string[]} items list of items to render
  3270. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3271. *
  3272. * @returns {Summary} summary instance
  3273. */
  3274. addList(items, ordered = false) {
  3275. const tag = ordered ? 'ol' : 'ul';
  3276. const listItems = items.map(item => this.wrap('li', item)).join('');
  3277. const element = this.wrap(tag, listItems);
  3278. return this.addRaw(element).addEOL();
  3279. }
  3280. /**
  3281. * Adds an HTML table to the summary buffer
  3282. *
  3283. * @param {SummaryTableCell[]} rows table rows
  3284. *
  3285. * @returns {Summary} summary instance
  3286. */
  3287. addTable(rows) {
  3288. const tableBody = rows
  3289. .map(row => {
  3290. const cells = row
  3291. .map(cell => {
  3292. if (typeof cell === 'string') {
  3293. return this.wrap('td', cell);
  3294. }
  3295. const { header, data, colspan, rowspan } = cell;
  3296. const tag = header ? 'th' : 'td';
  3297. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3298. return this.wrap(tag, data, attrs);
  3299. })
  3300. .join('');
  3301. return this.wrap('tr', cells);
  3302. })
  3303. .join('');
  3304. const element = this.wrap('table', tableBody);
  3305. return this.addRaw(element).addEOL();
  3306. }
  3307. /**
  3308. * Adds a collapsable HTML details element to the summary buffer
  3309. *
  3310. * @param {string} label text for the closed state
  3311. * @param {string} content collapsable content
  3312. *
  3313. * @returns {Summary} summary instance
  3314. */
  3315. addDetails(label, content) {
  3316. const element = this.wrap('details', this.wrap('summary', label) + content);
  3317. return this.addRaw(element).addEOL();
  3318. }
  3319. /**
  3320. * Adds an HTML image tag to the summary buffer
  3321. *
  3322. * @param {string} src path to the image you to embed
  3323. * @param {string} alt text description of the image
  3324. * @param {SummaryImageOptions} options (optional) addition image attributes
  3325. *
  3326. * @returns {Summary} summary instance
  3327. */
  3328. addImage(src, alt, options) {
  3329. const { width, height } = options || {};
  3330. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3331. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3332. return this.addRaw(element).addEOL();
  3333. }
  3334. /**
  3335. * Adds an HTML section heading element
  3336. *
  3337. * @param {string} text heading text
  3338. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3339. *
  3340. * @returns {Summary} summary instance
  3341. */
  3342. addHeading(text, level) {
  3343. const tag = `h${level}`;
  3344. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3345. ? tag
  3346. : 'h1';
  3347. const element = this.wrap(allowedTag, text);
  3348. return this.addRaw(element).addEOL();
  3349. }
  3350. /**
  3351. * Adds an HTML thematic break (<hr>) to the summary buffer
  3352. *
  3353. * @returns {Summary} summary instance
  3354. */
  3355. addSeparator() {
  3356. const element = this.wrap('hr', null);
  3357. return this.addRaw(element).addEOL();
  3358. }
  3359. /**
  3360. * Adds an HTML line break (<br>) to the summary buffer
  3361. *
  3362. * @returns {Summary} summary instance
  3363. */
  3364. addBreak() {
  3365. const element = this.wrap('br', null);
  3366. return this.addRaw(element).addEOL();
  3367. }
  3368. /**
  3369. * Adds an HTML blockquote to the summary buffer
  3370. *
  3371. * @param {string} text quote text
  3372. * @param {string} cite (optional) citation url
  3373. *
  3374. * @returns {Summary} summary instance
  3375. */
  3376. addQuote(text, cite) {
  3377. const attrs = Object.assign({}, (cite && { cite }));
  3378. const element = this.wrap('blockquote', text, attrs);
  3379. return this.addRaw(element).addEOL();
  3380. }
  3381. /**
  3382. * Adds an HTML anchor tag to the summary buffer
  3383. *
  3384. * @param {string} text link text/content
  3385. * @param {string} href hyperlink
  3386. *
  3387. * @returns {Summary} summary instance
  3388. */
  3389. addLink(text, href) {
  3390. const element = this.wrap('a', text, { href });
  3391. return this.addRaw(element).addEOL();
  3392. }
  3393. }
  3394. const _summary = new Summary();
  3395. /**
  3396. * @deprecated use `core.summary`
  3397. */
  3398. exports.markdownSummary = _summary;
  3399. exports.summary = _summary;
  3400. //# sourceMappingURL=summary.js.map
  3401. /***/ }),
  3402. /***/ 5278:
  3403. /***/ ((__unused_webpack_module, exports) => {
  3404. "use strict";
  3405. // We use any as a valid input type
  3406. /* eslint-disable @typescript-eslint/no-explicit-any */
  3407. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3408. exports.toCommandProperties = exports.toCommandValue = void 0;
  3409. /**
  3410. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3411. * @param input input to sanitize into a string
  3412. */
  3413. function toCommandValue(input) {
  3414. if (input === null || input === undefined) {
  3415. return '';
  3416. }
  3417. else if (typeof input === 'string' || input instanceof String) {
  3418. return input;
  3419. }
  3420. return JSON.stringify(input);
  3421. }
  3422. exports.toCommandValue = toCommandValue;
  3423. /**
  3424. *
  3425. * @param annotationProperties
  3426. * @returns The command properties to send with the actual annotation command
  3427. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3428. */
  3429. function toCommandProperties(annotationProperties) {
  3430. if (!Object.keys(annotationProperties).length) {
  3431. return {};
  3432. }
  3433. return {
  3434. title: annotationProperties.title,
  3435. file: annotationProperties.file,
  3436. line: annotationProperties.startLine,
  3437. endLine: annotationProperties.endLine,
  3438. col: annotationProperties.startColumn,
  3439. endColumn: annotationProperties.endColumn
  3440. };
  3441. }
  3442. exports.toCommandProperties = toCommandProperties;
  3443. //# sourceMappingURL=utils.js.map
  3444. /***/ }),
  3445. /***/ 8974:
  3446. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3447. "use strict";
  3448. Object.defineProperty(exports, "__esModule", ({
  3449. value: true
  3450. }));
  3451. Object.defineProperty(exports, "v1", ({
  3452. enumerable: true,
  3453. get: function () {
  3454. return _v.default;
  3455. }
  3456. }));
  3457. Object.defineProperty(exports, "v3", ({
  3458. enumerable: true,
  3459. get: function () {
  3460. return _v2.default;
  3461. }
  3462. }));
  3463. Object.defineProperty(exports, "v4", ({
  3464. enumerable: true,
  3465. get: function () {
  3466. return _v3.default;
  3467. }
  3468. }));
  3469. Object.defineProperty(exports, "v5", ({
  3470. enumerable: true,
  3471. get: function () {
  3472. return _v4.default;
  3473. }
  3474. }));
  3475. Object.defineProperty(exports, "NIL", ({
  3476. enumerable: true,
  3477. get: function () {
  3478. return _nil.default;
  3479. }
  3480. }));
  3481. Object.defineProperty(exports, "version", ({
  3482. enumerable: true,
  3483. get: function () {
  3484. return _version.default;
  3485. }
  3486. }));
  3487. Object.defineProperty(exports, "validate", ({
  3488. enumerable: true,
  3489. get: function () {
  3490. return _validate.default;
  3491. }
  3492. }));
  3493. Object.defineProperty(exports, "stringify", ({
  3494. enumerable: true,
  3495. get: function () {
  3496. return _stringify.default;
  3497. }
  3498. }));
  3499. Object.defineProperty(exports, "parse", ({
  3500. enumerable: true,
  3501. get: function () {
  3502. return _parse.default;
  3503. }
  3504. }));
  3505. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3506. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3507. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3508. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3509. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3510. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3511. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3512. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3513. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3514. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3515. /***/ }),
  3516. /***/ 5842:
  3517. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3518. "use strict";
  3519. Object.defineProperty(exports, "__esModule", ({
  3520. value: true
  3521. }));
  3522. exports["default"] = void 0;
  3523. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3524. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3525. function md5(bytes) {
  3526. if (Array.isArray(bytes)) {
  3527. bytes = Buffer.from(bytes);
  3528. } else if (typeof bytes === 'string') {
  3529. bytes = Buffer.from(bytes, 'utf8');
  3530. }
  3531. return _crypto.default.createHash('md5').update(bytes).digest();
  3532. }
  3533. var _default = md5;
  3534. exports["default"] = _default;
  3535. /***/ }),
  3536. /***/ 2381:
  3537. /***/ ((__unused_webpack_module, exports) => {
  3538. "use strict";
  3539. Object.defineProperty(exports, "__esModule", ({
  3540. value: true
  3541. }));
  3542. exports["default"] = void 0;
  3543. var _default = '00000000-0000-0000-0000-000000000000';
  3544. exports["default"] = _default;
  3545. /***/ }),
  3546. /***/ 6385:
  3547. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3548. "use strict";
  3549. Object.defineProperty(exports, "__esModule", ({
  3550. value: true
  3551. }));
  3552. exports["default"] = void 0;
  3553. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3554. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3555. function parse(uuid) {
  3556. if (!(0, _validate.default)(uuid)) {
  3557. throw TypeError('Invalid UUID');
  3558. }
  3559. let v;
  3560. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3561. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3562. arr[1] = v >>> 16 & 0xff;
  3563. arr[2] = v >>> 8 & 0xff;
  3564. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3565. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3566. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3567. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3568. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3569. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3570. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3571. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3572. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3573. arr[11] = v / 0x100000000 & 0xff;
  3574. arr[12] = v >>> 24 & 0xff;
  3575. arr[13] = v >>> 16 & 0xff;
  3576. arr[14] = v >>> 8 & 0xff;
  3577. arr[15] = v & 0xff;
  3578. return arr;
  3579. }
  3580. var _default = parse;
  3581. exports["default"] = _default;
  3582. /***/ }),
  3583. /***/ 6230:
  3584. /***/ ((__unused_webpack_module, exports) => {
  3585. "use strict";
  3586. Object.defineProperty(exports, "__esModule", ({
  3587. value: true
  3588. }));
  3589. exports["default"] = void 0;
  3590. 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;
  3591. exports["default"] = _default;
  3592. /***/ }),
  3593. /***/ 9784:
  3594. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3595. "use strict";
  3596. Object.defineProperty(exports, "__esModule", ({
  3597. value: true
  3598. }));
  3599. exports["default"] = rng;
  3600. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3601. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3602. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3603. let poolPtr = rnds8Pool.length;
  3604. function rng() {
  3605. if (poolPtr > rnds8Pool.length - 16) {
  3606. _crypto.default.randomFillSync(rnds8Pool);
  3607. poolPtr = 0;
  3608. }
  3609. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3610. }
  3611. /***/ }),
  3612. /***/ 8844:
  3613. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3614. "use strict";
  3615. Object.defineProperty(exports, "__esModule", ({
  3616. value: true
  3617. }));
  3618. exports["default"] = void 0;
  3619. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3620. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3621. function sha1(bytes) {
  3622. if (Array.isArray(bytes)) {
  3623. bytes = Buffer.from(bytes);
  3624. } else if (typeof bytes === 'string') {
  3625. bytes = Buffer.from(bytes, 'utf8');
  3626. }
  3627. return _crypto.default.createHash('sha1').update(bytes).digest();
  3628. }
  3629. var _default = sha1;
  3630. exports["default"] = _default;
  3631. /***/ }),
  3632. /***/ 1458:
  3633. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3634. "use strict";
  3635. Object.defineProperty(exports, "__esModule", ({
  3636. value: true
  3637. }));
  3638. exports["default"] = void 0;
  3639. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3640. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3641. /**
  3642. * Convert array of 16 byte values to UUID string format of the form:
  3643. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3644. */
  3645. const byteToHex = [];
  3646. for (let i = 0; i < 256; ++i) {
  3647. byteToHex.push((i + 0x100).toString(16).substr(1));
  3648. }
  3649. function stringify(arr, offset = 0) {
  3650. // Note: Be careful editing this code! It's been tuned for performance
  3651. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3652. 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
  3653. // of the following:
  3654. // - One or more input array values don't map to a hex octet (leading to
  3655. // "undefined" in the uuid)
  3656. // - Invalid input values for the RFC `version` or `variant` fields
  3657. if (!(0, _validate.default)(uuid)) {
  3658. throw TypeError('Stringified UUID is invalid');
  3659. }
  3660. return uuid;
  3661. }
  3662. var _default = stringify;
  3663. exports["default"] = _default;
  3664. /***/ }),
  3665. /***/ 1595:
  3666. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3667. "use strict";
  3668. Object.defineProperty(exports, "__esModule", ({
  3669. value: true
  3670. }));
  3671. exports["default"] = void 0;
  3672. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3673. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3674. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3675. // **`v1()` - Generate time-based UUID**
  3676. //
  3677. // Inspired by https://github.com/LiosK/UUID.js
  3678. // and http://docs.python.org/library/uuid.html
  3679. let _nodeId;
  3680. let _clockseq; // Previous uuid creation time
  3681. let _lastMSecs = 0;
  3682. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3683. function v1(options, buf, offset) {
  3684. let i = buf && offset || 0;
  3685. const b = buf || new Array(16);
  3686. options = options || {};
  3687. let node = options.node || _nodeId;
  3688. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3689. // specified. We do this lazily to minimize issues related to insufficient
  3690. // system entropy. See #189
  3691. if (node == null || clockseq == null) {
  3692. const seedBytes = options.random || (options.rng || _rng.default)();
  3693. if (node == null) {
  3694. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3695. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3696. }
  3697. if (clockseq == null) {
  3698. // Per 4.2.2, randomize (14 bit) clockseq
  3699. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3700. }
  3701. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3702. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3703. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3704. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3705. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3706. // cycle to simulate higher resolution clock
  3707. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3708. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3709. if (dt < 0 && options.clockseq === undefined) {
  3710. clockseq = clockseq + 1 & 0x3fff;
  3711. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3712. // time interval
  3713. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3714. nsecs = 0;
  3715. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3716. if (nsecs >= 10000) {
  3717. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3718. }
  3719. _lastMSecs = msecs;
  3720. _lastNSecs = nsecs;
  3721. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3722. msecs += 12219292800000; // `time_low`
  3723. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3724. b[i++] = tl >>> 24 & 0xff;
  3725. b[i++] = tl >>> 16 & 0xff;
  3726. b[i++] = tl >>> 8 & 0xff;
  3727. b[i++] = tl & 0xff; // `time_mid`
  3728. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  3729. b[i++] = tmh >>> 8 & 0xff;
  3730. b[i++] = tmh & 0xff; // `time_high_and_version`
  3731. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  3732. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  3733. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  3734. b[i++] = clockseq & 0xff; // `node`
  3735. for (let n = 0; n < 6; ++n) {
  3736. b[i + n] = node[n];
  3737. }
  3738. return buf || (0, _stringify.default)(b);
  3739. }
  3740. var _default = v1;
  3741. exports["default"] = _default;
  3742. /***/ }),
  3743. /***/ 6993:
  3744. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3745. "use strict";
  3746. Object.defineProperty(exports, "__esModule", ({
  3747. value: true
  3748. }));
  3749. exports["default"] = void 0;
  3750. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3751. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  3752. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3753. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  3754. var _default = v3;
  3755. exports["default"] = _default;
  3756. /***/ }),
  3757. /***/ 5920:
  3758. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3759. "use strict";
  3760. Object.defineProperty(exports, "__esModule", ({
  3761. value: true
  3762. }));
  3763. exports["default"] = _default;
  3764. exports.URL = exports.DNS = void 0;
  3765. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3766. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3767. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3768. function stringToBytes(str) {
  3769. str = unescape(encodeURIComponent(str)); // UTF8 escape
  3770. const bytes = [];
  3771. for (let i = 0; i < str.length; ++i) {
  3772. bytes.push(str.charCodeAt(i));
  3773. }
  3774. return bytes;
  3775. }
  3776. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  3777. exports.DNS = DNS;
  3778. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  3779. exports.URL = URL;
  3780. function _default(name, version, hashfunc) {
  3781. function generateUUID(value, namespace, buf, offset) {
  3782. if (typeof value === 'string') {
  3783. value = stringToBytes(value);
  3784. }
  3785. if (typeof namespace === 'string') {
  3786. namespace = (0, _parse.default)(namespace);
  3787. }
  3788. if (namespace.length !== 16) {
  3789. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  3790. } // Compute hash of namespace and value, Per 4.3
  3791. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  3792. // hashfunc([...namespace, ... value])`
  3793. let bytes = new Uint8Array(16 + value.length);
  3794. bytes.set(namespace);
  3795. bytes.set(value, namespace.length);
  3796. bytes = hashfunc(bytes);
  3797. bytes[6] = bytes[6] & 0x0f | version;
  3798. bytes[8] = bytes[8] & 0x3f | 0x80;
  3799. if (buf) {
  3800. offset = offset || 0;
  3801. for (let i = 0; i < 16; ++i) {
  3802. buf[offset + i] = bytes[i];
  3803. }
  3804. return buf;
  3805. }
  3806. return (0, _stringify.default)(bytes);
  3807. } // Function#name is not settable on some platforms (#270)
  3808. try {
  3809. generateUUID.name = name; // eslint-disable-next-line no-empty
  3810. } catch (err) {} // For CommonJS default export support
  3811. generateUUID.DNS = DNS;
  3812. generateUUID.URL = URL;
  3813. return generateUUID;
  3814. }
  3815. /***/ }),
  3816. /***/ 1472:
  3817. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3818. "use strict";
  3819. Object.defineProperty(exports, "__esModule", ({
  3820. value: true
  3821. }));
  3822. exports["default"] = void 0;
  3823. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3824. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3825. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3826. function v4(options, buf, offset) {
  3827. options = options || {};
  3828. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  3829. rnds[6] = rnds[6] & 0x0f | 0x40;
  3830. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  3831. if (buf) {
  3832. offset = offset || 0;
  3833. for (let i = 0; i < 16; ++i) {
  3834. buf[offset + i] = rnds[i];
  3835. }
  3836. return buf;
  3837. }
  3838. return (0, _stringify.default)(rnds);
  3839. }
  3840. var _default = v4;
  3841. exports["default"] = _default;
  3842. /***/ }),
  3843. /***/ 6217:
  3844. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3845. "use strict";
  3846. Object.defineProperty(exports, "__esModule", ({
  3847. value: true
  3848. }));
  3849. exports["default"] = void 0;
  3850. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3851. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  3852. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3853. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  3854. var _default = v5;
  3855. exports["default"] = _default;
  3856. /***/ }),
  3857. /***/ 2609:
  3858. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3859. "use strict";
  3860. Object.defineProperty(exports, "__esModule", ({
  3861. value: true
  3862. }));
  3863. exports["default"] = void 0;
  3864. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  3865. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3866. function validate(uuid) {
  3867. return typeof uuid === 'string' && _regex.default.test(uuid);
  3868. }
  3869. var _default = validate;
  3870. exports["default"] = _default;
  3871. /***/ }),
  3872. /***/ 427:
  3873. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3874. "use strict";
  3875. Object.defineProperty(exports, "__esModule", ({
  3876. value: true
  3877. }));
  3878. exports["default"] = void 0;
  3879. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3880. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3881. function version(uuid) {
  3882. if (!(0, _validate.default)(uuid)) {
  3883. throw TypeError('Invalid UUID');
  3884. }
  3885. return parseInt(uuid.substr(14, 1), 16);
  3886. }
  3887. var _default = version;
  3888. exports["default"] = _default;
  3889. /***/ }),
  3890. /***/ 1514:
  3891. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3892. "use strict";
  3893. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3894. if (k2 === undefined) k2 = k;
  3895. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3896. }) : (function(o, m, k, k2) {
  3897. if (k2 === undefined) k2 = k;
  3898. o[k2] = m[k];
  3899. }));
  3900. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3901. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3902. }) : function(o, v) {
  3903. o["default"] = v;
  3904. });
  3905. var __importStar = (this && this.__importStar) || function (mod) {
  3906. if (mod && mod.__esModule) return mod;
  3907. var result = {};
  3908. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3909. __setModuleDefault(result, mod);
  3910. return result;
  3911. };
  3912. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3913. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3914. return new (P || (P = Promise))(function (resolve, reject) {
  3915. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3916. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3917. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3918. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3919. });
  3920. };
  3921. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3922. exports.getExecOutput = exports.exec = void 0;
  3923. const string_decoder_1 = __nccwpck_require__(1576);
  3924. const tr = __importStar(__nccwpck_require__(8159));
  3925. /**
  3926. * Exec a command.
  3927. * Output will be streamed to the live console.
  3928. * Returns promise with return code
  3929. *
  3930. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3931. * @param args optional arguments for tool. Escaping is handled by the lib.
  3932. * @param options optional exec options. See ExecOptions
  3933. * @returns Promise<number> exit code
  3934. */
  3935. function exec(commandLine, args, options) {
  3936. return __awaiter(this, void 0, void 0, function* () {
  3937. const commandArgs = tr.argStringToArray(commandLine);
  3938. if (commandArgs.length === 0) {
  3939. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  3940. }
  3941. // Path to tool to execute should be first arg
  3942. const toolPath = commandArgs[0];
  3943. args = commandArgs.slice(1).concat(args || []);
  3944. const runner = new tr.ToolRunner(toolPath, args, options);
  3945. return runner.exec();
  3946. });
  3947. }
  3948. exports.exec = exec;
  3949. /**
  3950. * Exec a command and get the output.
  3951. * Output will be streamed to the live console.
  3952. * Returns promise with the exit code and collected stdout and stderr
  3953. *
  3954. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3955. * @param args optional arguments for tool. Escaping is handled by the lib.
  3956. * @param options optional exec options. See ExecOptions
  3957. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  3958. */
  3959. function getExecOutput(commandLine, args, options) {
  3960. var _a, _b;
  3961. return __awaiter(this, void 0, void 0, function* () {
  3962. let stdout = '';
  3963. let stderr = '';
  3964. //Using string decoder covers the case where a mult-byte character is split
  3965. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  3966. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  3967. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  3968. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  3969. const stdErrListener = (data) => {
  3970. stderr += stderrDecoder.write(data);
  3971. if (originalStdErrListener) {
  3972. originalStdErrListener(data);
  3973. }
  3974. };
  3975. const stdOutListener = (data) => {
  3976. stdout += stdoutDecoder.write(data);
  3977. if (originalStdoutListener) {
  3978. originalStdoutListener(data);
  3979. }
  3980. };
  3981. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  3982. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  3983. //flush any remaining characters
  3984. stdout += stdoutDecoder.end();
  3985. stderr += stderrDecoder.end();
  3986. return {
  3987. exitCode,
  3988. stdout,
  3989. stderr
  3990. };
  3991. });
  3992. }
  3993. exports.getExecOutput = getExecOutput;
  3994. //# sourceMappingURL=exec.js.map
  3995. /***/ }),
  3996. /***/ 8159:
  3997. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3998. "use strict";
  3999. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4000. if (k2 === undefined) k2 = k;
  4001. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4002. }) : (function(o, m, k, k2) {
  4003. if (k2 === undefined) k2 = k;
  4004. o[k2] = m[k];
  4005. }));
  4006. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4007. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4008. }) : function(o, v) {
  4009. o["default"] = v;
  4010. });
  4011. var __importStar = (this && this.__importStar) || function (mod) {
  4012. if (mod && mod.__esModule) return mod;
  4013. var result = {};
  4014. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4015. __setModuleDefault(result, mod);
  4016. return result;
  4017. };
  4018. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4019. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4020. return new (P || (P = Promise))(function (resolve, reject) {
  4021. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4022. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4023. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4024. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4025. });
  4026. };
  4027. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4028. exports.argStringToArray = exports.ToolRunner = void 0;
  4029. const os = __importStar(__nccwpck_require__(2037));
  4030. const events = __importStar(__nccwpck_require__(2361));
  4031. const child = __importStar(__nccwpck_require__(2081));
  4032. const path = __importStar(__nccwpck_require__(1017));
  4033. const io = __importStar(__nccwpck_require__(7436));
  4034. const ioUtil = __importStar(__nccwpck_require__(1962));
  4035. const timers_1 = __nccwpck_require__(9512);
  4036. /* eslint-disable @typescript-eslint/unbound-method */
  4037. const IS_WINDOWS = process.platform === 'win32';
  4038. /*
  4039. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4040. */
  4041. class ToolRunner extends events.EventEmitter {
  4042. constructor(toolPath, args, options) {
  4043. super();
  4044. if (!toolPath) {
  4045. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4046. }
  4047. this.toolPath = toolPath;
  4048. this.args = args || [];
  4049. this.options = options || {};
  4050. }
  4051. _debug(message) {
  4052. if (this.options.listeners && this.options.listeners.debug) {
  4053. this.options.listeners.debug(message);
  4054. }
  4055. }
  4056. _getCommandString(options, noPrefix) {
  4057. const toolPath = this._getSpawnFileName();
  4058. const args = this._getSpawnArgs(options);
  4059. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4060. if (IS_WINDOWS) {
  4061. // Windows + cmd file
  4062. if (this._isCmdFile()) {
  4063. cmd += toolPath;
  4064. for (const a of args) {
  4065. cmd += ` ${a}`;
  4066. }
  4067. }
  4068. // Windows + verbatim
  4069. else if (options.windowsVerbatimArguments) {
  4070. cmd += `"${toolPath}"`;
  4071. for (const a of args) {
  4072. cmd += ` ${a}`;
  4073. }
  4074. }
  4075. // Windows (regular)
  4076. else {
  4077. cmd += this._windowsQuoteCmdArg(toolPath);
  4078. for (const a of args) {
  4079. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4080. }
  4081. }
  4082. }
  4083. else {
  4084. // OSX/Linux - this can likely be improved with some form of quoting.
  4085. // creating processes on Unix is fundamentally different than Windows.
  4086. // on Unix, execvp() takes an arg array.
  4087. cmd += toolPath;
  4088. for (const a of args) {
  4089. cmd += ` ${a}`;
  4090. }
  4091. }
  4092. return cmd;
  4093. }
  4094. _processLineBuffer(data, strBuffer, onLine) {
  4095. try {
  4096. let s = strBuffer + data.toString();
  4097. let n = s.indexOf(os.EOL);
  4098. while (n > -1) {
  4099. const line = s.substring(0, n);
  4100. onLine(line);
  4101. // the rest of the string ...
  4102. s = s.substring(n + os.EOL.length);
  4103. n = s.indexOf(os.EOL);
  4104. }
  4105. return s;
  4106. }
  4107. catch (err) {
  4108. // streaming lines to console is best effort. Don't fail a build.
  4109. this._debug(`error processing line. Failed with error ${err}`);
  4110. return '';
  4111. }
  4112. }
  4113. _getSpawnFileName() {
  4114. if (IS_WINDOWS) {
  4115. if (this._isCmdFile()) {
  4116. return process.env['COMSPEC'] || 'cmd.exe';
  4117. }
  4118. }
  4119. return this.toolPath;
  4120. }
  4121. _getSpawnArgs(options) {
  4122. if (IS_WINDOWS) {
  4123. if (this._isCmdFile()) {
  4124. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4125. for (const a of this.args) {
  4126. argline += ' ';
  4127. argline += options.windowsVerbatimArguments
  4128. ? a
  4129. : this._windowsQuoteCmdArg(a);
  4130. }
  4131. argline += '"';
  4132. return [argline];
  4133. }
  4134. }
  4135. return this.args;
  4136. }
  4137. _endsWith(str, end) {
  4138. return str.endsWith(end);
  4139. }
  4140. _isCmdFile() {
  4141. const upperToolPath = this.toolPath.toUpperCase();
  4142. return (this._endsWith(upperToolPath, '.CMD') ||
  4143. this._endsWith(upperToolPath, '.BAT'));
  4144. }
  4145. _windowsQuoteCmdArg(arg) {
  4146. // for .exe, apply the normal quoting rules that libuv applies
  4147. if (!this._isCmdFile()) {
  4148. return this._uvQuoteCmdArg(arg);
  4149. }
  4150. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4151. // the libuv rules are generic and are not designed specifically for cmd.exe
  4152. // command line parser.
  4153. //
  4154. // for a detailed description of the cmd.exe command line parser, refer to
  4155. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4156. // need quotes for empty arg
  4157. if (!arg) {
  4158. return '""';
  4159. }
  4160. // determine whether the arg needs to be quoted
  4161. const cmdSpecialChars = [
  4162. ' ',
  4163. '\t',
  4164. '&',
  4165. '(',
  4166. ')',
  4167. '[',
  4168. ']',
  4169. '{',
  4170. '}',
  4171. '^',
  4172. '=',
  4173. ';',
  4174. '!',
  4175. "'",
  4176. '+',
  4177. ',',
  4178. '`',
  4179. '~',
  4180. '|',
  4181. '<',
  4182. '>',
  4183. '"'
  4184. ];
  4185. let needsQuotes = false;
  4186. for (const char of arg) {
  4187. if (cmdSpecialChars.some(x => x === char)) {
  4188. needsQuotes = true;
  4189. break;
  4190. }
  4191. }
  4192. // short-circuit if quotes not needed
  4193. if (!needsQuotes) {
  4194. return arg;
  4195. }
  4196. // the following quoting rules are very similar to the rules that by libuv applies.
  4197. //
  4198. // 1) wrap the string in quotes
  4199. //
  4200. // 2) double-up quotes - i.e. " => ""
  4201. //
  4202. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4203. // doesn't work well with a cmd.exe command line.
  4204. //
  4205. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4206. // for example, the command line:
  4207. // foo.exe "myarg:""my val"""
  4208. // is parsed by a .NET console app into an arg array:
  4209. // [ "myarg:\"my val\"" ]
  4210. // which is the same end result when applying libuv quoting rules. although the actual
  4211. // command line from libuv quoting rules would look like:
  4212. // foo.exe "myarg:\"my val\""
  4213. //
  4214. // 3) double-up slashes that precede a quote,
  4215. // e.g. hello \world => "hello \world"
  4216. // hello\"world => "hello\\""world"
  4217. // hello\\"world => "hello\\\\""world"
  4218. // hello world\ => "hello world\\"
  4219. //
  4220. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4221. // the reasons for including this as a .cmd quoting rule are:
  4222. //
  4223. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4224. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4225. //
  4226. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4227. // haven't heard any complaints about that aspect.
  4228. //
  4229. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4230. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4231. // by using %%.
  4232. //
  4233. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4234. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4235. //
  4236. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4237. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4238. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4239. // to an external program.
  4240. //
  4241. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4242. // % can be escaped within a .cmd file.
  4243. let reverse = '"';
  4244. let quoteHit = true;
  4245. for (let i = arg.length; i > 0; i--) {
  4246. // walk the string in reverse
  4247. reverse += arg[i - 1];
  4248. if (quoteHit && arg[i - 1] === '\\') {
  4249. reverse += '\\'; // double the slash
  4250. }
  4251. else if (arg[i - 1] === '"') {
  4252. quoteHit = true;
  4253. reverse += '"'; // double the quote
  4254. }
  4255. else {
  4256. quoteHit = false;
  4257. }
  4258. }
  4259. reverse += '"';
  4260. return reverse
  4261. .split('')
  4262. .reverse()
  4263. .join('');
  4264. }
  4265. _uvQuoteCmdArg(arg) {
  4266. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4267. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4268. // is used.
  4269. //
  4270. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4271. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4272. // pasting copyright notice from Node within this function:
  4273. //
  4274. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4275. //
  4276. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4277. // of this software and associated documentation files (the "Software"), to
  4278. // deal in the Software without restriction, including without limitation the
  4279. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4280. // sell copies of the Software, and to permit persons to whom the Software is
  4281. // furnished to do so, subject to the following conditions:
  4282. //
  4283. // The above copyright notice and this permission notice shall be included in
  4284. // all copies or substantial portions of the Software.
  4285. //
  4286. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4287. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4288. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4289. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4290. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4291. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4292. // IN THE SOFTWARE.
  4293. if (!arg) {
  4294. // Need double quotation for empty argument
  4295. return '""';
  4296. }
  4297. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4298. // No quotation needed
  4299. return arg;
  4300. }
  4301. if (!arg.includes('"') && !arg.includes('\\')) {
  4302. // No embedded double quotes or backslashes, so I can just wrap
  4303. // quote marks around the whole thing.
  4304. return `"${arg}"`;
  4305. }
  4306. // Expected input/output:
  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"
  4317. // input : hello\\"world
  4318. // output: "hello\\\\\"world"
  4319. // input : hello world\
  4320. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4321. // but it appears the comment is wrong, it should be "hello world\\"
  4322. let reverse = '"';
  4323. let quoteHit = true;
  4324. for (let i = arg.length; i > 0; i--) {
  4325. // walk the string in reverse
  4326. reverse += arg[i - 1];
  4327. if (quoteHit && arg[i - 1] === '\\') {
  4328. reverse += '\\';
  4329. }
  4330. else if (arg[i - 1] === '"') {
  4331. quoteHit = true;
  4332. reverse += '\\';
  4333. }
  4334. else {
  4335. quoteHit = false;
  4336. }
  4337. }
  4338. reverse += '"';
  4339. return reverse
  4340. .split('')
  4341. .reverse()
  4342. .join('');
  4343. }
  4344. _cloneExecOptions(options) {
  4345. options = options || {};
  4346. const result = {
  4347. cwd: options.cwd || process.cwd(),
  4348. env: options.env || process.env,
  4349. silent: options.silent || false,
  4350. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4351. failOnStdErr: options.failOnStdErr || false,
  4352. ignoreReturnCode: options.ignoreReturnCode || false,
  4353. delay: options.delay || 10000
  4354. };
  4355. result.outStream = options.outStream || process.stdout;
  4356. result.errStream = options.errStream || process.stderr;
  4357. return result;
  4358. }
  4359. _getSpawnOptions(options, toolPath) {
  4360. options = options || {};
  4361. const result = {};
  4362. result.cwd = options.cwd;
  4363. result.env = options.env;
  4364. result['windowsVerbatimArguments'] =
  4365. options.windowsVerbatimArguments || this._isCmdFile();
  4366. if (options.windowsVerbatimArguments) {
  4367. result.argv0 = `"${toolPath}"`;
  4368. }
  4369. return result;
  4370. }
  4371. /**
  4372. * Exec a tool.
  4373. * Output will be streamed to the live console.
  4374. * Returns promise with return code
  4375. *
  4376. * @param tool path to tool to exec
  4377. * @param options optional exec options. See ExecOptions
  4378. * @returns number
  4379. */
  4380. exec() {
  4381. return __awaiter(this, void 0, void 0, function* () {
  4382. // root the tool path if it is unrooted and contains relative pathing
  4383. if (!ioUtil.isRooted(this.toolPath) &&
  4384. (this.toolPath.includes('/') ||
  4385. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4386. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4387. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4388. }
  4389. // if the tool is only a file name, then resolve it from the PATH
  4390. // otherwise verify it exists (add extension on Windows if necessary)
  4391. this.toolPath = yield io.which(this.toolPath, true);
  4392. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4393. this._debug(`exec tool: ${this.toolPath}`);
  4394. this._debug('arguments:');
  4395. for (const arg of this.args) {
  4396. this._debug(` ${arg}`);
  4397. }
  4398. const optionsNonNull = this._cloneExecOptions(this.options);
  4399. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4400. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4401. }
  4402. const state = new ExecState(optionsNonNull, this.toolPath);
  4403. state.on('debug', (message) => {
  4404. this._debug(message);
  4405. });
  4406. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4407. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4408. }
  4409. const fileName = this._getSpawnFileName();
  4410. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4411. let stdbuffer = '';
  4412. if (cp.stdout) {
  4413. cp.stdout.on('data', (data) => {
  4414. if (this.options.listeners && this.options.listeners.stdout) {
  4415. this.options.listeners.stdout(data);
  4416. }
  4417. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4418. optionsNonNull.outStream.write(data);
  4419. }
  4420. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4421. if (this.options.listeners && this.options.listeners.stdline) {
  4422. this.options.listeners.stdline(line);
  4423. }
  4424. });
  4425. });
  4426. }
  4427. let errbuffer = '';
  4428. if (cp.stderr) {
  4429. cp.stderr.on('data', (data) => {
  4430. state.processStderr = true;
  4431. if (this.options.listeners && this.options.listeners.stderr) {
  4432. this.options.listeners.stderr(data);
  4433. }
  4434. if (!optionsNonNull.silent &&
  4435. optionsNonNull.errStream &&
  4436. optionsNonNull.outStream) {
  4437. const s = optionsNonNull.failOnStdErr
  4438. ? optionsNonNull.errStream
  4439. : optionsNonNull.outStream;
  4440. s.write(data);
  4441. }
  4442. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4443. if (this.options.listeners && this.options.listeners.errline) {
  4444. this.options.listeners.errline(line);
  4445. }
  4446. });
  4447. });
  4448. }
  4449. cp.on('error', (err) => {
  4450. state.processError = err.message;
  4451. state.processExited = true;
  4452. state.processClosed = true;
  4453. state.CheckComplete();
  4454. });
  4455. cp.on('exit', (code) => {
  4456. state.processExitCode = code;
  4457. state.processExited = true;
  4458. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4459. state.CheckComplete();
  4460. });
  4461. cp.on('close', (code) => {
  4462. state.processExitCode = code;
  4463. state.processExited = true;
  4464. state.processClosed = true;
  4465. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4466. state.CheckComplete();
  4467. });
  4468. state.on('done', (error, exitCode) => {
  4469. if (stdbuffer.length > 0) {
  4470. this.emit('stdline', stdbuffer);
  4471. }
  4472. if (errbuffer.length > 0) {
  4473. this.emit('errline', errbuffer);
  4474. }
  4475. cp.removeAllListeners();
  4476. if (error) {
  4477. reject(error);
  4478. }
  4479. else {
  4480. resolve(exitCode);
  4481. }
  4482. });
  4483. if (this.options.input) {
  4484. if (!cp.stdin) {
  4485. throw new Error('child process missing stdin');
  4486. }
  4487. cp.stdin.end(this.options.input);
  4488. }
  4489. }));
  4490. });
  4491. }
  4492. }
  4493. exports.ToolRunner = ToolRunner;
  4494. /**
  4495. * Convert an arg string to an array of args. Handles escaping
  4496. *
  4497. * @param argString string of arguments
  4498. * @returns string[] array of arguments
  4499. */
  4500. function argStringToArray(argString) {
  4501. const args = [];
  4502. let inQuotes = false;
  4503. let escaped = false;
  4504. let arg = '';
  4505. function append(c) {
  4506. // we only escape double quotes.
  4507. if (escaped && c !== '"') {
  4508. arg += '\\';
  4509. }
  4510. arg += c;
  4511. escaped = false;
  4512. }
  4513. for (let i = 0; i < argString.length; i++) {
  4514. const c = argString.charAt(i);
  4515. if (c === '"') {
  4516. if (!escaped) {
  4517. inQuotes = !inQuotes;
  4518. }
  4519. else {
  4520. append(c);
  4521. }
  4522. continue;
  4523. }
  4524. if (c === '\\' && escaped) {
  4525. append(c);
  4526. continue;
  4527. }
  4528. if (c === '\\' && inQuotes) {
  4529. escaped = true;
  4530. continue;
  4531. }
  4532. if (c === ' ' && !inQuotes) {
  4533. if (arg.length > 0) {
  4534. args.push(arg);
  4535. arg = '';
  4536. }
  4537. continue;
  4538. }
  4539. append(c);
  4540. }
  4541. if (arg.length > 0) {
  4542. args.push(arg.trim());
  4543. }
  4544. return args;
  4545. }
  4546. exports.argStringToArray = argStringToArray;
  4547. class ExecState extends events.EventEmitter {
  4548. constructor(options, toolPath) {
  4549. super();
  4550. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4551. this.processError = '';
  4552. this.processExitCode = 0;
  4553. this.processExited = false; // tracks whether the process has exited
  4554. this.processStderr = false; // tracks whether stderr was written to
  4555. this.delay = 10000; // 10 seconds
  4556. this.done = false;
  4557. this.timeout = null;
  4558. if (!toolPath) {
  4559. throw new Error('toolPath must not be empty');
  4560. }
  4561. this.options = options;
  4562. this.toolPath = toolPath;
  4563. if (options.delay) {
  4564. this.delay = options.delay;
  4565. }
  4566. }
  4567. CheckComplete() {
  4568. if (this.done) {
  4569. return;
  4570. }
  4571. if (this.processClosed) {
  4572. this._setResult();
  4573. }
  4574. else if (this.processExited) {
  4575. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4576. }
  4577. }
  4578. _debug(message) {
  4579. this.emit('debug', message);
  4580. }
  4581. _setResult() {
  4582. // determine whether there is an error
  4583. let error;
  4584. if (this.processExited) {
  4585. if (this.processError) {
  4586. 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}`);
  4587. }
  4588. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4589. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4590. }
  4591. else if (this.processStderr && this.options.failOnStdErr) {
  4592. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4593. }
  4594. }
  4595. // clear the timeout
  4596. if (this.timeout) {
  4597. clearTimeout(this.timeout);
  4598. this.timeout = null;
  4599. }
  4600. this.done = true;
  4601. this.emit('done', error, this.processExitCode);
  4602. }
  4603. static HandleTimeout(state) {
  4604. if (state.done) {
  4605. return;
  4606. }
  4607. if (!state.processClosed && state.processExited) {
  4608. const message = `The STDIO streams did not close within ${state.delay /
  4609. 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.`;
  4610. state._debug(message);
  4611. }
  4612. state._setResult();
  4613. }
  4614. }
  4615. //# sourceMappingURL=toolrunner.js.map
  4616. /***/ }),
  4617. /***/ 4087:
  4618. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4619. "use strict";
  4620. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4621. exports.Context = void 0;
  4622. const fs_1 = __nccwpck_require__(7147);
  4623. const os_1 = __nccwpck_require__(2037);
  4624. class Context {
  4625. /**
  4626. * Hydrate the context from the environment
  4627. */
  4628. constructor() {
  4629. var _a, _b, _c;
  4630. this.payload = {};
  4631. if (process.env.GITHUB_EVENT_PATH) {
  4632. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4633. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4634. }
  4635. else {
  4636. const path = process.env.GITHUB_EVENT_PATH;
  4637. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4638. }
  4639. }
  4640. this.eventName = process.env.GITHUB_EVENT_NAME;
  4641. this.sha = process.env.GITHUB_SHA;
  4642. this.ref = process.env.GITHUB_REF;
  4643. this.workflow = process.env.GITHUB_WORKFLOW;
  4644. this.action = process.env.GITHUB_ACTION;
  4645. this.actor = process.env.GITHUB_ACTOR;
  4646. this.job = process.env.GITHUB_JOB;
  4647. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4648. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4649. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4650. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4651. this.graphqlUrl =
  4652. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4653. }
  4654. get issue() {
  4655. const payload = this.payload;
  4656. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4657. }
  4658. get repo() {
  4659. if (process.env.GITHUB_REPOSITORY) {
  4660. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4661. return { owner, repo };
  4662. }
  4663. if (this.payload.repository) {
  4664. return {
  4665. owner: this.payload.repository.owner.login,
  4666. repo: this.payload.repository.name
  4667. };
  4668. }
  4669. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4670. }
  4671. }
  4672. exports.Context = Context;
  4673. //# sourceMappingURL=context.js.map
  4674. /***/ }),
  4675. /***/ 5438:
  4676. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4677. "use strict";
  4678. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4679. if (k2 === undefined) k2 = k;
  4680. var desc = Object.getOwnPropertyDescriptor(m, k);
  4681. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4682. desc = { enumerable: true, get: function() { return m[k]; } };
  4683. }
  4684. Object.defineProperty(o, k2, desc);
  4685. }) : (function(o, m, k, k2) {
  4686. if (k2 === undefined) k2 = k;
  4687. o[k2] = m[k];
  4688. }));
  4689. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4690. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4691. }) : function(o, v) {
  4692. o["default"] = v;
  4693. });
  4694. var __importStar = (this && this.__importStar) || function (mod) {
  4695. if (mod && mod.__esModule) return mod;
  4696. var result = {};
  4697. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4698. __setModuleDefault(result, mod);
  4699. return result;
  4700. };
  4701. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4702. exports.getOctokit = exports.context = void 0;
  4703. const Context = __importStar(__nccwpck_require__(4087));
  4704. const utils_1 = __nccwpck_require__(3030);
  4705. exports.context = new Context.Context();
  4706. /**
  4707. * Returns a hydrated octokit ready to use for GitHub Actions
  4708. *
  4709. * @param token the repo PAT or GITHUB_TOKEN
  4710. * @param options other options to set
  4711. */
  4712. function getOctokit(token, options, ...additionalPlugins) {
  4713. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4714. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4715. }
  4716. exports.getOctokit = getOctokit;
  4717. //# sourceMappingURL=github.js.map
  4718. /***/ }),
  4719. /***/ 7914:
  4720. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4721. "use strict";
  4722. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4723. if (k2 === undefined) k2 = k;
  4724. var desc = Object.getOwnPropertyDescriptor(m, k);
  4725. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4726. desc = { enumerable: true, get: function() { return m[k]; } };
  4727. }
  4728. Object.defineProperty(o, k2, desc);
  4729. }) : (function(o, m, k, k2) {
  4730. if (k2 === undefined) k2 = k;
  4731. o[k2] = m[k];
  4732. }));
  4733. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4734. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4735. }) : function(o, v) {
  4736. o["default"] = v;
  4737. });
  4738. var __importStar = (this && this.__importStar) || function (mod) {
  4739. if (mod && mod.__esModule) return mod;
  4740. var result = {};
  4741. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4742. __setModuleDefault(result, mod);
  4743. return result;
  4744. };
  4745. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4746. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4747. return new (P || (P = Promise))(function (resolve, reject) {
  4748. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4749. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4750. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4751. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4752. });
  4753. };
  4754. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4755. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  4756. const httpClient = __importStar(__nccwpck_require__(6255));
  4757. const undici_1 = __nccwpck_require__(1773);
  4758. function getAuthString(token, options) {
  4759. if (!token && !options.auth) {
  4760. throw new Error('Parameter token or opts.auth is required');
  4761. }
  4762. else if (token && options.auth) {
  4763. throw new Error('Parameters token and opts.auth may not both be specified');
  4764. }
  4765. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  4766. }
  4767. exports.getAuthString = getAuthString;
  4768. function getProxyAgent(destinationUrl) {
  4769. const hc = new httpClient.HttpClient();
  4770. return hc.getAgent(destinationUrl);
  4771. }
  4772. exports.getProxyAgent = getProxyAgent;
  4773. function getProxyAgentDispatcher(destinationUrl) {
  4774. const hc = new httpClient.HttpClient();
  4775. return hc.getAgentDispatcher(destinationUrl);
  4776. }
  4777. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  4778. function getProxyFetch(destinationUrl) {
  4779. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  4780. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  4781. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  4782. });
  4783. return proxyFetch;
  4784. }
  4785. exports.getProxyFetch = getProxyFetch;
  4786. function getApiBaseUrl() {
  4787. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  4788. }
  4789. exports.getApiBaseUrl = getApiBaseUrl;
  4790. //# sourceMappingURL=utils.js.map
  4791. /***/ }),
  4792. /***/ 3030:
  4793. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4794. "use strict";
  4795. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4796. if (k2 === undefined) k2 = k;
  4797. var desc = Object.getOwnPropertyDescriptor(m, k);
  4798. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4799. desc = { enumerable: true, get: function() { return m[k]; } };
  4800. }
  4801. Object.defineProperty(o, k2, desc);
  4802. }) : (function(o, m, k, k2) {
  4803. if (k2 === undefined) k2 = k;
  4804. o[k2] = m[k];
  4805. }));
  4806. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4807. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4808. }) : function(o, v) {
  4809. o["default"] = v;
  4810. });
  4811. var __importStar = (this && this.__importStar) || function (mod) {
  4812. if (mod && mod.__esModule) return mod;
  4813. var result = {};
  4814. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4815. __setModuleDefault(result, mod);
  4816. return result;
  4817. };
  4818. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4819. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  4820. const Context = __importStar(__nccwpck_require__(4087));
  4821. const Utils = __importStar(__nccwpck_require__(7914));
  4822. // octokit + plugins
  4823. const core_1 = __nccwpck_require__(6762);
  4824. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  4825. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  4826. exports.context = new Context.Context();
  4827. const baseUrl = Utils.getApiBaseUrl();
  4828. exports.defaults = {
  4829. baseUrl,
  4830. request: {
  4831. agent: Utils.getProxyAgent(baseUrl),
  4832. fetch: Utils.getProxyFetch(baseUrl)
  4833. }
  4834. };
  4835. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  4836. /**
  4837. * Convience function to correctly format Octokit Options to pass into the constructor.
  4838. *
  4839. * @param token the repo PAT or GITHUB_TOKEN
  4840. * @param options other options to set
  4841. */
  4842. function getOctokitOptions(token, options) {
  4843. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  4844. // Auth
  4845. const auth = Utils.getAuthString(token, opts);
  4846. if (auth) {
  4847. opts.auth = auth;
  4848. }
  4849. return opts;
  4850. }
  4851. exports.getOctokitOptions = getOctokitOptions;
  4852. //# sourceMappingURL=utils.js.map
  4853. /***/ }),
  4854. /***/ 5526:
  4855. /***/ (function(__unused_webpack_module, exports) {
  4856. "use strict";
  4857. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4858. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4859. return new (P || (P = Promise))(function (resolve, reject) {
  4860. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4861. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4862. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4863. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4864. });
  4865. };
  4866. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4867. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  4868. class BasicCredentialHandler {
  4869. constructor(username, password) {
  4870. this.username = username;
  4871. this.password = password;
  4872. }
  4873. prepareRequest(options) {
  4874. if (!options.headers) {
  4875. throw Error('The request has no headers');
  4876. }
  4877. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  4878. }
  4879. // This handler cannot handle 401
  4880. canHandleAuthentication() {
  4881. return false;
  4882. }
  4883. handleAuthentication() {
  4884. return __awaiter(this, void 0, void 0, function* () {
  4885. throw new Error('not implemented');
  4886. });
  4887. }
  4888. }
  4889. exports.BasicCredentialHandler = BasicCredentialHandler;
  4890. class BearerCredentialHandler {
  4891. constructor(token) {
  4892. this.token = token;
  4893. }
  4894. // currently implements pre-authorization
  4895. // TODO: support preAuth = false where it hooks on 401
  4896. prepareRequest(options) {
  4897. if (!options.headers) {
  4898. throw Error('The request has no headers');
  4899. }
  4900. options.headers['Authorization'] = `Bearer ${this.token}`;
  4901. }
  4902. // This handler cannot handle 401
  4903. canHandleAuthentication() {
  4904. return false;
  4905. }
  4906. handleAuthentication() {
  4907. return __awaiter(this, void 0, void 0, function* () {
  4908. throw new Error('not implemented');
  4909. });
  4910. }
  4911. }
  4912. exports.BearerCredentialHandler = BearerCredentialHandler;
  4913. class PersonalAccessTokenCredentialHandler {
  4914. constructor(token) {
  4915. this.token = token;
  4916. }
  4917. // currently implements pre-authorization
  4918. // TODO: support preAuth = false where it hooks on 401
  4919. prepareRequest(options) {
  4920. if (!options.headers) {
  4921. throw Error('The request has no headers');
  4922. }
  4923. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  4924. }
  4925. // This handler cannot handle 401
  4926. canHandleAuthentication() {
  4927. return false;
  4928. }
  4929. handleAuthentication() {
  4930. return __awaiter(this, void 0, void 0, function* () {
  4931. throw new Error('not implemented');
  4932. });
  4933. }
  4934. }
  4935. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  4936. //# sourceMappingURL=auth.js.map
  4937. /***/ }),
  4938. /***/ 6255:
  4939. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4940. "use strict";
  4941. /* eslint-disable @typescript-eslint/no-explicit-any */
  4942. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4943. if (k2 === undefined) k2 = k;
  4944. var desc = Object.getOwnPropertyDescriptor(m, k);
  4945. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4946. desc = { enumerable: true, get: function() { return m[k]; } };
  4947. }
  4948. Object.defineProperty(o, k2, desc);
  4949. }) : (function(o, m, k, k2) {
  4950. if (k2 === undefined) k2 = k;
  4951. o[k2] = m[k];
  4952. }));
  4953. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4954. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4955. }) : function(o, v) {
  4956. o["default"] = v;
  4957. });
  4958. var __importStar = (this && this.__importStar) || function (mod) {
  4959. if (mod && mod.__esModule) return mod;
  4960. var result = {};
  4961. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4962. __setModuleDefault(result, mod);
  4963. return result;
  4964. };
  4965. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4966. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4967. return new (P || (P = Promise))(function (resolve, reject) {
  4968. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4969. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4970. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4971. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4972. });
  4973. };
  4974. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4975. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  4976. const http = __importStar(__nccwpck_require__(3685));
  4977. const https = __importStar(__nccwpck_require__(5687));
  4978. const pm = __importStar(__nccwpck_require__(9835));
  4979. const tunnel = __importStar(__nccwpck_require__(4294));
  4980. const undici_1 = __nccwpck_require__(1773);
  4981. var HttpCodes;
  4982. (function (HttpCodes) {
  4983. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  4984. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  4985. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  4986. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  4987. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  4988. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  4989. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  4990. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  4991. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  4992. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  4993. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  4994. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  4995. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  4996. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  4997. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  4998. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  4999. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5000. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5001. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5002. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5003. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5004. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5005. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5006. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5007. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5008. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5009. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5010. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5011. var Headers;
  5012. (function (Headers) {
  5013. Headers["Accept"] = "accept";
  5014. Headers["ContentType"] = "content-type";
  5015. })(Headers || (exports.Headers = Headers = {}));
  5016. var MediaTypes;
  5017. (function (MediaTypes) {
  5018. MediaTypes["ApplicationJson"] = "application/json";
  5019. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5020. /**
  5021. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5022. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5023. */
  5024. function getProxyUrl(serverUrl) {
  5025. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5026. return proxyUrl ? proxyUrl.href : '';
  5027. }
  5028. exports.getProxyUrl = getProxyUrl;
  5029. const HttpRedirectCodes = [
  5030. HttpCodes.MovedPermanently,
  5031. HttpCodes.ResourceMoved,
  5032. HttpCodes.SeeOther,
  5033. HttpCodes.TemporaryRedirect,
  5034. HttpCodes.PermanentRedirect
  5035. ];
  5036. const HttpResponseRetryCodes = [
  5037. HttpCodes.BadGateway,
  5038. HttpCodes.ServiceUnavailable,
  5039. HttpCodes.GatewayTimeout
  5040. ];
  5041. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5042. const ExponentialBackoffCeiling = 10;
  5043. const ExponentialBackoffTimeSlice = 5;
  5044. class HttpClientError extends Error {
  5045. constructor(message, statusCode) {
  5046. super(message);
  5047. this.name = 'HttpClientError';
  5048. this.statusCode = statusCode;
  5049. Object.setPrototypeOf(this, HttpClientError.prototype);
  5050. }
  5051. }
  5052. exports.HttpClientError = HttpClientError;
  5053. class HttpClientResponse {
  5054. constructor(message) {
  5055. this.message = message;
  5056. }
  5057. readBody() {
  5058. return __awaiter(this, void 0, void 0, function* () {
  5059. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5060. let output = Buffer.alloc(0);
  5061. this.message.on('data', (chunk) => {
  5062. output = Buffer.concat([output, chunk]);
  5063. });
  5064. this.message.on('end', () => {
  5065. resolve(output.toString());
  5066. });
  5067. }));
  5068. });
  5069. }
  5070. readBodyBuffer() {
  5071. return __awaiter(this, void 0, void 0, function* () {
  5072. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5073. const chunks = [];
  5074. this.message.on('data', (chunk) => {
  5075. chunks.push(chunk);
  5076. });
  5077. this.message.on('end', () => {
  5078. resolve(Buffer.concat(chunks));
  5079. });
  5080. }));
  5081. });
  5082. }
  5083. }
  5084. exports.HttpClientResponse = HttpClientResponse;
  5085. function isHttps(requestUrl) {
  5086. const parsedUrl = new URL(requestUrl);
  5087. return parsedUrl.protocol === 'https:';
  5088. }
  5089. exports.isHttps = isHttps;
  5090. class HttpClient {
  5091. constructor(userAgent, handlers, requestOptions) {
  5092. this._ignoreSslError = false;
  5093. this._allowRedirects = true;
  5094. this._allowRedirectDowngrade = false;
  5095. this._maxRedirects = 50;
  5096. this._allowRetries = false;
  5097. this._maxRetries = 1;
  5098. this._keepAlive = false;
  5099. this._disposed = false;
  5100. this.userAgent = userAgent;
  5101. this.handlers = handlers || [];
  5102. this.requestOptions = requestOptions;
  5103. if (requestOptions) {
  5104. if (requestOptions.ignoreSslError != null) {
  5105. this._ignoreSslError = requestOptions.ignoreSslError;
  5106. }
  5107. this._socketTimeout = requestOptions.socketTimeout;
  5108. if (requestOptions.allowRedirects != null) {
  5109. this._allowRedirects = requestOptions.allowRedirects;
  5110. }
  5111. if (requestOptions.allowRedirectDowngrade != null) {
  5112. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5113. }
  5114. if (requestOptions.maxRedirects != null) {
  5115. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5116. }
  5117. if (requestOptions.keepAlive != null) {
  5118. this._keepAlive = requestOptions.keepAlive;
  5119. }
  5120. if (requestOptions.allowRetries != null) {
  5121. this._allowRetries = requestOptions.allowRetries;
  5122. }
  5123. if (requestOptions.maxRetries != null) {
  5124. this._maxRetries = requestOptions.maxRetries;
  5125. }
  5126. }
  5127. }
  5128. options(requestUrl, additionalHeaders) {
  5129. return __awaiter(this, void 0, void 0, function* () {
  5130. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5131. });
  5132. }
  5133. get(requestUrl, additionalHeaders) {
  5134. return __awaiter(this, void 0, void 0, function* () {
  5135. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5136. });
  5137. }
  5138. del(requestUrl, additionalHeaders) {
  5139. return __awaiter(this, void 0, void 0, function* () {
  5140. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5141. });
  5142. }
  5143. post(requestUrl, data, additionalHeaders) {
  5144. return __awaiter(this, void 0, void 0, function* () {
  5145. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5146. });
  5147. }
  5148. patch(requestUrl, data, additionalHeaders) {
  5149. return __awaiter(this, void 0, void 0, function* () {
  5150. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5151. });
  5152. }
  5153. put(requestUrl, data, additionalHeaders) {
  5154. return __awaiter(this, void 0, void 0, function* () {
  5155. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5156. });
  5157. }
  5158. head(requestUrl, additionalHeaders) {
  5159. return __awaiter(this, void 0, void 0, function* () {
  5160. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5161. });
  5162. }
  5163. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5164. return __awaiter(this, void 0, void 0, function* () {
  5165. return this.request(verb, requestUrl, stream, additionalHeaders);
  5166. });
  5167. }
  5168. /**
  5169. * Gets a typed object from an endpoint
  5170. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5171. */
  5172. getJson(requestUrl, additionalHeaders = {}) {
  5173. return __awaiter(this, void 0, void 0, function* () {
  5174. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5175. const res = yield this.get(requestUrl, additionalHeaders);
  5176. return this._processResponse(res, this.requestOptions);
  5177. });
  5178. }
  5179. postJson(requestUrl, obj, additionalHeaders = {}) {
  5180. return __awaiter(this, void 0, void 0, function* () {
  5181. const data = JSON.stringify(obj, null, 2);
  5182. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5183. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5184. const res = yield this.post(requestUrl, data, additionalHeaders);
  5185. return this._processResponse(res, this.requestOptions);
  5186. });
  5187. }
  5188. putJson(requestUrl, obj, additionalHeaders = {}) {
  5189. return __awaiter(this, void 0, void 0, function* () {
  5190. const data = JSON.stringify(obj, null, 2);
  5191. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5192. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5193. const res = yield this.put(requestUrl, data, additionalHeaders);
  5194. return this._processResponse(res, this.requestOptions);
  5195. });
  5196. }
  5197. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5198. return __awaiter(this, void 0, void 0, function* () {
  5199. const data = JSON.stringify(obj, null, 2);
  5200. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5201. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5202. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5203. return this._processResponse(res, this.requestOptions);
  5204. });
  5205. }
  5206. /**
  5207. * Makes a raw http request.
  5208. * All other methods such as get, post, patch, and request ultimately call this.
  5209. * Prefer get, del, post and patch
  5210. */
  5211. request(verb, requestUrl, data, headers) {
  5212. return __awaiter(this, void 0, void 0, function* () {
  5213. if (this._disposed) {
  5214. throw new Error('Client has already been disposed.');
  5215. }
  5216. const parsedUrl = new URL(requestUrl);
  5217. let info = this._prepareRequest(verb, parsedUrl, headers);
  5218. // Only perform retries on reads since writes may not be idempotent.
  5219. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5220. ? this._maxRetries + 1
  5221. : 1;
  5222. let numTries = 0;
  5223. let response;
  5224. do {
  5225. response = yield this.requestRaw(info, data);
  5226. // Check if it's an authentication challenge
  5227. if (response &&
  5228. response.message &&
  5229. response.message.statusCode === HttpCodes.Unauthorized) {
  5230. let authenticationHandler;
  5231. for (const handler of this.handlers) {
  5232. if (handler.canHandleAuthentication(response)) {
  5233. authenticationHandler = handler;
  5234. break;
  5235. }
  5236. }
  5237. if (authenticationHandler) {
  5238. return authenticationHandler.handleAuthentication(this, info, data);
  5239. }
  5240. else {
  5241. // We have received an unauthorized response but have no handlers to handle it.
  5242. // Let the response return to the caller.
  5243. return response;
  5244. }
  5245. }
  5246. let redirectsRemaining = this._maxRedirects;
  5247. while (response.message.statusCode &&
  5248. HttpRedirectCodes.includes(response.message.statusCode) &&
  5249. this._allowRedirects &&
  5250. redirectsRemaining > 0) {
  5251. const redirectUrl = response.message.headers['location'];
  5252. if (!redirectUrl) {
  5253. // if there's no location to redirect to, we won't
  5254. break;
  5255. }
  5256. const parsedRedirectUrl = new URL(redirectUrl);
  5257. if (parsedUrl.protocol === 'https:' &&
  5258. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5259. !this._allowRedirectDowngrade) {
  5260. 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.');
  5261. }
  5262. // we need to finish reading the response before reassigning response
  5263. // which will leak the open socket.
  5264. yield response.readBody();
  5265. // strip authorization header if redirected to a different hostname
  5266. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5267. for (const header in headers) {
  5268. // header names are case insensitive
  5269. if (header.toLowerCase() === 'authorization') {
  5270. delete headers[header];
  5271. }
  5272. }
  5273. }
  5274. // let's make the request with the new redirectUrl
  5275. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5276. response = yield this.requestRaw(info, data);
  5277. redirectsRemaining--;
  5278. }
  5279. if (!response.message.statusCode ||
  5280. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5281. // If not a retry code, return immediately instead of retrying
  5282. return response;
  5283. }
  5284. numTries += 1;
  5285. if (numTries < maxTries) {
  5286. yield response.readBody();
  5287. yield this._performExponentialBackoff(numTries);
  5288. }
  5289. } while (numTries < maxTries);
  5290. return response;
  5291. });
  5292. }
  5293. /**
  5294. * Needs to be called if keepAlive is set to true in request options.
  5295. */
  5296. dispose() {
  5297. if (this._agent) {
  5298. this._agent.destroy();
  5299. }
  5300. this._disposed = true;
  5301. }
  5302. /**
  5303. * Raw request.
  5304. * @param info
  5305. * @param data
  5306. */
  5307. requestRaw(info, data) {
  5308. return __awaiter(this, void 0, void 0, function* () {
  5309. return new Promise((resolve, reject) => {
  5310. function callbackForResult(err, res) {
  5311. if (err) {
  5312. reject(err);
  5313. }
  5314. else if (!res) {
  5315. // If `err` is not passed, then `res` must be passed.
  5316. reject(new Error('Unknown error'));
  5317. }
  5318. else {
  5319. resolve(res);
  5320. }
  5321. }
  5322. this.requestRawWithCallback(info, data, callbackForResult);
  5323. });
  5324. });
  5325. }
  5326. /**
  5327. * Raw request with callback.
  5328. * @param info
  5329. * @param data
  5330. * @param onResult
  5331. */
  5332. requestRawWithCallback(info, data, onResult) {
  5333. if (typeof data === 'string') {
  5334. if (!info.options.headers) {
  5335. info.options.headers = {};
  5336. }
  5337. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5338. }
  5339. let callbackCalled = false;
  5340. function handleResult(err, res) {
  5341. if (!callbackCalled) {
  5342. callbackCalled = true;
  5343. onResult(err, res);
  5344. }
  5345. }
  5346. const req = info.httpModule.request(info.options, (msg) => {
  5347. const res = new HttpClientResponse(msg);
  5348. handleResult(undefined, res);
  5349. });
  5350. let socket;
  5351. req.on('socket', sock => {
  5352. socket = sock;
  5353. });
  5354. // If we ever get disconnected, we want the socket to timeout eventually
  5355. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5356. if (socket) {
  5357. socket.end();
  5358. }
  5359. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5360. });
  5361. req.on('error', function (err) {
  5362. // err has statusCode property
  5363. // res should have headers
  5364. handleResult(err);
  5365. });
  5366. if (data && typeof data === 'string') {
  5367. req.write(data, 'utf8');
  5368. }
  5369. if (data && typeof data !== 'string') {
  5370. data.on('close', function () {
  5371. req.end();
  5372. });
  5373. data.pipe(req);
  5374. }
  5375. else {
  5376. req.end();
  5377. }
  5378. }
  5379. /**
  5380. * Gets an http agent. This function is useful when you need an http agent that handles
  5381. * routing through a proxy server - depending upon the url and proxy environment variables.
  5382. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5383. */
  5384. getAgent(serverUrl) {
  5385. const parsedUrl = new URL(serverUrl);
  5386. return this._getAgent(parsedUrl);
  5387. }
  5388. getAgentDispatcher(serverUrl) {
  5389. const parsedUrl = new URL(serverUrl);
  5390. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5391. const useProxy = proxyUrl && proxyUrl.hostname;
  5392. if (!useProxy) {
  5393. return;
  5394. }
  5395. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5396. }
  5397. _prepareRequest(method, requestUrl, headers) {
  5398. const info = {};
  5399. info.parsedUrl = requestUrl;
  5400. const usingSsl = info.parsedUrl.protocol === 'https:';
  5401. info.httpModule = usingSsl ? https : http;
  5402. const defaultPort = usingSsl ? 443 : 80;
  5403. info.options = {};
  5404. info.options.host = info.parsedUrl.hostname;
  5405. info.options.port = info.parsedUrl.port
  5406. ? parseInt(info.parsedUrl.port)
  5407. : defaultPort;
  5408. info.options.path =
  5409. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5410. info.options.method = method;
  5411. info.options.headers = this._mergeHeaders(headers);
  5412. if (this.userAgent != null) {
  5413. info.options.headers['user-agent'] = this.userAgent;
  5414. }
  5415. info.options.agent = this._getAgent(info.parsedUrl);
  5416. // gives handlers an opportunity to participate
  5417. if (this.handlers) {
  5418. for (const handler of this.handlers) {
  5419. handler.prepareRequest(info.options);
  5420. }
  5421. }
  5422. return info;
  5423. }
  5424. _mergeHeaders(headers) {
  5425. if (this.requestOptions && this.requestOptions.headers) {
  5426. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5427. }
  5428. return lowercaseKeys(headers || {});
  5429. }
  5430. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5431. let clientHeader;
  5432. if (this.requestOptions && this.requestOptions.headers) {
  5433. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5434. }
  5435. return additionalHeaders[header] || clientHeader || _default;
  5436. }
  5437. _getAgent(parsedUrl) {
  5438. let agent;
  5439. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5440. const useProxy = proxyUrl && proxyUrl.hostname;
  5441. if (this._keepAlive && useProxy) {
  5442. agent = this._proxyAgent;
  5443. }
  5444. if (!useProxy) {
  5445. agent = this._agent;
  5446. }
  5447. // if agent is already assigned use that agent.
  5448. if (agent) {
  5449. return agent;
  5450. }
  5451. const usingSsl = parsedUrl.protocol === 'https:';
  5452. let maxSockets = 100;
  5453. if (this.requestOptions) {
  5454. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5455. }
  5456. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5457. if (proxyUrl && proxyUrl.hostname) {
  5458. const agentOptions = {
  5459. maxSockets,
  5460. keepAlive: this._keepAlive,
  5461. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5462. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5463. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5464. };
  5465. let tunnelAgent;
  5466. const overHttps = proxyUrl.protocol === 'https:';
  5467. if (usingSsl) {
  5468. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5469. }
  5470. else {
  5471. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5472. }
  5473. agent = tunnelAgent(agentOptions);
  5474. this._proxyAgent = agent;
  5475. }
  5476. // if tunneling agent isn't assigned create a new agent
  5477. if (!agent) {
  5478. const options = { keepAlive: this._keepAlive, maxSockets };
  5479. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5480. this._agent = agent;
  5481. }
  5482. if (usingSsl && this._ignoreSslError) {
  5483. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5484. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5485. // we have to cast it to any and change it directly
  5486. agent.options = Object.assign(agent.options || {}, {
  5487. rejectUnauthorized: false
  5488. });
  5489. }
  5490. return agent;
  5491. }
  5492. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5493. let proxyAgent;
  5494. if (this._keepAlive) {
  5495. proxyAgent = this._proxyAgentDispatcher;
  5496. }
  5497. // if agent is already assigned use that agent.
  5498. if (proxyAgent) {
  5499. return proxyAgent;
  5500. }
  5501. const usingSsl = parsedUrl.protocol === 'https:';
  5502. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5503. token: `${proxyUrl.username}:${proxyUrl.password}`
  5504. })));
  5505. this._proxyAgentDispatcher = proxyAgent;
  5506. if (usingSsl && this._ignoreSslError) {
  5507. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5508. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5509. // we have to cast it to any and change it directly
  5510. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5511. rejectUnauthorized: false
  5512. });
  5513. }
  5514. return proxyAgent;
  5515. }
  5516. _performExponentialBackoff(retryNumber) {
  5517. return __awaiter(this, void 0, void 0, function* () {
  5518. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5519. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5520. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5521. });
  5522. }
  5523. _processResponse(res, options) {
  5524. return __awaiter(this, void 0, void 0, function* () {
  5525. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5526. const statusCode = res.message.statusCode || 0;
  5527. const response = {
  5528. statusCode,
  5529. result: null,
  5530. headers: {}
  5531. };
  5532. // not found leads to null obj returned
  5533. if (statusCode === HttpCodes.NotFound) {
  5534. resolve(response);
  5535. }
  5536. // get the result from the body
  5537. function dateTimeDeserializer(key, value) {
  5538. if (typeof value === 'string') {
  5539. const a = new Date(value);
  5540. if (!isNaN(a.valueOf())) {
  5541. return a;
  5542. }
  5543. }
  5544. return value;
  5545. }
  5546. let obj;
  5547. let contents;
  5548. try {
  5549. contents = yield res.readBody();
  5550. if (contents && contents.length > 0) {
  5551. if (options && options.deserializeDates) {
  5552. obj = JSON.parse(contents, dateTimeDeserializer);
  5553. }
  5554. else {
  5555. obj = JSON.parse(contents);
  5556. }
  5557. response.result = obj;
  5558. }
  5559. response.headers = res.message.headers;
  5560. }
  5561. catch (err) {
  5562. // Invalid resource (contents not json); leaving result obj null
  5563. }
  5564. // note that 3xx redirects are handled by the http layer.
  5565. if (statusCode > 299) {
  5566. let msg;
  5567. // if exception/error in body, attempt to get better error
  5568. if (obj && obj.message) {
  5569. msg = obj.message;
  5570. }
  5571. else if (contents && contents.length > 0) {
  5572. // it may be the case that the exception is in the body message as string
  5573. msg = contents;
  5574. }
  5575. else {
  5576. msg = `Failed request: (${statusCode})`;
  5577. }
  5578. const err = new HttpClientError(msg, statusCode);
  5579. err.result = response.result;
  5580. reject(err);
  5581. }
  5582. else {
  5583. resolve(response);
  5584. }
  5585. }));
  5586. });
  5587. }
  5588. }
  5589. exports.HttpClient = HttpClient;
  5590. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5591. //# sourceMappingURL=index.js.map
  5592. /***/ }),
  5593. /***/ 9835:
  5594. /***/ ((__unused_webpack_module, exports) => {
  5595. "use strict";
  5596. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5597. exports.checkBypass = exports.getProxyUrl = void 0;
  5598. function getProxyUrl(reqUrl) {
  5599. const usingSsl = reqUrl.protocol === 'https:';
  5600. if (checkBypass(reqUrl)) {
  5601. return undefined;
  5602. }
  5603. const proxyVar = (() => {
  5604. if (usingSsl) {
  5605. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5606. }
  5607. else {
  5608. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5609. }
  5610. })();
  5611. if (proxyVar) {
  5612. try {
  5613. return new URL(proxyVar);
  5614. }
  5615. catch (_a) {
  5616. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5617. return new URL(`http://${proxyVar}`);
  5618. }
  5619. }
  5620. else {
  5621. return undefined;
  5622. }
  5623. }
  5624. exports.getProxyUrl = getProxyUrl;
  5625. function checkBypass(reqUrl) {
  5626. if (!reqUrl.hostname) {
  5627. return false;
  5628. }
  5629. const reqHost = reqUrl.hostname;
  5630. if (isLoopbackAddress(reqHost)) {
  5631. return true;
  5632. }
  5633. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5634. if (!noProxy) {
  5635. return false;
  5636. }
  5637. // Determine the request port
  5638. let reqPort;
  5639. if (reqUrl.port) {
  5640. reqPort = Number(reqUrl.port);
  5641. }
  5642. else if (reqUrl.protocol === 'http:') {
  5643. reqPort = 80;
  5644. }
  5645. else if (reqUrl.protocol === 'https:') {
  5646. reqPort = 443;
  5647. }
  5648. // Format the request hostname and hostname with port
  5649. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5650. if (typeof reqPort === 'number') {
  5651. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5652. }
  5653. // Compare request host against noproxy
  5654. for (const upperNoProxyItem of noProxy
  5655. .split(',')
  5656. .map(x => x.trim().toUpperCase())
  5657. .filter(x => x)) {
  5658. if (upperNoProxyItem === '*' ||
  5659. upperReqHosts.some(x => x === upperNoProxyItem ||
  5660. x.endsWith(`.${upperNoProxyItem}`) ||
  5661. (upperNoProxyItem.startsWith('.') &&
  5662. x.endsWith(`${upperNoProxyItem}`)))) {
  5663. return true;
  5664. }
  5665. }
  5666. return false;
  5667. }
  5668. exports.checkBypass = checkBypass;
  5669. function isLoopbackAddress(host) {
  5670. const hostLower = host.toLowerCase();
  5671. return (hostLower === 'localhost' ||
  5672. hostLower.startsWith('127.') ||
  5673. hostLower.startsWith('[::1]') ||
  5674. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5675. }
  5676. //# sourceMappingURL=proxy.js.map
  5677. /***/ }),
  5678. /***/ 1962:
  5679. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5680. "use strict";
  5681. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5682. if (k2 === undefined) k2 = k;
  5683. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5684. }) : (function(o, m, k, k2) {
  5685. if (k2 === undefined) k2 = k;
  5686. o[k2] = m[k];
  5687. }));
  5688. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5689. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5690. }) : function(o, v) {
  5691. o["default"] = v;
  5692. });
  5693. var __importStar = (this && this.__importStar) || function (mod) {
  5694. if (mod && mod.__esModule) return mod;
  5695. var result = {};
  5696. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5697. __setModuleDefault(result, mod);
  5698. return result;
  5699. };
  5700. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5701. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5702. return new (P || (P = Promise))(function (resolve, reject) {
  5703. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5704. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5705. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5706. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5707. });
  5708. };
  5709. var _a;
  5710. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5711. 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;
  5712. const fs = __importStar(__nccwpck_require__(7147));
  5713. const path = __importStar(__nccwpck_require__(1017));
  5714. _a = fs.promises
  5715. // export const {open} = 'fs'
  5716. , 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;
  5717. // export const {open} = 'fs'
  5718. exports.IS_WINDOWS = process.platform === 'win32';
  5719. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5720. exports.UV_FS_O_EXLOCK = 0x10000000;
  5721. exports.READONLY = fs.constants.O_RDONLY;
  5722. function exists(fsPath) {
  5723. return __awaiter(this, void 0, void 0, function* () {
  5724. try {
  5725. yield exports.stat(fsPath);
  5726. }
  5727. catch (err) {
  5728. if (err.code === 'ENOENT') {
  5729. return false;
  5730. }
  5731. throw err;
  5732. }
  5733. return true;
  5734. });
  5735. }
  5736. exports.exists = exists;
  5737. function isDirectory(fsPath, useStat = false) {
  5738. return __awaiter(this, void 0, void 0, function* () {
  5739. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  5740. return stats.isDirectory();
  5741. });
  5742. }
  5743. exports.isDirectory = isDirectory;
  5744. /**
  5745. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  5746. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  5747. */
  5748. function isRooted(p) {
  5749. p = normalizeSeparators(p);
  5750. if (!p) {
  5751. throw new Error('isRooted() parameter "p" cannot be empty');
  5752. }
  5753. if (exports.IS_WINDOWS) {
  5754. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  5755. ); // e.g. C: or C:\hello
  5756. }
  5757. return p.startsWith('/');
  5758. }
  5759. exports.isRooted = isRooted;
  5760. /**
  5761. * Best effort attempt to determine whether a file exists and is executable.
  5762. * @param filePath file path to check
  5763. * @param extensions additional file extensions to try
  5764. * @return if file exists and is executable, returns the file path. otherwise empty string.
  5765. */
  5766. function tryGetExecutablePath(filePath, extensions) {
  5767. return __awaiter(this, void 0, void 0, function* () {
  5768. let stats = undefined;
  5769. try {
  5770. // test file exists
  5771. stats = yield exports.stat(filePath);
  5772. }
  5773. catch (err) {
  5774. if (err.code !== 'ENOENT') {
  5775. // eslint-disable-next-line no-console
  5776. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5777. }
  5778. }
  5779. if (stats && stats.isFile()) {
  5780. if (exports.IS_WINDOWS) {
  5781. // on Windows, test for valid extension
  5782. const upperExt = path.extname(filePath).toUpperCase();
  5783. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  5784. return filePath;
  5785. }
  5786. }
  5787. else {
  5788. if (isUnixExecutable(stats)) {
  5789. return filePath;
  5790. }
  5791. }
  5792. }
  5793. // try each extension
  5794. const originalFilePath = filePath;
  5795. for (const extension of extensions) {
  5796. filePath = originalFilePath + extension;
  5797. stats = undefined;
  5798. try {
  5799. stats = yield exports.stat(filePath);
  5800. }
  5801. catch (err) {
  5802. if (err.code !== 'ENOENT') {
  5803. // eslint-disable-next-line no-console
  5804. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5805. }
  5806. }
  5807. if (stats && stats.isFile()) {
  5808. if (exports.IS_WINDOWS) {
  5809. // preserve the case of the actual file (since an extension was appended)
  5810. try {
  5811. const directory = path.dirname(filePath);
  5812. const upperName = path.basename(filePath).toUpperCase();
  5813. for (const actualName of yield exports.readdir(directory)) {
  5814. if (upperName === actualName.toUpperCase()) {
  5815. filePath = path.join(directory, actualName);
  5816. break;
  5817. }
  5818. }
  5819. }
  5820. catch (err) {
  5821. // eslint-disable-next-line no-console
  5822. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  5823. }
  5824. return filePath;
  5825. }
  5826. else {
  5827. if (isUnixExecutable(stats)) {
  5828. return filePath;
  5829. }
  5830. }
  5831. }
  5832. }
  5833. return '';
  5834. });
  5835. }
  5836. exports.tryGetExecutablePath = tryGetExecutablePath;
  5837. function normalizeSeparators(p) {
  5838. p = p || '';
  5839. if (exports.IS_WINDOWS) {
  5840. // convert slashes on Windows
  5841. p = p.replace(/\//g, '\\');
  5842. // remove redundant slashes
  5843. return p.replace(/\\\\+/g, '\\');
  5844. }
  5845. // remove redundant slashes
  5846. return p.replace(/\/\/+/g, '/');
  5847. }
  5848. // on Mac/Linux, test the execute bit
  5849. // R W X R W X R W X
  5850. // 256 128 64 32 16 8 4 2 1
  5851. function isUnixExecutable(stats) {
  5852. return ((stats.mode & 1) > 0 ||
  5853. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  5854. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  5855. }
  5856. // Get the path of cmd.exe in windows
  5857. function getCmdPath() {
  5858. var _a;
  5859. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  5860. }
  5861. exports.getCmdPath = getCmdPath;
  5862. //# sourceMappingURL=io-util.js.map
  5863. /***/ }),
  5864. /***/ 7436:
  5865. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5866. "use strict";
  5867. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5868. if (k2 === undefined) k2 = k;
  5869. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5870. }) : (function(o, m, k, k2) {
  5871. if (k2 === undefined) k2 = k;
  5872. o[k2] = m[k];
  5873. }));
  5874. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5875. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5876. }) : function(o, v) {
  5877. o["default"] = v;
  5878. });
  5879. var __importStar = (this && this.__importStar) || function (mod) {
  5880. if (mod && mod.__esModule) return mod;
  5881. var result = {};
  5882. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5883. __setModuleDefault(result, mod);
  5884. return result;
  5885. };
  5886. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5887. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5888. return new (P || (P = Promise))(function (resolve, reject) {
  5889. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5890. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5891. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5892. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5893. });
  5894. };
  5895. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5896. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  5897. const assert_1 = __nccwpck_require__(9491);
  5898. const path = __importStar(__nccwpck_require__(1017));
  5899. const ioUtil = __importStar(__nccwpck_require__(1962));
  5900. /**
  5901. * Copies a file or folder.
  5902. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  5903. *
  5904. * @param source source path
  5905. * @param dest destination path
  5906. * @param options optional. See CopyOptions.
  5907. */
  5908. function cp(source, dest, options = {}) {
  5909. return __awaiter(this, void 0, void 0, function* () {
  5910. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  5911. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  5912. // Dest is an existing file, but not forcing
  5913. if (destStat && destStat.isFile() && !force) {
  5914. return;
  5915. }
  5916. // If dest is an existing directory, should copy inside.
  5917. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  5918. ? path.join(dest, path.basename(source))
  5919. : dest;
  5920. if (!(yield ioUtil.exists(source))) {
  5921. throw new Error(`no such file or directory: ${source}`);
  5922. }
  5923. const sourceStat = yield ioUtil.stat(source);
  5924. if (sourceStat.isDirectory()) {
  5925. if (!recursive) {
  5926. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  5927. }
  5928. else {
  5929. yield cpDirRecursive(source, newDest, 0, force);
  5930. }
  5931. }
  5932. else {
  5933. if (path.relative(source, newDest) === '') {
  5934. // a file cannot be copied to itself
  5935. throw new Error(`'${newDest}' and '${source}' are the same file`);
  5936. }
  5937. yield copyFile(source, newDest, force);
  5938. }
  5939. });
  5940. }
  5941. exports.cp = cp;
  5942. /**
  5943. * Moves a path.
  5944. *
  5945. * @param source source path
  5946. * @param dest destination path
  5947. * @param options optional. See MoveOptions.
  5948. */
  5949. function mv(source, dest, options = {}) {
  5950. return __awaiter(this, void 0, void 0, function* () {
  5951. if (yield ioUtil.exists(dest)) {
  5952. let destExists = true;
  5953. if (yield ioUtil.isDirectory(dest)) {
  5954. // If dest is directory copy src into dest
  5955. dest = path.join(dest, path.basename(source));
  5956. destExists = yield ioUtil.exists(dest);
  5957. }
  5958. if (destExists) {
  5959. if (options.force == null || options.force) {
  5960. yield rmRF(dest);
  5961. }
  5962. else {
  5963. throw new Error('Destination already exists');
  5964. }
  5965. }
  5966. }
  5967. yield mkdirP(path.dirname(dest));
  5968. yield ioUtil.rename(source, dest);
  5969. });
  5970. }
  5971. exports.mv = mv;
  5972. /**
  5973. * Remove a path recursively with force
  5974. *
  5975. * @param inputPath path to remove
  5976. */
  5977. function rmRF(inputPath) {
  5978. return __awaiter(this, void 0, void 0, function* () {
  5979. if (ioUtil.IS_WINDOWS) {
  5980. // Check for invalid characters
  5981. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  5982. if (/[*"<>|]/.test(inputPath)) {
  5983. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  5984. }
  5985. }
  5986. try {
  5987. // note if path does not exist, error is silent
  5988. yield ioUtil.rm(inputPath, {
  5989. force: true,
  5990. maxRetries: 3,
  5991. recursive: true,
  5992. retryDelay: 300
  5993. });
  5994. }
  5995. catch (err) {
  5996. throw new Error(`File was unable to be removed ${err}`);
  5997. }
  5998. });
  5999. }
  6000. exports.rmRF = rmRF;
  6001. /**
  6002. * Make a directory. Creates the full path with folders in between
  6003. * Will throw if it fails
  6004. *
  6005. * @param fsPath path to create
  6006. * @returns Promise<void>
  6007. */
  6008. function mkdirP(fsPath) {
  6009. return __awaiter(this, void 0, void 0, function* () {
  6010. assert_1.ok(fsPath, 'a path argument must be provided');
  6011. yield ioUtil.mkdir(fsPath, { recursive: true });
  6012. });
  6013. }
  6014. exports.mkdirP = mkdirP;
  6015. /**
  6016. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6017. * If you check and the tool does not exist, it will throw.
  6018. *
  6019. * @param tool name of the tool
  6020. * @param check whether to check if tool exists
  6021. * @returns Promise<string> path to tool
  6022. */
  6023. function which(tool, check) {
  6024. return __awaiter(this, void 0, void 0, function* () {
  6025. if (!tool) {
  6026. throw new Error("parameter 'tool' is required");
  6027. }
  6028. // recursive when check=true
  6029. if (check) {
  6030. const result = yield which(tool, false);
  6031. if (!result) {
  6032. if (ioUtil.IS_WINDOWS) {
  6033. 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.`);
  6034. }
  6035. else {
  6036. 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.`);
  6037. }
  6038. }
  6039. return result;
  6040. }
  6041. const matches = yield findInPath(tool);
  6042. if (matches && matches.length > 0) {
  6043. return matches[0];
  6044. }
  6045. return '';
  6046. });
  6047. }
  6048. exports.which = which;
  6049. /**
  6050. * Returns a list of all occurrences of the given tool on the system path.
  6051. *
  6052. * @returns Promise<string[]> the paths of the tool
  6053. */
  6054. function findInPath(tool) {
  6055. return __awaiter(this, void 0, void 0, function* () {
  6056. if (!tool) {
  6057. throw new Error("parameter 'tool' is required");
  6058. }
  6059. // build the list of extensions to try
  6060. const extensions = [];
  6061. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6062. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6063. if (extension) {
  6064. extensions.push(extension);
  6065. }
  6066. }
  6067. }
  6068. // if it's rooted, return it if exists. otherwise return empty.
  6069. if (ioUtil.isRooted(tool)) {
  6070. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6071. if (filePath) {
  6072. return [filePath];
  6073. }
  6074. return [];
  6075. }
  6076. // if any path separators, return empty
  6077. if (tool.includes(path.sep)) {
  6078. return [];
  6079. }
  6080. // build the list of directories
  6081. //
  6082. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6083. // it feels like we should not do this. Checking the current directory seems like more of a use
  6084. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6085. // across platforms.
  6086. const directories = [];
  6087. if (process.env.PATH) {
  6088. for (const p of process.env.PATH.split(path.delimiter)) {
  6089. if (p) {
  6090. directories.push(p);
  6091. }
  6092. }
  6093. }
  6094. // find all matches
  6095. const matches = [];
  6096. for (const directory of directories) {
  6097. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6098. if (filePath) {
  6099. matches.push(filePath);
  6100. }
  6101. }
  6102. return matches;
  6103. });
  6104. }
  6105. exports.findInPath = findInPath;
  6106. function readCopyOptions(options) {
  6107. const force = options.force == null ? true : options.force;
  6108. const recursive = Boolean(options.recursive);
  6109. const copySourceDirectory = options.copySourceDirectory == null
  6110. ? true
  6111. : Boolean(options.copySourceDirectory);
  6112. return { force, recursive, copySourceDirectory };
  6113. }
  6114. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6115. return __awaiter(this, void 0, void 0, function* () {
  6116. // Ensure there is not a run away recursive copy
  6117. if (currentDepth >= 255)
  6118. return;
  6119. currentDepth++;
  6120. yield mkdirP(destDir);
  6121. const files = yield ioUtil.readdir(sourceDir);
  6122. for (const fileName of files) {
  6123. const srcFile = `${sourceDir}/${fileName}`;
  6124. const destFile = `${destDir}/${fileName}`;
  6125. const srcFileStat = yield ioUtil.lstat(srcFile);
  6126. if (srcFileStat.isDirectory()) {
  6127. // Recurse
  6128. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6129. }
  6130. else {
  6131. yield copyFile(srcFile, destFile, force);
  6132. }
  6133. }
  6134. // Change the mode for the newly created directory
  6135. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6136. });
  6137. }
  6138. // Buffered file copy
  6139. function copyFile(srcFile, destFile, force) {
  6140. return __awaiter(this, void 0, void 0, function* () {
  6141. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6142. // unlink/re-link it
  6143. try {
  6144. yield ioUtil.lstat(destFile);
  6145. yield ioUtil.unlink(destFile);
  6146. }
  6147. catch (e) {
  6148. // Try to override file permission
  6149. if (e.code === 'EPERM') {
  6150. yield ioUtil.chmod(destFile, '0666');
  6151. yield ioUtil.unlink(destFile);
  6152. }
  6153. // other errors = it doesn't exist, no work to do
  6154. }
  6155. // Copy over symlink
  6156. const symlinkFull = yield ioUtil.readlink(srcFile);
  6157. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6158. }
  6159. else if (!(yield ioUtil.exists(destFile)) || force) {
  6160. yield ioUtil.copyFile(srcFile, destFile);
  6161. }
  6162. });
  6163. }
  6164. //# sourceMappingURL=io.js.map
  6165. /***/ }),
  6166. /***/ 2473:
  6167. /***/ (function(module, exports, __nccwpck_require__) {
  6168. "use strict";
  6169. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6170. if (k2 === undefined) k2 = k;
  6171. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6172. }) : (function(o, m, k, k2) {
  6173. if (k2 === undefined) k2 = k;
  6174. o[k2] = m[k];
  6175. }));
  6176. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6177. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6178. }) : function(o, v) {
  6179. o["default"] = v;
  6180. });
  6181. var __importStar = (this && this.__importStar) || function (mod) {
  6182. if (mod && mod.__esModule) return mod;
  6183. var result = {};
  6184. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6185. __setModuleDefault(result, mod);
  6186. return result;
  6187. };
  6188. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6189. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6190. return new (P || (P = Promise))(function (resolve, reject) {
  6191. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6192. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6193. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6194. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6195. });
  6196. };
  6197. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6198. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6199. const semver = __importStar(__nccwpck_require__(5911));
  6200. const core_1 = __nccwpck_require__(2186);
  6201. // needs to be require for core node modules to be mocked
  6202. /* eslint @typescript-eslint/no-require-imports: 0 */
  6203. const os = __nccwpck_require__(2037);
  6204. const cp = __nccwpck_require__(2081);
  6205. const fs = __nccwpck_require__(7147);
  6206. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6207. return __awaiter(this, void 0, void 0, function* () {
  6208. const platFilter = os.platform();
  6209. let result;
  6210. let match;
  6211. let file;
  6212. for (const candidate of candidates) {
  6213. const version = candidate.version;
  6214. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6215. if (semver.satisfies(version, versionSpec) &&
  6216. (!stable || candidate.stable === stable)) {
  6217. file = candidate.files.find(item => {
  6218. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6219. let chk = item.arch === archFilter && item.platform === platFilter;
  6220. if (chk && item.platform_version) {
  6221. const osVersion = module.exports._getOsVersion();
  6222. if (osVersion === item.platform_version) {
  6223. chk = true;
  6224. }
  6225. else {
  6226. chk = semver.satisfies(osVersion, item.platform_version);
  6227. }
  6228. }
  6229. return chk;
  6230. });
  6231. if (file) {
  6232. core_1.debug(`matched ${candidate.version}`);
  6233. match = candidate;
  6234. break;
  6235. }
  6236. }
  6237. }
  6238. if (match && file) {
  6239. // clone since we're mutating the file list to be only the file that matches
  6240. result = Object.assign({}, match);
  6241. result.files = [file];
  6242. }
  6243. return result;
  6244. });
  6245. }
  6246. exports._findMatch = _findMatch;
  6247. function _getOsVersion() {
  6248. // TODO: add windows and other linux, arm variants
  6249. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6250. const plat = os.platform();
  6251. let version = '';
  6252. if (plat === 'darwin') {
  6253. version = cp.execSync('sw_vers -productVersion').toString();
  6254. }
  6255. else if (plat === 'linux') {
  6256. // lsb_release process not in some containers, readfile
  6257. // Run cat /etc/lsb-release
  6258. // DISTRIB_ID=Ubuntu
  6259. // DISTRIB_RELEASE=18.04
  6260. // DISTRIB_CODENAME=bionic
  6261. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6262. const lsbContents = module.exports._readLinuxVersionFile();
  6263. if (lsbContents) {
  6264. const lines = lsbContents.split('\n');
  6265. for (const line of lines) {
  6266. const parts = line.split('=');
  6267. if (parts.length === 2 &&
  6268. (parts[0].trim() === 'VERSION_ID' ||
  6269. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6270. version = parts[1]
  6271. .trim()
  6272. .replace(/^"/, '')
  6273. .replace(/"$/, '');
  6274. break;
  6275. }
  6276. }
  6277. }
  6278. }
  6279. return version;
  6280. }
  6281. exports._getOsVersion = _getOsVersion;
  6282. function _readLinuxVersionFile() {
  6283. const lsbReleaseFile = '/etc/lsb-release';
  6284. const osReleaseFile = '/etc/os-release';
  6285. let contents = '';
  6286. if (fs.existsSync(lsbReleaseFile)) {
  6287. contents = fs.readFileSync(lsbReleaseFile).toString();
  6288. }
  6289. else if (fs.existsSync(osReleaseFile)) {
  6290. contents = fs.readFileSync(osReleaseFile).toString();
  6291. }
  6292. return contents;
  6293. }
  6294. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6295. //# sourceMappingURL=manifest.js.map
  6296. /***/ }),
  6297. /***/ 8279:
  6298. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6299. "use strict";
  6300. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6301. if (k2 === undefined) k2 = k;
  6302. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6303. }) : (function(o, m, k, k2) {
  6304. if (k2 === undefined) k2 = k;
  6305. o[k2] = m[k];
  6306. }));
  6307. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6308. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6309. }) : function(o, v) {
  6310. o["default"] = v;
  6311. });
  6312. var __importStar = (this && this.__importStar) || function (mod) {
  6313. if (mod && mod.__esModule) return mod;
  6314. var result = {};
  6315. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6316. __setModuleDefault(result, mod);
  6317. return result;
  6318. };
  6319. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6320. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6321. return new (P || (P = Promise))(function (resolve, reject) {
  6322. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6323. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6324. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6325. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6326. });
  6327. };
  6328. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6329. exports.RetryHelper = void 0;
  6330. const core = __importStar(__nccwpck_require__(2186));
  6331. /**
  6332. * Internal class for retries
  6333. */
  6334. class RetryHelper {
  6335. constructor(maxAttempts, minSeconds, maxSeconds) {
  6336. if (maxAttempts < 1) {
  6337. throw new Error('max attempts should be greater than or equal to 1');
  6338. }
  6339. this.maxAttempts = maxAttempts;
  6340. this.minSeconds = Math.floor(minSeconds);
  6341. this.maxSeconds = Math.floor(maxSeconds);
  6342. if (this.minSeconds > this.maxSeconds) {
  6343. throw new Error('min seconds should be less than or equal to max seconds');
  6344. }
  6345. }
  6346. execute(action, isRetryable) {
  6347. return __awaiter(this, void 0, void 0, function* () {
  6348. let attempt = 1;
  6349. while (attempt < this.maxAttempts) {
  6350. // Try
  6351. try {
  6352. return yield action();
  6353. }
  6354. catch (err) {
  6355. if (isRetryable && !isRetryable(err)) {
  6356. throw err;
  6357. }
  6358. core.info(err.message);
  6359. }
  6360. // Sleep
  6361. const seconds = this.getSleepAmount();
  6362. core.info(`Waiting ${seconds} seconds before trying again`);
  6363. yield this.sleep(seconds);
  6364. attempt++;
  6365. }
  6366. // Last attempt
  6367. return yield action();
  6368. });
  6369. }
  6370. getSleepAmount() {
  6371. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6372. this.minSeconds);
  6373. }
  6374. sleep(seconds) {
  6375. return __awaiter(this, void 0, void 0, function* () {
  6376. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6377. });
  6378. }
  6379. }
  6380. exports.RetryHelper = RetryHelper;
  6381. //# sourceMappingURL=retry-helper.js.map
  6382. /***/ }),
  6383. /***/ 7784:
  6384. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6385. "use strict";
  6386. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6387. if (k2 === undefined) k2 = k;
  6388. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6389. }) : (function(o, m, k, k2) {
  6390. if (k2 === undefined) k2 = k;
  6391. o[k2] = m[k];
  6392. }));
  6393. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6394. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6395. }) : function(o, v) {
  6396. o["default"] = v;
  6397. });
  6398. var __importStar = (this && this.__importStar) || function (mod) {
  6399. if (mod && mod.__esModule) return mod;
  6400. var result = {};
  6401. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6402. __setModuleDefault(result, mod);
  6403. return result;
  6404. };
  6405. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6406. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6407. return new (P || (P = Promise))(function (resolve, reject) {
  6408. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6409. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6410. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6411. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6412. });
  6413. };
  6414. var __importDefault = (this && this.__importDefault) || function (mod) {
  6415. return (mod && mod.__esModule) ? mod : { "default": mod };
  6416. };
  6417. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6418. 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;
  6419. const core = __importStar(__nccwpck_require__(2186));
  6420. const io = __importStar(__nccwpck_require__(7436));
  6421. const fs = __importStar(__nccwpck_require__(7147));
  6422. const mm = __importStar(__nccwpck_require__(2473));
  6423. const os = __importStar(__nccwpck_require__(2037));
  6424. const path = __importStar(__nccwpck_require__(1017));
  6425. const httpm = __importStar(__nccwpck_require__(6255));
  6426. const semver = __importStar(__nccwpck_require__(5911));
  6427. const stream = __importStar(__nccwpck_require__(2781));
  6428. const util = __importStar(__nccwpck_require__(3837));
  6429. const assert_1 = __nccwpck_require__(9491);
  6430. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6431. const exec_1 = __nccwpck_require__(1514);
  6432. const retry_helper_1 = __nccwpck_require__(8279);
  6433. class HTTPError extends Error {
  6434. constructor(httpStatusCode) {
  6435. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6436. this.httpStatusCode = httpStatusCode;
  6437. Object.setPrototypeOf(this, new.target.prototype);
  6438. }
  6439. }
  6440. exports.HTTPError = HTTPError;
  6441. const IS_WINDOWS = process.platform === 'win32';
  6442. const IS_MAC = process.platform === 'darwin';
  6443. const userAgent = 'actions/tool-cache';
  6444. /**
  6445. * Download a tool from an url and stream it into a file
  6446. *
  6447. * @param url url of tool to download
  6448. * @param dest path to download tool
  6449. * @param auth authorization header
  6450. * @param headers other headers
  6451. * @returns path to downloaded tool
  6452. */
  6453. function downloadTool(url, dest, auth, headers) {
  6454. return __awaiter(this, void 0, void 0, function* () {
  6455. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6456. yield io.mkdirP(path.dirname(dest));
  6457. core.debug(`Downloading ${url}`);
  6458. core.debug(`Destination ${dest}`);
  6459. const maxAttempts = 3;
  6460. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6461. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6462. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6463. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6464. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6465. }), (err) => {
  6466. if (err instanceof HTTPError && err.httpStatusCode) {
  6467. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6468. if (err.httpStatusCode < 500 &&
  6469. err.httpStatusCode !== 408 &&
  6470. err.httpStatusCode !== 429) {
  6471. return false;
  6472. }
  6473. }
  6474. // Otherwise retry
  6475. return true;
  6476. });
  6477. });
  6478. }
  6479. exports.downloadTool = downloadTool;
  6480. function downloadToolAttempt(url, dest, auth, headers) {
  6481. return __awaiter(this, void 0, void 0, function* () {
  6482. if (fs.existsSync(dest)) {
  6483. throw new Error(`Destination file path ${dest} already exists`);
  6484. }
  6485. // Get the response headers
  6486. const http = new httpm.HttpClient(userAgent, [], {
  6487. allowRetries: false
  6488. });
  6489. if (auth) {
  6490. core.debug('set auth');
  6491. if (headers === undefined) {
  6492. headers = {};
  6493. }
  6494. headers.authorization = auth;
  6495. }
  6496. const response = yield http.get(url, headers);
  6497. if (response.message.statusCode !== 200) {
  6498. const err = new HTTPError(response.message.statusCode);
  6499. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6500. throw err;
  6501. }
  6502. // Download the response body
  6503. const pipeline = util.promisify(stream.pipeline);
  6504. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6505. const readStream = responseMessageFactory();
  6506. let succeeded = false;
  6507. try {
  6508. yield pipeline(readStream, fs.createWriteStream(dest));
  6509. core.debug('download complete');
  6510. succeeded = true;
  6511. return dest;
  6512. }
  6513. finally {
  6514. // Error, delete dest before retry
  6515. if (!succeeded) {
  6516. core.debug('download failed');
  6517. try {
  6518. yield io.rmRF(dest);
  6519. }
  6520. catch (err) {
  6521. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6522. }
  6523. }
  6524. }
  6525. });
  6526. }
  6527. /**
  6528. * Extract a .7z file
  6529. *
  6530. * @param file path to the .7z file
  6531. * @param dest destination directory. Optional.
  6532. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6533. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6534. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6535. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6536. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6537. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6538. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6539. * to 7zr.exe can be pass to this function.
  6540. * @returns path to the destination directory
  6541. */
  6542. function extract7z(file, dest, _7zPath) {
  6543. return __awaiter(this, void 0, void 0, function* () {
  6544. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6545. assert_1.ok(file, 'parameter "file" is required');
  6546. dest = yield _createExtractFolder(dest);
  6547. const originalCwd = process.cwd();
  6548. process.chdir(dest);
  6549. if (_7zPath) {
  6550. try {
  6551. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6552. const args = [
  6553. 'x',
  6554. logLevel,
  6555. '-bd',
  6556. '-sccUTF-8',
  6557. file
  6558. ];
  6559. const options = {
  6560. silent: true
  6561. };
  6562. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6563. }
  6564. finally {
  6565. process.chdir(originalCwd);
  6566. }
  6567. }
  6568. else {
  6569. const escapedScript = path
  6570. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6571. .replace(/'/g, "''")
  6572. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6573. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6574. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6575. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6576. const args = [
  6577. '-NoLogo',
  6578. '-Sta',
  6579. '-NoProfile',
  6580. '-NonInteractive',
  6581. '-ExecutionPolicy',
  6582. 'Unrestricted',
  6583. '-Command',
  6584. command
  6585. ];
  6586. const options = {
  6587. silent: true
  6588. };
  6589. try {
  6590. const powershellPath = yield io.which('powershell', true);
  6591. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6592. }
  6593. finally {
  6594. process.chdir(originalCwd);
  6595. }
  6596. }
  6597. return dest;
  6598. });
  6599. }
  6600. exports.extract7z = extract7z;
  6601. /**
  6602. * Extract a compressed tar archive
  6603. *
  6604. * @param file path to the tar
  6605. * @param dest destination directory. Optional.
  6606. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6607. * @returns path to the destination directory
  6608. */
  6609. function extractTar(file, dest, flags = 'xz') {
  6610. return __awaiter(this, void 0, void 0, function* () {
  6611. if (!file) {
  6612. throw new Error("parameter 'file' is required");
  6613. }
  6614. // Create dest
  6615. dest = yield _createExtractFolder(dest);
  6616. // Determine whether GNU tar
  6617. core.debug('Checking tar --version');
  6618. let versionOutput = '';
  6619. yield exec_1.exec('tar --version', [], {
  6620. ignoreReturnCode: true,
  6621. silent: true,
  6622. listeners: {
  6623. stdout: (data) => (versionOutput += data.toString()),
  6624. stderr: (data) => (versionOutput += data.toString())
  6625. }
  6626. });
  6627. core.debug(versionOutput.trim());
  6628. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6629. // Initialize args
  6630. let args;
  6631. if (flags instanceof Array) {
  6632. args = flags;
  6633. }
  6634. else {
  6635. args = [flags];
  6636. }
  6637. if (core.isDebug() && !flags.includes('v')) {
  6638. args.push('-v');
  6639. }
  6640. let destArg = dest;
  6641. let fileArg = file;
  6642. if (IS_WINDOWS && isGnuTar) {
  6643. args.push('--force-local');
  6644. destArg = dest.replace(/\\/g, '/');
  6645. // Technically only the dest needs to have `/` but for aesthetic consistency
  6646. // convert slashes in the file arg too.
  6647. fileArg = file.replace(/\\/g, '/');
  6648. }
  6649. if (isGnuTar) {
  6650. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6651. args.push('--warning=no-unknown-keyword');
  6652. args.push('--overwrite');
  6653. }
  6654. args.push('-C', destArg, '-f', fileArg);
  6655. yield exec_1.exec(`tar`, args);
  6656. return dest;
  6657. });
  6658. }
  6659. exports.extractTar = extractTar;
  6660. /**
  6661. * Extract a xar compatible archive
  6662. *
  6663. * @param file path to the archive
  6664. * @param dest destination directory. Optional.
  6665. * @param flags flags for the xar. Optional.
  6666. * @returns path to the destination directory
  6667. */
  6668. function extractXar(file, dest, flags = []) {
  6669. return __awaiter(this, void 0, void 0, function* () {
  6670. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6671. assert_1.ok(file, 'parameter "file" is required');
  6672. dest = yield _createExtractFolder(dest);
  6673. let args;
  6674. if (flags instanceof Array) {
  6675. args = flags;
  6676. }
  6677. else {
  6678. args = [flags];
  6679. }
  6680. args.push('-x', '-C', dest, '-f', file);
  6681. if (core.isDebug()) {
  6682. args.push('-v');
  6683. }
  6684. const xarPath = yield io.which('xar', true);
  6685. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6686. return dest;
  6687. });
  6688. }
  6689. exports.extractXar = extractXar;
  6690. /**
  6691. * Extract a zip
  6692. *
  6693. * @param file path to the zip
  6694. * @param dest destination directory. Optional.
  6695. * @returns path to the destination directory
  6696. */
  6697. function extractZip(file, dest) {
  6698. return __awaiter(this, void 0, void 0, function* () {
  6699. if (!file) {
  6700. throw new Error("parameter 'file' is required");
  6701. }
  6702. dest = yield _createExtractFolder(dest);
  6703. if (IS_WINDOWS) {
  6704. yield extractZipWin(file, dest);
  6705. }
  6706. else {
  6707. yield extractZipNix(file, dest);
  6708. }
  6709. return dest;
  6710. });
  6711. }
  6712. exports.extractZip = extractZip;
  6713. function extractZipWin(file, dest) {
  6714. return __awaiter(this, void 0, void 0, function* () {
  6715. // build the powershell command
  6716. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6717. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6718. const pwshPath = yield io.which('pwsh', false);
  6719. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6720. //and the -Force flag for Expand-Archive as a fallback
  6721. if (pwshPath) {
  6722. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6723. const pwshCommand = [
  6724. `$ErrorActionPreference = 'Stop' ;`,
  6725. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6726. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  6727. `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 $_ } } ;`
  6728. ].join(' ');
  6729. const args = [
  6730. '-NoLogo',
  6731. '-NoProfile',
  6732. '-NonInteractive',
  6733. '-ExecutionPolicy',
  6734. 'Unrestricted',
  6735. '-Command',
  6736. pwshCommand
  6737. ];
  6738. core.debug(`Using pwsh at path: ${pwshPath}`);
  6739. yield exec_1.exec(`"${pwshPath}"`, args);
  6740. }
  6741. else {
  6742. const powershellCommand = [
  6743. `$ErrorActionPreference = 'Stop' ;`,
  6744. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  6745. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  6746. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  6747. ].join(' ');
  6748. const args = [
  6749. '-NoLogo',
  6750. '-Sta',
  6751. '-NoProfile',
  6752. '-NonInteractive',
  6753. '-ExecutionPolicy',
  6754. 'Unrestricted',
  6755. '-Command',
  6756. powershellCommand
  6757. ];
  6758. const powershellPath = yield io.which('powershell', true);
  6759. core.debug(`Using powershell at path: ${powershellPath}`);
  6760. yield exec_1.exec(`"${powershellPath}"`, args);
  6761. }
  6762. });
  6763. }
  6764. function extractZipNix(file, dest) {
  6765. return __awaiter(this, void 0, void 0, function* () {
  6766. const unzipPath = yield io.which('unzip', true);
  6767. const args = [file];
  6768. if (!core.isDebug()) {
  6769. args.unshift('-q');
  6770. }
  6771. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  6772. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  6773. });
  6774. }
  6775. /**
  6776. * Caches a directory and installs it into the tool cacheDir
  6777. *
  6778. * @param sourceDir the directory to cache into tools
  6779. * @param tool tool name
  6780. * @param version version of the tool. semver format
  6781. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6782. */
  6783. function cacheDir(sourceDir, tool, version, arch) {
  6784. return __awaiter(this, void 0, void 0, function* () {
  6785. version = semver.clean(version) || version;
  6786. arch = arch || os.arch();
  6787. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6788. core.debug(`source dir: ${sourceDir}`);
  6789. if (!fs.statSync(sourceDir).isDirectory()) {
  6790. throw new Error('sourceDir is not a directory');
  6791. }
  6792. // Create the tool dir
  6793. const destPath = yield _createToolPath(tool, version, arch);
  6794. // copy each child item. do not move. move can fail on Windows
  6795. // due to anti-virus software having an open handle on a file.
  6796. for (const itemName of fs.readdirSync(sourceDir)) {
  6797. const s = path.join(sourceDir, itemName);
  6798. yield io.cp(s, destPath, { recursive: true });
  6799. }
  6800. // write .complete
  6801. _completeToolPath(tool, version, arch);
  6802. return destPath;
  6803. });
  6804. }
  6805. exports.cacheDir = cacheDir;
  6806. /**
  6807. * Caches a downloaded file (GUID) and installs it
  6808. * into the tool cache with a given targetName
  6809. *
  6810. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  6811. * @param targetFile the name of the file name in the tools directory
  6812. * @param tool tool name
  6813. * @param version version of the tool. semver format
  6814. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6815. */
  6816. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  6817. return __awaiter(this, void 0, void 0, function* () {
  6818. version = semver.clean(version) || version;
  6819. arch = arch || os.arch();
  6820. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6821. core.debug(`source file: ${sourceFile}`);
  6822. if (!fs.statSync(sourceFile).isFile()) {
  6823. throw new Error('sourceFile is not a file');
  6824. }
  6825. // create the tool dir
  6826. const destFolder = yield _createToolPath(tool, version, arch);
  6827. // copy instead of move. move can fail on Windows due to
  6828. // anti-virus software having an open handle on a file.
  6829. const destPath = path.join(destFolder, targetFile);
  6830. core.debug(`destination file ${destPath}`);
  6831. yield io.cp(sourceFile, destPath);
  6832. // write .complete
  6833. _completeToolPath(tool, version, arch);
  6834. return destFolder;
  6835. });
  6836. }
  6837. exports.cacheFile = cacheFile;
  6838. /**
  6839. * Finds the path to a tool version in the local installed tool cache
  6840. *
  6841. * @param toolName name of the tool
  6842. * @param versionSpec version of the tool
  6843. * @param arch optional arch. defaults to arch of computer
  6844. */
  6845. function find(toolName, versionSpec, arch) {
  6846. if (!toolName) {
  6847. throw new Error('toolName parameter is required');
  6848. }
  6849. if (!versionSpec) {
  6850. throw new Error('versionSpec parameter is required');
  6851. }
  6852. arch = arch || os.arch();
  6853. // attempt to resolve an explicit version
  6854. if (!isExplicitVersion(versionSpec)) {
  6855. const localVersions = findAllVersions(toolName, arch);
  6856. const match = evaluateVersions(localVersions, versionSpec);
  6857. versionSpec = match;
  6858. }
  6859. // check for the explicit version in the cache
  6860. let toolPath = '';
  6861. if (versionSpec) {
  6862. versionSpec = semver.clean(versionSpec) || '';
  6863. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  6864. core.debug(`checking cache: ${cachePath}`);
  6865. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  6866. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  6867. toolPath = cachePath;
  6868. }
  6869. else {
  6870. core.debug('not found');
  6871. }
  6872. }
  6873. return toolPath;
  6874. }
  6875. exports.find = find;
  6876. /**
  6877. * Finds the paths to all versions of a tool that are installed in the local tool cache
  6878. *
  6879. * @param toolName name of the tool
  6880. * @param arch optional arch. defaults to arch of computer
  6881. */
  6882. function findAllVersions(toolName, arch) {
  6883. const versions = [];
  6884. arch = arch || os.arch();
  6885. const toolPath = path.join(_getCacheDirectory(), toolName);
  6886. if (fs.existsSync(toolPath)) {
  6887. const children = fs.readdirSync(toolPath);
  6888. for (const child of children) {
  6889. if (isExplicitVersion(child)) {
  6890. const fullPath = path.join(toolPath, child, arch || '');
  6891. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  6892. versions.push(child);
  6893. }
  6894. }
  6895. }
  6896. }
  6897. return versions;
  6898. }
  6899. exports.findAllVersions = findAllVersions;
  6900. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  6901. return __awaiter(this, void 0, void 0, function* () {
  6902. let releases = [];
  6903. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  6904. const http = new httpm.HttpClient('tool-cache');
  6905. const headers = {};
  6906. if (auth) {
  6907. core.debug('set auth');
  6908. headers.authorization = auth;
  6909. }
  6910. const response = yield http.getJson(treeUrl, headers);
  6911. if (!response.result) {
  6912. return releases;
  6913. }
  6914. let manifestUrl = '';
  6915. for (const item of response.result.tree) {
  6916. if (item.path === 'versions-manifest.json') {
  6917. manifestUrl = item.url;
  6918. break;
  6919. }
  6920. }
  6921. headers['accept'] = 'application/vnd.github.VERSION.raw';
  6922. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  6923. if (versionsRaw) {
  6924. // shouldn't be needed but protects against invalid json saved with BOM
  6925. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  6926. try {
  6927. releases = JSON.parse(versionsRaw);
  6928. }
  6929. catch (_a) {
  6930. core.debug('Invalid json');
  6931. }
  6932. }
  6933. return releases;
  6934. });
  6935. }
  6936. exports.getManifestFromRepo = getManifestFromRepo;
  6937. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  6938. return __awaiter(this, void 0, void 0, function* () {
  6939. // wrap the internal impl
  6940. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  6941. return match;
  6942. });
  6943. }
  6944. exports.findFromManifest = findFromManifest;
  6945. function _createExtractFolder(dest) {
  6946. return __awaiter(this, void 0, void 0, function* () {
  6947. if (!dest) {
  6948. // create a temp dir
  6949. dest = path.join(_getTempDirectory(), v4_1.default());
  6950. }
  6951. yield io.mkdirP(dest);
  6952. return dest;
  6953. });
  6954. }
  6955. function _createToolPath(tool, version, arch) {
  6956. return __awaiter(this, void 0, void 0, function* () {
  6957. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6958. core.debug(`destination ${folderPath}`);
  6959. const markerPath = `${folderPath}.complete`;
  6960. yield io.rmRF(folderPath);
  6961. yield io.rmRF(markerPath);
  6962. yield io.mkdirP(folderPath);
  6963. return folderPath;
  6964. });
  6965. }
  6966. function _completeToolPath(tool, version, arch) {
  6967. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6968. const markerPath = `${folderPath}.complete`;
  6969. fs.writeFileSync(markerPath, '');
  6970. core.debug('finished caching tool');
  6971. }
  6972. /**
  6973. * Check if version string is explicit
  6974. *
  6975. * @param versionSpec version string to check
  6976. */
  6977. function isExplicitVersion(versionSpec) {
  6978. const c = semver.clean(versionSpec) || '';
  6979. core.debug(`isExplicit: ${c}`);
  6980. const valid = semver.valid(c) != null;
  6981. core.debug(`explicit? ${valid}`);
  6982. return valid;
  6983. }
  6984. exports.isExplicitVersion = isExplicitVersion;
  6985. /**
  6986. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  6987. *
  6988. * @param versions array of versions to evaluate
  6989. * @param versionSpec semantic version spec to satisfy
  6990. */
  6991. function evaluateVersions(versions, versionSpec) {
  6992. let version = '';
  6993. core.debug(`evaluating ${versions.length} versions`);
  6994. versions = versions.sort((a, b) => {
  6995. if (semver.gt(a, b)) {
  6996. return 1;
  6997. }
  6998. return -1;
  6999. });
  7000. for (let i = versions.length - 1; i >= 0; i--) {
  7001. const potential = versions[i];
  7002. const satisfied = semver.satisfies(potential, versionSpec);
  7003. if (satisfied) {
  7004. version = potential;
  7005. break;
  7006. }
  7007. }
  7008. if (version) {
  7009. core.debug(`matched: ${version}`);
  7010. }
  7011. else {
  7012. core.debug('match not found');
  7013. }
  7014. return version;
  7015. }
  7016. exports.evaluateVersions = evaluateVersions;
  7017. /**
  7018. * Gets RUNNER_TOOL_CACHE
  7019. */
  7020. function _getCacheDirectory() {
  7021. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7022. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7023. return cacheDirectory;
  7024. }
  7025. /**
  7026. * Gets RUNNER_TEMP
  7027. */
  7028. function _getTempDirectory() {
  7029. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7030. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7031. return tempDirectory;
  7032. }
  7033. /**
  7034. * Gets a global variable
  7035. */
  7036. function _getGlobal(key, defaultValue) {
  7037. /* eslint-disable @typescript-eslint/no-explicit-any */
  7038. const value = global[key];
  7039. /* eslint-enable @typescript-eslint/no-explicit-any */
  7040. return value !== undefined ? value : defaultValue;
  7041. }
  7042. /**
  7043. * Returns an array of unique values.
  7044. * @param values Values to make unique.
  7045. */
  7046. function _unique(values) {
  7047. return Array.from(new Set(values));
  7048. }
  7049. //# sourceMappingURL=tool-cache.js.map
  7050. /***/ }),
  7051. /***/ 7701:
  7052. /***/ ((module) => {
  7053. /**
  7054. * Convert array of 16 byte values to UUID string format of the form:
  7055. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7056. */
  7057. var byteToHex = [];
  7058. for (var i = 0; i < 256; ++i) {
  7059. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7060. }
  7061. function bytesToUuid(buf, offset) {
  7062. var i = offset || 0;
  7063. var bth = byteToHex;
  7064. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7065. return ([
  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. bth[buf[i++]], bth[buf[i++]], '-',
  7071. bth[buf[i++]], bth[buf[i++]],
  7072. bth[buf[i++]], bth[buf[i++]],
  7073. bth[buf[i++]], bth[buf[i++]]
  7074. ]).join('');
  7075. }
  7076. module.exports = bytesToUuid;
  7077. /***/ }),
  7078. /***/ 7269:
  7079. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7080. // Unique ID creation requires a high quality random # generator. In node.js
  7081. // this is pretty straight-forward - we use the crypto API.
  7082. var crypto = __nccwpck_require__(6113);
  7083. module.exports = function nodeRNG() {
  7084. return crypto.randomBytes(16);
  7085. };
  7086. /***/ }),
  7087. /***/ 7468:
  7088. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7089. var rng = __nccwpck_require__(7269);
  7090. var bytesToUuid = __nccwpck_require__(7701);
  7091. function v4(options, buf, offset) {
  7092. var i = buf && offset || 0;
  7093. if (typeof(options) == 'string') {
  7094. buf = options === 'binary' ? new Array(16) : null;
  7095. options = null;
  7096. }
  7097. options = options || {};
  7098. var rnds = options.random || (options.rng || rng)();
  7099. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7100. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7101. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7102. // Copy bytes to buffer, if provided
  7103. if (buf) {
  7104. for (var ii = 0; ii < 16; ++ii) {
  7105. buf[i + ii] = rnds[ii];
  7106. }
  7107. }
  7108. return buf || bytesToUuid(rnds);
  7109. }
  7110. module.exports = v4;
  7111. /***/ }),
  7112. /***/ 334:
  7113. /***/ ((module) => {
  7114. "use strict";
  7115. var __defProp = Object.defineProperty;
  7116. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7117. var __getOwnPropNames = Object.getOwnPropertyNames;
  7118. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7119. var __export = (target, all) => {
  7120. for (var name in all)
  7121. __defProp(target, name, { get: all[name], enumerable: true });
  7122. };
  7123. var __copyProps = (to, from, except, desc) => {
  7124. if (from && typeof from === "object" || typeof from === "function") {
  7125. for (let key of __getOwnPropNames(from))
  7126. if (!__hasOwnProp.call(to, key) && key !== except)
  7127. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7128. }
  7129. return to;
  7130. };
  7131. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7132. // pkg/dist-src/index.js
  7133. var dist_src_exports = {};
  7134. __export(dist_src_exports, {
  7135. createTokenAuth: () => createTokenAuth
  7136. });
  7137. module.exports = __toCommonJS(dist_src_exports);
  7138. // pkg/dist-src/auth.js
  7139. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7140. var REGEX_IS_INSTALLATION = /^ghs_/;
  7141. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7142. async function auth(token) {
  7143. const isApp = token.split(/\./).length === 3;
  7144. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7145. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7146. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7147. return {
  7148. type: "token",
  7149. token,
  7150. tokenType
  7151. };
  7152. }
  7153. // pkg/dist-src/with-authorization-prefix.js
  7154. function withAuthorizationPrefix(token) {
  7155. if (token.split(/\./).length === 3) {
  7156. return `bearer ${token}`;
  7157. }
  7158. return `token ${token}`;
  7159. }
  7160. // pkg/dist-src/hook.js
  7161. async function hook(token, request, route, parameters) {
  7162. const endpoint = request.endpoint.merge(
  7163. route,
  7164. parameters
  7165. );
  7166. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7167. return request(endpoint);
  7168. }
  7169. // pkg/dist-src/index.js
  7170. var createTokenAuth = function createTokenAuth2(token) {
  7171. if (!token) {
  7172. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7173. }
  7174. if (typeof token !== "string") {
  7175. throw new Error(
  7176. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7177. );
  7178. }
  7179. token = token.replace(/^(token|bearer) +/i, "");
  7180. return Object.assign(auth.bind(null, token), {
  7181. hook: hook.bind(null, token)
  7182. });
  7183. };
  7184. // Annotate the CommonJS export names for ESM import in node:
  7185. 0 && (0);
  7186. /***/ }),
  7187. /***/ 6762:
  7188. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7189. "use strict";
  7190. var __defProp = Object.defineProperty;
  7191. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7192. var __getOwnPropNames = Object.getOwnPropertyNames;
  7193. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7194. var __export = (target, all) => {
  7195. for (var name in all)
  7196. __defProp(target, name, { get: all[name], enumerable: true });
  7197. };
  7198. var __copyProps = (to, from, except, desc) => {
  7199. if (from && typeof from === "object" || typeof from === "function") {
  7200. for (let key of __getOwnPropNames(from))
  7201. if (!__hasOwnProp.call(to, key) && key !== except)
  7202. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7203. }
  7204. return to;
  7205. };
  7206. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7207. // pkg/dist-src/index.js
  7208. var dist_src_exports = {};
  7209. __export(dist_src_exports, {
  7210. Octokit: () => Octokit
  7211. });
  7212. module.exports = __toCommonJS(dist_src_exports);
  7213. var import_universal_user_agent = __nccwpck_require__(5030);
  7214. var import_before_after_hook = __nccwpck_require__(3682);
  7215. var import_request = __nccwpck_require__(6234);
  7216. var import_graphql = __nccwpck_require__(8467);
  7217. var import_auth_token = __nccwpck_require__(334);
  7218. // pkg/dist-src/version.js
  7219. var VERSION = "5.2.0";
  7220. // pkg/dist-src/index.js
  7221. var noop = () => {
  7222. };
  7223. var consoleWarn = console.warn.bind(console);
  7224. var consoleError = console.error.bind(console);
  7225. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7226. var Octokit = class {
  7227. static {
  7228. this.VERSION = VERSION;
  7229. }
  7230. static defaults(defaults) {
  7231. const OctokitWithDefaults = class extends this {
  7232. constructor(...args) {
  7233. const options = args[0] || {};
  7234. if (typeof defaults === "function") {
  7235. super(defaults(options));
  7236. return;
  7237. }
  7238. super(
  7239. Object.assign(
  7240. {},
  7241. defaults,
  7242. options,
  7243. options.userAgent && defaults.userAgent ? {
  7244. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7245. } : null
  7246. )
  7247. );
  7248. }
  7249. };
  7250. return OctokitWithDefaults;
  7251. }
  7252. static {
  7253. this.plugins = [];
  7254. }
  7255. /**
  7256. * Attach a plugin (or many) to your Octokit instance.
  7257. *
  7258. * @example
  7259. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7260. */
  7261. static plugin(...newPlugins) {
  7262. const currentPlugins = this.plugins;
  7263. const NewOctokit = class extends this {
  7264. static {
  7265. this.plugins = currentPlugins.concat(
  7266. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7267. );
  7268. }
  7269. };
  7270. return NewOctokit;
  7271. }
  7272. constructor(options = {}) {
  7273. const hook = new import_before_after_hook.Collection();
  7274. const requestDefaults = {
  7275. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7276. headers: {},
  7277. request: Object.assign({}, options.request, {
  7278. // @ts-ignore internal usage only, no need to type
  7279. hook: hook.bind(null, "request")
  7280. }),
  7281. mediaType: {
  7282. previews: [],
  7283. format: ""
  7284. }
  7285. };
  7286. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7287. if (options.baseUrl) {
  7288. requestDefaults.baseUrl = options.baseUrl;
  7289. }
  7290. if (options.previews) {
  7291. requestDefaults.mediaType.previews = options.previews;
  7292. }
  7293. if (options.timeZone) {
  7294. requestDefaults.headers["time-zone"] = options.timeZone;
  7295. }
  7296. this.request = import_request.request.defaults(requestDefaults);
  7297. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7298. this.log = Object.assign(
  7299. {
  7300. debug: noop,
  7301. info: noop,
  7302. warn: consoleWarn,
  7303. error: consoleError
  7304. },
  7305. options.log
  7306. );
  7307. this.hook = hook;
  7308. if (!options.authStrategy) {
  7309. if (!options.auth) {
  7310. this.auth = async () => ({
  7311. type: "unauthenticated"
  7312. });
  7313. } else {
  7314. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7315. hook.wrap("request", auth.hook);
  7316. this.auth = auth;
  7317. }
  7318. } else {
  7319. const { authStrategy, ...otherOptions } = options;
  7320. const auth = authStrategy(
  7321. Object.assign(
  7322. {
  7323. request: this.request,
  7324. log: this.log,
  7325. // we pass the current octokit instance as well as its constructor options
  7326. // to allow for authentication strategies that return a new octokit instance
  7327. // that shares the same internal state as the current one. The original
  7328. // requirement for this was the "event-octokit" authentication strategy
  7329. // of https://github.com/probot/octokit-auth-probot.
  7330. octokit: this,
  7331. octokitOptions: otherOptions
  7332. },
  7333. options.auth
  7334. )
  7335. );
  7336. hook.wrap("request", auth.hook);
  7337. this.auth = auth;
  7338. }
  7339. const classConstructor = this.constructor;
  7340. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7341. Object.assign(this, classConstructor.plugins[i](this, options));
  7342. }
  7343. }
  7344. };
  7345. // Annotate the CommonJS export names for ESM import in node:
  7346. 0 && (0);
  7347. /***/ }),
  7348. /***/ 9440:
  7349. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7350. "use strict";
  7351. var __defProp = Object.defineProperty;
  7352. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7353. var __getOwnPropNames = Object.getOwnPropertyNames;
  7354. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7355. var __export = (target, all) => {
  7356. for (var name in all)
  7357. __defProp(target, name, { get: all[name], enumerable: true });
  7358. };
  7359. var __copyProps = (to, from, except, desc) => {
  7360. if (from && typeof from === "object" || typeof from === "function") {
  7361. for (let key of __getOwnPropNames(from))
  7362. if (!__hasOwnProp.call(to, key) && key !== except)
  7363. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7364. }
  7365. return to;
  7366. };
  7367. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7368. // pkg/dist-src/index.js
  7369. var dist_src_exports = {};
  7370. __export(dist_src_exports, {
  7371. endpoint: () => endpoint
  7372. });
  7373. module.exports = __toCommonJS(dist_src_exports);
  7374. // pkg/dist-src/defaults.js
  7375. var import_universal_user_agent = __nccwpck_require__(5030);
  7376. // pkg/dist-src/version.js
  7377. var VERSION = "9.0.5";
  7378. // pkg/dist-src/defaults.js
  7379. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7380. var DEFAULTS = {
  7381. method: "GET",
  7382. baseUrl: "https://api.github.com",
  7383. headers: {
  7384. accept: "application/vnd.github.v3+json",
  7385. "user-agent": userAgent
  7386. },
  7387. mediaType: {
  7388. format: ""
  7389. }
  7390. };
  7391. // pkg/dist-src/util/lowercase-keys.js
  7392. function lowercaseKeys(object) {
  7393. if (!object) {
  7394. return {};
  7395. }
  7396. return Object.keys(object).reduce((newObj, key) => {
  7397. newObj[key.toLowerCase()] = object[key];
  7398. return newObj;
  7399. }, {});
  7400. }
  7401. // pkg/dist-src/util/is-plain-object.js
  7402. function isPlainObject(value) {
  7403. if (typeof value !== "object" || value === null)
  7404. return false;
  7405. if (Object.prototype.toString.call(value) !== "[object Object]")
  7406. return false;
  7407. const proto = Object.getPrototypeOf(value);
  7408. if (proto === null)
  7409. return true;
  7410. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7411. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7412. }
  7413. // pkg/dist-src/util/merge-deep.js
  7414. function mergeDeep(defaults, options) {
  7415. const result = Object.assign({}, defaults);
  7416. Object.keys(options).forEach((key) => {
  7417. if (isPlainObject(options[key])) {
  7418. if (!(key in defaults))
  7419. Object.assign(result, { [key]: options[key] });
  7420. else
  7421. result[key] = mergeDeep(defaults[key], options[key]);
  7422. } else {
  7423. Object.assign(result, { [key]: options[key] });
  7424. }
  7425. });
  7426. return result;
  7427. }
  7428. // pkg/dist-src/util/remove-undefined-properties.js
  7429. function removeUndefinedProperties(obj) {
  7430. for (const key in obj) {
  7431. if (obj[key] === void 0) {
  7432. delete obj[key];
  7433. }
  7434. }
  7435. return obj;
  7436. }
  7437. // pkg/dist-src/merge.js
  7438. function merge(defaults, route, options) {
  7439. if (typeof route === "string") {
  7440. let [method, url] = route.split(" ");
  7441. options = Object.assign(url ? { method, url } : { url: method }, options);
  7442. } else {
  7443. options = Object.assign({}, route);
  7444. }
  7445. options.headers = lowercaseKeys(options.headers);
  7446. removeUndefinedProperties(options);
  7447. removeUndefinedProperties(options.headers);
  7448. const mergedOptions = mergeDeep(defaults || {}, options);
  7449. if (options.url === "/graphql") {
  7450. if (defaults && defaults.mediaType.previews?.length) {
  7451. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7452. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7453. ).concat(mergedOptions.mediaType.previews);
  7454. }
  7455. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7456. }
  7457. return mergedOptions;
  7458. }
  7459. // pkg/dist-src/util/add-query-parameters.js
  7460. function addQueryParameters(url, parameters) {
  7461. const separator = /\?/.test(url) ? "&" : "?";
  7462. const names = Object.keys(parameters);
  7463. if (names.length === 0) {
  7464. return url;
  7465. }
  7466. return url + separator + names.map((name) => {
  7467. if (name === "q") {
  7468. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7469. }
  7470. return `${name}=${encodeURIComponent(parameters[name])}`;
  7471. }).join("&");
  7472. }
  7473. // pkg/dist-src/util/extract-url-variable-names.js
  7474. var urlVariableRegex = /\{[^}]+\}/g;
  7475. function removeNonChars(variableName) {
  7476. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  7477. }
  7478. function extractUrlVariableNames(url) {
  7479. const matches = url.match(urlVariableRegex);
  7480. if (!matches) {
  7481. return [];
  7482. }
  7483. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7484. }
  7485. // pkg/dist-src/util/omit.js
  7486. function omit(object, keysToOmit) {
  7487. const result = { __proto__: null };
  7488. for (const key of Object.keys(object)) {
  7489. if (keysToOmit.indexOf(key) === -1) {
  7490. result[key] = object[key];
  7491. }
  7492. }
  7493. return result;
  7494. }
  7495. // pkg/dist-src/util/url-template.js
  7496. function encodeReserved(str) {
  7497. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7498. if (!/%[0-9A-Fa-f]/.test(part)) {
  7499. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7500. }
  7501. return part;
  7502. }).join("");
  7503. }
  7504. function encodeUnreserved(str) {
  7505. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7506. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7507. });
  7508. }
  7509. function encodeValue(operator, value, key) {
  7510. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7511. if (key) {
  7512. return encodeUnreserved(key) + "=" + value;
  7513. } else {
  7514. return value;
  7515. }
  7516. }
  7517. function isDefined(value) {
  7518. return value !== void 0 && value !== null;
  7519. }
  7520. function isKeyOperator(operator) {
  7521. return operator === ";" || operator === "&" || operator === "?";
  7522. }
  7523. function getValues(context, operator, key, modifier) {
  7524. var value = context[key], result = [];
  7525. if (isDefined(value) && value !== "") {
  7526. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7527. value = value.toString();
  7528. if (modifier && modifier !== "*") {
  7529. value = value.substring(0, parseInt(modifier, 10));
  7530. }
  7531. result.push(
  7532. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7533. );
  7534. } else {
  7535. if (modifier === "*") {
  7536. if (Array.isArray(value)) {
  7537. value.filter(isDefined).forEach(function(value2) {
  7538. result.push(
  7539. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7540. );
  7541. });
  7542. } else {
  7543. Object.keys(value).forEach(function(k) {
  7544. if (isDefined(value[k])) {
  7545. result.push(encodeValue(operator, value[k], k));
  7546. }
  7547. });
  7548. }
  7549. } else {
  7550. const tmp = [];
  7551. if (Array.isArray(value)) {
  7552. value.filter(isDefined).forEach(function(value2) {
  7553. tmp.push(encodeValue(operator, value2));
  7554. });
  7555. } else {
  7556. Object.keys(value).forEach(function(k) {
  7557. if (isDefined(value[k])) {
  7558. tmp.push(encodeUnreserved(k));
  7559. tmp.push(encodeValue(operator, value[k].toString()));
  7560. }
  7561. });
  7562. }
  7563. if (isKeyOperator(operator)) {
  7564. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7565. } else if (tmp.length !== 0) {
  7566. result.push(tmp.join(","));
  7567. }
  7568. }
  7569. }
  7570. } else {
  7571. if (operator === ";") {
  7572. if (isDefined(value)) {
  7573. result.push(encodeUnreserved(key));
  7574. }
  7575. } else if (value === "" && (operator === "&" || operator === "?")) {
  7576. result.push(encodeUnreserved(key) + "=");
  7577. } else if (value === "") {
  7578. result.push("");
  7579. }
  7580. }
  7581. return result;
  7582. }
  7583. function parseUrl(template) {
  7584. return {
  7585. expand: expand.bind(null, template)
  7586. };
  7587. }
  7588. function expand(template, context) {
  7589. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7590. template = template.replace(
  7591. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7592. function(_, expression, literal) {
  7593. if (expression) {
  7594. let operator = "";
  7595. const values = [];
  7596. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7597. operator = expression.charAt(0);
  7598. expression = expression.substr(1);
  7599. }
  7600. expression.split(/,/g).forEach(function(variable) {
  7601. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7602. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7603. });
  7604. if (operator && operator !== "+") {
  7605. var separator = ",";
  7606. if (operator === "?") {
  7607. separator = "&";
  7608. } else if (operator !== "#") {
  7609. separator = operator;
  7610. }
  7611. return (values.length !== 0 ? operator : "") + values.join(separator);
  7612. } else {
  7613. return values.join(",");
  7614. }
  7615. } else {
  7616. return encodeReserved(literal);
  7617. }
  7618. }
  7619. );
  7620. if (template === "/") {
  7621. return template;
  7622. } else {
  7623. return template.replace(/\/$/, "");
  7624. }
  7625. }
  7626. // pkg/dist-src/parse.js
  7627. function parse(options) {
  7628. let method = options.method.toUpperCase();
  7629. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7630. let headers = Object.assign({}, options.headers);
  7631. let body;
  7632. let parameters = omit(options, [
  7633. "method",
  7634. "baseUrl",
  7635. "url",
  7636. "headers",
  7637. "request",
  7638. "mediaType"
  7639. ]);
  7640. const urlVariableNames = extractUrlVariableNames(url);
  7641. url = parseUrl(url).expand(parameters);
  7642. if (!/^http/.test(url)) {
  7643. url = options.baseUrl + url;
  7644. }
  7645. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7646. const remainingParameters = omit(parameters, omittedParameters);
  7647. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7648. if (!isBinaryRequest) {
  7649. if (options.mediaType.format) {
  7650. headers.accept = headers.accept.split(/,/).map(
  7651. (format) => format.replace(
  7652. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7653. `application/vnd$1$2.${options.mediaType.format}`
  7654. )
  7655. ).join(",");
  7656. }
  7657. if (url.endsWith("/graphql")) {
  7658. if (options.mediaType.previews?.length) {
  7659. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  7660. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7661. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7662. return `application/vnd.github.${preview}-preview${format}`;
  7663. }).join(",");
  7664. }
  7665. }
  7666. }
  7667. if (["GET", "HEAD"].includes(method)) {
  7668. url = addQueryParameters(url, remainingParameters);
  7669. } else {
  7670. if ("data" in remainingParameters) {
  7671. body = remainingParameters.data;
  7672. } else {
  7673. if (Object.keys(remainingParameters).length) {
  7674. body = remainingParameters;
  7675. }
  7676. }
  7677. }
  7678. if (!headers["content-type"] && typeof body !== "undefined") {
  7679. headers["content-type"] = "application/json; charset=utf-8";
  7680. }
  7681. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7682. body = "";
  7683. }
  7684. return Object.assign(
  7685. { method, url, headers },
  7686. typeof body !== "undefined" ? { body } : null,
  7687. options.request ? { request: options.request } : null
  7688. );
  7689. }
  7690. // pkg/dist-src/endpoint-with-defaults.js
  7691. function endpointWithDefaults(defaults, route, options) {
  7692. return parse(merge(defaults, route, options));
  7693. }
  7694. // pkg/dist-src/with-defaults.js
  7695. function withDefaults(oldDefaults, newDefaults) {
  7696. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7697. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7698. return Object.assign(endpoint2, {
  7699. DEFAULTS: DEFAULTS2,
  7700. defaults: withDefaults.bind(null, DEFAULTS2),
  7701. merge: merge.bind(null, DEFAULTS2),
  7702. parse
  7703. });
  7704. }
  7705. // pkg/dist-src/index.js
  7706. var endpoint = withDefaults(null, DEFAULTS);
  7707. // Annotate the CommonJS export names for ESM import in node:
  7708. 0 && (0);
  7709. /***/ }),
  7710. /***/ 8467:
  7711. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7712. "use strict";
  7713. var __defProp = Object.defineProperty;
  7714. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7715. var __getOwnPropNames = Object.getOwnPropertyNames;
  7716. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7717. var __export = (target, all) => {
  7718. for (var name in all)
  7719. __defProp(target, name, { get: all[name], enumerable: true });
  7720. };
  7721. var __copyProps = (to, from, except, desc) => {
  7722. if (from && typeof from === "object" || typeof from === "function") {
  7723. for (let key of __getOwnPropNames(from))
  7724. if (!__hasOwnProp.call(to, key) && key !== except)
  7725. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7726. }
  7727. return to;
  7728. };
  7729. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7730. // pkg/dist-src/index.js
  7731. var dist_src_exports = {};
  7732. __export(dist_src_exports, {
  7733. GraphqlResponseError: () => GraphqlResponseError,
  7734. graphql: () => graphql2,
  7735. withCustomRequest: () => withCustomRequest
  7736. });
  7737. module.exports = __toCommonJS(dist_src_exports);
  7738. var import_request3 = __nccwpck_require__(6234);
  7739. var import_universal_user_agent = __nccwpck_require__(5030);
  7740. // pkg/dist-src/version.js
  7741. var VERSION = "7.1.0";
  7742. // pkg/dist-src/with-defaults.js
  7743. var import_request2 = __nccwpck_require__(6234);
  7744. // pkg/dist-src/graphql.js
  7745. var import_request = __nccwpck_require__(6234);
  7746. // pkg/dist-src/error.js
  7747. function _buildMessageForResponseErrors(data) {
  7748. return `Request failed due to following response errors:
  7749. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  7750. }
  7751. var GraphqlResponseError = class extends Error {
  7752. constructor(request2, headers, response) {
  7753. super(_buildMessageForResponseErrors(response));
  7754. this.request = request2;
  7755. this.headers = headers;
  7756. this.response = response;
  7757. this.name = "GraphqlResponseError";
  7758. this.errors = response.errors;
  7759. this.data = response.data;
  7760. if (Error.captureStackTrace) {
  7761. Error.captureStackTrace(this, this.constructor);
  7762. }
  7763. }
  7764. };
  7765. // pkg/dist-src/graphql.js
  7766. var NON_VARIABLE_OPTIONS = [
  7767. "method",
  7768. "baseUrl",
  7769. "url",
  7770. "headers",
  7771. "request",
  7772. "query",
  7773. "mediaType"
  7774. ];
  7775. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  7776. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  7777. function graphql(request2, query, options) {
  7778. if (options) {
  7779. if (typeof query === "string" && "query" in options) {
  7780. return Promise.reject(
  7781. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  7782. );
  7783. }
  7784. for (const key in options) {
  7785. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  7786. continue;
  7787. return Promise.reject(
  7788. new Error(
  7789. `[@octokit/graphql] "${key}" cannot be used as variable name`
  7790. )
  7791. );
  7792. }
  7793. }
  7794. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  7795. const requestOptions = Object.keys(
  7796. parsedOptions
  7797. ).reduce((result, key) => {
  7798. if (NON_VARIABLE_OPTIONS.includes(key)) {
  7799. result[key] = parsedOptions[key];
  7800. return result;
  7801. }
  7802. if (!result.variables) {
  7803. result.variables = {};
  7804. }
  7805. result.variables[key] = parsedOptions[key];
  7806. return result;
  7807. }, {});
  7808. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  7809. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  7810. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  7811. }
  7812. return request2(requestOptions).then((response) => {
  7813. if (response.data.errors) {
  7814. const headers = {};
  7815. for (const key of Object.keys(response.headers)) {
  7816. headers[key] = response.headers[key];
  7817. }
  7818. throw new GraphqlResponseError(
  7819. requestOptions,
  7820. headers,
  7821. response.data
  7822. );
  7823. }
  7824. return response.data.data;
  7825. });
  7826. }
  7827. // pkg/dist-src/with-defaults.js
  7828. function withDefaults(request2, newDefaults) {
  7829. const newRequest = request2.defaults(newDefaults);
  7830. const newApi = (query, options) => {
  7831. return graphql(newRequest, query, options);
  7832. };
  7833. return Object.assign(newApi, {
  7834. defaults: withDefaults.bind(null, newRequest),
  7835. endpoint: newRequest.endpoint
  7836. });
  7837. }
  7838. // pkg/dist-src/index.js
  7839. var graphql2 = withDefaults(import_request3.request, {
  7840. headers: {
  7841. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  7842. },
  7843. method: "POST",
  7844. url: "/graphql"
  7845. });
  7846. function withCustomRequest(customRequest) {
  7847. return withDefaults(customRequest, {
  7848. method: "POST",
  7849. url: "/graphql"
  7850. });
  7851. }
  7852. // Annotate the CommonJS export names for ESM import in node:
  7853. 0 && (0);
  7854. /***/ }),
  7855. /***/ 4193:
  7856. /***/ ((module) => {
  7857. "use strict";
  7858. var __defProp = Object.defineProperty;
  7859. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7860. var __getOwnPropNames = Object.getOwnPropertyNames;
  7861. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7862. var __export = (target, all) => {
  7863. for (var name in all)
  7864. __defProp(target, name, { get: all[name], enumerable: true });
  7865. };
  7866. var __copyProps = (to, from, except, desc) => {
  7867. if (from && typeof from === "object" || typeof from === "function") {
  7868. for (let key of __getOwnPropNames(from))
  7869. if (!__hasOwnProp.call(to, key) && key !== except)
  7870. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7871. }
  7872. return to;
  7873. };
  7874. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7875. // pkg/dist-src/index.js
  7876. var dist_src_exports = {};
  7877. __export(dist_src_exports, {
  7878. composePaginateRest: () => composePaginateRest,
  7879. isPaginatingEndpoint: () => isPaginatingEndpoint,
  7880. paginateRest: () => paginateRest,
  7881. paginatingEndpoints: () => paginatingEndpoints
  7882. });
  7883. module.exports = __toCommonJS(dist_src_exports);
  7884. // pkg/dist-src/version.js
  7885. var VERSION = "9.2.1";
  7886. // pkg/dist-src/normalize-paginated-list-response.js
  7887. function normalizePaginatedListResponse(response) {
  7888. if (!response.data) {
  7889. return {
  7890. ...response,
  7891. data: []
  7892. };
  7893. }
  7894. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  7895. if (!responseNeedsNormalization)
  7896. return response;
  7897. const incompleteResults = response.data.incomplete_results;
  7898. const repositorySelection = response.data.repository_selection;
  7899. const totalCount = response.data.total_count;
  7900. delete response.data.incomplete_results;
  7901. delete response.data.repository_selection;
  7902. delete response.data.total_count;
  7903. const namespaceKey = Object.keys(response.data)[0];
  7904. const data = response.data[namespaceKey];
  7905. response.data = data;
  7906. if (typeof incompleteResults !== "undefined") {
  7907. response.data.incomplete_results = incompleteResults;
  7908. }
  7909. if (typeof repositorySelection !== "undefined") {
  7910. response.data.repository_selection = repositorySelection;
  7911. }
  7912. response.data.total_count = totalCount;
  7913. return response;
  7914. }
  7915. // pkg/dist-src/iterator.js
  7916. function iterator(octokit, route, parameters) {
  7917. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  7918. const requestMethod = typeof route === "function" ? route : octokit.request;
  7919. const method = options.method;
  7920. const headers = options.headers;
  7921. let url = options.url;
  7922. return {
  7923. [Symbol.asyncIterator]: () => ({
  7924. async next() {
  7925. if (!url)
  7926. return { done: true };
  7927. try {
  7928. const response = await requestMethod({ method, url, headers });
  7929. const normalizedResponse = normalizePaginatedListResponse(response);
  7930. url = ((normalizedResponse.headers.link || "").match(
  7931. /<([^>]+)>;\s*rel="next"/
  7932. ) || [])[1];
  7933. return { value: normalizedResponse };
  7934. } catch (error) {
  7935. if (error.status !== 409)
  7936. throw error;
  7937. url = "";
  7938. return {
  7939. value: {
  7940. status: 200,
  7941. headers: {},
  7942. data: []
  7943. }
  7944. };
  7945. }
  7946. }
  7947. })
  7948. };
  7949. }
  7950. // pkg/dist-src/paginate.js
  7951. function paginate(octokit, route, parameters, mapFn) {
  7952. if (typeof parameters === "function") {
  7953. mapFn = parameters;
  7954. parameters = void 0;
  7955. }
  7956. return gather(
  7957. octokit,
  7958. [],
  7959. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  7960. mapFn
  7961. );
  7962. }
  7963. function gather(octokit, results, iterator2, mapFn) {
  7964. return iterator2.next().then((result) => {
  7965. if (result.done) {
  7966. return results;
  7967. }
  7968. let earlyExit = false;
  7969. function done() {
  7970. earlyExit = true;
  7971. }
  7972. results = results.concat(
  7973. mapFn ? mapFn(result.value, done) : result.value.data
  7974. );
  7975. if (earlyExit) {
  7976. return results;
  7977. }
  7978. return gather(octokit, results, iterator2, mapFn);
  7979. });
  7980. }
  7981. // pkg/dist-src/compose-paginate.js
  7982. var composePaginateRest = Object.assign(paginate, {
  7983. iterator
  7984. });
  7985. // pkg/dist-src/generated/paginating-endpoints.js
  7986. var paginatingEndpoints = [
  7987. "GET /advisories",
  7988. "GET /app/hook/deliveries",
  7989. "GET /app/installation-requests",
  7990. "GET /app/installations",
  7991. "GET /assignments/{assignment_id}/accepted_assignments",
  7992. "GET /classrooms",
  7993. "GET /classrooms/{classroom_id}/assignments",
  7994. "GET /enterprises/{enterprise}/dependabot/alerts",
  7995. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  7996. "GET /events",
  7997. "GET /gists",
  7998. "GET /gists/public",
  7999. "GET /gists/starred",
  8000. "GET /gists/{gist_id}/comments",
  8001. "GET /gists/{gist_id}/commits",
  8002. "GET /gists/{gist_id}/forks",
  8003. "GET /installation/repositories",
  8004. "GET /issues",
  8005. "GET /licenses",
  8006. "GET /marketplace_listing/plans",
  8007. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8008. "GET /marketplace_listing/stubbed/plans",
  8009. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8010. "GET /networks/{owner}/{repo}/events",
  8011. "GET /notifications",
  8012. "GET /organizations",
  8013. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8014. "GET /orgs/{org}/actions/permissions/repositories",
  8015. "GET /orgs/{org}/actions/runners",
  8016. "GET /orgs/{org}/actions/secrets",
  8017. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8018. "GET /orgs/{org}/actions/variables",
  8019. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8020. "GET /orgs/{org}/blocks",
  8021. "GET /orgs/{org}/code-scanning/alerts",
  8022. "GET /orgs/{org}/codespaces",
  8023. "GET /orgs/{org}/codespaces/secrets",
  8024. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8025. "GET /orgs/{org}/copilot/billing/seats",
  8026. "GET /orgs/{org}/dependabot/alerts",
  8027. "GET /orgs/{org}/dependabot/secrets",
  8028. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8029. "GET /orgs/{org}/events",
  8030. "GET /orgs/{org}/failed_invitations",
  8031. "GET /orgs/{org}/hooks",
  8032. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8033. "GET /orgs/{org}/installations",
  8034. "GET /orgs/{org}/invitations",
  8035. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8036. "GET /orgs/{org}/issues",
  8037. "GET /orgs/{org}/members",
  8038. "GET /orgs/{org}/members/{username}/codespaces",
  8039. "GET /orgs/{org}/migrations",
  8040. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8041. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8042. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8043. "GET /orgs/{org}/outside_collaborators",
  8044. "GET /orgs/{org}/packages",
  8045. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8046. "GET /orgs/{org}/personal-access-token-requests",
  8047. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8048. "GET /orgs/{org}/personal-access-tokens",
  8049. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8050. "GET /orgs/{org}/projects",
  8051. "GET /orgs/{org}/properties/values",
  8052. "GET /orgs/{org}/public_members",
  8053. "GET /orgs/{org}/repos",
  8054. "GET /orgs/{org}/rulesets",
  8055. "GET /orgs/{org}/rulesets/rule-suites",
  8056. "GET /orgs/{org}/secret-scanning/alerts",
  8057. "GET /orgs/{org}/security-advisories",
  8058. "GET /orgs/{org}/teams",
  8059. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8060. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8061. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8062. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8063. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8064. "GET /orgs/{org}/teams/{team_slug}/members",
  8065. "GET /orgs/{org}/teams/{team_slug}/projects",
  8066. "GET /orgs/{org}/teams/{team_slug}/repos",
  8067. "GET /orgs/{org}/teams/{team_slug}/teams",
  8068. "GET /projects/columns/{column_id}/cards",
  8069. "GET /projects/{project_id}/collaborators",
  8070. "GET /projects/{project_id}/columns",
  8071. "GET /repos/{owner}/{repo}/actions/artifacts",
  8072. "GET /repos/{owner}/{repo}/actions/caches",
  8073. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8074. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8075. "GET /repos/{owner}/{repo}/actions/runners",
  8076. "GET /repos/{owner}/{repo}/actions/runs",
  8077. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8078. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8079. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8080. "GET /repos/{owner}/{repo}/actions/secrets",
  8081. "GET /repos/{owner}/{repo}/actions/variables",
  8082. "GET /repos/{owner}/{repo}/actions/workflows",
  8083. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8084. "GET /repos/{owner}/{repo}/activity",
  8085. "GET /repos/{owner}/{repo}/assignees",
  8086. "GET /repos/{owner}/{repo}/branches",
  8087. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8088. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8089. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8090. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8091. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8092. "GET /repos/{owner}/{repo}/codespaces",
  8093. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8094. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8095. "GET /repos/{owner}/{repo}/collaborators",
  8096. "GET /repos/{owner}/{repo}/comments",
  8097. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8098. "GET /repos/{owner}/{repo}/commits",
  8099. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8100. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8101. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8102. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8103. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8104. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8105. "GET /repos/{owner}/{repo}/contributors",
  8106. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8107. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8108. "GET /repos/{owner}/{repo}/deployments",
  8109. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8110. "GET /repos/{owner}/{repo}/environments",
  8111. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8112. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8113. "GET /repos/{owner}/{repo}/events",
  8114. "GET /repos/{owner}/{repo}/forks",
  8115. "GET /repos/{owner}/{repo}/hooks",
  8116. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8117. "GET /repos/{owner}/{repo}/invitations",
  8118. "GET /repos/{owner}/{repo}/issues",
  8119. "GET /repos/{owner}/{repo}/issues/comments",
  8120. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8121. "GET /repos/{owner}/{repo}/issues/events",
  8122. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8123. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8124. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8125. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8126. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8127. "GET /repos/{owner}/{repo}/keys",
  8128. "GET /repos/{owner}/{repo}/labels",
  8129. "GET /repos/{owner}/{repo}/milestones",
  8130. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8131. "GET /repos/{owner}/{repo}/notifications",
  8132. "GET /repos/{owner}/{repo}/pages/builds",
  8133. "GET /repos/{owner}/{repo}/projects",
  8134. "GET /repos/{owner}/{repo}/pulls",
  8135. "GET /repos/{owner}/{repo}/pulls/comments",
  8136. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8137. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8138. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8139. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8140. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8141. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8142. "GET /repos/{owner}/{repo}/releases",
  8143. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8144. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8145. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8146. "GET /repos/{owner}/{repo}/rulesets",
  8147. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8148. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8149. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8150. "GET /repos/{owner}/{repo}/security-advisories",
  8151. "GET /repos/{owner}/{repo}/stargazers",
  8152. "GET /repos/{owner}/{repo}/subscribers",
  8153. "GET /repos/{owner}/{repo}/tags",
  8154. "GET /repos/{owner}/{repo}/teams",
  8155. "GET /repos/{owner}/{repo}/topics",
  8156. "GET /repositories",
  8157. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8158. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8159. "GET /search/code",
  8160. "GET /search/commits",
  8161. "GET /search/issues",
  8162. "GET /search/labels",
  8163. "GET /search/repositories",
  8164. "GET /search/topics",
  8165. "GET /search/users",
  8166. "GET /teams/{team_id}/discussions",
  8167. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8168. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8169. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8170. "GET /teams/{team_id}/invitations",
  8171. "GET /teams/{team_id}/members",
  8172. "GET /teams/{team_id}/projects",
  8173. "GET /teams/{team_id}/repos",
  8174. "GET /teams/{team_id}/teams",
  8175. "GET /user/blocks",
  8176. "GET /user/codespaces",
  8177. "GET /user/codespaces/secrets",
  8178. "GET /user/emails",
  8179. "GET /user/followers",
  8180. "GET /user/following",
  8181. "GET /user/gpg_keys",
  8182. "GET /user/installations",
  8183. "GET /user/installations/{installation_id}/repositories",
  8184. "GET /user/issues",
  8185. "GET /user/keys",
  8186. "GET /user/marketplace_purchases",
  8187. "GET /user/marketplace_purchases/stubbed",
  8188. "GET /user/memberships/orgs",
  8189. "GET /user/migrations",
  8190. "GET /user/migrations/{migration_id}/repositories",
  8191. "GET /user/orgs",
  8192. "GET /user/packages",
  8193. "GET /user/packages/{package_type}/{package_name}/versions",
  8194. "GET /user/public_emails",
  8195. "GET /user/repos",
  8196. "GET /user/repository_invitations",
  8197. "GET /user/social_accounts",
  8198. "GET /user/ssh_signing_keys",
  8199. "GET /user/starred",
  8200. "GET /user/subscriptions",
  8201. "GET /user/teams",
  8202. "GET /users",
  8203. "GET /users/{username}/events",
  8204. "GET /users/{username}/events/orgs/{org}",
  8205. "GET /users/{username}/events/public",
  8206. "GET /users/{username}/followers",
  8207. "GET /users/{username}/following",
  8208. "GET /users/{username}/gists",
  8209. "GET /users/{username}/gpg_keys",
  8210. "GET /users/{username}/keys",
  8211. "GET /users/{username}/orgs",
  8212. "GET /users/{username}/packages",
  8213. "GET /users/{username}/projects",
  8214. "GET /users/{username}/received_events",
  8215. "GET /users/{username}/received_events/public",
  8216. "GET /users/{username}/repos",
  8217. "GET /users/{username}/social_accounts",
  8218. "GET /users/{username}/ssh_signing_keys",
  8219. "GET /users/{username}/starred",
  8220. "GET /users/{username}/subscriptions"
  8221. ];
  8222. // pkg/dist-src/paginating-endpoints.js
  8223. function isPaginatingEndpoint(arg) {
  8224. if (typeof arg === "string") {
  8225. return paginatingEndpoints.includes(arg);
  8226. } else {
  8227. return false;
  8228. }
  8229. }
  8230. // pkg/dist-src/index.js
  8231. function paginateRest(octokit) {
  8232. return {
  8233. paginate: Object.assign(paginate.bind(null, octokit), {
  8234. iterator: iterator.bind(null, octokit)
  8235. })
  8236. };
  8237. }
  8238. paginateRest.VERSION = VERSION;
  8239. // Annotate the CommonJS export names for ESM import in node:
  8240. 0 && (0);
  8241. /***/ }),
  8242. /***/ 3044:
  8243. /***/ ((module) => {
  8244. "use strict";
  8245. var __defProp = Object.defineProperty;
  8246. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8247. var __getOwnPropNames = Object.getOwnPropertyNames;
  8248. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8249. var __export = (target, all) => {
  8250. for (var name in all)
  8251. __defProp(target, name, { get: all[name], enumerable: true });
  8252. };
  8253. var __copyProps = (to, from, except, desc) => {
  8254. if (from && typeof from === "object" || typeof from === "function") {
  8255. for (let key of __getOwnPropNames(from))
  8256. if (!__hasOwnProp.call(to, key) && key !== except)
  8257. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8258. }
  8259. return to;
  8260. };
  8261. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8262. // pkg/dist-src/index.js
  8263. var dist_src_exports = {};
  8264. __export(dist_src_exports, {
  8265. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8266. restEndpointMethods: () => restEndpointMethods
  8267. });
  8268. module.exports = __toCommonJS(dist_src_exports);
  8269. // pkg/dist-src/version.js
  8270. var VERSION = "10.4.1";
  8271. // pkg/dist-src/generated/endpoints.js
  8272. var Endpoints = {
  8273. actions: {
  8274. addCustomLabelsToSelfHostedRunnerForOrg: [
  8275. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8276. ],
  8277. addCustomLabelsToSelfHostedRunnerForRepo: [
  8278. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8279. ],
  8280. addSelectedRepoToOrgSecret: [
  8281. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8282. ],
  8283. addSelectedRepoToOrgVariable: [
  8284. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8285. ],
  8286. approveWorkflowRun: [
  8287. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8288. ],
  8289. cancelWorkflowRun: [
  8290. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8291. ],
  8292. createEnvironmentVariable: [
  8293. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8294. ],
  8295. createOrUpdateEnvironmentSecret: [
  8296. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8297. ],
  8298. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8299. createOrUpdateRepoSecret: [
  8300. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8301. ],
  8302. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8303. createRegistrationTokenForOrg: [
  8304. "POST /orgs/{org}/actions/runners/registration-token"
  8305. ],
  8306. createRegistrationTokenForRepo: [
  8307. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8308. ],
  8309. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8310. createRemoveTokenForRepo: [
  8311. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8312. ],
  8313. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8314. createWorkflowDispatch: [
  8315. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8316. ],
  8317. deleteActionsCacheById: [
  8318. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8319. ],
  8320. deleteActionsCacheByKey: [
  8321. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8322. ],
  8323. deleteArtifact: [
  8324. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8325. ],
  8326. deleteEnvironmentSecret: [
  8327. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8328. ],
  8329. deleteEnvironmentVariable: [
  8330. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8331. ],
  8332. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8333. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8334. deleteRepoSecret: [
  8335. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8336. ],
  8337. deleteRepoVariable: [
  8338. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8339. ],
  8340. deleteSelfHostedRunnerFromOrg: [
  8341. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8342. ],
  8343. deleteSelfHostedRunnerFromRepo: [
  8344. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8345. ],
  8346. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8347. deleteWorkflowRunLogs: [
  8348. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8349. ],
  8350. disableSelectedRepositoryGithubActionsOrganization: [
  8351. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8352. ],
  8353. disableWorkflow: [
  8354. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8355. ],
  8356. downloadArtifact: [
  8357. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8358. ],
  8359. downloadJobLogsForWorkflowRun: [
  8360. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8361. ],
  8362. downloadWorkflowRunAttemptLogs: [
  8363. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8364. ],
  8365. downloadWorkflowRunLogs: [
  8366. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8367. ],
  8368. enableSelectedRepositoryGithubActionsOrganization: [
  8369. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8370. ],
  8371. enableWorkflow: [
  8372. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8373. ],
  8374. forceCancelWorkflowRun: [
  8375. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8376. ],
  8377. generateRunnerJitconfigForOrg: [
  8378. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8379. ],
  8380. generateRunnerJitconfigForRepo: [
  8381. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8382. ],
  8383. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8384. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8385. getActionsCacheUsageByRepoForOrg: [
  8386. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8387. ],
  8388. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8389. getAllowedActionsOrganization: [
  8390. "GET /orgs/{org}/actions/permissions/selected-actions"
  8391. ],
  8392. getAllowedActionsRepository: [
  8393. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8394. ],
  8395. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8396. getCustomOidcSubClaimForRepo: [
  8397. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8398. ],
  8399. getEnvironmentPublicKey: [
  8400. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8401. ],
  8402. getEnvironmentSecret: [
  8403. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8404. ],
  8405. getEnvironmentVariable: [
  8406. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8407. ],
  8408. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8409. "GET /orgs/{org}/actions/permissions/workflow"
  8410. ],
  8411. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8412. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8413. ],
  8414. getGithubActionsPermissionsOrganization: [
  8415. "GET /orgs/{org}/actions/permissions"
  8416. ],
  8417. getGithubActionsPermissionsRepository: [
  8418. "GET /repos/{owner}/{repo}/actions/permissions"
  8419. ],
  8420. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8421. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8422. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8423. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8424. getPendingDeploymentsForRun: [
  8425. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8426. ],
  8427. getRepoPermissions: [
  8428. "GET /repos/{owner}/{repo}/actions/permissions",
  8429. {},
  8430. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8431. ],
  8432. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8433. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8434. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8435. getReviewsForRun: [
  8436. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8437. ],
  8438. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8439. getSelfHostedRunnerForRepo: [
  8440. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8441. ],
  8442. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8443. getWorkflowAccessToRepository: [
  8444. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8445. ],
  8446. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8447. getWorkflowRunAttempt: [
  8448. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8449. ],
  8450. getWorkflowRunUsage: [
  8451. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8452. ],
  8453. getWorkflowUsage: [
  8454. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8455. ],
  8456. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8457. listEnvironmentSecrets: [
  8458. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8459. ],
  8460. listEnvironmentVariables: [
  8461. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8462. ],
  8463. listJobsForWorkflowRun: [
  8464. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8465. ],
  8466. listJobsForWorkflowRunAttempt: [
  8467. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8468. ],
  8469. listLabelsForSelfHostedRunnerForOrg: [
  8470. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8471. ],
  8472. listLabelsForSelfHostedRunnerForRepo: [
  8473. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8474. ],
  8475. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8476. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8477. listRepoOrganizationSecrets: [
  8478. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8479. ],
  8480. listRepoOrganizationVariables: [
  8481. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8482. ],
  8483. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8484. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8485. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8486. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8487. listRunnerApplicationsForRepo: [
  8488. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8489. ],
  8490. listSelectedReposForOrgSecret: [
  8491. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8492. ],
  8493. listSelectedReposForOrgVariable: [
  8494. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8495. ],
  8496. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8497. "GET /orgs/{org}/actions/permissions/repositories"
  8498. ],
  8499. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8500. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8501. listWorkflowRunArtifacts: [
  8502. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8503. ],
  8504. listWorkflowRuns: [
  8505. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8506. ],
  8507. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8508. reRunJobForWorkflowRun: [
  8509. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8510. ],
  8511. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8512. reRunWorkflowFailedJobs: [
  8513. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8514. ],
  8515. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8516. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8517. ],
  8518. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8519. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8520. ],
  8521. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8522. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8523. ],
  8524. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8525. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8526. ],
  8527. removeSelectedRepoFromOrgSecret: [
  8528. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8529. ],
  8530. removeSelectedRepoFromOrgVariable: [
  8531. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8532. ],
  8533. reviewCustomGatesForRun: [
  8534. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8535. ],
  8536. reviewPendingDeploymentsForRun: [
  8537. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8538. ],
  8539. setAllowedActionsOrganization: [
  8540. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8541. ],
  8542. setAllowedActionsRepository: [
  8543. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8544. ],
  8545. setCustomLabelsForSelfHostedRunnerForOrg: [
  8546. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8547. ],
  8548. setCustomLabelsForSelfHostedRunnerForRepo: [
  8549. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8550. ],
  8551. setCustomOidcSubClaimForRepo: [
  8552. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8553. ],
  8554. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8555. "PUT /orgs/{org}/actions/permissions/workflow"
  8556. ],
  8557. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8558. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8559. ],
  8560. setGithubActionsPermissionsOrganization: [
  8561. "PUT /orgs/{org}/actions/permissions"
  8562. ],
  8563. setGithubActionsPermissionsRepository: [
  8564. "PUT /repos/{owner}/{repo}/actions/permissions"
  8565. ],
  8566. setSelectedReposForOrgSecret: [
  8567. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8568. ],
  8569. setSelectedReposForOrgVariable: [
  8570. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8571. ],
  8572. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8573. "PUT /orgs/{org}/actions/permissions/repositories"
  8574. ],
  8575. setWorkflowAccessToRepository: [
  8576. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8577. ],
  8578. updateEnvironmentVariable: [
  8579. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8580. ],
  8581. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8582. updateRepoVariable: [
  8583. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8584. ]
  8585. },
  8586. activity: {
  8587. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8588. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8589. deleteThreadSubscription: [
  8590. "DELETE /notifications/threads/{thread_id}/subscription"
  8591. ],
  8592. getFeeds: ["GET /feeds"],
  8593. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8594. getThread: ["GET /notifications/threads/{thread_id}"],
  8595. getThreadSubscriptionForAuthenticatedUser: [
  8596. "GET /notifications/threads/{thread_id}/subscription"
  8597. ],
  8598. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8599. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8600. listOrgEventsForAuthenticatedUser: [
  8601. "GET /users/{username}/events/orgs/{org}"
  8602. ],
  8603. listPublicEvents: ["GET /events"],
  8604. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8605. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8606. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8607. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8608. listReceivedPublicEventsForUser: [
  8609. "GET /users/{username}/received_events/public"
  8610. ],
  8611. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8612. listRepoNotificationsForAuthenticatedUser: [
  8613. "GET /repos/{owner}/{repo}/notifications"
  8614. ],
  8615. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8616. listReposStarredByUser: ["GET /users/{username}/starred"],
  8617. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8618. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8619. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8620. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8621. markNotificationsAsRead: ["PUT /notifications"],
  8622. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8623. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8624. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8625. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8626. setThreadSubscription: [
  8627. "PUT /notifications/threads/{thread_id}/subscription"
  8628. ],
  8629. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8630. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8631. },
  8632. apps: {
  8633. addRepoToInstallation: [
  8634. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8635. {},
  8636. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8637. ],
  8638. addRepoToInstallationForAuthenticatedUser: [
  8639. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8640. ],
  8641. checkToken: ["POST /applications/{client_id}/token"],
  8642. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8643. createInstallationAccessToken: [
  8644. "POST /app/installations/{installation_id}/access_tokens"
  8645. ],
  8646. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8647. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8648. deleteToken: ["DELETE /applications/{client_id}/token"],
  8649. getAuthenticated: ["GET /app"],
  8650. getBySlug: ["GET /apps/{app_slug}"],
  8651. getInstallation: ["GET /app/installations/{installation_id}"],
  8652. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8653. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8654. getSubscriptionPlanForAccount: [
  8655. "GET /marketplace_listing/accounts/{account_id}"
  8656. ],
  8657. getSubscriptionPlanForAccountStubbed: [
  8658. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8659. ],
  8660. getUserInstallation: ["GET /users/{username}/installation"],
  8661. getWebhookConfigForApp: ["GET /app/hook/config"],
  8662. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8663. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8664. listAccountsForPlanStubbed: [
  8665. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8666. ],
  8667. listInstallationReposForAuthenticatedUser: [
  8668. "GET /user/installations/{installation_id}/repositories"
  8669. ],
  8670. listInstallationRequestsForAuthenticatedApp: [
  8671. "GET /app/installation-requests"
  8672. ],
  8673. listInstallations: ["GET /app/installations"],
  8674. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8675. listPlans: ["GET /marketplace_listing/plans"],
  8676. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8677. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8678. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8679. listSubscriptionsForAuthenticatedUserStubbed: [
  8680. "GET /user/marketplace_purchases/stubbed"
  8681. ],
  8682. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8683. redeliverWebhookDelivery: [
  8684. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8685. ],
  8686. removeRepoFromInstallation: [
  8687. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8688. {},
  8689. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8690. ],
  8691. removeRepoFromInstallationForAuthenticatedUser: [
  8692. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8693. ],
  8694. resetToken: ["PATCH /applications/{client_id}/token"],
  8695. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8696. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8697. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8698. unsuspendInstallation: [
  8699. "DELETE /app/installations/{installation_id}/suspended"
  8700. ],
  8701. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8702. },
  8703. billing: {
  8704. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8705. getGithubActionsBillingUser: [
  8706. "GET /users/{username}/settings/billing/actions"
  8707. ],
  8708. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8709. getGithubPackagesBillingUser: [
  8710. "GET /users/{username}/settings/billing/packages"
  8711. ],
  8712. getSharedStorageBillingOrg: [
  8713. "GET /orgs/{org}/settings/billing/shared-storage"
  8714. ],
  8715. getSharedStorageBillingUser: [
  8716. "GET /users/{username}/settings/billing/shared-storage"
  8717. ]
  8718. },
  8719. checks: {
  8720. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8721. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8722. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8723. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8724. listAnnotations: [
  8725. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8726. ],
  8727. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  8728. listForSuite: [
  8729. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  8730. ],
  8731. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  8732. rerequestRun: [
  8733. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  8734. ],
  8735. rerequestSuite: [
  8736. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  8737. ],
  8738. setSuitesPreferences: [
  8739. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  8740. ],
  8741. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  8742. },
  8743. codeScanning: {
  8744. deleteAnalysis: [
  8745. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  8746. ],
  8747. getAlert: [
  8748. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  8749. {},
  8750. { renamedParameters: { alert_id: "alert_number" } }
  8751. ],
  8752. getAnalysis: [
  8753. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  8754. ],
  8755. getCodeqlDatabase: [
  8756. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  8757. ],
  8758. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  8759. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  8760. listAlertInstances: [
  8761. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  8762. ],
  8763. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  8764. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  8765. listAlertsInstances: [
  8766. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8767. {},
  8768. { renamed: ["codeScanning", "listAlertInstances"] }
  8769. ],
  8770. listCodeqlDatabases: [
  8771. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  8772. ],
  8773. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  8774. updateAlert: [
  8775. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  8776. ],
  8777. updateDefaultSetup: [
  8778. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  8779. ],
  8780. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  8781. },
  8782. codesOfConduct: {
  8783. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  8784. getConductCode: ["GET /codes_of_conduct/{key}"]
  8785. },
  8786. codespaces: {
  8787. addRepositoryForSecretForAuthenticatedUser: [
  8788. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8789. ],
  8790. addSelectedRepoToOrgSecret: [
  8791. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8792. ],
  8793. checkPermissionsForDevcontainer: [
  8794. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  8795. ],
  8796. codespaceMachinesForAuthenticatedUser: [
  8797. "GET /user/codespaces/{codespace_name}/machines"
  8798. ],
  8799. createForAuthenticatedUser: ["POST /user/codespaces"],
  8800. createOrUpdateOrgSecret: [
  8801. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  8802. ],
  8803. createOrUpdateRepoSecret: [
  8804. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8805. ],
  8806. createOrUpdateSecretForAuthenticatedUser: [
  8807. "PUT /user/codespaces/secrets/{secret_name}"
  8808. ],
  8809. createWithPrForAuthenticatedUser: [
  8810. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  8811. ],
  8812. createWithRepoForAuthenticatedUser: [
  8813. "POST /repos/{owner}/{repo}/codespaces"
  8814. ],
  8815. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  8816. deleteFromOrganization: [
  8817. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  8818. ],
  8819. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  8820. deleteRepoSecret: [
  8821. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8822. ],
  8823. deleteSecretForAuthenticatedUser: [
  8824. "DELETE /user/codespaces/secrets/{secret_name}"
  8825. ],
  8826. exportForAuthenticatedUser: [
  8827. "POST /user/codespaces/{codespace_name}/exports"
  8828. ],
  8829. getCodespacesForUserInOrg: [
  8830. "GET /orgs/{org}/members/{username}/codespaces"
  8831. ],
  8832. getExportDetailsForAuthenticatedUser: [
  8833. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  8834. ],
  8835. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  8836. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  8837. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  8838. getPublicKeyForAuthenticatedUser: [
  8839. "GET /user/codespaces/secrets/public-key"
  8840. ],
  8841. getRepoPublicKey: [
  8842. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  8843. ],
  8844. getRepoSecret: [
  8845. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8846. ],
  8847. getSecretForAuthenticatedUser: [
  8848. "GET /user/codespaces/secrets/{secret_name}"
  8849. ],
  8850. listDevcontainersInRepositoryForAuthenticatedUser: [
  8851. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  8852. ],
  8853. listForAuthenticatedUser: ["GET /user/codespaces"],
  8854. listInOrganization: [
  8855. "GET /orgs/{org}/codespaces",
  8856. {},
  8857. { renamedParameters: { org_id: "org" } }
  8858. ],
  8859. listInRepositoryForAuthenticatedUser: [
  8860. "GET /repos/{owner}/{repo}/codespaces"
  8861. ],
  8862. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  8863. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  8864. listRepositoriesForSecretForAuthenticatedUser: [
  8865. "GET /user/codespaces/secrets/{secret_name}/repositories"
  8866. ],
  8867. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  8868. listSelectedReposForOrgSecret: [
  8869. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8870. ],
  8871. preFlightWithRepoForAuthenticatedUser: [
  8872. "GET /repos/{owner}/{repo}/codespaces/new"
  8873. ],
  8874. publishForAuthenticatedUser: [
  8875. "POST /user/codespaces/{codespace_name}/publish"
  8876. ],
  8877. removeRepositoryForSecretForAuthenticatedUser: [
  8878. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8879. ],
  8880. removeSelectedRepoFromOrgSecret: [
  8881. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8882. ],
  8883. repoMachinesForAuthenticatedUser: [
  8884. "GET /repos/{owner}/{repo}/codespaces/machines"
  8885. ],
  8886. setRepositoriesForSecretForAuthenticatedUser: [
  8887. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  8888. ],
  8889. setSelectedReposForOrgSecret: [
  8890. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8891. ],
  8892. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  8893. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  8894. stopInOrganization: [
  8895. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  8896. ],
  8897. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  8898. },
  8899. copilot: {
  8900. addCopilotSeatsForTeams: [
  8901. "POST /orgs/{org}/copilot/billing/selected_teams"
  8902. ],
  8903. addCopilotSeatsForUsers: [
  8904. "POST /orgs/{org}/copilot/billing/selected_users"
  8905. ],
  8906. cancelCopilotSeatAssignmentForTeams: [
  8907. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  8908. ],
  8909. cancelCopilotSeatAssignmentForUsers: [
  8910. "DELETE /orgs/{org}/copilot/billing/selected_users"
  8911. ],
  8912. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  8913. getCopilotSeatDetailsForUser: [
  8914. "GET /orgs/{org}/members/{username}/copilot"
  8915. ],
  8916. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  8917. },
  8918. dependabot: {
  8919. addSelectedRepoToOrgSecret: [
  8920. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8921. ],
  8922. createOrUpdateOrgSecret: [
  8923. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  8924. ],
  8925. createOrUpdateRepoSecret: [
  8926. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8927. ],
  8928. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  8929. deleteRepoSecret: [
  8930. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8931. ],
  8932. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  8933. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  8934. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  8935. getRepoPublicKey: [
  8936. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  8937. ],
  8938. getRepoSecret: [
  8939. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8940. ],
  8941. listAlertsForEnterprise: [
  8942. "GET /enterprises/{enterprise}/dependabot/alerts"
  8943. ],
  8944. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  8945. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  8946. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  8947. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  8948. listSelectedReposForOrgSecret: [
  8949. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8950. ],
  8951. removeSelectedRepoFromOrgSecret: [
  8952. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8953. ],
  8954. setSelectedReposForOrgSecret: [
  8955. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8956. ],
  8957. updateAlert: [
  8958. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  8959. ]
  8960. },
  8961. dependencyGraph: {
  8962. createRepositorySnapshot: [
  8963. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  8964. ],
  8965. diffRange: [
  8966. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  8967. ],
  8968. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  8969. },
  8970. emojis: { get: ["GET /emojis"] },
  8971. gists: {
  8972. checkIsStarred: ["GET /gists/{gist_id}/star"],
  8973. create: ["POST /gists"],
  8974. createComment: ["POST /gists/{gist_id}/comments"],
  8975. delete: ["DELETE /gists/{gist_id}"],
  8976. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  8977. fork: ["POST /gists/{gist_id}/forks"],
  8978. get: ["GET /gists/{gist_id}"],
  8979. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  8980. getRevision: ["GET /gists/{gist_id}/{sha}"],
  8981. list: ["GET /gists"],
  8982. listComments: ["GET /gists/{gist_id}/comments"],
  8983. listCommits: ["GET /gists/{gist_id}/commits"],
  8984. listForUser: ["GET /users/{username}/gists"],
  8985. listForks: ["GET /gists/{gist_id}/forks"],
  8986. listPublic: ["GET /gists/public"],
  8987. listStarred: ["GET /gists/starred"],
  8988. star: ["PUT /gists/{gist_id}/star"],
  8989. unstar: ["DELETE /gists/{gist_id}/star"],
  8990. update: ["PATCH /gists/{gist_id}"],
  8991. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  8992. },
  8993. git: {
  8994. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  8995. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  8996. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  8997. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  8998. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  8999. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9000. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9001. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9002. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9003. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9004. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9005. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9006. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9007. },
  9008. gitignore: {
  9009. getAllTemplates: ["GET /gitignore/templates"],
  9010. getTemplate: ["GET /gitignore/templates/{name}"]
  9011. },
  9012. interactions: {
  9013. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9014. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9015. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9016. getRestrictionsForYourPublicRepos: [
  9017. "GET /user/interaction-limits",
  9018. {},
  9019. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9020. ],
  9021. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9022. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9023. removeRestrictionsForRepo: [
  9024. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9025. ],
  9026. removeRestrictionsForYourPublicRepos: [
  9027. "DELETE /user/interaction-limits",
  9028. {},
  9029. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9030. ],
  9031. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9032. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9033. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9034. setRestrictionsForYourPublicRepos: [
  9035. "PUT /user/interaction-limits",
  9036. {},
  9037. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9038. ]
  9039. },
  9040. issues: {
  9041. addAssignees: [
  9042. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9043. ],
  9044. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9045. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9046. checkUserCanBeAssignedToIssue: [
  9047. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9048. ],
  9049. create: ["POST /repos/{owner}/{repo}/issues"],
  9050. createComment: [
  9051. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9052. ],
  9053. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9054. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9055. deleteComment: [
  9056. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9057. ],
  9058. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9059. deleteMilestone: [
  9060. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9061. ],
  9062. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9063. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9064. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9065. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9066. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9067. list: ["GET /issues"],
  9068. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9069. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9070. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9071. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9072. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9073. listEventsForTimeline: [
  9074. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9075. ],
  9076. listForAuthenticatedUser: ["GET /user/issues"],
  9077. listForOrg: ["GET /orgs/{org}/issues"],
  9078. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9079. listLabelsForMilestone: [
  9080. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9081. ],
  9082. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9083. listLabelsOnIssue: [
  9084. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9085. ],
  9086. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9087. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9088. removeAllLabels: [
  9089. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9090. ],
  9091. removeAssignees: [
  9092. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9093. ],
  9094. removeLabel: [
  9095. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9096. ],
  9097. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9098. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9099. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9100. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9101. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9102. updateMilestone: [
  9103. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9104. ]
  9105. },
  9106. licenses: {
  9107. get: ["GET /licenses/{license}"],
  9108. getAllCommonlyUsed: ["GET /licenses"],
  9109. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9110. },
  9111. markdown: {
  9112. render: ["POST /markdown"],
  9113. renderRaw: [
  9114. "POST /markdown/raw",
  9115. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9116. ]
  9117. },
  9118. meta: {
  9119. get: ["GET /meta"],
  9120. getAllVersions: ["GET /versions"],
  9121. getOctocat: ["GET /octocat"],
  9122. getZen: ["GET /zen"],
  9123. root: ["GET /"]
  9124. },
  9125. migrations: {
  9126. cancelImport: [
  9127. "DELETE /repos/{owner}/{repo}/import",
  9128. {},
  9129. {
  9130. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9131. }
  9132. ],
  9133. deleteArchiveForAuthenticatedUser: [
  9134. "DELETE /user/migrations/{migration_id}/archive"
  9135. ],
  9136. deleteArchiveForOrg: [
  9137. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9138. ],
  9139. downloadArchiveForOrg: [
  9140. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9141. ],
  9142. getArchiveForAuthenticatedUser: [
  9143. "GET /user/migrations/{migration_id}/archive"
  9144. ],
  9145. getCommitAuthors: [
  9146. "GET /repos/{owner}/{repo}/import/authors",
  9147. {},
  9148. {
  9149. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9150. }
  9151. ],
  9152. getImportStatus: [
  9153. "GET /repos/{owner}/{repo}/import",
  9154. {},
  9155. {
  9156. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9157. }
  9158. ],
  9159. getLargeFiles: [
  9160. "GET /repos/{owner}/{repo}/import/large_files",
  9161. {},
  9162. {
  9163. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9164. }
  9165. ],
  9166. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9167. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9168. listForAuthenticatedUser: ["GET /user/migrations"],
  9169. listForOrg: ["GET /orgs/{org}/migrations"],
  9170. listReposForAuthenticatedUser: [
  9171. "GET /user/migrations/{migration_id}/repositories"
  9172. ],
  9173. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9174. listReposForUser: [
  9175. "GET /user/migrations/{migration_id}/repositories",
  9176. {},
  9177. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9178. ],
  9179. mapCommitAuthor: [
  9180. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9181. {},
  9182. {
  9183. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9184. }
  9185. ],
  9186. setLfsPreference: [
  9187. "PATCH /repos/{owner}/{repo}/import/lfs",
  9188. {},
  9189. {
  9190. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9191. }
  9192. ],
  9193. startForAuthenticatedUser: ["POST /user/migrations"],
  9194. startForOrg: ["POST /orgs/{org}/migrations"],
  9195. startImport: [
  9196. "PUT /repos/{owner}/{repo}/import",
  9197. {},
  9198. {
  9199. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9200. }
  9201. ],
  9202. unlockRepoForAuthenticatedUser: [
  9203. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9204. ],
  9205. unlockRepoForOrg: [
  9206. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9207. ],
  9208. updateImport: [
  9209. "PATCH /repos/{owner}/{repo}/import",
  9210. {},
  9211. {
  9212. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9213. }
  9214. ]
  9215. },
  9216. oidc: {
  9217. getOidcCustomSubTemplateForOrg: [
  9218. "GET /orgs/{org}/actions/oidc/customization/sub"
  9219. ],
  9220. updateOidcCustomSubTemplateForOrg: [
  9221. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9222. ]
  9223. },
  9224. orgs: {
  9225. addSecurityManagerTeam: [
  9226. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9227. ],
  9228. assignTeamToOrgRole: [
  9229. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9230. ],
  9231. assignUserToOrgRole: [
  9232. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9233. ],
  9234. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9235. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9236. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9237. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9238. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9239. convertMemberToOutsideCollaborator: [
  9240. "PUT /orgs/{org}/outside_collaborators/{username}"
  9241. ],
  9242. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9243. createInvitation: ["POST /orgs/{org}/invitations"],
  9244. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9245. createOrUpdateCustomPropertiesValuesForRepos: [
  9246. "PATCH /orgs/{org}/properties/values"
  9247. ],
  9248. createOrUpdateCustomProperty: [
  9249. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9250. ],
  9251. createWebhook: ["POST /orgs/{org}/hooks"],
  9252. delete: ["DELETE /orgs/{org}"],
  9253. deleteCustomOrganizationRole: [
  9254. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9255. ],
  9256. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9257. enableOrDisableSecurityProductOnAllOrgRepos: [
  9258. "POST /orgs/{org}/{security_product}/{enablement}"
  9259. ],
  9260. get: ["GET /orgs/{org}"],
  9261. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9262. getCustomProperty: [
  9263. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9264. ],
  9265. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9266. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9267. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9268. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9269. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9270. getWebhookDelivery: [
  9271. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9272. ],
  9273. list: ["GET /organizations"],
  9274. listAppInstallations: ["GET /orgs/{org}/installations"],
  9275. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9276. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9277. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9278. listForAuthenticatedUser: ["GET /user/orgs"],
  9279. listForUser: ["GET /users/{username}/orgs"],
  9280. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9281. listMembers: ["GET /orgs/{org}/members"],
  9282. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9283. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9284. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9285. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9286. listOrganizationFineGrainedPermissions: [
  9287. "GET /orgs/{org}/organization-fine-grained-permissions"
  9288. ],
  9289. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9290. listPatGrantRepositories: [
  9291. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9292. ],
  9293. listPatGrantRequestRepositories: [
  9294. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9295. ],
  9296. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9297. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9298. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9299. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9300. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9301. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9302. listWebhooks: ["GET /orgs/{org}/hooks"],
  9303. patchCustomOrganizationRole: [
  9304. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9305. ],
  9306. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9307. redeliverWebhookDelivery: [
  9308. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9309. ],
  9310. removeCustomProperty: [
  9311. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9312. ],
  9313. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9314. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9315. removeOutsideCollaborator: [
  9316. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9317. ],
  9318. removePublicMembershipForAuthenticatedUser: [
  9319. "DELETE /orgs/{org}/public_members/{username}"
  9320. ],
  9321. removeSecurityManagerTeam: [
  9322. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9323. ],
  9324. reviewPatGrantRequest: [
  9325. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9326. ],
  9327. reviewPatGrantRequestsInBulk: [
  9328. "POST /orgs/{org}/personal-access-token-requests"
  9329. ],
  9330. revokeAllOrgRolesTeam: [
  9331. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9332. ],
  9333. revokeAllOrgRolesUser: [
  9334. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9335. ],
  9336. revokeOrgRoleTeam: [
  9337. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9338. ],
  9339. revokeOrgRoleUser: [
  9340. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9341. ],
  9342. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9343. setPublicMembershipForAuthenticatedUser: [
  9344. "PUT /orgs/{org}/public_members/{username}"
  9345. ],
  9346. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9347. update: ["PATCH /orgs/{org}"],
  9348. updateMembershipForAuthenticatedUser: [
  9349. "PATCH /user/memberships/orgs/{org}"
  9350. ],
  9351. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9352. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9353. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9354. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9355. },
  9356. packages: {
  9357. deletePackageForAuthenticatedUser: [
  9358. "DELETE /user/packages/{package_type}/{package_name}"
  9359. ],
  9360. deletePackageForOrg: [
  9361. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9362. ],
  9363. deletePackageForUser: [
  9364. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9365. ],
  9366. deletePackageVersionForAuthenticatedUser: [
  9367. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9368. ],
  9369. deletePackageVersionForOrg: [
  9370. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9371. ],
  9372. deletePackageVersionForUser: [
  9373. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9374. ],
  9375. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9376. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9377. {},
  9378. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9379. ],
  9380. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9381. "GET /user/packages/{package_type}/{package_name}/versions",
  9382. {},
  9383. {
  9384. renamed: [
  9385. "packages",
  9386. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9387. ]
  9388. }
  9389. ],
  9390. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9391. "GET /user/packages/{package_type}/{package_name}/versions"
  9392. ],
  9393. getAllPackageVersionsForPackageOwnedByOrg: [
  9394. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9395. ],
  9396. getAllPackageVersionsForPackageOwnedByUser: [
  9397. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9398. ],
  9399. getPackageForAuthenticatedUser: [
  9400. "GET /user/packages/{package_type}/{package_name}"
  9401. ],
  9402. getPackageForOrganization: [
  9403. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9404. ],
  9405. getPackageForUser: [
  9406. "GET /users/{username}/packages/{package_type}/{package_name}"
  9407. ],
  9408. getPackageVersionForAuthenticatedUser: [
  9409. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9410. ],
  9411. getPackageVersionForOrganization: [
  9412. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9413. ],
  9414. getPackageVersionForUser: [
  9415. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9416. ],
  9417. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9418. "GET /user/docker/conflicts"
  9419. ],
  9420. listDockerMigrationConflictingPackagesForOrganization: [
  9421. "GET /orgs/{org}/docker/conflicts"
  9422. ],
  9423. listDockerMigrationConflictingPackagesForUser: [
  9424. "GET /users/{username}/docker/conflicts"
  9425. ],
  9426. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9427. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9428. listPackagesForUser: ["GET /users/{username}/packages"],
  9429. restorePackageForAuthenticatedUser: [
  9430. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9431. ],
  9432. restorePackageForOrg: [
  9433. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9434. ],
  9435. restorePackageForUser: [
  9436. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9437. ],
  9438. restorePackageVersionForAuthenticatedUser: [
  9439. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9440. ],
  9441. restorePackageVersionForOrg: [
  9442. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9443. ],
  9444. restorePackageVersionForUser: [
  9445. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9446. ]
  9447. },
  9448. projects: {
  9449. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9450. createCard: ["POST /projects/columns/{column_id}/cards"],
  9451. createColumn: ["POST /projects/{project_id}/columns"],
  9452. createForAuthenticatedUser: ["POST /user/projects"],
  9453. createForOrg: ["POST /orgs/{org}/projects"],
  9454. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9455. delete: ["DELETE /projects/{project_id}"],
  9456. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9457. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9458. get: ["GET /projects/{project_id}"],
  9459. getCard: ["GET /projects/columns/cards/{card_id}"],
  9460. getColumn: ["GET /projects/columns/{column_id}"],
  9461. getPermissionForUser: [
  9462. "GET /projects/{project_id}/collaborators/{username}/permission"
  9463. ],
  9464. listCards: ["GET /projects/columns/{column_id}/cards"],
  9465. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9466. listColumns: ["GET /projects/{project_id}/columns"],
  9467. listForOrg: ["GET /orgs/{org}/projects"],
  9468. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9469. listForUser: ["GET /users/{username}/projects"],
  9470. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9471. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9472. removeCollaborator: [
  9473. "DELETE /projects/{project_id}/collaborators/{username}"
  9474. ],
  9475. update: ["PATCH /projects/{project_id}"],
  9476. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9477. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9478. },
  9479. pulls: {
  9480. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9481. create: ["POST /repos/{owner}/{repo}/pulls"],
  9482. createReplyForReviewComment: [
  9483. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9484. ],
  9485. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9486. createReviewComment: [
  9487. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9488. ],
  9489. deletePendingReview: [
  9490. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9491. ],
  9492. deleteReviewComment: [
  9493. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9494. ],
  9495. dismissReview: [
  9496. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9497. ],
  9498. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9499. getReview: [
  9500. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9501. ],
  9502. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9503. list: ["GET /repos/{owner}/{repo}/pulls"],
  9504. listCommentsForReview: [
  9505. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9506. ],
  9507. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9508. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9509. listRequestedReviewers: [
  9510. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9511. ],
  9512. listReviewComments: [
  9513. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9514. ],
  9515. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9516. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9517. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9518. removeRequestedReviewers: [
  9519. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9520. ],
  9521. requestReviewers: [
  9522. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9523. ],
  9524. submitReview: [
  9525. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9526. ],
  9527. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9528. updateBranch: [
  9529. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9530. ],
  9531. updateReview: [
  9532. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9533. ],
  9534. updateReviewComment: [
  9535. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9536. ]
  9537. },
  9538. rateLimit: { get: ["GET /rate_limit"] },
  9539. reactions: {
  9540. createForCommitComment: [
  9541. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9542. ],
  9543. createForIssue: [
  9544. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9545. ],
  9546. createForIssueComment: [
  9547. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9548. ],
  9549. createForPullRequestReviewComment: [
  9550. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9551. ],
  9552. createForRelease: [
  9553. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9554. ],
  9555. createForTeamDiscussionCommentInOrg: [
  9556. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9557. ],
  9558. createForTeamDiscussionInOrg: [
  9559. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9560. ],
  9561. deleteForCommitComment: [
  9562. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9563. ],
  9564. deleteForIssue: [
  9565. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9566. ],
  9567. deleteForIssueComment: [
  9568. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9569. ],
  9570. deleteForPullRequestComment: [
  9571. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9572. ],
  9573. deleteForRelease: [
  9574. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9575. ],
  9576. deleteForTeamDiscussion: [
  9577. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9578. ],
  9579. deleteForTeamDiscussionComment: [
  9580. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9581. ],
  9582. listForCommitComment: [
  9583. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9584. ],
  9585. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9586. listForIssueComment: [
  9587. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9588. ],
  9589. listForPullRequestReviewComment: [
  9590. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9591. ],
  9592. listForRelease: [
  9593. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9594. ],
  9595. listForTeamDiscussionCommentInOrg: [
  9596. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9597. ],
  9598. listForTeamDiscussionInOrg: [
  9599. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9600. ]
  9601. },
  9602. repos: {
  9603. acceptInvitation: [
  9604. "PATCH /user/repository_invitations/{invitation_id}",
  9605. {},
  9606. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9607. ],
  9608. acceptInvitationForAuthenticatedUser: [
  9609. "PATCH /user/repository_invitations/{invitation_id}"
  9610. ],
  9611. addAppAccessRestrictions: [
  9612. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9613. {},
  9614. { mapToData: "apps" }
  9615. ],
  9616. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9617. addStatusCheckContexts: [
  9618. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9619. {},
  9620. { mapToData: "contexts" }
  9621. ],
  9622. addTeamAccessRestrictions: [
  9623. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9624. {},
  9625. { mapToData: "teams" }
  9626. ],
  9627. addUserAccessRestrictions: [
  9628. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9629. {},
  9630. { mapToData: "users" }
  9631. ],
  9632. cancelPagesDeployment: [
  9633. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9634. ],
  9635. checkAutomatedSecurityFixes: [
  9636. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9637. ],
  9638. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9639. checkVulnerabilityAlerts: [
  9640. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9641. ],
  9642. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9643. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9644. compareCommitsWithBasehead: [
  9645. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9646. ],
  9647. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9648. createCommitComment: [
  9649. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9650. ],
  9651. createCommitSignatureProtection: [
  9652. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9653. ],
  9654. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9655. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9656. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9657. createDeploymentBranchPolicy: [
  9658. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9659. ],
  9660. createDeploymentProtectionRule: [
  9661. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9662. ],
  9663. createDeploymentStatus: [
  9664. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9665. ],
  9666. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9667. createForAuthenticatedUser: ["POST /user/repos"],
  9668. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9669. createInOrg: ["POST /orgs/{org}/repos"],
  9670. createOrUpdateCustomPropertiesValues: [
  9671. "PATCH /repos/{owner}/{repo}/properties/values"
  9672. ],
  9673. createOrUpdateEnvironment: [
  9674. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9675. ],
  9676. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9677. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9678. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9679. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9680. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9681. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9682. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9683. createUsingTemplate: [
  9684. "POST /repos/{template_owner}/{template_repo}/generate"
  9685. ],
  9686. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9687. declineInvitation: [
  9688. "DELETE /user/repository_invitations/{invitation_id}",
  9689. {},
  9690. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9691. ],
  9692. declineInvitationForAuthenticatedUser: [
  9693. "DELETE /user/repository_invitations/{invitation_id}"
  9694. ],
  9695. delete: ["DELETE /repos/{owner}/{repo}"],
  9696. deleteAccessRestrictions: [
  9697. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9698. ],
  9699. deleteAdminBranchProtection: [
  9700. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9701. ],
  9702. deleteAnEnvironment: [
  9703. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9704. ],
  9705. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9706. deleteBranchProtection: [
  9707. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9708. ],
  9709. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9710. deleteCommitSignatureProtection: [
  9711. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9712. ],
  9713. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9714. deleteDeployment: [
  9715. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9716. ],
  9717. deleteDeploymentBranchPolicy: [
  9718. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9719. ],
  9720. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9721. deleteInvitation: [
  9722. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9723. ],
  9724. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9725. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9726. deletePullRequestReviewProtection: [
  9727. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9728. ],
  9729. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  9730. deleteReleaseAsset: [
  9731. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9732. ],
  9733. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9734. deleteTagProtection: [
  9735. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  9736. ],
  9737. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  9738. disableAutomatedSecurityFixes: [
  9739. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  9740. ],
  9741. disableDeploymentProtectionRule: [
  9742. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9743. ],
  9744. disablePrivateVulnerabilityReporting: [
  9745. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  9746. ],
  9747. disableVulnerabilityAlerts: [
  9748. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  9749. ],
  9750. downloadArchive: [
  9751. "GET /repos/{owner}/{repo}/zipball/{ref}",
  9752. {},
  9753. { renamed: ["repos", "downloadZipballArchive"] }
  9754. ],
  9755. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  9756. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  9757. enableAutomatedSecurityFixes: [
  9758. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  9759. ],
  9760. enablePrivateVulnerabilityReporting: [
  9761. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  9762. ],
  9763. enableVulnerabilityAlerts: [
  9764. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  9765. ],
  9766. generateReleaseNotes: [
  9767. "POST /repos/{owner}/{repo}/releases/generate-notes"
  9768. ],
  9769. get: ["GET /repos/{owner}/{repo}"],
  9770. getAccessRestrictions: [
  9771. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9772. ],
  9773. getAdminBranchProtection: [
  9774. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9775. ],
  9776. getAllDeploymentProtectionRules: [
  9777. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9778. ],
  9779. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  9780. getAllStatusCheckContexts: [
  9781. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  9782. ],
  9783. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  9784. getAppsWithAccessToProtectedBranch: [
  9785. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  9786. ],
  9787. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9788. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  9789. getBranchProtection: [
  9790. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  9791. ],
  9792. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  9793. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  9794. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  9795. getCollaboratorPermissionLevel: [
  9796. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  9797. ],
  9798. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  9799. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  9800. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  9801. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  9802. getCommitSignatureProtection: [
  9803. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9804. ],
  9805. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  9806. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  9807. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  9808. getCustomDeploymentProtectionRule: [
  9809. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9810. ],
  9811. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  9812. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  9813. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  9814. getDeploymentBranchPolicy: [
  9815. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9816. ],
  9817. getDeploymentStatus: [
  9818. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  9819. ],
  9820. getEnvironment: [
  9821. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  9822. ],
  9823. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  9824. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  9825. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  9826. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  9827. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  9828. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  9829. getPages: ["GET /repos/{owner}/{repo}/pages"],
  9830. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  9831. getPagesDeployment: [
  9832. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  9833. ],
  9834. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  9835. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  9836. getPullRequestReviewProtection: [
  9837. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9838. ],
  9839. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  9840. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  9841. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  9842. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  9843. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  9844. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  9845. getRepoRuleSuite: [
  9846. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  9847. ],
  9848. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  9849. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9850. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  9851. getStatusChecksProtection: [
  9852. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9853. ],
  9854. getTeamsWithAccessToProtectedBranch: [
  9855. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  9856. ],
  9857. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  9858. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  9859. getUsersWithAccessToProtectedBranch: [
  9860. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  9861. ],
  9862. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  9863. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  9864. getWebhookConfigForRepo: [
  9865. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  9866. ],
  9867. getWebhookDelivery: [
  9868. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  9869. ],
  9870. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  9871. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  9872. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  9873. listBranchesForHeadCommit: [
  9874. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  9875. ],
  9876. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  9877. listCommentsForCommit: [
  9878. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9879. ],
  9880. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  9881. listCommitStatusesForRef: [
  9882. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  9883. ],
  9884. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  9885. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  9886. listCustomDeploymentRuleIntegrations: [
  9887. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  9888. ],
  9889. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  9890. listDeploymentBranchPolicies: [
  9891. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9892. ],
  9893. listDeploymentStatuses: [
  9894. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9895. ],
  9896. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  9897. listForAuthenticatedUser: ["GET /user/repos"],
  9898. listForOrg: ["GET /orgs/{org}/repos"],
  9899. listForUser: ["GET /users/{username}/repos"],
  9900. listForks: ["GET /repos/{owner}/{repo}/forks"],
  9901. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  9902. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  9903. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  9904. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  9905. listPublic: ["GET /repositories"],
  9906. listPullRequestsAssociatedWithCommit: [
  9907. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  9908. ],
  9909. listReleaseAssets: [
  9910. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  9911. ],
  9912. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  9913. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  9914. listTags: ["GET /repos/{owner}/{repo}/tags"],
  9915. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  9916. listWebhookDeliveries: [
  9917. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  9918. ],
  9919. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  9920. merge: ["POST /repos/{owner}/{repo}/merges"],
  9921. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  9922. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  9923. redeliverWebhookDelivery: [
  9924. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9925. ],
  9926. removeAppAccessRestrictions: [
  9927. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9928. {},
  9929. { mapToData: "apps" }
  9930. ],
  9931. removeCollaborator: [
  9932. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  9933. ],
  9934. removeStatusCheckContexts: [
  9935. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9936. {},
  9937. { mapToData: "contexts" }
  9938. ],
  9939. removeStatusCheckProtection: [
  9940. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9941. ],
  9942. removeTeamAccessRestrictions: [
  9943. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9944. {},
  9945. { mapToData: "teams" }
  9946. ],
  9947. removeUserAccessRestrictions: [
  9948. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9949. {},
  9950. { mapToData: "users" }
  9951. ],
  9952. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  9953. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  9954. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  9955. setAdminBranchProtection: [
  9956. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9957. ],
  9958. setAppAccessRestrictions: [
  9959. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9960. {},
  9961. { mapToData: "apps" }
  9962. ],
  9963. setStatusCheckContexts: [
  9964. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9965. {},
  9966. { mapToData: "contexts" }
  9967. ],
  9968. setTeamAccessRestrictions: [
  9969. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9970. {},
  9971. { mapToData: "teams" }
  9972. ],
  9973. setUserAccessRestrictions: [
  9974. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9975. {},
  9976. { mapToData: "users" }
  9977. ],
  9978. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  9979. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  9980. update: ["PATCH /repos/{owner}/{repo}"],
  9981. updateBranchProtection: [
  9982. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  9983. ],
  9984. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  9985. updateDeploymentBranchPolicy: [
  9986. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9987. ],
  9988. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  9989. updateInvitation: [
  9990. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  9991. ],
  9992. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  9993. updatePullRequestReviewProtection: [
  9994. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9995. ],
  9996. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  9997. updateReleaseAsset: [
  9998. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9999. ],
  10000. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10001. updateStatusCheckPotection: [
  10002. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10003. {},
  10004. { renamed: ["repos", "updateStatusCheckProtection"] }
  10005. ],
  10006. updateStatusCheckProtection: [
  10007. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10008. ],
  10009. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10010. updateWebhookConfigForRepo: [
  10011. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10012. ],
  10013. uploadReleaseAsset: [
  10014. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10015. { baseUrl: "https://uploads.github.com" }
  10016. ]
  10017. },
  10018. search: {
  10019. code: ["GET /search/code"],
  10020. commits: ["GET /search/commits"],
  10021. issuesAndPullRequests: ["GET /search/issues"],
  10022. labels: ["GET /search/labels"],
  10023. repos: ["GET /search/repositories"],
  10024. topics: ["GET /search/topics"],
  10025. users: ["GET /search/users"]
  10026. },
  10027. secretScanning: {
  10028. getAlert: [
  10029. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10030. ],
  10031. listAlertsForEnterprise: [
  10032. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10033. ],
  10034. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10035. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10036. listLocationsForAlert: [
  10037. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10038. ],
  10039. updateAlert: [
  10040. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10041. ]
  10042. },
  10043. securityAdvisories: {
  10044. createFork: [
  10045. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10046. ],
  10047. createPrivateVulnerabilityReport: [
  10048. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10049. ],
  10050. createRepositoryAdvisory: [
  10051. "POST /repos/{owner}/{repo}/security-advisories"
  10052. ],
  10053. createRepositoryAdvisoryCveRequest: [
  10054. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10055. ],
  10056. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10057. getRepositoryAdvisory: [
  10058. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10059. ],
  10060. listGlobalAdvisories: ["GET /advisories"],
  10061. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10062. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10063. updateRepositoryAdvisory: [
  10064. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10065. ]
  10066. },
  10067. teams: {
  10068. addOrUpdateMembershipForUserInOrg: [
  10069. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10070. ],
  10071. addOrUpdateProjectPermissionsInOrg: [
  10072. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10073. ],
  10074. addOrUpdateRepoPermissionsInOrg: [
  10075. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10076. ],
  10077. checkPermissionsForProjectInOrg: [
  10078. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10079. ],
  10080. checkPermissionsForRepoInOrg: [
  10081. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10082. ],
  10083. create: ["POST /orgs/{org}/teams"],
  10084. createDiscussionCommentInOrg: [
  10085. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10086. ],
  10087. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10088. deleteDiscussionCommentInOrg: [
  10089. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10090. ],
  10091. deleteDiscussionInOrg: [
  10092. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10093. ],
  10094. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10095. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10096. getDiscussionCommentInOrg: [
  10097. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10098. ],
  10099. getDiscussionInOrg: [
  10100. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10101. ],
  10102. getMembershipForUserInOrg: [
  10103. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10104. ],
  10105. list: ["GET /orgs/{org}/teams"],
  10106. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10107. listDiscussionCommentsInOrg: [
  10108. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10109. ],
  10110. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10111. listForAuthenticatedUser: ["GET /user/teams"],
  10112. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10113. listPendingInvitationsInOrg: [
  10114. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10115. ],
  10116. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10117. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10118. removeMembershipForUserInOrg: [
  10119. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10120. ],
  10121. removeProjectInOrg: [
  10122. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10123. ],
  10124. removeRepoInOrg: [
  10125. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10126. ],
  10127. updateDiscussionCommentInOrg: [
  10128. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10129. ],
  10130. updateDiscussionInOrg: [
  10131. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10132. ],
  10133. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10134. },
  10135. users: {
  10136. addEmailForAuthenticated: [
  10137. "POST /user/emails",
  10138. {},
  10139. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10140. ],
  10141. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10142. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10143. block: ["PUT /user/blocks/{username}"],
  10144. checkBlocked: ["GET /user/blocks/{username}"],
  10145. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10146. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10147. createGpgKeyForAuthenticated: [
  10148. "POST /user/gpg_keys",
  10149. {},
  10150. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10151. ],
  10152. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10153. createPublicSshKeyForAuthenticated: [
  10154. "POST /user/keys",
  10155. {},
  10156. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10157. ],
  10158. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10159. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10160. deleteEmailForAuthenticated: [
  10161. "DELETE /user/emails",
  10162. {},
  10163. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10164. ],
  10165. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10166. deleteGpgKeyForAuthenticated: [
  10167. "DELETE /user/gpg_keys/{gpg_key_id}",
  10168. {},
  10169. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10170. ],
  10171. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10172. deletePublicSshKeyForAuthenticated: [
  10173. "DELETE /user/keys/{key_id}",
  10174. {},
  10175. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10176. ],
  10177. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10178. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10179. deleteSshSigningKeyForAuthenticatedUser: [
  10180. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10181. ],
  10182. follow: ["PUT /user/following/{username}"],
  10183. getAuthenticated: ["GET /user"],
  10184. getByUsername: ["GET /users/{username}"],
  10185. getContextForUser: ["GET /users/{username}/hovercard"],
  10186. getGpgKeyForAuthenticated: [
  10187. "GET /user/gpg_keys/{gpg_key_id}",
  10188. {},
  10189. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10190. ],
  10191. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10192. getPublicSshKeyForAuthenticated: [
  10193. "GET /user/keys/{key_id}",
  10194. {},
  10195. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10196. ],
  10197. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10198. getSshSigningKeyForAuthenticatedUser: [
  10199. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10200. ],
  10201. list: ["GET /users"],
  10202. listBlockedByAuthenticated: [
  10203. "GET /user/blocks",
  10204. {},
  10205. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10206. ],
  10207. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10208. listEmailsForAuthenticated: [
  10209. "GET /user/emails",
  10210. {},
  10211. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10212. ],
  10213. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10214. listFollowedByAuthenticated: [
  10215. "GET /user/following",
  10216. {},
  10217. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10218. ],
  10219. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10220. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10221. listFollowersForUser: ["GET /users/{username}/followers"],
  10222. listFollowingForUser: ["GET /users/{username}/following"],
  10223. listGpgKeysForAuthenticated: [
  10224. "GET /user/gpg_keys",
  10225. {},
  10226. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10227. ],
  10228. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10229. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10230. listPublicEmailsForAuthenticated: [
  10231. "GET /user/public_emails",
  10232. {},
  10233. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10234. ],
  10235. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10236. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10237. listPublicSshKeysForAuthenticated: [
  10238. "GET /user/keys",
  10239. {},
  10240. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10241. ],
  10242. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10243. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10244. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10245. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10246. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10247. setPrimaryEmailVisibilityForAuthenticated: [
  10248. "PATCH /user/email/visibility",
  10249. {},
  10250. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10251. ],
  10252. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10253. "PATCH /user/email/visibility"
  10254. ],
  10255. unblock: ["DELETE /user/blocks/{username}"],
  10256. unfollow: ["DELETE /user/following/{username}"],
  10257. updateAuthenticated: ["PATCH /user"]
  10258. }
  10259. };
  10260. var endpoints_default = Endpoints;
  10261. // pkg/dist-src/endpoints-to-methods.js
  10262. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10263. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10264. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10265. const [route, defaults, decorations] = endpoint;
  10266. const [method, url] = route.split(/ /);
  10267. const endpointDefaults = Object.assign(
  10268. {
  10269. method,
  10270. url
  10271. },
  10272. defaults
  10273. );
  10274. if (!endpointMethodsMap.has(scope)) {
  10275. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10276. }
  10277. endpointMethodsMap.get(scope).set(methodName, {
  10278. scope,
  10279. methodName,
  10280. endpointDefaults,
  10281. decorations
  10282. });
  10283. }
  10284. }
  10285. var handler = {
  10286. has({ scope }, methodName) {
  10287. return endpointMethodsMap.get(scope).has(methodName);
  10288. },
  10289. getOwnPropertyDescriptor(target, methodName) {
  10290. return {
  10291. value: this.get(target, methodName),
  10292. // ensures method is in the cache
  10293. configurable: true,
  10294. writable: true,
  10295. enumerable: true
  10296. };
  10297. },
  10298. defineProperty(target, methodName, descriptor) {
  10299. Object.defineProperty(target.cache, methodName, descriptor);
  10300. return true;
  10301. },
  10302. deleteProperty(target, methodName) {
  10303. delete target.cache[methodName];
  10304. return true;
  10305. },
  10306. ownKeys({ scope }) {
  10307. return [...endpointMethodsMap.get(scope).keys()];
  10308. },
  10309. set(target, methodName, value) {
  10310. return target.cache[methodName] = value;
  10311. },
  10312. get({ octokit, scope, cache }, methodName) {
  10313. if (cache[methodName]) {
  10314. return cache[methodName];
  10315. }
  10316. const method = endpointMethodsMap.get(scope).get(methodName);
  10317. if (!method) {
  10318. return void 0;
  10319. }
  10320. const { endpointDefaults, decorations } = method;
  10321. if (decorations) {
  10322. cache[methodName] = decorate(
  10323. octokit,
  10324. scope,
  10325. methodName,
  10326. endpointDefaults,
  10327. decorations
  10328. );
  10329. } else {
  10330. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10331. }
  10332. return cache[methodName];
  10333. }
  10334. };
  10335. function endpointsToMethods(octokit) {
  10336. const newMethods = {};
  10337. for (const scope of endpointMethodsMap.keys()) {
  10338. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10339. }
  10340. return newMethods;
  10341. }
  10342. function decorate(octokit, scope, methodName, defaults, decorations) {
  10343. const requestWithDefaults = octokit.request.defaults(defaults);
  10344. function withDecorations(...args) {
  10345. let options = requestWithDefaults.endpoint.merge(...args);
  10346. if (decorations.mapToData) {
  10347. options = Object.assign({}, options, {
  10348. data: options[decorations.mapToData],
  10349. [decorations.mapToData]: void 0
  10350. });
  10351. return requestWithDefaults(options);
  10352. }
  10353. if (decorations.renamed) {
  10354. const [newScope, newMethodName] = decorations.renamed;
  10355. octokit.log.warn(
  10356. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10357. );
  10358. }
  10359. if (decorations.deprecated) {
  10360. octokit.log.warn(decorations.deprecated);
  10361. }
  10362. if (decorations.renamedParameters) {
  10363. const options2 = requestWithDefaults.endpoint.merge(...args);
  10364. for (const [name, alias] of Object.entries(
  10365. decorations.renamedParameters
  10366. )) {
  10367. if (name in options2) {
  10368. octokit.log.warn(
  10369. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10370. );
  10371. if (!(alias in options2)) {
  10372. options2[alias] = options2[name];
  10373. }
  10374. delete options2[name];
  10375. }
  10376. }
  10377. return requestWithDefaults(options2);
  10378. }
  10379. return requestWithDefaults(...args);
  10380. }
  10381. return Object.assign(withDecorations, requestWithDefaults);
  10382. }
  10383. // pkg/dist-src/index.js
  10384. function restEndpointMethods(octokit) {
  10385. const api = endpointsToMethods(octokit);
  10386. return {
  10387. rest: api
  10388. };
  10389. }
  10390. restEndpointMethods.VERSION = VERSION;
  10391. function legacyRestEndpointMethods(octokit) {
  10392. const api = endpointsToMethods(octokit);
  10393. return {
  10394. ...api,
  10395. rest: api
  10396. };
  10397. }
  10398. legacyRestEndpointMethods.VERSION = VERSION;
  10399. // Annotate the CommonJS export names for ESM import in node:
  10400. 0 && (0);
  10401. /***/ }),
  10402. /***/ 537:
  10403. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10404. "use strict";
  10405. var __create = Object.create;
  10406. var __defProp = Object.defineProperty;
  10407. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10408. var __getOwnPropNames = Object.getOwnPropertyNames;
  10409. var __getProtoOf = Object.getPrototypeOf;
  10410. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10411. var __export = (target, all) => {
  10412. for (var name in all)
  10413. __defProp(target, name, { get: all[name], enumerable: true });
  10414. };
  10415. var __copyProps = (to, from, except, desc) => {
  10416. if (from && typeof from === "object" || typeof from === "function") {
  10417. for (let key of __getOwnPropNames(from))
  10418. if (!__hasOwnProp.call(to, key) && key !== except)
  10419. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10420. }
  10421. return to;
  10422. };
  10423. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10424. // If the importer is in node compatibility mode or this is not an ESM
  10425. // file that has been converted to a CommonJS file using a Babel-
  10426. // compatible transform (i.e. "__esModule" has not been set), then set
  10427. // "default" to the CommonJS "module.exports" for node compatibility.
  10428. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10429. mod
  10430. ));
  10431. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10432. // pkg/dist-src/index.js
  10433. var dist_src_exports = {};
  10434. __export(dist_src_exports, {
  10435. RequestError: () => RequestError
  10436. });
  10437. module.exports = __toCommonJS(dist_src_exports);
  10438. var import_deprecation = __nccwpck_require__(8932);
  10439. var import_once = __toESM(__nccwpck_require__(1223));
  10440. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10441. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10442. var RequestError = class extends Error {
  10443. constructor(message, statusCode, options) {
  10444. super(message);
  10445. if (Error.captureStackTrace) {
  10446. Error.captureStackTrace(this, this.constructor);
  10447. }
  10448. this.name = "HttpError";
  10449. this.status = statusCode;
  10450. let headers;
  10451. if ("headers" in options && typeof options.headers !== "undefined") {
  10452. headers = options.headers;
  10453. }
  10454. if ("response" in options) {
  10455. this.response = options.response;
  10456. headers = options.response.headers;
  10457. }
  10458. const requestCopy = Object.assign({}, options.request);
  10459. if (options.request.headers.authorization) {
  10460. requestCopy.headers = Object.assign({}, options.request.headers, {
  10461. authorization: options.request.headers.authorization.replace(
  10462. / .*$/,
  10463. " [REDACTED]"
  10464. )
  10465. });
  10466. }
  10467. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10468. this.request = requestCopy;
  10469. Object.defineProperty(this, "code", {
  10470. get() {
  10471. logOnceCode(
  10472. new import_deprecation.Deprecation(
  10473. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10474. )
  10475. );
  10476. return statusCode;
  10477. }
  10478. });
  10479. Object.defineProperty(this, "headers", {
  10480. get() {
  10481. logOnceHeaders(
  10482. new import_deprecation.Deprecation(
  10483. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10484. )
  10485. );
  10486. return headers || {};
  10487. }
  10488. });
  10489. }
  10490. };
  10491. // Annotate the CommonJS export names for ESM import in node:
  10492. 0 && (0);
  10493. /***/ }),
  10494. /***/ 6234:
  10495. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10496. "use strict";
  10497. var __defProp = Object.defineProperty;
  10498. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10499. var __getOwnPropNames = Object.getOwnPropertyNames;
  10500. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10501. var __export = (target, all) => {
  10502. for (var name in all)
  10503. __defProp(target, name, { get: all[name], enumerable: true });
  10504. };
  10505. var __copyProps = (to, from, except, desc) => {
  10506. if (from && typeof from === "object" || typeof from === "function") {
  10507. for (let key of __getOwnPropNames(from))
  10508. if (!__hasOwnProp.call(to, key) && key !== except)
  10509. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10510. }
  10511. return to;
  10512. };
  10513. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10514. // pkg/dist-src/index.js
  10515. var dist_src_exports = {};
  10516. __export(dist_src_exports, {
  10517. request: () => request
  10518. });
  10519. module.exports = __toCommonJS(dist_src_exports);
  10520. var import_endpoint = __nccwpck_require__(9440);
  10521. var import_universal_user_agent = __nccwpck_require__(5030);
  10522. // pkg/dist-src/version.js
  10523. var VERSION = "8.4.0";
  10524. // pkg/dist-src/is-plain-object.js
  10525. function isPlainObject(value) {
  10526. if (typeof value !== "object" || value === null)
  10527. return false;
  10528. if (Object.prototype.toString.call(value) !== "[object Object]")
  10529. return false;
  10530. const proto = Object.getPrototypeOf(value);
  10531. if (proto === null)
  10532. return true;
  10533. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10534. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10535. }
  10536. // pkg/dist-src/fetch-wrapper.js
  10537. var import_request_error = __nccwpck_require__(537);
  10538. // pkg/dist-src/get-buffer-response.js
  10539. function getBufferResponse(response) {
  10540. return response.arrayBuffer();
  10541. }
  10542. // pkg/dist-src/fetch-wrapper.js
  10543. function fetchWrapper(requestOptions) {
  10544. var _a, _b, _c, _d;
  10545. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10546. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10547. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10548. requestOptions.body = JSON.stringify(requestOptions.body);
  10549. }
  10550. let headers = {};
  10551. let status;
  10552. let url;
  10553. let { fetch } = globalThis;
  10554. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10555. fetch = requestOptions.request.fetch;
  10556. }
  10557. if (!fetch) {
  10558. throw new Error(
  10559. "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"
  10560. );
  10561. }
  10562. return fetch(requestOptions.url, {
  10563. method: requestOptions.method,
  10564. body: requestOptions.body,
  10565. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10566. headers: requestOptions.headers,
  10567. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10568. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10569. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10570. ...requestOptions.body && { duplex: "half" }
  10571. }).then(async (response) => {
  10572. url = response.url;
  10573. status = response.status;
  10574. for (const keyAndValue of response.headers) {
  10575. headers[keyAndValue[0]] = keyAndValue[1];
  10576. }
  10577. if ("deprecation" in headers) {
  10578. const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
  10579. const deprecationLink = matches && matches.pop();
  10580. log.warn(
  10581. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10582. );
  10583. }
  10584. if (status === 204 || status === 205) {
  10585. return;
  10586. }
  10587. if (requestOptions.method === "HEAD") {
  10588. if (status < 400) {
  10589. return;
  10590. }
  10591. throw new import_request_error.RequestError(response.statusText, status, {
  10592. response: {
  10593. url,
  10594. status,
  10595. headers,
  10596. data: void 0
  10597. },
  10598. request: requestOptions
  10599. });
  10600. }
  10601. if (status === 304) {
  10602. throw new import_request_error.RequestError("Not modified", status, {
  10603. response: {
  10604. url,
  10605. status,
  10606. headers,
  10607. data: await getResponseData(response)
  10608. },
  10609. request: requestOptions
  10610. });
  10611. }
  10612. if (status >= 400) {
  10613. const data = await getResponseData(response);
  10614. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10615. response: {
  10616. url,
  10617. status,
  10618. headers,
  10619. data
  10620. },
  10621. request: requestOptions
  10622. });
  10623. throw error;
  10624. }
  10625. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10626. }).then((data) => {
  10627. return {
  10628. status,
  10629. url,
  10630. headers,
  10631. data
  10632. };
  10633. }).catch((error) => {
  10634. if (error instanceof import_request_error.RequestError)
  10635. throw error;
  10636. else if (error.name === "AbortError")
  10637. throw error;
  10638. let message = error.message;
  10639. if (error.name === "TypeError" && "cause" in error) {
  10640. if (error.cause instanceof Error) {
  10641. message = error.cause.message;
  10642. } else if (typeof error.cause === "string") {
  10643. message = error.cause;
  10644. }
  10645. }
  10646. throw new import_request_error.RequestError(message, 500, {
  10647. request: requestOptions
  10648. });
  10649. });
  10650. }
  10651. async function getResponseData(response) {
  10652. const contentType = response.headers.get("content-type");
  10653. if (/application\/json/.test(contentType)) {
  10654. return response.json().catch(() => response.text()).catch(() => "");
  10655. }
  10656. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10657. return response.text();
  10658. }
  10659. return getBufferResponse(response);
  10660. }
  10661. function toErrorMessage(data) {
  10662. if (typeof data === "string")
  10663. return data;
  10664. let suffix;
  10665. if ("documentation_url" in data) {
  10666. suffix = ` - ${data.documentation_url}`;
  10667. } else {
  10668. suffix = "";
  10669. }
  10670. if ("message" in data) {
  10671. if (Array.isArray(data.errors)) {
  10672. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10673. }
  10674. return `${data.message}${suffix}`;
  10675. }
  10676. return `Unknown error: ${JSON.stringify(data)}`;
  10677. }
  10678. // pkg/dist-src/with-defaults.js
  10679. function withDefaults(oldEndpoint, newDefaults) {
  10680. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10681. const newApi = function(route, parameters) {
  10682. const endpointOptions = endpoint2.merge(route, parameters);
  10683. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10684. return fetchWrapper(endpoint2.parse(endpointOptions));
  10685. }
  10686. const request2 = (route2, parameters2) => {
  10687. return fetchWrapper(
  10688. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10689. );
  10690. };
  10691. Object.assign(request2, {
  10692. endpoint: endpoint2,
  10693. defaults: withDefaults.bind(null, endpoint2)
  10694. });
  10695. return endpointOptions.request.hook(request2, endpointOptions);
  10696. };
  10697. return Object.assign(newApi, {
  10698. endpoint: endpoint2,
  10699. defaults: withDefaults.bind(null, endpoint2)
  10700. });
  10701. }
  10702. // pkg/dist-src/index.js
  10703. var request = withDefaults(import_endpoint.endpoint, {
  10704. headers: {
  10705. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10706. }
  10707. });
  10708. // Annotate the CommonJS export names for ESM import in node:
  10709. 0 && (0);
  10710. /***/ }),
  10711. /***/ 3682:
  10712. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10713. var register = __nccwpck_require__(4670);
  10714. var addHook = __nccwpck_require__(5549);
  10715. var removeHook = __nccwpck_require__(6819);
  10716. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10717. var bind = Function.bind;
  10718. var bindable = bind.bind(bind);
  10719. function bindApi(hook, state, name) {
  10720. var removeHookRef = bindable(removeHook, null).apply(
  10721. null,
  10722. name ? [state, name] : [state]
  10723. );
  10724. hook.api = { remove: removeHookRef };
  10725. hook.remove = removeHookRef;
  10726. ["before", "error", "after", "wrap"].forEach(function (kind) {
  10727. var args = name ? [state, kind, name] : [state, kind];
  10728. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  10729. });
  10730. }
  10731. function HookSingular() {
  10732. var singularHookName = "h";
  10733. var singularHookState = {
  10734. registry: {},
  10735. };
  10736. var singularHook = register.bind(null, singularHookState, singularHookName);
  10737. bindApi(singularHook, singularHookState, singularHookName);
  10738. return singularHook;
  10739. }
  10740. function HookCollection() {
  10741. var state = {
  10742. registry: {},
  10743. };
  10744. var hook = register.bind(null, state);
  10745. bindApi(hook, state);
  10746. return hook;
  10747. }
  10748. var collectionHookDeprecationMessageDisplayed = false;
  10749. function Hook() {
  10750. if (!collectionHookDeprecationMessageDisplayed) {
  10751. console.warn(
  10752. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  10753. );
  10754. collectionHookDeprecationMessageDisplayed = true;
  10755. }
  10756. return HookCollection();
  10757. }
  10758. Hook.Singular = HookSingular.bind();
  10759. Hook.Collection = HookCollection.bind();
  10760. module.exports = Hook;
  10761. // expose constructors as a named property for TypeScript
  10762. module.exports.Hook = Hook;
  10763. module.exports.Singular = Hook.Singular;
  10764. module.exports.Collection = Hook.Collection;
  10765. /***/ }),
  10766. /***/ 5549:
  10767. /***/ ((module) => {
  10768. module.exports = addHook;
  10769. function addHook(state, kind, name, hook) {
  10770. var orig = hook;
  10771. if (!state.registry[name]) {
  10772. state.registry[name] = [];
  10773. }
  10774. if (kind === "before") {
  10775. hook = function (method, options) {
  10776. return Promise.resolve()
  10777. .then(orig.bind(null, options))
  10778. .then(method.bind(null, options));
  10779. };
  10780. }
  10781. if (kind === "after") {
  10782. hook = function (method, options) {
  10783. var result;
  10784. return Promise.resolve()
  10785. .then(method.bind(null, options))
  10786. .then(function (result_) {
  10787. result = result_;
  10788. return orig(result, options);
  10789. })
  10790. .then(function () {
  10791. return result;
  10792. });
  10793. };
  10794. }
  10795. if (kind === "error") {
  10796. hook = function (method, options) {
  10797. return Promise.resolve()
  10798. .then(method.bind(null, options))
  10799. .catch(function (error) {
  10800. return orig(error, options);
  10801. });
  10802. };
  10803. }
  10804. state.registry[name].push({
  10805. hook: hook,
  10806. orig: orig,
  10807. });
  10808. }
  10809. /***/ }),
  10810. /***/ 4670:
  10811. /***/ ((module) => {
  10812. module.exports = register;
  10813. function register(state, name, method, options) {
  10814. if (typeof method !== "function") {
  10815. throw new Error("method for before hook must be a function");
  10816. }
  10817. if (!options) {
  10818. options = {};
  10819. }
  10820. if (Array.isArray(name)) {
  10821. return name.reverse().reduce(function (callback, name) {
  10822. return register.bind(null, state, name, callback, options);
  10823. }, method)();
  10824. }
  10825. return Promise.resolve().then(function () {
  10826. if (!state.registry[name]) {
  10827. return method(options);
  10828. }
  10829. return state.registry[name].reduce(function (method, registered) {
  10830. return registered.hook.bind(null, method, options);
  10831. }, method)();
  10832. });
  10833. }
  10834. /***/ }),
  10835. /***/ 6819:
  10836. /***/ ((module) => {
  10837. module.exports = removeHook;
  10838. function removeHook(state, name, method) {
  10839. if (!state.registry[name]) {
  10840. return;
  10841. }
  10842. var index = state.registry[name]
  10843. .map(function (registered) {
  10844. return registered.orig;
  10845. })
  10846. .indexOf(method);
  10847. if (index === -1) {
  10848. return;
  10849. }
  10850. state.registry[name].splice(index, 1);
  10851. }
  10852. /***/ }),
  10853. /***/ 8932:
  10854. /***/ ((__unused_webpack_module, exports) => {
  10855. "use strict";
  10856. Object.defineProperty(exports, "__esModule", ({ value: true }));
  10857. class Deprecation extends Error {
  10858. constructor(message) {
  10859. super(message); // Maintains proper stack trace (only available on V8)
  10860. /* istanbul ignore next */
  10861. if (Error.captureStackTrace) {
  10862. Error.captureStackTrace(this, this.constructor);
  10863. }
  10864. this.name = 'Deprecation';
  10865. }
  10866. }
  10867. exports.Deprecation = Deprecation;
  10868. /***/ }),
  10869. /***/ 1223:
  10870. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10871. var wrappy = __nccwpck_require__(2940)
  10872. module.exports = wrappy(once)
  10873. module.exports.strict = wrappy(onceStrict)
  10874. once.proto = once(function () {
  10875. Object.defineProperty(Function.prototype, 'once', {
  10876. value: function () {
  10877. return once(this)
  10878. },
  10879. configurable: true
  10880. })
  10881. Object.defineProperty(Function.prototype, 'onceStrict', {
  10882. value: function () {
  10883. return onceStrict(this)
  10884. },
  10885. configurable: true
  10886. })
  10887. })
  10888. function once (fn) {
  10889. var f = function () {
  10890. if (f.called) return f.value
  10891. f.called = true
  10892. return f.value = fn.apply(this, arguments)
  10893. }
  10894. f.called = false
  10895. return f
  10896. }
  10897. function onceStrict (fn) {
  10898. var f = function () {
  10899. if (f.called)
  10900. throw new Error(f.onceError)
  10901. f.called = true
  10902. return f.value = fn.apply(this, arguments)
  10903. }
  10904. var name = fn.name || 'Function wrapped with `once`'
  10905. f.onceError = name + " shouldn't be called more than once"
  10906. f.called = false
  10907. return f
  10908. }
  10909. /***/ }),
  10910. /***/ 5911:
  10911. /***/ ((module, exports) => {
  10912. exports = module.exports = SemVer
  10913. var debug
  10914. /* istanbul ignore next */
  10915. if (typeof process === 'object' &&
  10916. process.env &&
  10917. process.env.NODE_DEBUG &&
  10918. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10919. debug = function () {
  10920. var args = Array.prototype.slice.call(arguments, 0)
  10921. args.unshift('SEMVER')
  10922. console.log.apply(console, args)
  10923. }
  10924. } else {
  10925. debug = function () {}
  10926. }
  10927. // Note: this is the semver.org version of the spec that it implements
  10928. // Not necessarily the package version of this code.
  10929. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10930. var MAX_LENGTH = 256
  10931. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10932. /* istanbul ignore next */ 9007199254740991
  10933. // Max safe segment length for coercion.
  10934. var MAX_SAFE_COMPONENT_LENGTH = 16
  10935. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  10936. // The actual regexps go on exports.re
  10937. var re = exports.re = []
  10938. var safeRe = exports.safeRe = []
  10939. var src = exports.src = []
  10940. var t = exports.tokens = {}
  10941. var R = 0
  10942. function tok (n) {
  10943. t[n] = R++
  10944. }
  10945. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  10946. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  10947. // used internally via the safeRe object since all inputs in this library get
  10948. // normalized first to trim and collapse all extra whitespace. The original
  10949. // regexes are exported for userland consumption and lower level usage. A
  10950. // future breaking change could export the safer regex only with a note that
  10951. // all input should have extra whitespace removed.
  10952. var safeRegexReplacements = [
  10953. ['\\s', 1],
  10954. ['\\d', MAX_LENGTH],
  10955. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  10956. ]
  10957. function makeSafeRe (value) {
  10958. for (var i = 0; i < safeRegexReplacements.length; i++) {
  10959. var token = safeRegexReplacements[i][0]
  10960. var max = safeRegexReplacements[i][1]
  10961. value = value
  10962. .split(token + '*').join(token + '{0,' + max + '}')
  10963. .split(token + '+').join(token + '{1,' + max + '}')
  10964. }
  10965. return value
  10966. }
  10967. // The following Regular Expressions can be used for tokenizing,
  10968. // validating, and parsing SemVer version strings.
  10969. // ## Numeric Identifier
  10970. // A single `0`, or a non-zero digit followed by zero or more digits.
  10971. tok('NUMERICIDENTIFIER')
  10972. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10973. tok('NUMERICIDENTIFIERLOOSE')
  10974. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  10975. // ## Non-numeric Identifier
  10976. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10977. // more letters, digits, or hyphens.
  10978. tok('NONNUMERICIDENTIFIER')
  10979. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  10980. // ## Main Version
  10981. // Three dot-separated numeric identifiers.
  10982. tok('MAINVERSION')
  10983. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10984. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10985. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10986. tok('MAINVERSIONLOOSE')
  10987. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10988. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10989. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10990. // ## Pre-release Version Identifier
  10991. // A numeric identifier, or a non-numeric identifier.
  10992. tok('PRERELEASEIDENTIFIER')
  10993. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10994. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10995. tok('PRERELEASEIDENTIFIERLOOSE')
  10996. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10997. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10998. // ## Pre-release Version
  10999. // Hyphen, followed by one or more dot-separated pre-release version
  11000. // identifiers.
  11001. tok('PRERELEASE')
  11002. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11003. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11004. tok('PRERELEASELOOSE')
  11005. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11006. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11007. // ## Build Metadata Identifier
  11008. // Any combination of digits, letters, or hyphens.
  11009. tok('BUILDIDENTIFIER')
  11010. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11011. // ## Build Metadata
  11012. // Plus sign, followed by one or more period-separated build metadata
  11013. // identifiers.
  11014. tok('BUILD')
  11015. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11016. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11017. // ## Full Version String
  11018. // A main version, followed optionally by a pre-release version and
  11019. // build metadata.
  11020. // Note that the only major, minor, patch, and pre-release sections of
  11021. // the version string are capturing groups. The build metadata is not a
  11022. // capturing group, because it should not ever be used in version
  11023. // comparison.
  11024. tok('FULL')
  11025. tok('FULLPLAIN')
  11026. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11027. src[t.PRERELEASE] + '?' +
  11028. src[t.BUILD] + '?'
  11029. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11030. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11031. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11032. // common in the npm registry.
  11033. tok('LOOSEPLAIN')
  11034. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11035. src[t.PRERELEASELOOSE] + '?' +
  11036. src[t.BUILD] + '?'
  11037. tok('LOOSE')
  11038. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11039. tok('GTLT')
  11040. src[t.GTLT] = '((?:<|>)?=?)'
  11041. // Something like "2.*" or "1.2.x".
  11042. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11043. // Only the first item is strictly required.
  11044. tok('XRANGEIDENTIFIERLOOSE')
  11045. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11046. tok('XRANGEIDENTIFIER')
  11047. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11048. tok('XRANGEPLAIN')
  11049. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11050. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11051. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11052. '(?:' + src[t.PRERELEASE] + ')?' +
  11053. src[t.BUILD] + '?' +
  11054. ')?)?'
  11055. tok('XRANGEPLAINLOOSE')
  11056. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11057. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11058. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11059. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11060. src[t.BUILD] + '?' +
  11061. ')?)?'
  11062. tok('XRANGE')
  11063. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11064. tok('XRANGELOOSE')
  11065. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11066. // Coercion.
  11067. // Extract anything that could conceivably be a part of a valid semver
  11068. tok('COERCE')
  11069. src[t.COERCE] = '(^|[^\\d])' +
  11070. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11071. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11072. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11073. '(?:$|[^\\d])'
  11074. tok('COERCERTL')
  11075. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11076. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11077. // Tilde ranges.
  11078. // Meaning is "reasonably at or greater than"
  11079. tok('LONETILDE')
  11080. src[t.LONETILDE] = '(?:~>?)'
  11081. tok('TILDETRIM')
  11082. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11083. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11084. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11085. var tildeTrimReplace = '$1~'
  11086. tok('TILDE')
  11087. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11088. tok('TILDELOOSE')
  11089. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11090. // Caret ranges.
  11091. // Meaning is "at least and backwards compatible with"
  11092. tok('LONECARET')
  11093. src[t.LONECARET] = '(?:\\^)'
  11094. tok('CARETTRIM')
  11095. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11096. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11097. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11098. var caretTrimReplace = '$1^'
  11099. tok('CARET')
  11100. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11101. tok('CARETLOOSE')
  11102. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11103. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11104. tok('COMPARATORLOOSE')
  11105. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11106. tok('COMPARATOR')
  11107. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11108. // An expression to strip any whitespace between the gtlt and the thing
  11109. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11110. tok('COMPARATORTRIM')
  11111. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11112. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11113. // this one has to use the /g flag
  11114. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11115. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11116. var comparatorTrimReplace = '$1$2$3'
  11117. // Something like `1.2.3 - 1.2.4`
  11118. // Note that these all use the loose form, because they'll be
  11119. // checked against either the strict or loose comparator form
  11120. // later.
  11121. tok('HYPHENRANGE')
  11122. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11123. '\\s+-\\s+' +
  11124. '(' + src[t.XRANGEPLAIN] + ')' +
  11125. '\\s*$'
  11126. tok('HYPHENRANGELOOSE')
  11127. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11128. '\\s+-\\s+' +
  11129. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11130. '\\s*$'
  11131. // Star ranges basically just allow anything at all.
  11132. tok('STAR')
  11133. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11134. // Compile to actual regexp objects.
  11135. // All are flag-free, unless they were created above with a flag.
  11136. for (var i = 0; i < R; i++) {
  11137. debug(i, src[i])
  11138. if (!re[i]) {
  11139. re[i] = new RegExp(src[i])
  11140. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11141. // used internally via the safeRe object since all inputs in this library get
  11142. // normalized first to trim and collapse all extra whitespace. The original
  11143. // regexes are exported for userland consumption and lower level usage. A
  11144. // future breaking change could export the safer regex only with a note that
  11145. // all input should have extra whitespace removed.
  11146. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11147. }
  11148. }
  11149. exports.parse = parse
  11150. function parse (version, options) {
  11151. if (!options || typeof options !== 'object') {
  11152. options = {
  11153. loose: !!options,
  11154. includePrerelease: false
  11155. }
  11156. }
  11157. if (version instanceof SemVer) {
  11158. return version
  11159. }
  11160. if (typeof version !== 'string') {
  11161. return null
  11162. }
  11163. if (version.length > MAX_LENGTH) {
  11164. return null
  11165. }
  11166. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11167. if (!r.test(version)) {
  11168. return null
  11169. }
  11170. try {
  11171. return new SemVer(version, options)
  11172. } catch (er) {
  11173. return null
  11174. }
  11175. }
  11176. exports.valid = valid
  11177. function valid (version, options) {
  11178. var v = parse(version, options)
  11179. return v ? v.version : null
  11180. }
  11181. exports.clean = clean
  11182. function clean (version, options) {
  11183. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11184. return s ? s.version : null
  11185. }
  11186. exports.SemVer = SemVer
  11187. function SemVer (version, options) {
  11188. if (!options || typeof options !== 'object') {
  11189. options = {
  11190. loose: !!options,
  11191. includePrerelease: false
  11192. }
  11193. }
  11194. if (version instanceof SemVer) {
  11195. if (version.loose === options.loose) {
  11196. return version
  11197. } else {
  11198. version = version.version
  11199. }
  11200. } else if (typeof version !== 'string') {
  11201. throw new TypeError('Invalid Version: ' + version)
  11202. }
  11203. if (version.length > MAX_LENGTH) {
  11204. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11205. }
  11206. if (!(this instanceof SemVer)) {
  11207. return new SemVer(version, options)
  11208. }
  11209. debug('SemVer', version, options)
  11210. this.options = options
  11211. this.loose = !!options.loose
  11212. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11213. if (!m) {
  11214. throw new TypeError('Invalid Version: ' + version)
  11215. }
  11216. this.raw = version
  11217. // these are actually numbers
  11218. this.major = +m[1]
  11219. this.minor = +m[2]
  11220. this.patch = +m[3]
  11221. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11222. throw new TypeError('Invalid major version')
  11223. }
  11224. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11225. throw new TypeError('Invalid minor version')
  11226. }
  11227. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11228. throw new TypeError('Invalid patch version')
  11229. }
  11230. // numberify any prerelease numeric ids
  11231. if (!m[4]) {
  11232. this.prerelease = []
  11233. } else {
  11234. this.prerelease = m[4].split('.').map(function (id) {
  11235. if (/^[0-9]+$/.test(id)) {
  11236. var num = +id
  11237. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11238. return num
  11239. }
  11240. }
  11241. return id
  11242. })
  11243. }
  11244. this.build = m[5] ? m[5].split('.') : []
  11245. this.format()
  11246. }
  11247. SemVer.prototype.format = function () {
  11248. this.version = this.major + '.' + this.minor + '.' + this.patch
  11249. if (this.prerelease.length) {
  11250. this.version += '-' + this.prerelease.join('.')
  11251. }
  11252. return this.version
  11253. }
  11254. SemVer.prototype.toString = function () {
  11255. return this.version
  11256. }
  11257. SemVer.prototype.compare = function (other) {
  11258. debug('SemVer.compare', this.version, this.options, other)
  11259. if (!(other instanceof SemVer)) {
  11260. other = new SemVer(other, this.options)
  11261. }
  11262. return this.compareMain(other) || this.comparePre(other)
  11263. }
  11264. SemVer.prototype.compareMain = function (other) {
  11265. if (!(other instanceof SemVer)) {
  11266. other = new SemVer(other, this.options)
  11267. }
  11268. return compareIdentifiers(this.major, other.major) ||
  11269. compareIdentifiers(this.minor, other.minor) ||
  11270. compareIdentifiers(this.patch, other.patch)
  11271. }
  11272. SemVer.prototype.comparePre = function (other) {
  11273. if (!(other instanceof SemVer)) {
  11274. other = new SemVer(other, this.options)
  11275. }
  11276. // NOT having a prerelease is > having one
  11277. if (this.prerelease.length && !other.prerelease.length) {
  11278. return -1
  11279. } else if (!this.prerelease.length && other.prerelease.length) {
  11280. return 1
  11281. } else if (!this.prerelease.length && !other.prerelease.length) {
  11282. return 0
  11283. }
  11284. var i = 0
  11285. do {
  11286. var a = this.prerelease[i]
  11287. var b = other.prerelease[i]
  11288. debug('prerelease compare', i, a, b)
  11289. if (a === undefined && b === undefined) {
  11290. return 0
  11291. } else if (b === undefined) {
  11292. return 1
  11293. } else if (a === undefined) {
  11294. return -1
  11295. } else if (a === b) {
  11296. continue
  11297. } else {
  11298. return compareIdentifiers(a, b)
  11299. }
  11300. } while (++i)
  11301. }
  11302. SemVer.prototype.compareBuild = function (other) {
  11303. if (!(other instanceof SemVer)) {
  11304. other = new SemVer(other, this.options)
  11305. }
  11306. var i = 0
  11307. do {
  11308. var a = this.build[i]
  11309. var b = other.build[i]
  11310. debug('prerelease compare', i, a, b)
  11311. if (a === undefined && b === undefined) {
  11312. return 0
  11313. } else if (b === undefined) {
  11314. return 1
  11315. } else if (a === undefined) {
  11316. return -1
  11317. } else if (a === b) {
  11318. continue
  11319. } else {
  11320. return compareIdentifiers(a, b)
  11321. }
  11322. } while (++i)
  11323. }
  11324. // preminor will bump the version up to the next minor release, and immediately
  11325. // down to pre-release. premajor and prepatch work the same way.
  11326. SemVer.prototype.inc = function (release, identifier) {
  11327. switch (release) {
  11328. case 'premajor':
  11329. this.prerelease.length = 0
  11330. this.patch = 0
  11331. this.minor = 0
  11332. this.major++
  11333. this.inc('pre', identifier)
  11334. break
  11335. case 'preminor':
  11336. this.prerelease.length = 0
  11337. this.patch = 0
  11338. this.minor++
  11339. this.inc('pre', identifier)
  11340. break
  11341. case 'prepatch':
  11342. // If this is already a prerelease, it will bump to the next version
  11343. // drop any prereleases that might already exist, since they are not
  11344. // relevant at this point.
  11345. this.prerelease.length = 0
  11346. this.inc('patch', identifier)
  11347. this.inc('pre', identifier)
  11348. break
  11349. // If the input is a non-prerelease version, this acts the same as
  11350. // prepatch.
  11351. case 'prerelease':
  11352. if (this.prerelease.length === 0) {
  11353. this.inc('patch', identifier)
  11354. }
  11355. this.inc('pre', identifier)
  11356. break
  11357. case 'major':
  11358. // If this is a pre-major version, bump up to the same major version.
  11359. // Otherwise increment major.
  11360. // 1.0.0-5 bumps to 1.0.0
  11361. // 1.1.0 bumps to 2.0.0
  11362. if (this.minor !== 0 ||
  11363. this.patch !== 0 ||
  11364. this.prerelease.length === 0) {
  11365. this.major++
  11366. }
  11367. this.minor = 0
  11368. this.patch = 0
  11369. this.prerelease = []
  11370. break
  11371. case 'minor':
  11372. // If this is a pre-minor version, bump up to the same minor version.
  11373. // Otherwise increment minor.
  11374. // 1.2.0-5 bumps to 1.2.0
  11375. // 1.2.1 bumps to 1.3.0
  11376. if (this.patch !== 0 || this.prerelease.length === 0) {
  11377. this.minor++
  11378. }
  11379. this.patch = 0
  11380. this.prerelease = []
  11381. break
  11382. case 'patch':
  11383. // If this is not a pre-release version, it will increment the patch.
  11384. // If it is a pre-release it will bump up to the same patch version.
  11385. // 1.2.0-5 patches to 1.2.0
  11386. // 1.2.0 patches to 1.2.1
  11387. if (this.prerelease.length === 0) {
  11388. this.patch++
  11389. }
  11390. this.prerelease = []
  11391. break
  11392. // This probably shouldn't be used publicly.
  11393. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11394. case 'pre':
  11395. if (this.prerelease.length === 0) {
  11396. this.prerelease = [0]
  11397. } else {
  11398. var i = this.prerelease.length
  11399. while (--i >= 0) {
  11400. if (typeof this.prerelease[i] === 'number') {
  11401. this.prerelease[i]++
  11402. i = -2
  11403. }
  11404. }
  11405. if (i === -1) {
  11406. // didn't increment anything
  11407. this.prerelease.push(0)
  11408. }
  11409. }
  11410. if (identifier) {
  11411. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11412. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11413. if (this.prerelease[0] === identifier) {
  11414. if (isNaN(this.prerelease[1])) {
  11415. this.prerelease = [identifier, 0]
  11416. }
  11417. } else {
  11418. this.prerelease = [identifier, 0]
  11419. }
  11420. }
  11421. break
  11422. default:
  11423. throw new Error('invalid increment argument: ' + release)
  11424. }
  11425. this.format()
  11426. this.raw = this.version
  11427. return this
  11428. }
  11429. exports.inc = inc
  11430. function inc (version, release, loose, identifier) {
  11431. if (typeof (loose) === 'string') {
  11432. identifier = loose
  11433. loose = undefined
  11434. }
  11435. try {
  11436. return new SemVer(version, loose).inc(release, identifier).version
  11437. } catch (er) {
  11438. return null
  11439. }
  11440. }
  11441. exports.diff = diff
  11442. function diff (version1, version2) {
  11443. if (eq(version1, version2)) {
  11444. return null
  11445. } else {
  11446. var v1 = parse(version1)
  11447. var v2 = parse(version2)
  11448. var prefix = ''
  11449. if (v1.prerelease.length || v2.prerelease.length) {
  11450. prefix = 'pre'
  11451. var defaultResult = 'prerelease'
  11452. }
  11453. for (var key in v1) {
  11454. if (key === 'major' || key === 'minor' || key === 'patch') {
  11455. if (v1[key] !== v2[key]) {
  11456. return prefix + key
  11457. }
  11458. }
  11459. }
  11460. return defaultResult // may be undefined
  11461. }
  11462. }
  11463. exports.compareIdentifiers = compareIdentifiers
  11464. var numeric = /^[0-9]+$/
  11465. function compareIdentifiers (a, b) {
  11466. var anum = numeric.test(a)
  11467. var bnum = numeric.test(b)
  11468. if (anum && bnum) {
  11469. a = +a
  11470. b = +b
  11471. }
  11472. return a === b ? 0
  11473. : (anum && !bnum) ? -1
  11474. : (bnum && !anum) ? 1
  11475. : a < b ? -1
  11476. : 1
  11477. }
  11478. exports.rcompareIdentifiers = rcompareIdentifiers
  11479. function rcompareIdentifiers (a, b) {
  11480. return compareIdentifiers(b, a)
  11481. }
  11482. exports.major = major
  11483. function major (a, loose) {
  11484. return new SemVer(a, loose).major
  11485. }
  11486. exports.minor = minor
  11487. function minor (a, loose) {
  11488. return new SemVer(a, loose).minor
  11489. }
  11490. exports.patch = patch
  11491. function patch (a, loose) {
  11492. return new SemVer(a, loose).patch
  11493. }
  11494. exports.compare = compare
  11495. function compare (a, b, loose) {
  11496. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11497. }
  11498. exports.compareLoose = compareLoose
  11499. function compareLoose (a, b) {
  11500. return compare(a, b, true)
  11501. }
  11502. exports.compareBuild = compareBuild
  11503. function compareBuild (a, b, loose) {
  11504. var versionA = new SemVer(a, loose)
  11505. var versionB = new SemVer(b, loose)
  11506. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11507. }
  11508. exports.rcompare = rcompare
  11509. function rcompare (a, b, loose) {
  11510. return compare(b, a, loose)
  11511. }
  11512. exports.sort = sort
  11513. function sort (list, loose) {
  11514. return list.sort(function (a, b) {
  11515. return exports.compareBuild(a, b, loose)
  11516. })
  11517. }
  11518. exports.rsort = rsort
  11519. function rsort (list, loose) {
  11520. return list.sort(function (a, b) {
  11521. return exports.compareBuild(b, a, loose)
  11522. })
  11523. }
  11524. exports.gt = gt
  11525. function gt (a, b, loose) {
  11526. return compare(a, b, loose) > 0
  11527. }
  11528. exports.lt = lt
  11529. function lt (a, b, loose) {
  11530. return compare(a, b, loose) < 0
  11531. }
  11532. exports.eq = eq
  11533. function eq (a, b, loose) {
  11534. return compare(a, b, loose) === 0
  11535. }
  11536. exports.neq = neq
  11537. function neq (a, b, loose) {
  11538. return compare(a, b, loose) !== 0
  11539. }
  11540. exports.gte = gte
  11541. function gte (a, b, loose) {
  11542. return compare(a, b, loose) >= 0
  11543. }
  11544. exports.lte = lte
  11545. function lte (a, b, loose) {
  11546. return compare(a, b, loose) <= 0
  11547. }
  11548. exports.cmp = cmp
  11549. function cmp (a, op, b, loose) {
  11550. switch (op) {
  11551. case '===':
  11552. if (typeof a === 'object')
  11553. a = a.version
  11554. if (typeof b === 'object')
  11555. b = b.version
  11556. return a === b
  11557. case '!==':
  11558. if (typeof a === 'object')
  11559. a = a.version
  11560. if (typeof b === 'object')
  11561. b = b.version
  11562. return a !== b
  11563. case '':
  11564. case '=':
  11565. case '==':
  11566. return eq(a, b, loose)
  11567. case '!=':
  11568. return neq(a, b, loose)
  11569. case '>':
  11570. return gt(a, b, loose)
  11571. case '>=':
  11572. return gte(a, b, loose)
  11573. case '<':
  11574. return lt(a, b, loose)
  11575. case '<=':
  11576. return lte(a, b, loose)
  11577. default:
  11578. throw new TypeError('Invalid operator: ' + op)
  11579. }
  11580. }
  11581. exports.Comparator = Comparator
  11582. function Comparator (comp, options) {
  11583. if (!options || typeof options !== 'object') {
  11584. options = {
  11585. loose: !!options,
  11586. includePrerelease: false
  11587. }
  11588. }
  11589. if (comp instanceof Comparator) {
  11590. if (comp.loose === !!options.loose) {
  11591. return comp
  11592. } else {
  11593. comp = comp.value
  11594. }
  11595. }
  11596. if (!(this instanceof Comparator)) {
  11597. return new Comparator(comp, options)
  11598. }
  11599. comp = comp.trim().split(/\s+/).join(' ')
  11600. debug('comparator', comp, options)
  11601. this.options = options
  11602. this.loose = !!options.loose
  11603. this.parse(comp)
  11604. if (this.semver === ANY) {
  11605. this.value = ''
  11606. } else {
  11607. this.value = this.operator + this.semver.version
  11608. }
  11609. debug('comp', this)
  11610. }
  11611. var ANY = {}
  11612. Comparator.prototype.parse = function (comp) {
  11613. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11614. var m = comp.match(r)
  11615. if (!m) {
  11616. throw new TypeError('Invalid comparator: ' + comp)
  11617. }
  11618. this.operator = m[1] !== undefined ? m[1] : ''
  11619. if (this.operator === '=') {
  11620. this.operator = ''
  11621. }
  11622. // if it literally is just '>' or '' then allow anything.
  11623. if (!m[2]) {
  11624. this.semver = ANY
  11625. } else {
  11626. this.semver = new SemVer(m[2], this.options.loose)
  11627. }
  11628. }
  11629. Comparator.prototype.toString = function () {
  11630. return this.value
  11631. }
  11632. Comparator.prototype.test = function (version) {
  11633. debug('Comparator.test', version, this.options.loose)
  11634. if (this.semver === ANY || version === ANY) {
  11635. return true
  11636. }
  11637. if (typeof version === 'string') {
  11638. try {
  11639. version = new SemVer(version, this.options)
  11640. } catch (er) {
  11641. return false
  11642. }
  11643. }
  11644. return cmp(version, this.operator, this.semver, this.options)
  11645. }
  11646. Comparator.prototype.intersects = function (comp, options) {
  11647. if (!(comp instanceof Comparator)) {
  11648. throw new TypeError('a Comparator is required')
  11649. }
  11650. if (!options || typeof options !== 'object') {
  11651. options = {
  11652. loose: !!options,
  11653. includePrerelease: false
  11654. }
  11655. }
  11656. var rangeTmp
  11657. if (this.operator === '') {
  11658. if (this.value === '') {
  11659. return true
  11660. }
  11661. rangeTmp = new Range(comp.value, options)
  11662. return satisfies(this.value, rangeTmp, options)
  11663. } else if (comp.operator === '') {
  11664. if (comp.value === '') {
  11665. return true
  11666. }
  11667. rangeTmp = new Range(this.value, options)
  11668. return satisfies(comp.semver, rangeTmp, options)
  11669. }
  11670. var sameDirectionIncreasing =
  11671. (this.operator === '>=' || this.operator === '>') &&
  11672. (comp.operator === '>=' || comp.operator === '>')
  11673. var sameDirectionDecreasing =
  11674. (this.operator === '<=' || this.operator === '<') &&
  11675. (comp.operator === '<=' || comp.operator === '<')
  11676. var sameSemVer = this.semver.version === comp.semver.version
  11677. var differentDirectionsInclusive =
  11678. (this.operator === '>=' || this.operator === '<=') &&
  11679. (comp.operator === '>=' || comp.operator === '<=')
  11680. var oppositeDirectionsLessThan =
  11681. cmp(this.semver, '<', comp.semver, options) &&
  11682. ((this.operator === '>=' || this.operator === '>') &&
  11683. (comp.operator === '<=' || comp.operator === '<'))
  11684. var oppositeDirectionsGreaterThan =
  11685. cmp(this.semver, '>', comp.semver, options) &&
  11686. ((this.operator === '<=' || this.operator === '<') &&
  11687. (comp.operator === '>=' || comp.operator === '>'))
  11688. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11689. (sameSemVer && differentDirectionsInclusive) ||
  11690. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11691. }
  11692. exports.Range = Range
  11693. function Range (range, options) {
  11694. if (!options || typeof options !== 'object') {
  11695. options = {
  11696. loose: !!options,
  11697. includePrerelease: false
  11698. }
  11699. }
  11700. if (range instanceof Range) {
  11701. if (range.loose === !!options.loose &&
  11702. range.includePrerelease === !!options.includePrerelease) {
  11703. return range
  11704. } else {
  11705. return new Range(range.raw, options)
  11706. }
  11707. }
  11708. if (range instanceof Comparator) {
  11709. return new Range(range.value, options)
  11710. }
  11711. if (!(this instanceof Range)) {
  11712. return new Range(range, options)
  11713. }
  11714. this.options = options
  11715. this.loose = !!options.loose
  11716. this.includePrerelease = !!options.includePrerelease
  11717. // First reduce all whitespace as much as possible so we do not have to rely
  11718. // on potentially slow regexes like \s*. This is then stored and used for
  11719. // future error messages as well.
  11720. this.raw = range
  11721. .trim()
  11722. .split(/\s+/)
  11723. .join(' ')
  11724. // First, split based on boolean or ||
  11725. this.set = this.raw.split('||').map(function (range) {
  11726. return this.parseRange(range.trim())
  11727. }, this).filter(function (c) {
  11728. // throw out any that are not relevant for whatever reason
  11729. return c.length
  11730. })
  11731. if (!this.set.length) {
  11732. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  11733. }
  11734. this.format()
  11735. }
  11736. Range.prototype.format = function () {
  11737. this.range = this.set.map(function (comps) {
  11738. return comps.join(' ').trim()
  11739. }).join('||').trim()
  11740. return this.range
  11741. }
  11742. Range.prototype.toString = function () {
  11743. return this.range
  11744. }
  11745. Range.prototype.parseRange = function (range) {
  11746. var loose = this.options.loose
  11747. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11748. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  11749. range = range.replace(hr, hyphenReplace)
  11750. debug('hyphen replace', range)
  11751. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11752. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  11753. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  11754. // `~ 1.2.3` => `~1.2.3`
  11755. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  11756. // `^ 1.2.3` => `^1.2.3`
  11757. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  11758. // normalize spaces
  11759. range = range.split(/\s+/).join(' ')
  11760. // At this point, the range is completely trimmed and
  11761. // ready to be split into comparators.
  11762. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11763. var set = range.split(' ').map(function (comp) {
  11764. return parseComparator(comp, this.options)
  11765. }, this).join(' ').split(/\s+/)
  11766. if (this.options.loose) {
  11767. // in loose mode, throw out any that are not valid comparators
  11768. set = set.filter(function (comp) {
  11769. return !!comp.match(compRe)
  11770. })
  11771. }
  11772. set = set.map(function (comp) {
  11773. return new Comparator(comp, this.options)
  11774. }, this)
  11775. return set
  11776. }
  11777. Range.prototype.intersects = function (range, options) {
  11778. if (!(range instanceof Range)) {
  11779. throw new TypeError('a Range is required')
  11780. }
  11781. return this.set.some(function (thisComparators) {
  11782. return (
  11783. isSatisfiable(thisComparators, options) &&
  11784. range.set.some(function (rangeComparators) {
  11785. return (
  11786. isSatisfiable(rangeComparators, options) &&
  11787. thisComparators.every(function (thisComparator) {
  11788. return rangeComparators.every(function (rangeComparator) {
  11789. return thisComparator.intersects(rangeComparator, options)
  11790. })
  11791. })
  11792. )
  11793. })
  11794. )
  11795. })
  11796. }
  11797. // take a set of comparators and determine whether there
  11798. // exists a version which can satisfy it
  11799. function isSatisfiable (comparators, options) {
  11800. var result = true
  11801. var remainingComparators = comparators.slice()
  11802. var testComparator = remainingComparators.pop()
  11803. while (result && remainingComparators.length) {
  11804. result = remainingComparators.every(function (otherComparator) {
  11805. return testComparator.intersects(otherComparator, options)
  11806. })
  11807. testComparator = remainingComparators.pop()
  11808. }
  11809. return result
  11810. }
  11811. // Mostly just for testing and legacy API reasons
  11812. exports.toComparators = toComparators
  11813. function toComparators (range, options) {
  11814. return new Range(range, options).set.map(function (comp) {
  11815. return comp.map(function (c) {
  11816. return c.value
  11817. }).join(' ').trim().split(' ')
  11818. })
  11819. }
  11820. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11821. // already replaced the hyphen ranges
  11822. // turn into a set of JUST comparators.
  11823. function parseComparator (comp, options) {
  11824. debug('comp', comp, options)
  11825. comp = replaceCarets(comp, options)
  11826. debug('caret', comp)
  11827. comp = replaceTildes(comp, options)
  11828. debug('tildes', comp)
  11829. comp = replaceXRanges(comp, options)
  11830. debug('xrange', comp)
  11831. comp = replaceStars(comp, options)
  11832. debug('stars', comp)
  11833. return comp
  11834. }
  11835. function isX (id) {
  11836. return !id || id.toLowerCase() === 'x' || id === '*'
  11837. }
  11838. // ~, ~> --> * (any, kinda silly)
  11839. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11840. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11841. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11842. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11843. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11844. function replaceTildes (comp, options) {
  11845. return comp.trim().split(/\s+/).map(function (comp) {
  11846. return replaceTilde(comp, options)
  11847. }).join(' ')
  11848. }
  11849. function replaceTilde (comp, options) {
  11850. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  11851. return comp.replace(r, function (_, M, m, p, pr) {
  11852. debug('tilde', comp, _, M, m, p, pr)
  11853. var ret
  11854. if (isX(M)) {
  11855. ret = ''
  11856. } else if (isX(m)) {
  11857. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11858. } else if (isX(p)) {
  11859. // ~1.2 == >=1.2.0 <1.3.0
  11860. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11861. } else if (pr) {
  11862. debug('replaceTilde pr', pr)
  11863. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11864. ' <' + M + '.' + (+m + 1) + '.0'
  11865. } else {
  11866. // ~1.2.3 == >=1.2.3 <1.3.0
  11867. ret = '>=' + M + '.' + m + '.' + p +
  11868. ' <' + M + '.' + (+m + 1) + '.0'
  11869. }
  11870. debug('tilde return', ret)
  11871. return ret
  11872. })
  11873. }
  11874. // ^ --> * (any, kinda silly)
  11875. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11876. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11877. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11878. // ^1.2.3 --> >=1.2.3 <2.0.0
  11879. // ^1.2.0 --> >=1.2.0 <2.0.0
  11880. function replaceCarets (comp, options) {
  11881. return comp.trim().split(/\s+/).map(function (comp) {
  11882. return replaceCaret(comp, options)
  11883. }).join(' ')
  11884. }
  11885. function replaceCaret (comp, options) {
  11886. debug('caret', comp, options)
  11887. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  11888. return comp.replace(r, function (_, M, m, p, pr) {
  11889. debug('caret', comp, _, M, m, p, pr)
  11890. var ret
  11891. if (isX(M)) {
  11892. ret = ''
  11893. } else if (isX(m)) {
  11894. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11895. } else if (isX(p)) {
  11896. if (M === '0') {
  11897. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11898. } else {
  11899. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11900. }
  11901. } else if (pr) {
  11902. debug('replaceCaret pr', pr)
  11903. if (M === '0') {
  11904. if (m === '0') {
  11905. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11906. ' <' + M + '.' + m + '.' + (+p + 1)
  11907. } else {
  11908. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11909. ' <' + M + '.' + (+m + 1) + '.0'
  11910. }
  11911. } else {
  11912. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11913. ' <' + (+M + 1) + '.0.0'
  11914. }
  11915. } else {
  11916. debug('no pr')
  11917. if (M === '0') {
  11918. if (m === '0') {
  11919. ret = '>=' + M + '.' + m + '.' + p +
  11920. ' <' + M + '.' + m + '.' + (+p + 1)
  11921. } else {
  11922. ret = '>=' + M + '.' + m + '.' + p +
  11923. ' <' + M + '.' + (+m + 1) + '.0'
  11924. }
  11925. } else {
  11926. ret = '>=' + M + '.' + m + '.' + p +
  11927. ' <' + (+M + 1) + '.0.0'
  11928. }
  11929. }
  11930. debug('caret return', ret)
  11931. return ret
  11932. })
  11933. }
  11934. function replaceXRanges (comp, options) {
  11935. debug('replaceXRanges', comp, options)
  11936. return comp.split(/\s+/).map(function (comp) {
  11937. return replaceXRange(comp, options)
  11938. }).join(' ')
  11939. }
  11940. function replaceXRange (comp, options) {
  11941. comp = comp.trim()
  11942. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  11943. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11944. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11945. var xM = isX(M)
  11946. var xm = xM || isX(m)
  11947. var xp = xm || isX(p)
  11948. var anyX = xp
  11949. if (gtlt === '=' && anyX) {
  11950. gtlt = ''
  11951. }
  11952. // if we're including prereleases in the match, then we need
  11953. // to fix this to -0, the lowest possible prerelease value
  11954. pr = options.includePrerelease ? '-0' : ''
  11955. if (xM) {
  11956. if (gtlt === '>' || gtlt === '<') {
  11957. // nothing is allowed
  11958. ret = '<0.0.0-0'
  11959. } else {
  11960. // nothing is forbidden
  11961. ret = '*'
  11962. }
  11963. } else if (gtlt && anyX) {
  11964. // we know patch is an x, because we have any x at all.
  11965. // replace X with 0
  11966. if (xm) {
  11967. m = 0
  11968. }
  11969. p = 0
  11970. if (gtlt === '>') {
  11971. // >1 => >=2.0.0
  11972. // >1.2 => >=1.3.0
  11973. // >1.2.3 => >= 1.2.4
  11974. gtlt = '>='
  11975. if (xm) {
  11976. M = +M + 1
  11977. m = 0
  11978. p = 0
  11979. } else {
  11980. m = +m + 1
  11981. p = 0
  11982. }
  11983. } else if (gtlt === '<=') {
  11984. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11985. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11986. gtlt = '<'
  11987. if (xm) {
  11988. M = +M + 1
  11989. } else {
  11990. m = +m + 1
  11991. }
  11992. }
  11993. ret = gtlt + M + '.' + m + '.' + p + pr
  11994. } else if (xm) {
  11995. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11996. } else if (xp) {
  11997. ret = '>=' + M + '.' + m + '.0' + pr +
  11998. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11999. }
  12000. debug('xRange return', ret)
  12001. return ret
  12002. })
  12003. }
  12004. // Because * is AND-ed with everything else in the comparator,
  12005. // and '' means "any version", just remove the *s entirely.
  12006. function replaceStars (comp, options) {
  12007. debug('replaceStars', comp, options)
  12008. // Looseness is ignored here. star is always as loose as it gets!
  12009. return comp.trim().replace(safeRe[t.STAR], '')
  12010. }
  12011. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12012. // M, m, patch, prerelease, build
  12013. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12014. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12015. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12016. function hyphenReplace ($0,
  12017. from, fM, fm, fp, fpr, fb,
  12018. to, tM, tm, tp, tpr, tb) {
  12019. if (isX(fM)) {
  12020. from = ''
  12021. } else if (isX(fm)) {
  12022. from = '>=' + fM + '.0.0'
  12023. } else if (isX(fp)) {
  12024. from = '>=' + fM + '.' + fm + '.0'
  12025. } else {
  12026. from = '>=' + from
  12027. }
  12028. if (isX(tM)) {
  12029. to = ''
  12030. } else if (isX(tm)) {
  12031. to = '<' + (+tM + 1) + '.0.0'
  12032. } else if (isX(tp)) {
  12033. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12034. } else if (tpr) {
  12035. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12036. } else {
  12037. to = '<=' + to
  12038. }
  12039. return (from + ' ' + to).trim()
  12040. }
  12041. // if ANY of the sets match ALL of its comparators, then pass
  12042. Range.prototype.test = function (version) {
  12043. if (!version) {
  12044. return false
  12045. }
  12046. if (typeof version === 'string') {
  12047. try {
  12048. version = new SemVer(version, this.options)
  12049. } catch (er) {
  12050. return false
  12051. }
  12052. }
  12053. for (var i = 0; i < this.set.length; i++) {
  12054. if (testSet(this.set[i], version, this.options)) {
  12055. return true
  12056. }
  12057. }
  12058. return false
  12059. }
  12060. function testSet (set, version, options) {
  12061. for (var i = 0; i < set.length; i++) {
  12062. if (!set[i].test(version)) {
  12063. return false
  12064. }
  12065. }
  12066. if (version.prerelease.length && !options.includePrerelease) {
  12067. // Find the set of versions that are allowed to have prereleases
  12068. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12069. // That should allow `1.2.3-pr.2` to pass.
  12070. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12071. // even though it's within the range set by the comparators.
  12072. for (i = 0; i < set.length; i++) {
  12073. debug(set[i].semver)
  12074. if (set[i].semver === ANY) {
  12075. continue
  12076. }
  12077. if (set[i].semver.prerelease.length > 0) {
  12078. var allowed = set[i].semver
  12079. if (allowed.major === version.major &&
  12080. allowed.minor === version.minor &&
  12081. allowed.patch === version.patch) {
  12082. return true
  12083. }
  12084. }
  12085. }
  12086. // Version has a -pre, but it's not one of the ones we like.
  12087. return false
  12088. }
  12089. return true
  12090. }
  12091. exports.satisfies = satisfies
  12092. function satisfies (version, range, options) {
  12093. try {
  12094. range = new Range(range, options)
  12095. } catch (er) {
  12096. return false
  12097. }
  12098. return range.test(version)
  12099. }
  12100. exports.maxSatisfying = maxSatisfying
  12101. function maxSatisfying (versions, range, options) {
  12102. var max = null
  12103. var maxSV = null
  12104. try {
  12105. var rangeObj = new Range(range, options)
  12106. } catch (er) {
  12107. return null
  12108. }
  12109. versions.forEach(function (v) {
  12110. if (rangeObj.test(v)) {
  12111. // satisfies(v, range, options)
  12112. if (!max || maxSV.compare(v) === -1) {
  12113. // compare(max, v, true)
  12114. max = v
  12115. maxSV = new SemVer(max, options)
  12116. }
  12117. }
  12118. })
  12119. return max
  12120. }
  12121. exports.minSatisfying = minSatisfying
  12122. function minSatisfying (versions, range, options) {
  12123. var min = null
  12124. var minSV = null
  12125. try {
  12126. var rangeObj = new Range(range, options)
  12127. } catch (er) {
  12128. return null
  12129. }
  12130. versions.forEach(function (v) {
  12131. if (rangeObj.test(v)) {
  12132. // satisfies(v, range, options)
  12133. if (!min || minSV.compare(v) === 1) {
  12134. // compare(min, v, true)
  12135. min = v
  12136. minSV = new SemVer(min, options)
  12137. }
  12138. }
  12139. })
  12140. return min
  12141. }
  12142. exports.minVersion = minVersion
  12143. function minVersion (range, loose) {
  12144. range = new Range(range, loose)
  12145. var minver = new SemVer('0.0.0')
  12146. if (range.test(minver)) {
  12147. return minver
  12148. }
  12149. minver = new SemVer('0.0.0-0')
  12150. if (range.test(minver)) {
  12151. return minver
  12152. }
  12153. minver = null
  12154. for (var i = 0; i < range.set.length; ++i) {
  12155. var comparators = range.set[i]
  12156. comparators.forEach(function (comparator) {
  12157. // Clone to avoid manipulating the comparator's semver object.
  12158. var compver = new SemVer(comparator.semver.version)
  12159. switch (comparator.operator) {
  12160. case '>':
  12161. if (compver.prerelease.length === 0) {
  12162. compver.patch++
  12163. } else {
  12164. compver.prerelease.push(0)
  12165. }
  12166. compver.raw = compver.format()
  12167. /* fallthrough */
  12168. case '':
  12169. case '>=':
  12170. if (!minver || gt(minver, compver)) {
  12171. minver = compver
  12172. }
  12173. break
  12174. case '<':
  12175. case '<=':
  12176. /* Ignore maximum versions */
  12177. break
  12178. /* istanbul ignore next */
  12179. default:
  12180. throw new Error('Unexpected operation: ' + comparator.operator)
  12181. }
  12182. })
  12183. }
  12184. if (minver && range.test(minver)) {
  12185. return minver
  12186. }
  12187. return null
  12188. }
  12189. exports.validRange = validRange
  12190. function validRange (range, options) {
  12191. try {
  12192. // Return '*' instead of '' so that truthiness works.
  12193. // This will throw if it's invalid anyway
  12194. return new Range(range, options).range || '*'
  12195. } catch (er) {
  12196. return null
  12197. }
  12198. }
  12199. // Determine if version is less than all the versions possible in the range
  12200. exports.ltr = ltr
  12201. function ltr (version, range, options) {
  12202. return outside(version, range, '<', options)
  12203. }
  12204. // Determine if version is greater than all the versions possible in the range.
  12205. exports.gtr = gtr
  12206. function gtr (version, range, options) {
  12207. return outside(version, range, '>', options)
  12208. }
  12209. exports.outside = outside
  12210. function outside (version, range, hilo, options) {
  12211. version = new SemVer(version, options)
  12212. range = new Range(range, options)
  12213. var gtfn, ltefn, ltfn, comp, ecomp
  12214. switch (hilo) {
  12215. case '>':
  12216. gtfn = gt
  12217. ltefn = lte
  12218. ltfn = lt
  12219. comp = '>'
  12220. ecomp = '>='
  12221. break
  12222. case '<':
  12223. gtfn = lt
  12224. ltefn = gte
  12225. ltfn = gt
  12226. comp = '<'
  12227. ecomp = '<='
  12228. break
  12229. default:
  12230. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12231. }
  12232. // If it satisifes the range it is not outside
  12233. if (satisfies(version, range, options)) {
  12234. return false
  12235. }
  12236. // From now on, variable terms are as if we're in "gtr" mode.
  12237. // but note that everything is flipped for the "ltr" function.
  12238. for (var i = 0; i < range.set.length; ++i) {
  12239. var comparators = range.set[i]
  12240. var high = null
  12241. var low = null
  12242. comparators.forEach(function (comparator) {
  12243. if (comparator.semver === ANY) {
  12244. comparator = new Comparator('>=0.0.0')
  12245. }
  12246. high = high || comparator
  12247. low = low || comparator
  12248. if (gtfn(comparator.semver, high.semver, options)) {
  12249. high = comparator
  12250. } else if (ltfn(comparator.semver, low.semver, options)) {
  12251. low = comparator
  12252. }
  12253. })
  12254. // If the edge version comparator has a operator then our version
  12255. // isn't outside it
  12256. if (high.operator === comp || high.operator === ecomp) {
  12257. return false
  12258. }
  12259. // If the lowest version comparator has an operator and our version
  12260. // is less than it then it isn't higher than the range
  12261. if ((!low.operator || low.operator === comp) &&
  12262. ltefn(version, low.semver)) {
  12263. return false
  12264. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12265. return false
  12266. }
  12267. }
  12268. return true
  12269. }
  12270. exports.prerelease = prerelease
  12271. function prerelease (version, options) {
  12272. var parsed = parse(version, options)
  12273. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12274. }
  12275. exports.intersects = intersects
  12276. function intersects (r1, r2, options) {
  12277. r1 = new Range(r1, options)
  12278. r2 = new Range(r2, options)
  12279. return r1.intersects(r2)
  12280. }
  12281. exports.coerce = coerce
  12282. function coerce (version, options) {
  12283. if (version instanceof SemVer) {
  12284. return version
  12285. }
  12286. if (typeof version === 'number') {
  12287. version = String(version)
  12288. }
  12289. if (typeof version !== 'string') {
  12290. return null
  12291. }
  12292. options = options || {}
  12293. var match = null
  12294. if (!options.rtl) {
  12295. match = version.match(safeRe[t.COERCE])
  12296. } else {
  12297. // Find the right-most coercible string that does not share
  12298. // a terminus with a more left-ward coercible string.
  12299. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12300. //
  12301. // Walk through the string checking with a /g regexp
  12302. // Manually set the index so as to pick up overlapping matches.
  12303. // Stop when we get a match that ends at the string end, since no
  12304. // coercible string can be more right-ward without the same terminus.
  12305. var next
  12306. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12307. (!match || match.index + match[0].length !== version.length)
  12308. ) {
  12309. if (!match ||
  12310. next.index + next[0].length !== match.index + match[0].length) {
  12311. match = next
  12312. }
  12313. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12314. }
  12315. // leave it in a clean state
  12316. safeRe[t.COERCERTL].lastIndex = -1
  12317. }
  12318. if (match === null) {
  12319. return null
  12320. }
  12321. return parse(match[2] +
  12322. '.' + (match[3] || '0') +
  12323. '.' + (match[4] || '0'), options)
  12324. }
  12325. /***/ }),
  12326. /***/ 4294:
  12327. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12328. module.exports = __nccwpck_require__(4219);
  12329. /***/ }),
  12330. /***/ 4219:
  12331. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12332. "use strict";
  12333. var net = __nccwpck_require__(1808);
  12334. var tls = __nccwpck_require__(4404);
  12335. var http = __nccwpck_require__(3685);
  12336. var https = __nccwpck_require__(5687);
  12337. var events = __nccwpck_require__(2361);
  12338. var assert = __nccwpck_require__(9491);
  12339. var util = __nccwpck_require__(3837);
  12340. exports.httpOverHttp = httpOverHttp;
  12341. exports.httpsOverHttp = httpsOverHttp;
  12342. exports.httpOverHttps = httpOverHttps;
  12343. exports.httpsOverHttps = httpsOverHttps;
  12344. function httpOverHttp(options) {
  12345. var agent = new TunnelingAgent(options);
  12346. agent.request = http.request;
  12347. return agent;
  12348. }
  12349. function httpsOverHttp(options) {
  12350. var agent = new TunnelingAgent(options);
  12351. agent.request = http.request;
  12352. agent.createSocket = createSecureSocket;
  12353. agent.defaultPort = 443;
  12354. return agent;
  12355. }
  12356. function httpOverHttps(options) {
  12357. var agent = new TunnelingAgent(options);
  12358. agent.request = https.request;
  12359. return agent;
  12360. }
  12361. function httpsOverHttps(options) {
  12362. var agent = new TunnelingAgent(options);
  12363. agent.request = https.request;
  12364. agent.createSocket = createSecureSocket;
  12365. agent.defaultPort = 443;
  12366. return agent;
  12367. }
  12368. function TunnelingAgent(options) {
  12369. var self = this;
  12370. self.options = options || {};
  12371. self.proxyOptions = self.options.proxy || {};
  12372. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12373. self.requests = [];
  12374. self.sockets = [];
  12375. self.on('free', function onFree(socket, host, port, localAddress) {
  12376. var options = toOptions(host, port, localAddress);
  12377. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12378. var pending = self.requests[i];
  12379. if (pending.host === options.host && pending.port === options.port) {
  12380. // Detect the request to connect same origin server,
  12381. // reuse the connection.
  12382. self.requests.splice(i, 1);
  12383. pending.request.onSocket(socket);
  12384. return;
  12385. }
  12386. }
  12387. socket.destroy();
  12388. self.removeSocket(socket);
  12389. });
  12390. }
  12391. util.inherits(TunnelingAgent, events.EventEmitter);
  12392. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12393. var self = this;
  12394. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12395. if (self.sockets.length >= this.maxSockets) {
  12396. // We are over limit so we'll add it to the queue.
  12397. self.requests.push(options);
  12398. return;
  12399. }
  12400. // If we are under maxSockets create a new one.
  12401. self.createSocket(options, function(socket) {
  12402. socket.on('free', onFree);
  12403. socket.on('close', onCloseOrRemove);
  12404. socket.on('agentRemove', onCloseOrRemove);
  12405. req.onSocket(socket);
  12406. function onFree() {
  12407. self.emit('free', socket, options);
  12408. }
  12409. function onCloseOrRemove(err) {
  12410. self.removeSocket(socket);
  12411. socket.removeListener('free', onFree);
  12412. socket.removeListener('close', onCloseOrRemove);
  12413. socket.removeListener('agentRemove', onCloseOrRemove);
  12414. }
  12415. });
  12416. };
  12417. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12418. var self = this;
  12419. var placeholder = {};
  12420. self.sockets.push(placeholder);
  12421. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12422. method: 'CONNECT',
  12423. path: options.host + ':' + options.port,
  12424. agent: false,
  12425. headers: {
  12426. host: options.host + ':' + options.port
  12427. }
  12428. });
  12429. if (options.localAddress) {
  12430. connectOptions.localAddress = options.localAddress;
  12431. }
  12432. if (connectOptions.proxyAuth) {
  12433. connectOptions.headers = connectOptions.headers || {};
  12434. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12435. new Buffer(connectOptions.proxyAuth).toString('base64');
  12436. }
  12437. debug('making CONNECT request');
  12438. var connectReq = self.request(connectOptions);
  12439. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12440. connectReq.once('response', onResponse); // for v0.6
  12441. connectReq.once('upgrade', onUpgrade); // for v0.6
  12442. connectReq.once('connect', onConnect); // for v0.7 or later
  12443. connectReq.once('error', onError);
  12444. connectReq.end();
  12445. function onResponse(res) {
  12446. // Very hacky. This is necessary to avoid http-parser leaks.
  12447. res.upgrade = true;
  12448. }
  12449. function onUpgrade(res, socket, head) {
  12450. // Hacky.
  12451. process.nextTick(function() {
  12452. onConnect(res, socket, head);
  12453. });
  12454. }
  12455. function onConnect(res, socket, head) {
  12456. connectReq.removeAllListeners();
  12457. socket.removeAllListeners();
  12458. if (res.statusCode !== 200) {
  12459. debug('tunneling socket could not be established, statusCode=%d',
  12460. res.statusCode);
  12461. socket.destroy();
  12462. var error = new Error('tunneling socket could not be established, ' +
  12463. 'statusCode=' + res.statusCode);
  12464. error.code = 'ECONNRESET';
  12465. options.request.emit('error', error);
  12466. self.removeSocket(placeholder);
  12467. return;
  12468. }
  12469. if (head.length > 0) {
  12470. debug('got illegal response body from proxy');
  12471. socket.destroy();
  12472. var error = new Error('got illegal response body from proxy');
  12473. error.code = 'ECONNRESET';
  12474. options.request.emit('error', error);
  12475. self.removeSocket(placeholder);
  12476. return;
  12477. }
  12478. debug('tunneling connection has established');
  12479. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12480. return cb(socket);
  12481. }
  12482. function onError(cause) {
  12483. connectReq.removeAllListeners();
  12484. debug('tunneling socket could not be established, cause=%s\n',
  12485. cause.message, cause.stack);
  12486. var error = new Error('tunneling socket could not be established, ' +
  12487. 'cause=' + cause.message);
  12488. error.code = 'ECONNRESET';
  12489. options.request.emit('error', error);
  12490. self.removeSocket(placeholder);
  12491. }
  12492. };
  12493. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12494. var pos = this.sockets.indexOf(socket)
  12495. if (pos === -1) {
  12496. return;
  12497. }
  12498. this.sockets.splice(pos, 1);
  12499. var pending = this.requests.shift();
  12500. if (pending) {
  12501. // If we have pending requests and a socket gets closed a new one
  12502. // needs to be created to take over in the pool for the one that closed.
  12503. this.createSocket(pending, function(socket) {
  12504. pending.request.onSocket(socket);
  12505. });
  12506. }
  12507. };
  12508. function createSecureSocket(options, cb) {
  12509. var self = this;
  12510. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12511. var hostHeader = options.request.getHeader('host');
  12512. var tlsOptions = mergeOptions({}, self.options, {
  12513. socket: socket,
  12514. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12515. });
  12516. // 0 is dummy port for v0.6
  12517. var secureSocket = tls.connect(0, tlsOptions);
  12518. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12519. cb(secureSocket);
  12520. });
  12521. }
  12522. function toOptions(host, port, localAddress) {
  12523. if (typeof host === 'string') { // since v0.10
  12524. return {
  12525. host: host,
  12526. port: port,
  12527. localAddress: localAddress
  12528. };
  12529. }
  12530. return host; // for v0.11 or later
  12531. }
  12532. function mergeOptions(target) {
  12533. for (var i = 1, len = arguments.length; i < len; ++i) {
  12534. var overrides = arguments[i];
  12535. if (typeof overrides === 'object') {
  12536. var keys = Object.keys(overrides);
  12537. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12538. var k = keys[j];
  12539. if (overrides[k] !== undefined) {
  12540. target[k] = overrides[k];
  12541. }
  12542. }
  12543. }
  12544. }
  12545. return target;
  12546. }
  12547. var debug;
  12548. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12549. debug = function() {
  12550. var args = Array.prototype.slice.call(arguments);
  12551. if (typeof args[0] === 'string') {
  12552. args[0] = 'TUNNEL: ' + args[0];
  12553. } else {
  12554. args.unshift('TUNNEL:');
  12555. }
  12556. console.error.apply(console, args);
  12557. }
  12558. } else {
  12559. debug = function() {};
  12560. }
  12561. exports.debug = debug; // for test
  12562. /***/ }),
  12563. /***/ 1773:
  12564. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12565. "use strict";
  12566. const Client = __nccwpck_require__(3598)
  12567. const Dispatcher = __nccwpck_require__(412)
  12568. const errors = __nccwpck_require__(8045)
  12569. const Pool = __nccwpck_require__(4634)
  12570. const BalancedPool = __nccwpck_require__(7931)
  12571. const Agent = __nccwpck_require__(7890)
  12572. const util = __nccwpck_require__(3983)
  12573. const { InvalidArgumentError } = errors
  12574. const api = __nccwpck_require__(4059)
  12575. const buildConnector = __nccwpck_require__(2067)
  12576. const MockClient = __nccwpck_require__(8687)
  12577. const MockAgent = __nccwpck_require__(6771)
  12578. const MockPool = __nccwpck_require__(6193)
  12579. const mockErrors = __nccwpck_require__(888)
  12580. const ProxyAgent = __nccwpck_require__(7858)
  12581. const RetryHandler = __nccwpck_require__(2286)
  12582. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12583. const DecoratorHandler = __nccwpck_require__(6930)
  12584. const RedirectHandler = __nccwpck_require__(2860)
  12585. const createRedirectInterceptor = __nccwpck_require__(8861)
  12586. let hasCrypto
  12587. try {
  12588. __nccwpck_require__(6113)
  12589. hasCrypto = true
  12590. } catch {
  12591. hasCrypto = false
  12592. }
  12593. Object.assign(Dispatcher.prototype, api)
  12594. module.exports.Dispatcher = Dispatcher
  12595. module.exports.Client = Client
  12596. module.exports.Pool = Pool
  12597. module.exports.BalancedPool = BalancedPool
  12598. module.exports.Agent = Agent
  12599. module.exports.ProxyAgent = ProxyAgent
  12600. module.exports.RetryHandler = RetryHandler
  12601. module.exports.DecoratorHandler = DecoratorHandler
  12602. module.exports.RedirectHandler = RedirectHandler
  12603. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12604. module.exports.buildConnector = buildConnector
  12605. module.exports.errors = errors
  12606. function makeDispatcher (fn) {
  12607. return (url, opts, handler) => {
  12608. if (typeof opts === 'function') {
  12609. handler = opts
  12610. opts = null
  12611. }
  12612. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12613. throw new InvalidArgumentError('invalid url')
  12614. }
  12615. if (opts != null && typeof opts !== 'object') {
  12616. throw new InvalidArgumentError('invalid opts')
  12617. }
  12618. if (opts && opts.path != null) {
  12619. if (typeof opts.path !== 'string') {
  12620. throw new InvalidArgumentError('invalid opts.path')
  12621. }
  12622. let path = opts.path
  12623. if (!opts.path.startsWith('/')) {
  12624. path = `/${path}`
  12625. }
  12626. url = new URL(util.parseOrigin(url).origin + path)
  12627. } else {
  12628. if (!opts) {
  12629. opts = typeof url === 'object' ? url : {}
  12630. }
  12631. url = util.parseURL(url)
  12632. }
  12633. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12634. if (agent) {
  12635. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12636. }
  12637. return fn.call(dispatcher, {
  12638. ...opts,
  12639. origin: url.origin,
  12640. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12641. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12642. }, handler)
  12643. }
  12644. }
  12645. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12646. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12647. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12648. let fetchImpl = null
  12649. module.exports.fetch = async function fetch (resource) {
  12650. if (!fetchImpl) {
  12651. fetchImpl = (__nccwpck_require__(4881).fetch)
  12652. }
  12653. try {
  12654. return await fetchImpl(...arguments)
  12655. } catch (err) {
  12656. if (typeof err === 'object') {
  12657. Error.captureStackTrace(err, this)
  12658. }
  12659. throw err
  12660. }
  12661. }
  12662. module.exports.Headers = __nccwpck_require__(554).Headers
  12663. module.exports.Response = __nccwpck_require__(7823).Response
  12664. module.exports.Request = __nccwpck_require__(8359).Request
  12665. module.exports.FormData = __nccwpck_require__(2015).FormData
  12666. module.exports.File = __nccwpck_require__(8511).File
  12667. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12668. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12669. module.exports.setGlobalOrigin = setGlobalOrigin
  12670. module.exports.getGlobalOrigin = getGlobalOrigin
  12671. const { CacheStorage } = __nccwpck_require__(7907)
  12672. const { kConstruct } = __nccwpck_require__(9174)
  12673. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12674. // in an older version of Node, it doesn't have any use without fetch.
  12675. module.exports.caches = new CacheStorage(kConstruct)
  12676. }
  12677. if (util.nodeMajor >= 16) {
  12678. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12679. module.exports.deleteCookie = deleteCookie
  12680. module.exports.getCookies = getCookies
  12681. module.exports.getSetCookies = getSetCookies
  12682. module.exports.setCookie = setCookie
  12683. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12684. module.exports.parseMIMEType = parseMIMEType
  12685. module.exports.serializeAMimeType = serializeAMimeType
  12686. }
  12687. if (util.nodeMajor >= 18 && hasCrypto) {
  12688. const { WebSocket } = __nccwpck_require__(4284)
  12689. module.exports.WebSocket = WebSocket
  12690. }
  12691. module.exports.request = makeDispatcher(api.request)
  12692. module.exports.stream = makeDispatcher(api.stream)
  12693. module.exports.pipeline = makeDispatcher(api.pipeline)
  12694. module.exports.connect = makeDispatcher(api.connect)
  12695. module.exports.upgrade = makeDispatcher(api.upgrade)
  12696. module.exports.MockClient = MockClient
  12697. module.exports.MockPool = MockPool
  12698. module.exports.MockAgent = MockAgent
  12699. module.exports.mockErrors = mockErrors
  12700. /***/ }),
  12701. /***/ 7890:
  12702. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12703. "use strict";
  12704. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12705. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12706. const DispatcherBase = __nccwpck_require__(4839)
  12707. const Pool = __nccwpck_require__(4634)
  12708. const Client = __nccwpck_require__(3598)
  12709. const util = __nccwpck_require__(3983)
  12710. const createRedirectInterceptor = __nccwpck_require__(8861)
  12711. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12712. const kOnConnect = Symbol('onConnect')
  12713. const kOnDisconnect = Symbol('onDisconnect')
  12714. const kOnConnectionError = Symbol('onConnectionError')
  12715. const kMaxRedirections = Symbol('maxRedirections')
  12716. const kOnDrain = Symbol('onDrain')
  12717. const kFactory = Symbol('factory')
  12718. const kFinalizer = Symbol('finalizer')
  12719. const kOptions = Symbol('options')
  12720. function defaultFactory (origin, opts) {
  12721. return opts && opts.connections === 1
  12722. ? new Client(origin, opts)
  12723. : new Pool(origin, opts)
  12724. }
  12725. class Agent extends DispatcherBase {
  12726. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  12727. super()
  12728. if (typeof factory !== 'function') {
  12729. throw new InvalidArgumentError('factory must be a function.')
  12730. }
  12731. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  12732. throw new InvalidArgumentError('connect must be a function or an object')
  12733. }
  12734. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  12735. throw new InvalidArgumentError('maxRedirections must be a positive number')
  12736. }
  12737. if (connect && typeof connect !== 'function') {
  12738. connect = { ...connect }
  12739. }
  12740. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  12741. ? options.interceptors.Agent
  12742. : [createRedirectInterceptor({ maxRedirections })]
  12743. this[kOptions] = { ...util.deepClone(options), connect }
  12744. this[kOptions].interceptors = options.interceptors
  12745. ? { ...options.interceptors }
  12746. : undefined
  12747. this[kMaxRedirections] = maxRedirections
  12748. this[kFactory] = factory
  12749. this[kClients] = new Map()
  12750. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  12751. const ref = this[kClients].get(key)
  12752. if (ref !== undefined && ref.deref() === undefined) {
  12753. this[kClients].delete(key)
  12754. }
  12755. })
  12756. const agent = this
  12757. this[kOnDrain] = (origin, targets) => {
  12758. agent.emit('drain', origin, [agent, ...targets])
  12759. }
  12760. this[kOnConnect] = (origin, targets) => {
  12761. agent.emit('connect', origin, [agent, ...targets])
  12762. }
  12763. this[kOnDisconnect] = (origin, targets, err) => {
  12764. agent.emit('disconnect', origin, [agent, ...targets], err)
  12765. }
  12766. this[kOnConnectionError] = (origin, targets, err) => {
  12767. agent.emit('connectionError', origin, [agent, ...targets], err)
  12768. }
  12769. }
  12770. get [kRunning] () {
  12771. let ret = 0
  12772. for (const ref of this[kClients].values()) {
  12773. const client = ref.deref()
  12774. /* istanbul ignore next: gc is undeterministic */
  12775. if (client) {
  12776. ret += client[kRunning]
  12777. }
  12778. }
  12779. return ret
  12780. }
  12781. [kDispatch] (opts, handler) {
  12782. let key
  12783. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  12784. key = String(opts.origin)
  12785. } else {
  12786. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  12787. }
  12788. const ref = this[kClients].get(key)
  12789. let dispatcher = ref ? ref.deref() : null
  12790. if (!dispatcher) {
  12791. dispatcher = this[kFactory](opts.origin, this[kOptions])
  12792. .on('drain', this[kOnDrain])
  12793. .on('connect', this[kOnConnect])
  12794. .on('disconnect', this[kOnDisconnect])
  12795. .on('connectionError', this[kOnConnectionError])
  12796. this[kClients].set(key, new WeakRef(dispatcher))
  12797. this[kFinalizer].register(dispatcher, key)
  12798. }
  12799. return dispatcher.dispatch(opts, handler)
  12800. }
  12801. async [kClose] () {
  12802. const closePromises = []
  12803. for (const ref of this[kClients].values()) {
  12804. const client = ref.deref()
  12805. /* istanbul ignore else: gc is undeterministic */
  12806. if (client) {
  12807. closePromises.push(client.close())
  12808. }
  12809. }
  12810. await Promise.all(closePromises)
  12811. }
  12812. async [kDestroy] (err) {
  12813. const destroyPromises = []
  12814. for (const ref of this[kClients].values()) {
  12815. const client = ref.deref()
  12816. /* istanbul ignore else: gc is undeterministic */
  12817. if (client) {
  12818. destroyPromises.push(client.destroy(err))
  12819. }
  12820. }
  12821. await Promise.all(destroyPromises)
  12822. }
  12823. }
  12824. module.exports = Agent
  12825. /***/ }),
  12826. /***/ 7032:
  12827. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12828. const { addAbortListener } = __nccwpck_require__(3983)
  12829. const { RequestAbortedError } = __nccwpck_require__(8045)
  12830. const kListener = Symbol('kListener')
  12831. const kSignal = Symbol('kSignal')
  12832. function abort (self) {
  12833. if (self.abort) {
  12834. self.abort()
  12835. } else {
  12836. self.onError(new RequestAbortedError())
  12837. }
  12838. }
  12839. function addSignal (self, signal) {
  12840. self[kSignal] = null
  12841. self[kListener] = null
  12842. if (!signal) {
  12843. return
  12844. }
  12845. if (signal.aborted) {
  12846. abort(self)
  12847. return
  12848. }
  12849. self[kSignal] = signal
  12850. self[kListener] = () => {
  12851. abort(self)
  12852. }
  12853. addAbortListener(self[kSignal], self[kListener])
  12854. }
  12855. function removeSignal (self) {
  12856. if (!self[kSignal]) {
  12857. return
  12858. }
  12859. if ('removeEventListener' in self[kSignal]) {
  12860. self[kSignal].removeEventListener('abort', self[kListener])
  12861. } else {
  12862. self[kSignal].removeListener('abort', self[kListener])
  12863. }
  12864. self[kSignal] = null
  12865. self[kListener] = null
  12866. }
  12867. module.exports = {
  12868. addSignal,
  12869. removeSignal
  12870. }
  12871. /***/ }),
  12872. /***/ 9744:
  12873. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12874. "use strict";
  12875. const { AsyncResource } = __nccwpck_require__(852)
  12876. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  12877. const util = __nccwpck_require__(3983)
  12878. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12879. class ConnectHandler extends AsyncResource {
  12880. constructor (opts, callback) {
  12881. if (!opts || typeof opts !== 'object') {
  12882. throw new InvalidArgumentError('invalid opts')
  12883. }
  12884. if (typeof callback !== 'function') {
  12885. throw new InvalidArgumentError('invalid callback')
  12886. }
  12887. const { signal, opaque, responseHeaders } = opts
  12888. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  12889. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  12890. }
  12891. super('UNDICI_CONNECT')
  12892. this.opaque = opaque || null
  12893. this.responseHeaders = responseHeaders || null
  12894. this.callback = callback
  12895. this.abort = null
  12896. addSignal(this, signal)
  12897. }
  12898. onConnect (abort, context) {
  12899. if (!this.callback) {
  12900. throw new RequestAbortedError()
  12901. }
  12902. this.abort = abort
  12903. this.context = context
  12904. }
  12905. onHeaders () {
  12906. throw new SocketError('bad connect', null)
  12907. }
  12908. onUpgrade (statusCode, rawHeaders, socket) {
  12909. const { callback, opaque, context } = this
  12910. removeSignal(this)
  12911. this.callback = null
  12912. let headers = rawHeaders
  12913. // Indicates is an HTTP2Session
  12914. if (headers != null) {
  12915. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  12916. }
  12917. this.runInAsyncScope(callback, null, null, {
  12918. statusCode,
  12919. headers,
  12920. socket,
  12921. opaque,
  12922. context
  12923. })
  12924. }
  12925. onError (err) {
  12926. const { callback, opaque } = this
  12927. removeSignal(this)
  12928. if (callback) {
  12929. this.callback = null
  12930. queueMicrotask(() => {
  12931. this.runInAsyncScope(callback, null, err, { opaque })
  12932. })
  12933. }
  12934. }
  12935. }
  12936. function connect (opts, callback) {
  12937. if (callback === undefined) {
  12938. return new Promise((resolve, reject) => {
  12939. connect.call(this, opts, (err, data) => {
  12940. return err ? reject(err) : resolve(data)
  12941. })
  12942. })
  12943. }
  12944. try {
  12945. const connectHandler = new ConnectHandler(opts, callback)
  12946. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  12947. } catch (err) {
  12948. if (typeof callback !== 'function') {
  12949. throw err
  12950. }
  12951. const opaque = opts && opts.opaque
  12952. queueMicrotask(() => callback(err, { opaque }))
  12953. }
  12954. }
  12955. module.exports = connect
  12956. /***/ }),
  12957. /***/ 8752:
  12958. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12959. "use strict";
  12960. const {
  12961. Readable,
  12962. Duplex,
  12963. PassThrough
  12964. } = __nccwpck_require__(2781)
  12965. const {
  12966. InvalidArgumentError,
  12967. InvalidReturnValueError,
  12968. RequestAbortedError
  12969. } = __nccwpck_require__(8045)
  12970. const util = __nccwpck_require__(3983)
  12971. const { AsyncResource } = __nccwpck_require__(852)
  12972. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12973. const assert = __nccwpck_require__(9491)
  12974. const kResume = Symbol('resume')
  12975. class PipelineRequest extends Readable {
  12976. constructor () {
  12977. super({ autoDestroy: true })
  12978. this[kResume] = null
  12979. }
  12980. _read () {
  12981. const { [kResume]: resume } = this
  12982. if (resume) {
  12983. this[kResume] = null
  12984. resume()
  12985. }
  12986. }
  12987. _destroy (err, callback) {
  12988. this._read()
  12989. callback(err)
  12990. }
  12991. }
  12992. class PipelineResponse extends Readable {
  12993. constructor (resume) {
  12994. super({ autoDestroy: true })
  12995. this[kResume] = resume
  12996. }
  12997. _read () {
  12998. this[kResume]()
  12999. }
  13000. _destroy (err, callback) {
  13001. if (!err && !this._readableState.endEmitted) {
  13002. err = new RequestAbortedError()
  13003. }
  13004. callback(err)
  13005. }
  13006. }
  13007. class PipelineHandler extends AsyncResource {
  13008. constructor (opts, handler) {
  13009. if (!opts || typeof opts !== 'object') {
  13010. throw new InvalidArgumentError('invalid opts')
  13011. }
  13012. if (typeof handler !== 'function') {
  13013. throw new InvalidArgumentError('invalid handler')
  13014. }
  13015. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13016. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13017. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13018. }
  13019. if (method === 'CONNECT') {
  13020. throw new InvalidArgumentError('invalid method')
  13021. }
  13022. if (onInfo && typeof onInfo !== 'function') {
  13023. throw new InvalidArgumentError('invalid onInfo callback')
  13024. }
  13025. super('UNDICI_PIPELINE')
  13026. this.opaque = opaque || null
  13027. this.responseHeaders = responseHeaders || null
  13028. this.handler = handler
  13029. this.abort = null
  13030. this.context = null
  13031. this.onInfo = onInfo || null
  13032. this.req = new PipelineRequest().on('error', util.nop)
  13033. this.ret = new Duplex({
  13034. readableObjectMode: opts.objectMode,
  13035. autoDestroy: true,
  13036. read: () => {
  13037. const { body } = this
  13038. if (body && body.resume) {
  13039. body.resume()
  13040. }
  13041. },
  13042. write: (chunk, encoding, callback) => {
  13043. const { req } = this
  13044. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13045. callback()
  13046. } else {
  13047. req[kResume] = callback
  13048. }
  13049. },
  13050. destroy: (err, callback) => {
  13051. const { body, req, res, ret, abort } = this
  13052. if (!err && !ret._readableState.endEmitted) {
  13053. err = new RequestAbortedError()
  13054. }
  13055. if (abort && err) {
  13056. abort()
  13057. }
  13058. util.destroy(body, err)
  13059. util.destroy(req, err)
  13060. util.destroy(res, err)
  13061. removeSignal(this)
  13062. callback(err)
  13063. }
  13064. }).on('prefinish', () => {
  13065. const { req } = this
  13066. // Node < 15 does not call _final in same tick.
  13067. req.push(null)
  13068. })
  13069. this.res = null
  13070. addSignal(this, signal)
  13071. }
  13072. onConnect (abort, context) {
  13073. const { ret, res } = this
  13074. assert(!res, 'pipeline cannot be retried')
  13075. if (ret.destroyed) {
  13076. throw new RequestAbortedError()
  13077. }
  13078. this.abort = abort
  13079. this.context = context
  13080. }
  13081. onHeaders (statusCode, rawHeaders, resume) {
  13082. const { opaque, handler, context } = this
  13083. if (statusCode < 200) {
  13084. if (this.onInfo) {
  13085. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13086. this.onInfo({ statusCode, headers })
  13087. }
  13088. return
  13089. }
  13090. this.res = new PipelineResponse(resume)
  13091. let body
  13092. try {
  13093. this.handler = null
  13094. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13095. body = this.runInAsyncScope(handler, null, {
  13096. statusCode,
  13097. headers,
  13098. opaque,
  13099. body: this.res,
  13100. context
  13101. })
  13102. } catch (err) {
  13103. this.res.on('error', util.nop)
  13104. throw err
  13105. }
  13106. if (!body || typeof body.on !== 'function') {
  13107. throw new InvalidReturnValueError('expected Readable')
  13108. }
  13109. body
  13110. .on('data', (chunk) => {
  13111. const { ret, body } = this
  13112. if (!ret.push(chunk) && body.pause) {
  13113. body.pause()
  13114. }
  13115. })
  13116. .on('error', (err) => {
  13117. const { ret } = this
  13118. util.destroy(ret, err)
  13119. })
  13120. .on('end', () => {
  13121. const { ret } = this
  13122. ret.push(null)
  13123. })
  13124. .on('close', () => {
  13125. const { ret } = this
  13126. if (!ret._readableState.ended) {
  13127. util.destroy(ret, new RequestAbortedError())
  13128. }
  13129. })
  13130. this.body = body
  13131. }
  13132. onData (chunk) {
  13133. const { res } = this
  13134. return res.push(chunk)
  13135. }
  13136. onComplete (trailers) {
  13137. const { res } = this
  13138. res.push(null)
  13139. }
  13140. onError (err) {
  13141. const { ret } = this
  13142. this.handler = null
  13143. util.destroy(ret, err)
  13144. }
  13145. }
  13146. function pipeline (opts, handler) {
  13147. try {
  13148. const pipelineHandler = new PipelineHandler(opts, handler)
  13149. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13150. return pipelineHandler.ret
  13151. } catch (err) {
  13152. return new PassThrough().destroy(err)
  13153. }
  13154. }
  13155. module.exports = pipeline
  13156. /***/ }),
  13157. /***/ 5448:
  13158. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13159. "use strict";
  13160. const Readable = __nccwpck_require__(3858)
  13161. const {
  13162. InvalidArgumentError,
  13163. RequestAbortedError
  13164. } = __nccwpck_require__(8045)
  13165. const util = __nccwpck_require__(3983)
  13166. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13167. const { AsyncResource } = __nccwpck_require__(852)
  13168. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13169. class RequestHandler extends AsyncResource {
  13170. constructor (opts, callback) {
  13171. if (!opts || typeof opts !== 'object') {
  13172. throw new InvalidArgumentError('invalid opts')
  13173. }
  13174. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13175. try {
  13176. if (typeof callback !== 'function') {
  13177. throw new InvalidArgumentError('invalid callback')
  13178. }
  13179. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13180. throw new InvalidArgumentError('invalid highWaterMark')
  13181. }
  13182. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13183. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13184. }
  13185. if (method === 'CONNECT') {
  13186. throw new InvalidArgumentError('invalid method')
  13187. }
  13188. if (onInfo && typeof onInfo !== 'function') {
  13189. throw new InvalidArgumentError('invalid onInfo callback')
  13190. }
  13191. super('UNDICI_REQUEST')
  13192. } catch (err) {
  13193. if (util.isStream(body)) {
  13194. util.destroy(body.on('error', util.nop), err)
  13195. }
  13196. throw err
  13197. }
  13198. this.responseHeaders = responseHeaders || null
  13199. this.opaque = opaque || null
  13200. this.callback = callback
  13201. this.res = null
  13202. this.abort = null
  13203. this.body = body
  13204. this.trailers = {}
  13205. this.context = null
  13206. this.onInfo = onInfo || null
  13207. this.throwOnError = throwOnError
  13208. this.highWaterMark = highWaterMark
  13209. if (util.isStream(body)) {
  13210. body.on('error', (err) => {
  13211. this.onError(err)
  13212. })
  13213. }
  13214. addSignal(this, signal)
  13215. }
  13216. onConnect (abort, context) {
  13217. if (!this.callback) {
  13218. throw new RequestAbortedError()
  13219. }
  13220. this.abort = abort
  13221. this.context = context
  13222. }
  13223. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13224. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13225. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13226. if (statusCode < 200) {
  13227. if (this.onInfo) {
  13228. this.onInfo({ statusCode, headers })
  13229. }
  13230. return
  13231. }
  13232. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13233. const contentType = parsedHeaders['content-type']
  13234. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13235. this.callback = null
  13236. this.res = body
  13237. if (callback !== null) {
  13238. if (this.throwOnError && statusCode >= 400) {
  13239. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13240. { callback, body, contentType, statusCode, statusMessage, headers }
  13241. )
  13242. } else {
  13243. this.runInAsyncScope(callback, null, null, {
  13244. statusCode,
  13245. headers,
  13246. trailers: this.trailers,
  13247. opaque,
  13248. body,
  13249. context
  13250. })
  13251. }
  13252. }
  13253. }
  13254. onData (chunk) {
  13255. const { res } = this
  13256. return res.push(chunk)
  13257. }
  13258. onComplete (trailers) {
  13259. const { res } = this
  13260. removeSignal(this)
  13261. util.parseHeaders(trailers, this.trailers)
  13262. res.push(null)
  13263. }
  13264. onError (err) {
  13265. const { res, callback, body, opaque } = this
  13266. removeSignal(this)
  13267. if (callback) {
  13268. // TODO: Does this need queueMicrotask?
  13269. this.callback = null
  13270. queueMicrotask(() => {
  13271. this.runInAsyncScope(callback, null, err, { opaque })
  13272. })
  13273. }
  13274. if (res) {
  13275. this.res = null
  13276. // Ensure all queued handlers are invoked before destroying res.
  13277. queueMicrotask(() => {
  13278. util.destroy(res, err)
  13279. })
  13280. }
  13281. if (body) {
  13282. this.body = null
  13283. util.destroy(body, err)
  13284. }
  13285. }
  13286. }
  13287. function request (opts, callback) {
  13288. if (callback === undefined) {
  13289. return new Promise((resolve, reject) => {
  13290. request.call(this, opts, (err, data) => {
  13291. return err ? reject(err) : resolve(data)
  13292. })
  13293. })
  13294. }
  13295. try {
  13296. this.dispatch(opts, new RequestHandler(opts, callback))
  13297. } catch (err) {
  13298. if (typeof callback !== 'function') {
  13299. throw err
  13300. }
  13301. const opaque = opts && opts.opaque
  13302. queueMicrotask(() => callback(err, { opaque }))
  13303. }
  13304. }
  13305. module.exports = request
  13306. module.exports.RequestHandler = RequestHandler
  13307. /***/ }),
  13308. /***/ 5395:
  13309. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13310. "use strict";
  13311. const { finished, PassThrough } = __nccwpck_require__(2781)
  13312. const {
  13313. InvalidArgumentError,
  13314. InvalidReturnValueError,
  13315. RequestAbortedError
  13316. } = __nccwpck_require__(8045)
  13317. const util = __nccwpck_require__(3983)
  13318. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13319. const { AsyncResource } = __nccwpck_require__(852)
  13320. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13321. class StreamHandler extends AsyncResource {
  13322. constructor (opts, factory, callback) {
  13323. if (!opts || typeof opts !== 'object') {
  13324. throw new InvalidArgumentError('invalid opts')
  13325. }
  13326. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13327. try {
  13328. if (typeof callback !== 'function') {
  13329. throw new InvalidArgumentError('invalid callback')
  13330. }
  13331. if (typeof factory !== 'function') {
  13332. throw new InvalidArgumentError('invalid factory')
  13333. }
  13334. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13335. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13336. }
  13337. if (method === 'CONNECT') {
  13338. throw new InvalidArgumentError('invalid method')
  13339. }
  13340. if (onInfo && typeof onInfo !== 'function') {
  13341. throw new InvalidArgumentError('invalid onInfo callback')
  13342. }
  13343. super('UNDICI_STREAM')
  13344. } catch (err) {
  13345. if (util.isStream(body)) {
  13346. util.destroy(body.on('error', util.nop), err)
  13347. }
  13348. throw err
  13349. }
  13350. this.responseHeaders = responseHeaders || null
  13351. this.opaque = opaque || null
  13352. this.factory = factory
  13353. this.callback = callback
  13354. this.res = null
  13355. this.abort = null
  13356. this.context = null
  13357. this.trailers = null
  13358. this.body = body
  13359. this.onInfo = onInfo || null
  13360. this.throwOnError = throwOnError || false
  13361. if (util.isStream(body)) {
  13362. body.on('error', (err) => {
  13363. this.onError(err)
  13364. })
  13365. }
  13366. addSignal(this, signal)
  13367. }
  13368. onConnect (abort, context) {
  13369. if (!this.callback) {
  13370. throw new RequestAbortedError()
  13371. }
  13372. this.abort = abort
  13373. this.context = context
  13374. }
  13375. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13376. const { factory, opaque, context, callback, responseHeaders } = this
  13377. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13378. if (statusCode < 200) {
  13379. if (this.onInfo) {
  13380. this.onInfo({ statusCode, headers })
  13381. }
  13382. return
  13383. }
  13384. this.factory = null
  13385. let res
  13386. if (this.throwOnError && statusCode >= 400) {
  13387. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13388. const contentType = parsedHeaders['content-type']
  13389. res = new PassThrough()
  13390. this.callback = null
  13391. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13392. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13393. )
  13394. } else {
  13395. if (factory === null) {
  13396. return
  13397. }
  13398. res = this.runInAsyncScope(factory, null, {
  13399. statusCode,
  13400. headers,
  13401. opaque,
  13402. context
  13403. })
  13404. if (
  13405. !res ||
  13406. typeof res.write !== 'function' ||
  13407. typeof res.end !== 'function' ||
  13408. typeof res.on !== 'function'
  13409. ) {
  13410. throw new InvalidReturnValueError('expected Writable')
  13411. }
  13412. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13413. finished(res, { readable: false }, (err) => {
  13414. const { callback, res, opaque, trailers, abort } = this
  13415. this.res = null
  13416. if (err || !res.readable) {
  13417. util.destroy(res, err)
  13418. }
  13419. this.callback = null
  13420. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13421. if (err) {
  13422. abort()
  13423. }
  13424. })
  13425. }
  13426. res.on('drain', resume)
  13427. this.res = res
  13428. const needDrain = res.writableNeedDrain !== undefined
  13429. ? res.writableNeedDrain
  13430. : res._writableState && res._writableState.needDrain
  13431. return needDrain !== true
  13432. }
  13433. onData (chunk) {
  13434. const { res } = this
  13435. return res ? res.write(chunk) : true
  13436. }
  13437. onComplete (trailers) {
  13438. const { res } = this
  13439. removeSignal(this)
  13440. if (!res) {
  13441. return
  13442. }
  13443. this.trailers = util.parseHeaders(trailers)
  13444. res.end()
  13445. }
  13446. onError (err) {
  13447. const { res, callback, opaque, body } = this
  13448. removeSignal(this)
  13449. this.factory = null
  13450. if (res) {
  13451. this.res = null
  13452. util.destroy(res, err)
  13453. } else if (callback) {
  13454. this.callback = null
  13455. queueMicrotask(() => {
  13456. this.runInAsyncScope(callback, null, err, { opaque })
  13457. })
  13458. }
  13459. if (body) {
  13460. this.body = null
  13461. util.destroy(body, err)
  13462. }
  13463. }
  13464. }
  13465. function stream (opts, factory, callback) {
  13466. if (callback === undefined) {
  13467. return new Promise((resolve, reject) => {
  13468. stream.call(this, opts, factory, (err, data) => {
  13469. return err ? reject(err) : resolve(data)
  13470. })
  13471. })
  13472. }
  13473. try {
  13474. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13475. } catch (err) {
  13476. if (typeof callback !== 'function') {
  13477. throw err
  13478. }
  13479. const opaque = opts && opts.opaque
  13480. queueMicrotask(() => callback(err, { opaque }))
  13481. }
  13482. }
  13483. module.exports = stream
  13484. /***/ }),
  13485. /***/ 6923:
  13486. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13487. "use strict";
  13488. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13489. const { AsyncResource } = __nccwpck_require__(852)
  13490. const util = __nccwpck_require__(3983)
  13491. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13492. const assert = __nccwpck_require__(9491)
  13493. class UpgradeHandler extends AsyncResource {
  13494. constructor (opts, callback) {
  13495. if (!opts || typeof opts !== 'object') {
  13496. throw new InvalidArgumentError('invalid opts')
  13497. }
  13498. if (typeof callback !== 'function') {
  13499. throw new InvalidArgumentError('invalid callback')
  13500. }
  13501. const { signal, opaque, responseHeaders } = opts
  13502. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13503. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13504. }
  13505. super('UNDICI_UPGRADE')
  13506. this.responseHeaders = responseHeaders || null
  13507. this.opaque = opaque || null
  13508. this.callback = callback
  13509. this.abort = null
  13510. this.context = null
  13511. addSignal(this, signal)
  13512. }
  13513. onConnect (abort, context) {
  13514. if (!this.callback) {
  13515. throw new RequestAbortedError()
  13516. }
  13517. this.abort = abort
  13518. this.context = null
  13519. }
  13520. onHeaders () {
  13521. throw new SocketError('bad upgrade', null)
  13522. }
  13523. onUpgrade (statusCode, rawHeaders, socket) {
  13524. const { callback, opaque, context } = this
  13525. assert.strictEqual(statusCode, 101)
  13526. removeSignal(this)
  13527. this.callback = null
  13528. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13529. this.runInAsyncScope(callback, null, null, {
  13530. headers,
  13531. socket,
  13532. opaque,
  13533. context
  13534. })
  13535. }
  13536. onError (err) {
  13537. const { callback, opaque } = this
  13538. removeSignal(this)
  13539. if (callback) {
  13540. this.callback = null
  13541. queueMicrotask(() => {
  13542. this.runInAsyncScope(callback, null, err, { opaque })
  13543. })
  13544. }
  13545. }
  13546. }
  13547. function upgrade (opts, callback) {
  13548. if (callback === undefined) {
  13549. return new Promise((resolve, reject) => {
  13550. upgrade.call(this, opts, (err, data) => {
  13551. return err ? reject(err) : resolve(data)
  13552. })
  13553. })
  13554. }
  13555. try {
  13556. const upgradeHandler = new UpgradeHandler(opts, callback)
  13557. this.dispatch({
  13558. ...opts,
  13559. method: opts.method || 'GET',
  13560. upgrade: opts.protocol || 'Websocket'
  13561. }, upgradeHandler)
  13562. } catch (err) {
  13563. if (typeof callback !== 'function') {
  13564. throw err
  13565. }
  13566. const opaque = opts && opts.opaque
  13567. queueMicrotask(() => callback(err, { opaque }))
  13568. }
  13569. }
  13570. module.exports = upgrade
  13571. /***/ }),
  13572. /***/ 4059:
  13573. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13574. "use strict";
  13575. module.exports.request = __nccwpck_require__(5448)
  13576. module.exports.stream = __nccwpck_require__(5395)
  13577. module.exports.pipeline = __nccwpck_require__(8752)
  13578. module.exports.upgrade = __nccwpck_require__(6923)
  13579. module.exports.connect = __nccwpck_require__(9744)
  13580. /***/ }),
  13581. /***/ 3858:
  13582. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13583. "use strict";
  13584. // Ported from https://github.com/nodejs/undici/pull/907
  13585. const assert = __nccwpck_require__(9491)
  13586. const { Readable } = __nccwpck_require__(2781)
  13587. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13588. const util = __nccwpck_require__(3983)
  13589. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13590. let Blob
  13591. const kConsume = Symbol('kConsume')
  13592. const kReading = Symbol('kReading')
  13593. const kBody = Symbol('kBody')
  13594. const kAbort = Symbol('abort')
  13595. const kContentType = Symbol('kContentType')
  13596. const noop = () => {}
  13597. module.exports = class BodyReadable extends Readable {
  13598. constructor ({
  13599. resume,
  13600. abort,
  13601. contentType = '',
  13602. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13603. }) {
  13604. super({
  13605. autoDestroy: true,
  13606. read: resume,
  13607. highWaterMark
  13608. })
  13609. this._readableState.dataEmitted = false
  13610. this[kAbort] = abort
  13611. this[kConsume] = null
  13612. this[kBody] = null
  13613. this[kContentType] = contentType
  13614. // Is stream being consumed through Readable API?
  13615. // This is an optimization so that we avoid checking
  13616. // for 'data' and 'readable' listeners in the hot path
  13617. // inside push().
  13618. this[kReading] = false
  13619. }
  13620. destroy (err) {
  13621. if (this.destroyed) {
  13622. // Node < 16
  13623. return this
  13624. }
  13625. if (!err && !this._readableState.endEmitted) {
  13626. err = new RequestAbortedError()
  13627. }
  13628. if (err) {
  13629. this[kAbort]()
  13630. }
  13631. return super.destroy(err)
  13632. }
  13633. emit (ev, ...args) {
  13634. if (ev === 'data') {
  13635. // Node < 16.7
  13636. this._readableState.dataEmitted = true
  13637. } else if (ev === 'error') {
  13638. // Node < 16
  13639. this._readableState.errorEmitted = true
  13640. }
  13641. return super.emit(ev, ...args)
  13642. }
  13643. on (ev, ...args) {
  13644. if (ev === 'data' || ev === 'readable') {
  13645. this[kReading] = true
  13646. }
  13647. return super.on(ev, ...args)
  13648. }
  13649. addListener (ev, ...args) {
  13650. return this.on(ev, ...args)
  13651. }
  13652. off (ev, ...args) {
  13653. const ret = super.off(ev, ...args)
  13654. if (ev === 'data' || ev === 'readable') {
  13655. this[kReading] = (
  13656. this.listenerCount('data') > 0 ||
  13657. this.listenerCount('readable') > 0
  13658. )
  13659. }
  13660. return ret
  13661. }
  13662. removeListener (ev, ...args) {
  13663. return this.off(ev, ...args)
  13664. }
  13665. push (chunk) {
  13666. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13667. consumePush(this[kConsume], chunk)
  13668. return this[kReading] ? super.push(chunk) : true
  13669. }
  13670. return super.push(chunk)
  13671. }
  13672. // https://fetch.spec.whatwg.org/#dom-body-text
  13673. async text () {
  13674. return consume(this, 'text')
  13675. }
  13676. // https://fetch.spec.whatwg.org/#dom-body-json
  13677. async json () {
  13678. return consume(this, 'json')
  13679. }
  13680. // https://fetch.spec.whatwg.org/#dom-body-blob
  13681. async blob () {
  13682. return consume(this, 'blob')
  13683. }
  13684. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13685. async arrayBuffer () {
  13686. return consume(this, 'arrayBuffer')
  13687. }
  13688. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13689. async formData () {
  13690. // TODO: Implement.
  13691. throw new NotSupportedError()
  13692. }
  13693. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13694. get bodyUsed () {
  13695. return util.isDisturbed(this)
  13696. }
  13697. // https://fetch.spec.whatwg.org/#dom-body-body
  13698. get body () {
  13699. if (!this[kBody]) {
  13700. this[kBody] = ReadableStreamFrom(this)
  13701. if (this[kConsume]) {
  13702. // TODO: Is this the best way to force a lock?
  13703. this[kBody].getReader() // Ensure stream is locked.
  13704. assert(this[kBody].locked)
  13705. }
  13706. }
  13707. return this[kBody]
  13708. }
  13709. dump (opts) {
  13710. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13711. const signal = opts && opts.signal
  13712. if (signal) {
  13713. try {
  13714. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13715. throw new InvalidArgumentError('signal must be an AbortSignal')
  13716. }
  13717. util.throwIfAborted(signal)
  13718. } catch (err) {
  13719. return Promise.reject(err)
  13720. }
  13721. }
  13722. if (this.closed) {
  13723. return Promise.resolve(null)
  13724. }
  13725. return new Promise((resolve, reject) => {
  13726. const signalListenerCleanup = signal
  13727. ? util.addAbortListener(signal, () => {
  13728. this.destroy()
  13729. })
  13730. : noop
  13731. this
  13732. .on('close', function () {
  13733. signalListenerCleanup()
  13734. if (signal && signal.aborted) {
  13735. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  13736. } else {
  13737. resolve(null)
  13738. }
  13739. })
  13740. .on('error', noop)
  13741. .on('data', function (chunk) {
  13742. limit -= chunk.length
  13743. if (limit <= 0) {
  13744. this.destroy()
  13745. }
  13746. })
  13747. .resume()
  13748. })
  13749. }
  13750. }
  13751. // https://streams.spec.whatwg.org/#readablestream-locked
  13752. function isLocked (self) {
  13753. // Consume is an implicit lock.
  13754. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  13755. }
  13756. // https://fetch.spec.whatwg.org/#body-unusable
  13757. function isUnusable (self) {
  13758. return util.isDisturbed(self) || isLocked(self)
  13759. }
  13760. async function consume (stream, type) {
  13761. if (isUnusable(stream)) {
  13762. throw new TypeError('unusable')
  13763. }
  13764. assert(!stream[kConsume])
  13765. return new Promise((resolve, reject) => {
  13766. stream[kConsume] = {
  13767. type,
  13768. stream,
  13769. resolve,
  13770. reject,
  13771. length: 0,
  13772. body: []
  13773. }
  13774. stream
  13775. .on('error', function (err) {
  13776. consumeFinish(this[kConsume], err)
  13777. })
  13778. .on('close', function () {
  13779. if (this[kConsume].body !== null) {
  13780. consumeFinish(this[kConsume], new RequestAbortedError())
  13781. }
  13782. })
  13783. process.nextTick(consumeStart, stream[kConsume])
  13784. })
  13785. }
  13786. function consumeStart (consume) {
  13787. if (consume.body === null) {
  13788. return
  13789. }
  13790. const { _readableState: state } = consume.stream
  13791. for (const chunk of state.buffer) {
  13792. consumePush(consume, chunk)
  13793. }
  13794. if (state.endEmitted) {
  13795. consumeEnd(this[kConsume])
  13796. } else {
  13797. consume.stream.on('end', function () {
  13798. consumeEnd(this[kConsume])
  13799. })
  13800. }
  13801. consume.stream.resume()
  13802. while (consume.stream.read() != null) {
  13803. // Loop
  13804. }
  13805. }
  13806. function consumeEnd (consume) {
  13807. const { type, body, resolve, stream, length } = consume
  13808. try {
  13809. if (type === 'text') {
  13810. resolve(toUSVString(Buffer.concat(body)))
  13811. } else if (type === 'json') {
  13812. resolve(JSON.parse(Buffer.concat(body)))
  13813. } else if (type === 'arrayBuffer') {
  13814. const dst = new Uint8Array(length)
  13815. let pos = 0
  13816. for (const buf of body) {
  13817. dst.set(buf, pos)
  13818. pos += buf.byteLength
  13819. }
  13820. resolve(dst.buffer)
  13821. } else if (type === 'blob') {
  13822. if (!Blob) {
  13823. Blob = (__nccwpck_require__(4300).Blob)
  13824. }
  13825. resolve(new Blob(body, { type: stream[kContentType] }))
  13826. }
  13827. consumeFinish(consume)
  13828. } catch (err) {
  13829. stream.destroy(err)
  13830. }
  13831. }
  13832. function consumePush (consume, chunk) {
  13833. consume.length += chunk.length
  13834. consume.body.push(chunk)
  13835. }
  13836. function consumeFinish (consume, err) {
  13837. if (consume.body === null) {
  13838. return
  13839. }
  13840. if (err) {
  13841. consume.reject(err)
  13842. } else {
  13843. consume.resolve()
  13844. }
  13845. consume.type = null
  13846. consume.stream = null
  13847. consume.resolve = null
  13848. consume.reject = null
  13849. consume.length = 0
  13850. consume.body = null
  13851. }
  13852. /***/ }),
  13853. /***/ 7474:
  13854. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13855. const assert = __nccwpck_require__(9491)
  13856. const {
  13857. ResponseStatusCodeError
  13858. } = __nccwpck_require__(8045)
  13859. const { toUSVString } = __nccwpck_require__(3983)
  13860. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  13861. assert(body)
  13862. let chunks = []
  13863. let limit = 0
  13864. for await (const chunk of body) {
  13865. chunks.push(chunk)
  13866. limit += chunk.length
  13867. if (limit > 128 * 1024) {
  13868. chunks = null
  13869. break
  13870. }
  13871. }
  13872. if (statusCode === 204 || !contentType || !chunks) {
  13873. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13874. return
  13875. }
  13876. try {
  13877. if (contentType.startsWith('application/json')) {
  13878. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  13879. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13880. return
  13881. }
  13882. if (contentType.startsWith('text/')) {
  13883. const payload = toUSVString(Buffer.concat(chunks))
  13884. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13885. return
  13886. }
  13887. } catch (err) {
  13888. // Process in a fallback if error
  13889. }
  13890. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13891. }
  13892. module.exports = { getResolveErrorBodyCallback }
  13893. /***/ }),
  13894. /***/ 7931:
  13895. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13896. "use strict";
  13897. const {
  13898. BalancedPoolMissingUpstreamError,
  13899. InvalidArgumentError
  13900. } = __nccwpck_require__(8045)
  13901. const {
  13902. PoolBase,
  13903. kClients,
  13904. kNeedDrain,
  13905. kAddClient,
  13906. kRemoveClient,
  13907. kGetDispatcher
  13908. } = __nccwpck_require__(3198)
  13909. const Pool = __nccwpck_require__(4634)
  13910. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  13911. const { parseOrigin } = __nccwpck_require__(3983)
  13912. const kFactory = Symbol('factory')
  13913. const kOptions = Symbol('options')
  13914. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  13915. const kCurrentWeight = Symbol('kCurrentWeight')
  13916. const kIndex = Symbol('kIndex')
  13917. const kWeight = Symbol('kWeight')
  13918. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  13919. const kErrorPenalty = Symbol('kErrorPenalty')
  13920. function getGreatestCommonDivisor (a, b) {
  13921. if (b === 0) return a
  13922. return getGreatestCommonDivisor(b, a % b)
  13923. }
  13924. function defaultFactory (origin, opts) {
  13925. return new Pool(origin, opts)
  13926. }
  13927. class BalancedPool extends PoolBase {
  13928. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  13929. super()
  13930. this[kOptions] = opts
  13931. this[kIndex] = -1
  13932. this[kCurrentWeight] = 0
  13933. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  13934. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  13935. if (!Array.isArray(upstreams)) {
  13936. upstreams = [upstreams]
  13937. }
  13938. if (typeof factory !== 'function') {
  13939. throw new InvalidArgumentError('factory must be a function.')
  13940. }
  13941. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  13942. ? opts.interceptors.BalancedPool
  13943. : []
  13944. this[kFactory] = factory
  13945. for (const upstream of upstreams) {
  13946. this.addUpstream(upstream)
  13947. }
  13948. this._updateBalancedPoolStats()
  13949. }
  13950. addUpstream (upstream) {
  13951. const upstreamOrigin = parseOrigin(upstream).origin
  13952. if (this[kClients].find((pool) => (
  13953. pool[kUrl].origin === upstreamOrigin &&
  13954. pool.closed !== true &&
  13955. pool.destroyed !== true
  13956. ))) {
  13957. return this
  13958. }
  13959. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  13960. this[kAddClient](pool)
  13961. pool.on('connect', () => {
  13962. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  13963. })
  13964. pool.on('connectionError', () => {
  13965. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13966. this._updateBalancedPoolStats()
  13967. })
  13968. pool.on('disconnect', (...args) => {
  13969. const err = args[2]
  13970. if (err && err.code === 'UND_ERR_SOCKET') {
  13971. // decrease the weight of the pool.
  13972. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13973. this._updateBalancedPoolStats()
  13974. }
  13975. })
  13976. for (const client of this[kClients]) {
  13977. client[kWeight] = this[kMaxWeightPerServer]
  13978. }
  13979. this._updateBalancedPoolStats()
  13980. return this
  13981. }
  13982. _updateBalancedPoolStats () {
  13983. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  13984. }
  13985. removeUpstream (upstream) {
  13986. const upstreamOrigin = parseOrigin(upstream).origin
  13987. const pool = this[kClients].find((pool) => (
  13988. pool[kUrl].origin === upstreamOrigin &&
  13989. pool.closed !== true &&
  13990. pool.destroyed !== true
  13991. ))
  13992. if (pool) {
  13993. this[kRemoveClient](pool)
  13994. }
  13995. return this
  13996. }
  13997. get upstreams () {
  13998. return this[kClients]
  13999. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14000. .map((p) => p[kUrl].origin)
  14001. }
  14002. [kGetDispatcher] () {
  14003. // We validate that pools is greater than 0,
  14004. // otherwise we would have to wait until an upstream
  14005. // is added, which might never happen.
  14006. if (this[kClients].length === 0) {
  14007. throw new BalancedPoolMissingUpstreamError()
  14008. }
  14009. const dispatcher = this[kClients].find(dispatcher => (
  14010. !dispatcher[kNeedDrain] &&
  14011. dispatcher.closed !== true &&
  14012. dispatcher.destroyed !== true
  14013. ))
  14014. if (!dispatcher) {
  14015. return
  14016. }
  14017. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14018. if (allClientsBusy) {
  14019. return
  14020. }
  14021. let counter = 0
  14022. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14023. while (counter++ < this[kClients].length) {
  14024. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14025. const pool = this[kClients][this[kIndex]]
  14026. // find pool index with the largest weight
  14027. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14028. maxWeightIndex = this[kIndex]
  14029. }
  14030. // decrease the current weight every `this[kClients].length`.
  14031. if (this[kIndex] === 0) {
  14032. // Set the current weight to the next lower weight.
  14033. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14034. if (this[kCurrentWeight] <= 0) {
  14035. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14036. }
  14037. }
  14038. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14039. return pool
  14040. }
  14041. }
  14042. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14043. this[kIndex] = maxWeightIndex
  14044. return this[kClients][maxWeightIndex]
  14045. }
  14046. }
  14047. module.exports = BalancedPool
  14048. /***/ }),
  14049. /***/ 6101:
  14050. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14051. "use strict";
  14052. const { kConstruct } = __nccwpck_require__(9174)
  14053. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14054. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14055. const { kHeadersList } = __nccwpck_require__(2785)
  14056. const { webidl } = __nccwpck_require__(1744)
  14057. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14058. const { Request } = __nccwpck_require__(8359)
  14059. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14060. const { fetching } = __nccwpck_require__(4881)
  14061. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14062. const assert = __nccwpck_require__(9491)
  14063. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14064. /**
  14065. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14066. * @typedef {Object} CacheBatchOperation
  14067. * @property {'delete' | 'put'} type
  14068. * @property {any} request
  14069. * @property {any} response
  14070. * @property {import('../../types/cache').CacheQueryOptions} options
  14071. */
  14072. /**
  14073. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14074. * @typedef {[any, any][]} requestResponseList
  14075. */
  14076. class Cache {
  14077. /**
  14078. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14079. * @type {requestResponseList}
  14080. */
  14081. #relevantRequestResponseList
  14082. constructor () {
  14083. if (arguments[0] !== kConstruct) {
  14084. webidl.illegalConstructor()
  14085. }
  14086. this.#relevantRequestResponseList = arguments[1]
  14087. }
  14088. async match (request, options = {}) {
  14089. webidl.brandCheck(this, Cache)
  14090. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14091. request = webidl.converters.RequestInfo(request)
  14092. options = webidl.converters.CacheQueryOptions(options)
  14093. const p = await this.matchAll(request, options)
  14094. if (p.length === 0) {
  14095. return
  14096. }
  14097. return p[0]
  14098. }
  14099. async matchAll (request = undefined, options = {}) {
  14100. webidl.brandCheck(this, Cache)
  14101. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14102. options = webidl.converters.CacheQueryOptions(options)
  14103. // 1.
  14104. let r = null
  14105. // 2.
  14106. if (request !== undefined) {
  14107. if (request instanceof Request) {
  14108. // 2.1.1
  14109. r = request[kState]
  14110. // 2.1.2
  14111. if (r.method !== 'GET' && !options.ignoreMethod) {
  14112. return []
  14113. }
  14114. } else if (typeof request === 'string') {
  14115. // 2.2.1
  14116. r = new Request(request)[kState]
  14117. }
  14118. }
  14119. // 5.
  14120. // 5.1
  14121. const responses = []
  14122. // 5.2
  14123. if (request === undefined) {
  14124. // 5.2.1
  14125. for (const requestResponse of this.#relevantRequestResponseList) {
  14126. responses.push(requestResponse[1])
  14127. }
  14128. } else { // 5.3
  14129. // 5.3.1
  14130. const requestResponses = this.#queryCache(r, options)
  14131. // 5.3.2
  14132. for (const requestResponse of requestResponses) {
  14133. responses.push(requestResponse[1])
  14134. }
  14135. }
  14136. // 5.4
  14137. // We don't implement CORs so we don't need to loop over the responses, yay!
  14138. // 5.5.1
  14139. const responseList = []
  14140. // 5.5.2
  14141. for (const response of responses) {
  14142. // 5.5.2.1
  14143. const responseObject = new Response(response.body?.source ?? null)
  14144. const body = responseObject[kState].body
  14145. responseObject[kState] = response
  14146. responseObject[kState].body = body
  14147. responseObject[kHeaders][kHeadersList] = response.headersList
  14148. responseObject[kHeaders][kGuard] = 'immutable'
  14149. responseList.push(responseObject)
  14150. }
  14151. // 6.
  14152. return Object.freeze(responseList)
  14153. }
  14154. async add (request) {
  14155. webidl.brandCheck(this, Cache)
  14156. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14157. request = webidl.converters.RequestInfo(request)
  14158. // 1.
  14159. const requests = [request]
  14160. // 2.
  14161. const responseArrayPromise = this.addAll(requests)
  14162. // 3.
  14163. return await responseArrayPromise
  14164. }
  14165. async addAll (requests) {
  14166. webidl.brandCheck(this, Cache)
  14167. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14168. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14169. // 1.
  14170. const responsePromises = []
  14171. // 2.
  14172. const requestList = []
  14173. // 3.
  14174. for (const request of requests) {
  14175. if (typeof request === 'string') {
  14176. continue
  14177. }
  14178. // 3.1
  14179. const r = request[kState]
  14180. // 3.2
  14181. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14182. throw webidl.errors.exception({
  14183. header: 'Cache.addAll',
  14184. message: 'Expected http/s scheme when method is not GET.'
  14185. })
  14186. }
  14187. }
  14188. // 4.
  14189. /** @type {ReturnType<typeof fetching>[]} */
  14190. const fetchControllers = []
  14191. // 5.
  14192. for (const request of requests) {
  14193. // 5.1
  14194. const r = new Request(request)[kState]
  14195. // 5.2
  14196. if (!urlIsHttpHttpsScheme(r.url)) {
  14197. throw webidl.errors.exception({
  14198. header: 'Cache.addAll',
  14199. message: 'Expected http/s scheme.'
  14200. })
  14201. }
  14202. // 5.4
  14203. r.initiator = 'fetch'
  14204. r.destination = 'subresource'
  14205. // 5.5
  14206. requestList.push(r)
  14207. // 5.6
  14208. const responsePromise = createDeferredPromise()
  14209. // 5.7
  14210. fetchControllers.push(fetching({
  14211. request: r,
  14212. dispatcher: getGlobalDispatcher(),
  14213. processResponse (response) {
  14214. // 1.
  14215. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14216. responsePromise.reject(webidl.errors.exception({
  14217. header: 'Cache.addAll',
  14218. message: 'Received an invalid status code or the request failed.'
  14219. }))
  14220. } else if (response.headersList.contains('vary')) { // 2.
  14221. // 2.1
  14222. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14223. // 2.2
  14224. for (const fieldValue of fieldValues) {
  14225. // 2.2.1
  14226. if (fieldValue === '*') {
  14227. responsePromise.reject(webidl.errors.exception({
  14228. header: 'Cache.addAll',
  14229. message: 'invalid vary field value'
  14230. }))
  14231. for (const controller of fetchControllers) {
  14232. controller.abort()
  14233. }
  14234. return
  14235. }
  14236. }
  14237. }
  14238. },
  14239. processResponseEndOfBody (response) {
  14240. // 1.
  14241. if (response.aborted) {
  14242. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14243. return
  14244. }
  14245. // 2.
  14246. responsePromise.resolve(response)
  14247. }
  14248. }))
  14249. // 5.8
  14250. responsePromises.push(responsePromise.promise)
  14251. }
  14252. // 6.
  14253. const p = Promise.all(responsePromises)
  14254. // 7.
  14255. const responses = await p
  14256. // 7.1
  14257. const operations = []
  14258. // 7.2
  14259. let index = 0
  14260. // 7.3
  14261. for (const response of responses) {
  14262. // 7.3.1
  14263. /** @type {CacheBatchOperation} */
  14264. const operation = {
  14265. type: 'put', // 7.3.2
  14266. request: requestList[index], // 7.3.3
  14267. response // 7.3.4
  14268. }
  14269. operations.push(operation) // 7.3.5
  14270. index++ // 7.3.6
  14271. }
  14272. // 7.5
  14273. const cacheJobPromise = createDeferredPromise()
  14274. // 7.6.1
  14275. let errorData = null
  14276. // 7.6.2
  14277. try {
  14278. this.#batchCacheOperations(operations)
  14279. } catch (e) {
  14280. errorData = e
  14281. }
  14282. // 7.6.3
  14283. queueMicrotask(() => {
  14284. // 7.6.3.1
  14285. if (errorData === null) {
  14286. cacheJobPromise.resolve(undefined)
  14287. } else {
  14288. // 7.6.3.2
  14289. cacheJobPromise.reject(errorData)
  14290. }
  14291. })
  14292. // 7.7
  14293. return cacheJobPromise.promise
  14294. }
  14295. async put (request, response) {
  14296. webidl.brandCheck(this, Cache)
  14297. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14298. request = webidl.converters.RequestInfo(request)
  14299. response = webidl.converters.Response(response)
  14300. // 1.
  14301. let innerRequest = null
  14302. // 2.
  14303. if (request instanceof Request) {
  14304. innerRequest = request[kState]
  14305. } else { // 3.
  14306. innerRequest = new Request(request)[kState]
  14307. }
  14308. // 4.
  14309. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14310. throw webidl.errors.exception({
  14311. header: 'Cache.put',
  14312. message: 'Expected an http/s scheme when method is not GET'
  14313. })
  14314. }
  14315. // 5.
  14316. const innerResponse = response[kState]
  14317. // 6.
  14318. if (innerResponse.status === 206) {
  14319. throw webidl.errors.exception({
  14320. header: 'Cache.put',
  14321. message: 'Got 206 status'
  14322. })
  14323. }
  14324. // 7.
  14325. if (innerResponse.headersList.contains('vary')) {
  14326. // 7.1.
  14327. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14328. // 7.2.
  14329. for (const fieldValue of fieldValues) {
  14330. // 7.2.1
  14331. if (fieldValue === '*') {
  14332. throw webidl.errors.exception({
  14333. header: 'Cache.put',
  14334. message: 'Got * vary field value'
  14335. })
  14336. }
  14337. }
  14338. }
  14339. // 8.
  14340. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14341. throw webidl.errors.exception({
  14342. header: 'Cache.put',
  14343. message: 'Response body is locked or disturbed'
  14344. })
  14345. }
  14346. // 9.
  14347. const clonedResponse = cloneResponse(innerResponse)
  14348. // 10.
  14349. const bodyReadPromise = createDeferredPromise()
  14350. // 11.
  14351. if (innerResponse.body != null) {
  14352. // 11.1
  14353. const stream = innerResponse.body.stream
  14354. // 11.2
  14355. const reader = stream.getReader()
  14356. // 11.3
  14357. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14358. } else {
  14359. bodyReadPromise.resolve(undefined)
  14360. }
  14361. // 12.
  14362. /** @type {CacheBatchOperation[]} */
  14363. const operations = []
  14364. // 13.
  14365. /** @type {CacheBatchOperation} */
  14366. const operation = {
  14367. type: 'put', // 14.
  14368. request: innerRequest, // 15.
  14369. response: clonedResponse // 16.
  14370. }
  14371. // 17.
  14372. operations.push(operation)
  14373. // 19.
  14374. const bytes = await bodyReadPromise.promise
  14375. if (clonedResponse.body != null) {
  14376. clonedResponse.body.source = bytes
  14377. }
  14378. // 19.1
  14379. const cacheJobPromise = createDeferredPromise()
  14380. // 19.2.1
  14381. let errorData = null
  14382. // 19.2.2
  14383. try {
  14384. this.#batchCacheOperations(operations)
  14385. } catch (e) {
  14386. errorData = e
  14387. }
  14388. // 19.2.3
  14389. queueMicrotask(() => {
  14390. // 19.2.3.1
  14391. if (errorData === null) {
  14392. cacheJobPromise.resolve()
  14393. } else { // 19.2.3.2
  14394. cacheJobPromise.reject(errorData)
  14395. }
  14396. })
  14397. return cacheJobPromise.promise
  14398. }
  14399. async delete (request, options = {}) {
  14400. webidl.brandCheck(this, Cache)
  14401. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14402. request = webidl.converters.RequestInfo(request)
  14403. options = webidl.converters.CacheQueryOptions(options)
  14404. /**
  14405. * @type {Request}
  14406. */
  14407. let r = null
  14408. if (request instanceof Request) {
  14409. r = request[kState]
  14410. if (r.method !== 'GET' && !options.ignoreMethod) {
  14411. return false
  14412. }
  14413. } else {
  14414. assert(typeof request === 'string')
  14415. r = new Request(request)[kState]
  14416. }
  14417. /** @type {CacheBatchOperation[]} */
  14418. const operations = []
  14419. /** @type {CacheBatchOperation} */
  14420. const operation = {
  14421. type: 'delete',
  14422. request: r,
  14423. options
  14424. }
  14425. operations.push(operation)
  14426. const cacheJobPromise = createDeferredPromise()
  14427. let errorData = null
  14428. let requestResponses
  14429. try {
  14430. requestResponses = this.#batchCacheOperations(operations)
  14431. } catch (e) {
  14432. errorData = e
  14433. }
  14434. queueMicrotask(() => {
  14435. if (errorData === null) {
  14436. cacheJobPromise.resolve(!!requestResponses?.length)
  14437. } else {
  14438. cacheJobPromise.reject(errorData)
  14439. }
  14440. })
  14441. return cacheJobPromise.promise
  14442. }
  14443. /**
  14444. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14445. * @param {any} request
  14446. * @param {import('../../types/cache').CacheQueryOptions} options
  14447. * @returns {readonly Request[]}
  14448. */
  14449. async keys (request = undefined, options = {}) {
  14450. webidl.brandCheck(this, Cache)
  14451. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14452. options = webidl.converters.CacheQueryOptions(options)
  14453. // 1.
  14454. let r = null
  14455. // 2.
  14456. if (request !== undefined) {
  14457. // 2.1
  14458. if (request instanceof Request) {
  14459. // 2.1.1
  14460. r = request[kState]
  14461. // 2.1.2
  14462. if (r.method !== 'GET' && !options.ignoreMethod) {
  14463. return []
  14464. }
  14465. } else if (typeof request === 'string') { // 2.2
  14466. r = new Request(request)[kState]
  14467. }
  14468. }
  14469. // 4.
  14470. const promise = createDeferredPromise()
  14471. // 5.
  14472. // 5.1
  14473. const requests = []
  14474. // 5.2
  14475. if (request === undefined) {
  14476. // 5.2.1
  14477. for (const requestResponse of this.#relevantRequestResponseList) {
  14478. // 5.2.1.1
  14479. requests.push(requestResponse[0])
  14480. }
  14481. } else { // 5.3
  14482. // 5.3.1
  14483. const requestResponses = this.#queryCache(r, options)
  14484. // 5.3.2
  14485. for (const requestResponse of requestResponses) {
  14486. // 5.3.2.1
  14487. requests.push(requestResponse[0])
  14488. }
  14489. }
  14490. // 5.4
  14491. queueMicrotask(() => {
  14492. // 5.4.1
  14493. const requestList = []
  14494. // 5.4.2
  14495. for (const request of requests) {
  14496. const requestObject = new Request('https://a')
  14497. requestObject[kState] = request
  14498. requestObject[kHeaders][kHeadersList] = request.headersList
  14499. requestObject[kHeaders][kGuard] = 'immutable'
  14500. requestObject[kRealm] = request.client
  14501. // 5.4.2.1
  14502. requestList.push(requestObject)
  14503. }
  14504. // 5.4.3
  14505. promise.resolve(Object.freeze(requestList))
  14506. })
  14507. return promise.promise
  14508. }
  14509. /**
  14510. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14511. * @param {CacheBatchOperation[]} operations
  14512. * @returns {requestResponseList}
  14513. */
  14514. #batchCacheOperations (operations) {
  14515. // 1.
  14516. const cache = this.#relevantRequestResponseList
  14517. // 2.
  14518. const backupCache = [...cache]
  14519. // 3.
  14520. const addedItems = []
  14521. // 4.1
  14522. const resultList = []
  14523. try {
  14524. // 4.2
  14525. for (const operation of operations) {
  14526. // 4.2.1
  14527. if (operation.type !== 'delete' && operation.type !== 'put') {
  14528. throw webidl.errors.exception({
  14529. header: 'Cache.#batchCacheOperations',
  14530. message: 'operation type does not match "delete" or "put"'
  14531. })
  14532. }
  14533. // 4.2.2
  14534. if (operation.type === 'delete' && operation.response != null) {
  14535. throw webidl.errors.exception({
  14536. header: 'Cache.#batchCacheOperations',
  14537. message: 'delete operation should not have an associated response'
  14538. })
  14539. }
  14540. // 4.2.3
  14541. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14542. throw new DOMException('???', 'InvalidStateError')
  14543. }
  14544. // 4.2.4
  14545. let requestResponses
  14546. // 4.2.5
  14547. if (operation.type === 'delete') {
  14548. // 4.2.5.1
  14549. requestResponses = this.#queryCache(operation.request, operation.options)
  14550. // TODO: the spec is wrong, this is needed to pass WPTs
  14551. if (requestResponses.length === 0) {
  14552. return []
  14553. }
  14554. // 4.2.5.2
  14555. for (const requestResponse of requestResponses) {
  14556. const idx = cache.indexOf(requestResponse)
  14557. assert(idx !== -1)
  14558. // 4.2.5.2.1
  14559. cache.splice(idx, 1)
  14560. }
  14561. } else if (operation.type === 'put') { // 4.2.6
  14562. // 4.2.6.1
  14563. if (operation.response == null) {
  14564. throw webidl.errors.exception({
  14565. header: 'Cache.#batchCacheOperations',
  14566. message: 'put operation should have an associated response'
  14567. })
  14568. }
  14569. // 4.2.6.2
  14570. const r = operation.request
  14571. // 4.2.6.3
  14572. if (!urlIsHttpHttpsScheme(r.url)) {
  14573. throw webidl.errors.exception({
  14574. header: 'Cache.#batchCacheOperations',
  14575. message: 'expected http or https scheme'
  14576. })
  14577. }
  14578. // 4.2.6.4
  14579. if (r.method !== 'GET') {
  14580. throw webidl.errors.exception({
  14581. header: 'Cache.#batchCacheOperations',
  14582. message: 'not get method'
  14583. })
  14584. }
  14585. // 4.2.6.5
  14586. if (operation.options != null) {
  14587. throw webidl.errors.exception({
  14588. header: 'Cache.#batchCacheOperations',
  14589. message: 'options must not be defined'
  14590. })
  14591. }
  14592. // 4.2.6.6
  14593. requestResponses = this.#queryCache(operation.request)
  14594. // 4.2.6.7
  14595. for (const requestResponse of requestResponses) {
  14596. const idx = cache.indexOf(requestResponse)
  14597. assert(idx !== -1)
  14598. // 4.2.6.7.1
  14599. cache.splice(idx, 1)
  14600. }
  14601. // 4.2.6.8
  14602. cache.push([operation.request, operation.response])
  14603. // 4.2.6.10
  14604. addedItems.push([operation.request, operation.response])
  14605. }
  14606. // 4.2.7
  14607. resultList.push([operation.request, operation.response])
  14608. }
  14609. // 4.3
  14610. return resultList
  14611. } catch (e) { // 5.
  14612. // 5.1
  14613. this.#relevantRequestResponseList.length = 0
  14614. // 5.2
  14615. this.#relevantRequestResponseList = backupCache
  14616. // 5.3
  14617. throw e
  14618. }
  14619. }
  14620. /**
  14621. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14622. * @param {any} requestQuery
  14623. * @param {import('../../types/cache').CacheQueryOptions} options
  14624. * @param {requestResponseList} targetStorage
  14625. * @returns {requestResponseList}
  14626. */
  14627. #queryCache (requestQuery, options, targetStorage) {
  14628. /** @type {requestResponseList} */
  14629. const resultList = []
  14630. const storage = targetStorage ?? this.#relevantRequestResponseList
  14631. for (const requestResponse of storage) {
  14632. const [cachedRequest, cachedResponse] = requestResponse
  14633. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14634. resultList.push(requestResponse)
  14635. }
  14636. }
  14637. return resultList
  14638. }
  14639. /**
  14640. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14641. * @param {any} requestQuery
  14642. * @param {any} request
  14643. * @param {any | null} response
  14644. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14645. * @returns {boolean}
  14646. */
  14647. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14648. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14649. // return false
  14650. // }
  14651. const queryURL = new URL(requestQuery.url)
  14652. const cachedURL = new URL(request.url)
  14653. if (options?.ignoreSearch) {
  14654. cachedURL.search = ''
  14655. queryURL.search = ''
  14656. }
  14657. if (!urlEquals(queryURL, cachedURL, true)) {
  14658. return false
  14659. }
  14660. if (
  14661. response == null ||
  14662. options?.ignoreVary ||
  14663. !response.headersList.contains('vary')
  14664. ) {
  14665. return true
  14666. }
  14667. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14668. for (const fieldValue of fieldValues) {
  14669. if (fieldValue === '*') {
  14670. return false
  14671. }
  14672. const requestValue = request.headersList.get(fieldValue)
  14673. const queryValue = requestQuery.headersList.get(fieldValue)
  14674. // If one has the header and the other doesn't, or one has
  14675. // a different value than the other, return false
  14676. if (requestValue !== queryValue) {
  14677. return false
  14678. }
  14679. }
  14680. return true
  14681. }
  14682. }
  14683. Object.defineProperties(Cache.prototype, {
  14684. [Symbol.toStringTag]: {
  14685. value: 'Cache',
  14686. configurable: true
  14687. },
  14688. match: kEnumerableProperty,
  14689. matchAll: kEnumerableProperty,
  14690. add: kEnumerableProperty,
  14691. addAll: kEnumerableProperty,
  14692. put: kEnumerableProperty,
  14693. delete: kEnumerableProperty,
  14694. keys: kEnumerableProperty
  14695. })
  14696. const cacheQueryOptionConverters = [
  14697. {
  14698. key: 'ignoreSearch',
  14699. converter: webidl.converters.boolean,
  14700. defaultValue: false
  14701. },
  14702. {
  14703. key: 'ignoreMethod',
  14704. converter: webidl.converters.boolean,
  14705. defaultValue: false
  14706. },
  14707. {
  14708. key: 'ignoreVary',
  14709. converter: webidl.converters.boolean,
  14710. defaultValue: false
  14711. }
  14712. ]
  14713. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14714. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14715. ...cacheQueryOptionConverters,
  14716. {
  14717. key: 'cacheName',
  14718. converter: webidl.converters.DOMString
  14719. }
  14720. ])
  14721. webidl.converters.Response = webidl.interfaceConverter(Response)
  14722. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14723. webidl.converters.RequestInfo
  14724. )
  14725. module.exports = {
  14726. Cache
  14727. }
  14728. /***/ }),
  14729. /***/ 7907:
  14730. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14731. "use strict";
  14732. const { kConstruct } = __nccwpck_require__(9174)
  14733. const { Cache } = __nccwpck_require__(6101)
  14734. const { webidl } = __nccwpck_require__(1744)
  14735. const { kEnumerableProperty } = __nccwpck_require__(3983)
  14736. class CacheStorage {
  14737. /**
  14738. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  14739. * @type {Map<string, import('./cache').requestResponseList}
  14740. */
  14741. #caches = new Map()
  14742. constructor () {
  14743. if (arguments[0] !== kConstruct) {
  14744. webidl.illegalConstructor()
  14745. }
  14746. }
  14747. async match (request, options = {}) {
  14748. webidl.brandCheck(this, CacheStorage)
  14749. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  14750. request = webidl.converters.RequestInfo(request)
  14751. options = webidl.converters.MultiCacheQueryOptions(options)
  14752. // 1.
  14753. if (options.cacheName != null) {
  14754. // 1.1.1.1
  14755. if (this.#caches.has(options.cacheName)) {
  14756. // 1.1.1.1.1
  14757. const cacheList = this.#caches.get(options.cacheName)
  14758. const cache = new Cache(kConstruct, cacheList)
  14759. return await cache.match(request, options)
  14760. }
  14761. } else { // 2.
  14762. // 2.2
  14763. for (const cacheList of this.#caches.values()) {
  14764. const cache = new Cache(kConstruct, cacheList)
  14765. // 2.2.1.2
  14766. const response = await cache.match(request, options)
  14767. if (response !== undefined) {
  14768. return response
  14769. }
  14770. }
  14771. }
  14772. }
  14773. /**
  14774. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  14775. * @param {string} cacheName
  14776. * @returns {Promise<boolean>}
  14777. */
  14778. async has (cacheName) {
  14779. webidl.brandCheck(this, CacheStorage)
  14780. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  14781. cacheName = webidl.converters.DOMString(cacheName)
  14782. // 2.1.1
  14783. // 2.2
  14784. return this.#caches.has(cacheName)
  14785. }
  14786. /**
  14787. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  14788. * @param {string} cacheName
  14789. * @returns {Promise<Cache>}
  14790. */
  14791. async open (cacheName) {
  14792. webidl.brandCheck(this, CacheStorage)
  14793. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  14794. cacheName = webidl.converters.DOMString(cacheName)
  14795. // 2.1
  14796. if (this.#caches.has(cacheName)) {
  14797. // await caches.open('v1') !== await caches.open('v1')
  14798. // 2.1.1
  14799. const cache = this.#caches.get(cacheName)
  14800. // 2.1.1.1
  14801. return new Cache(kConstruct, cache)
  14802. }
  14803. // 2.2
  14804. const cache = []
  14805. // 2.3
  14806. this.#caches.set(cacheName, cache)
  14807. // 2.4
  14808. return new Cache(kConstruct, cache)
  14809. }
  14810. /**
  14811. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  14812. * @param {string} cacheName
  14813. * @returns {Promise<boolean>}
  14814. */
  14815. async delete (cacheName) {
  14816. webidl.brandCheck(this, CacheStorage)
  14817. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  14818. cacheName = webidl.converters.DOMString(cacheName)
  14819. return this.#caches.delete(cacheName)
  14820. }
  14821. /**
  14822. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  14823. * @returns {string[]}
  14824. */
  14825. async keys () {
  14826. webidl.brandCheck(this, CacheStorage)
  14827. // 2.1
  14828. const keys = this.#caches.keys()
  14829. // 2.2
  14830. return [...keys]
  14831. }
  14832. }
  14833. Object.defineProperties(CacheStorage.prototype, {
  14834. [Symbol.toStringTag]: {
  14835. value: 'CacheStorage',
  14836. configurable: true
  14837. },
  14838. match: kEnumerableProperty,
  14839. has: kEnumerableProperty,
  14840. open: kEnumerableProperty,
  14841. delete: kEnumerableProperty,
  14842. keys: kEnumerableProperty
  14843. })
  14844. module.exports = {
  14845. CacheStorage
  14846. }
  14847. /***/ }),
  14848. /***/ 9174:
  14849. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14850. "use strict";
  14851. module.exports = {
  14852. kConstruct: (__nccwpck_require__(2785).kConstruct)
  14853. }
  14854. /***/ }),
  14855. /***/ 2396:
  14856. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14857. "use strict";
  14858. const assert = __nccwpck_require__(9491)
  14859. const { URLSerializer } = __nccwpck_require__(685)
  14860. const { isValidHeaderName } = __nccwpck_require__(2538)
  14861. /**
  14862. * @see https://url.spec.whatwg.org/#concept-url-equals
  14863. * @param {URL} A
  14864. * @param {URL} B
  14865. * @param {boolean | undefined} excludeFragment
  14866. * @returns {boolean}
  14867. */
  14868. function urlEquals (A, B, excludeFragment = false) {
  14869. const serializedA = URLSerializer(A, excludeFragment)
  14870. const serializedB = URLSerializer(B, excludeFragment)
  14871. return serializedA === serializedB
  14872. }
  14873. /**
  14874. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  14875. * @param {string} header
  14876. */
  14877. function fieldValues (header) {
  14878. assert(header !== null)
  14879. const values = []
  14880. for (let value of header.split(',')) {
  14881. value = value.trim()
  14882. if (!value.length) {
  14883. continue
  14884. } else if (!isValidHeaderName(value)) {
  14885. continue
  14886. }
  14887. values.push(value)
  14888. }
  14889. return values
  14890. }
  14891. module.exports = {
  14892. urlEquals,
  14893. fieldValues
  14894. }
  14895. /***/ }),
  14896. /***/ 3598:
  14897. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14898. "use strict";
  14899. // @ts-check
  14900. /* global WebAssembly */
  14901. const assert = __nccwpck_require__(9491)
  14902. const net = __nccwpck_require__(1808)
  14903. const http = __nccwpck_require__(3685)
  14904. const { pipeline } = __nccwpck_require__(2781)
  14905. const util = __nccwpck_require__(3983)
  14906. const timers = __nccwpck_require__(9459)
  14907. const Request = __nccwpck_require__(2905)
  14908. const DispatcherBase = __nccwpck_require__(4839)
  14909. const {
  14910. RequestContentLengthMismatchError,
  14911. ResponseContentLengthMismatchError,
  14912. InvalidArgumentError,
  14913. RequestAbortedError,
  14914. HeadersTimeoutError,
  14915. HeadersOverflowError,
  14916. SocketError,
  14917. InformationalError,
  14918. BodyTimeoutError,
  14919. HTTPParserError,
  14920. ResponseExceededMaxSizeError,
  14921. ClientDestroyedError
  14922. } = __nccwpck_require__(8045)
  14923. const buildConnector = __nccwpck_require__(2067)
  14924. const {
  14925. kUrl,
  14926. kReset,
  14927. kServerName,
  14928. kClient,
  14929. kBusy,
  14930. kParser,
  14931. kConnect,
  14932. kBlocking,
  14933. kResuming,
  14934. kRunning,
  14935. kPending,
  14936. kSize,
  14937. kWriting,
  14938. kQueue,
  14939. kConnected,
  14940. kConnecting,
  14941. kNeedDrain,
  14942. kNoRef,
  14943. kKeepAliveDefaultTimeout,
  14944. kHostHeader,
  14945. kPendingIdx,
  14946. kRunningIdx,
  14947. kError,
  14948. kPipelining,
  14949. kSocket,
  14950. kKeepAliveTimeoutValue,
  14951. kMaxHeadersSize,
  14952. kKeepAliveMaxTimeout,
  14953. kKeepAliveTimeoutThreshold,
  14954. kHeadersTimeout,
  14955. kBodyTimeout,
  14956. kStrictContentLength,
  14957. kConnector,
  14958. kMaxRedirections,
  14959. kMaxRequests,
  14960. kCounter,
  14961. kClose,
  14962. kDestroy,
  14963. kDispatch,
  14964. kInterceptors,
  14965. kLocalAddress,
  14966. kMaxResponseSize,
  14967. kHTTPConnVersion,
  14968. // HTTP2
  14969. kHost,
  14970. kHTTP2Session,
  14971. kHTTP2SessionState,
  14972. kHTTP2BuildRequest,
  14973. kHTTP2CopyHeaders,
  14974. kHTTP1BuildRequest
  14975. } = __nccwpck_require__(2785)
  14976. /** @type {import('http2')} */
  14977. let http2
  14978. try {
  14979. http2 = __nccwpck_require__(5158)
  14980. } catch {
  14981. // @ts-ignore
  14982. http2 = { constants: {} }
  14983. }
  14984. const {
  14985. constants: {
  14986. HTTP2_HEADER_AUTHORITY,
  14987. HTTP2_HEADER_METHOD,
  14988. HTTP2_HEADER_PATH,
  14989. HTTP2_HEADER_SCHEME,
  14990. HTTP2_HEADER_CONTENT_LENGTH,
  14991. HTTP2_HEADER_EXPECT,
  14992. HTTP2_HEADER_STATUS
  14993. }
  14994. } = http2
  14995. // Experimental
  14996. let h2ExperimentalWarned = false
  14997. const FastBuffer = Buffer[Symbol.species]
  14998. const kClosedResolve = Symbol('kClosedResolve')
  14999. const channels = {}
  15000. try {
  15001. const diagnosticsChannel = __nccwpck_require__(7643)
  15002. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15003. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15004. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15005. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15006. } catch {
  15007. channels.sendHeaders = { hasSubscribers: false }
  15008. channels.beforeConnect = { hasSubscribers: false }
  15009. channels.connectError = { hasSubscribers: false }
  15010. channels.connected = { hasSubscribers: false }
  15011. }
  15012. /**
  15013. * @type {import('../types/client').default}
  15014. */
  15015. class Client extends DispatcherBase {
  15016. /**
  15017. *
  15018. * @param {string|URL} url
  15019. * @param {import('../types/client').Client.Options} options
  15020. */
  15021. constructor (url, {
  15022. interceptors,
  15023. maxHeaderSize,
  15024. headersTimeout,
  15025. socketTimeout,
  15026. requestTimeout,
  15027. connectTimeout,
  15028. bodyTimeout,
  15029. idleTimeout,
  15030. keepAlive,
  15031. keepAliveTimeout,
  15032. maxKeepAliveTimeout,
  15033. keepAliveMaxTimeout,
  15034. keepAliveTimeoutThreshold,
  15035. socketPath,
  15036. pipelining,
  15037. tls,
  15038. strictContentLength,
  15039. maxCachedSessions,
  15040. maxRedirections,
  15041. connect,
  15042. maxRequestsPerClient,
  15043. localAddress,
  15044. maxResponseSize,
  15045. autoSelectFamily,
  15046. autoSelectFamilyAttemptTimeout,
  15047. // h2
  15048. allowH2,
  15049. maxConcurrentStreams
  15050. } = {}) {
  15051. super()
  15052. if (keepAlive !== undefined) {
  15053. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15054. }
  15055. if (socketTimeout !== undefined) {
  15056. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15057. }
  15058. if (requestTimeout !== undefined) {
  15059. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15060. }
  15061. if (idleTimeout !== undefined) {
  15062. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15063. }
  15064. if (maxKeepAliveTimeout !== undefined) {
  15065. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15066. }
  15067. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15068. throw new InvalidArgumentError('invalid maxHeaderSize')
  15069. }
  15070. if (socketPath != null && typeof socketPath !== 'string') {
  15071. throw new InvalidArgumentError('invalid socketPath')
  15072. }
  15073. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15074. throw new InvalidArgumentError('invalid connectTimeout')
  15075. }
  15076. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15077. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15078. }
  15079. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15080. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15081. }
  15082. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15083. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15084. }
  15085. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15086. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15087. }
  15088. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15089. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15090. }
  15091. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15092. throw new InvalidArgumentError('connect must be a function or an object')
  15093. }
  15094. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15095. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15096. }
  15097. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15098. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15099. }
  15100. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15101. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15102. }
  15103. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15104. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15105. }
  15106. if (
  15107. autoSelectFamilyAttemptTimeout != null &&
  15108. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15109. ) {
  15110. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15111. }
  15112. // h2
  15113. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15114. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15115. }
  15116. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15117. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15118. }
  15119. if (typeof connect !== 'function') {
  15120. connect = buildConnector({
  15121. ...tls,
  15122. maxCachedSessions,
  15123. allowH2,
  15124. socketPath,
  15125. timeout: connectTimeout,
  15126. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15127. ...connect
  15128. })
  15129. }
  15130. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15131. ? interceptors.Client
  15132. : [createRedirectInterceptor({ maxRedirections })]
  15133. this[kUrl] = util.parseOrigin(url)
  15134. this[kConnector] = connect
  15135. this[kSocket] = null
  15136. this[kPipelining] = pipelining != null ? pipelining : 1
  15137. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15138. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15139. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15140. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15141. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15142. this[kServerName] = null
  15143. this[kLocalAddress] = localAddress != null ? localAddress : null
  15144. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15145. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15146. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15147. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15148. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15149. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15150. this[kMaxRedirections] = maxRedirections
  15151. this[kMaxRequests] = maxRequestsPerClient
  15152. this[kClosedResolve] = null
  15153. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15154. this[kHTTPConnVersion] = 'h1'
  15155. // HTTP/2
  15156. this[kHTTP2Session] = null
  15157. this[kHTTP2SessionState] = !allowH2
  15158. ? null
  15159. : {
  15160. // streams: null, // Fixed queue of streams - For future support of `push`
  15161. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15162. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15163. }
  15164. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15165. // kQueue is built up of 3 sections separated by
  15166. // the kRunningIdx and kPendingIdx indices.
  15167. // | complete | running | pending |
  15168. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15169. // kRunningIdx points to the first running element.
  15170. // kPendingIdx points to the first pending element.
  15171. // This implements a fast queue with an amortized
  15172. // time of O(1).
  15173. this[kQueue] = []
  15174. this[kRunningIdx] = 0
  15175. this[kPendingIdx] = 0
  15176. }
  15177. get pipelining () {
  15178. return this[kPipelining]
  15179. }
  15180. set pipelining (value) {
  15181. this[kPipelining] = value
  15182. resume(this, true)
  15183. }
  15184. get [kPending] () {
  15185. return this[kQueue].length - this[kPendingIdx]
  15186. }
  15187. get [kRunning] () {
  15188. return this[kPendingIdx] - this[kRunningIdx]
  15189. }
  15190. get [kSize] () {
  15191. return this[kQueue].length - this[kRunningIdx]
  15192. }
  15193. get [kConnected] () {
  15194. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15195. }
  15196. get [kBusy] () {
  15197. const socket = this[kSocket]
  15198. return (
  15199. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15200. (this[kSize] >= (this[kPipelining] || 1)) ||
  15201. this[kPending] > 0
  15202. )
  15203. }
  15204. /* istanbul ignore: only used for test */
  15205. [kConnect] (cb) {
  15206. connect(this)
  15207. this.once('connect', cb)
  15208. }
  15209. [kDispatch] (opts, handler) {
  15210. const origin = opts.origin || this[kUrl].origin
  15211. const request = this[kHTTPConnVersion] === 'h2'
  15212. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15213. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15214. this[kQueue].push(request)
  15215. if (this[kResuming]) {
  15216. // Do nothing.
  15217. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15218. // Wait a tick in case stream/iterator is ended in the same tick.
  15219. this[kResuming] = 1
  15220. process.nextTick(resume, this)
  15221. } else {
  15222. resume(this, true)
  15223. }
  15224. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15225. this[kNeedDrain] = 2
  15226. }
  15227. return this[kNeedDrain] < 2
  15228. }
  15229. async [kClose] () {
  15230. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15231. // request and close each stream.
  15232. return new Promise((resolve) => {
  15233. if (!this[kSize]) {
  15234. resolve(null)
  15235. } else {
  15236. this[kClosedResolve] = resolve
  15237. }
  15238. })
  15239. }
  15240. async [kDestroy] (err) {
  15241. return new Promise((resolve) => {
  15242. const requests = this[kQueue].splice(this[kPendingIdx])
  15243. for (let i = 0; i < requests.length; i++) {
  15244. const request = requests[i]
  15245. errorRequest(this, request, err)
  15246. }
  15247. const callback = () => {
  15248. if (this[kClosedResolve]) {
  15249. // TODO (fix): Should we error here with ClientDestroyedError?
  15250. this[kClosedResolve]()
  15251. this[kClosedResolve] = null
  15252. }
  15253. resolve()
  15254. }
  15255. if (this[kHTTP2Session] != null) {
  15256. util.destroy(this[kHTTP2Session], err)
  15257. this[kHTTP2Session] = null
  15258. this[kHTTP2SessionState] = null
  15259. }
  15260. if (!this[kSocket]) {
  15261. queueMicrotask(callback)
  15262. } else {
  15263. util.destroy(this[kSocket].on('close', callback), err)
  15264. }
  15265. resume(this)
  15266. })
  15267. }
  15268. }
  15269. function onHttp2SessionError (err) {
  15270. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15271. this[kSocket][kError] = err
  15272. onError(this[kClient], err)
  15273. }
  15274. function onHttp2FrameError (type, code, id) {
  15275. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15276. if (id === 0) {
  15277. this[kSocket][kError] = err
  15278. onError(this[kClient], err)
  15279. }
  15280. }
  15281. function onHttp2SessionEnd () {
  15282. util.destroy(this, new SocketError('other side closed'))
  15283. util.destroy(this[kSocket], new SocketError('other side closed'))
  15284. }
  15285. function onHTTP2GoAway (code) {
  15286. const client = this[kClient]
  15287. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15288. client[kSocket] = null
  15289. client[kHTTP2Session] = null
  15290. if (client.destroyed) {
  15291. assert(this[kPending] === 0)
  15292. // Fail entire queue.
  15293. const requests = client[kQueue].splice(client[kRunningIdx])
  15294. for (let i = 0; i < requests.length; i++) {
  15295. const request = requests[i]
  15296. errorRequest(this, request, err)
  15297. }
  15298. } else if (client[kRunning] > 0) {
  15299. // Fail head of pipeline.
  15300. const request = client[kQueue][client[kRunningIdx]]
  15301. client[kQueue][client[kRunningIdx]++] = null
  15302. errorRequest(client, request, err)
  15303. }
  15304. client[kPendingIdx] = client[kRunningIdx]
  15305. assert(client[kRunning] === 0)
  15306. client.emit('disconnect',
  15307. client[kUrl],
  15308. [client],
  15309. err
  15310. )
  15311. resume(client)
  15312. }
  15313. const constants = __nccwpck_require__(953)
  15314. const createRedirectInterceptor = __nccwpck_require__(8861)
  15315. const EMPTY_BUF = Buffer.alloc(0)
  15316. async function lazyllhttp () {
  15317. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15318. let mod
  15319. try {
  15320. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15321. } catch (e) {
  15322. /* istanbul ignore next */
  15323. // We could check if the error was caused by the simd option not
  15324. // being enabled, but the occurring of this other error
  15325. // * https://github.com/emscripten-core/emscripten/issues/11495
  15326. // got me to remove that check to avoid breaking Node 12.
  15327. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15328. }
  15329. return await WebAssembly.instantiate(mod, {
  15330. env: {
  15331. /* eslint-disable camelcase */
  15332. wasm_on_url: (p, at, len) => {
  15333. /* istanbul ignore next */
  15334. return 0
  15335. },
  15336. wasm_on_status: (p, at, len) => {
  15337. assert.strictEqual(currentParser.ptr, p)
  15338. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15339. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15340. },
  15341. wasm_on_message_begin: (p) => {
  15342. assert.strictEqual(currentParser.ptr, p)
  15343. return currentParser.onMessageBegin() || 0
  15344. },
  15345. wasm_on_header_field: (p, at, len) => {
  15346. assert.strictEqual(currentParser.ptr, p)
  15347. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15348. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15349. },
  15350. wasm_on_header_value: (p, at, len) => {
  15351. assert.strictEqual(currentParser.ptr, p)
  15352. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15353. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15354. },
  15355. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15356. assert.strictEqual(currentParser.ptr, p)
  15357. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15358. },
  15359. wasm_on_body: (p, at, len) => {
  15360. assert.strictEqual(currentParser.ptr, p)
  15361. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15362. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15363. },
  15364. wasm_on_message_complete: (p) => {
  15365. assert.strictEqual(currentParser.ptr, p)
  15366. return currentParser.onMessageComplete() || 0
  15367. }
  15368. /* eslint-enable camelcase */
  15369. }
  15370. })
  15371. }
  15372. let llhttpInstance = null
  15373. let llhttpPromise = lazyllhttp()
  15374. llhttpPromise.catch()
  15375. let currentParser = null
  15376. let currentBufferRef = null
  15377. let currentBufferSize = 0
  15378. let currentBufferPtr = null
  15379. const TIMEOUT_HEADERS = 1
  15380. const TIMEOUT_BODY = 2
  15381. const TIMEOUT_IDLE = 3
  15382. class Parser {
  15383. constructor (client, socket, { exports }) {
  15384. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15385. this.llhttp = exports
  15386. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15387. this.client = client
  15388. this.socket = socket
  15389. this.timeout = null
  15390. this.timeoutValue = null
  15391. this.timeoutType = null
  15392. this.statusCode = null
  15393. this.statusText = ''
  15394. this.upgrade = false
  15395. this.headers = []
  15396. this.headersSize = 0
  15397. this.headersMaxSize = client[kMaxHeadersSize]
  15398. this.shouldKeepAlive = false
  15399. this.paused = false
  15400. this.resume = this.resume.bind(this)
  15401. this.bytesRead = 0
  15402. this.keepAlive = ''
  15403. this.contentLength = ''
  15404. this.connection = ''
  15405. this.maxResponseSize = client[kMaxResponseSize]
  15406. }
  15407. setTimeout (value, type) {
  15408. this.timeoutType = type
  15409. if (value !== this.timeoutValue) {
  15410. timers.clearTimeout(this.timeout)
  15411. if (value) {
  15412. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15413. // istanbul ignore else: only for jest
  15414. if (this.timeout.unref) {
  15415. this.timeout.unref()
  15416. }
  15417. } else {
  15418. this.timeout = null
  15419. }
  15420. this.timeoutValue = value
  15421. } else if (this.timeout) {
  15422. // istanbul ignore else: only for jest
  15423. if (this.timeout.refresh) {
  15424. this.timeout.refresh()
  15425. }
  15426. }
  15427. }
  15428. resume () {
  15429. if (this.socket.destroyed || !this.paused) {
  15430. return
  15431. }
  15432. assert(this.ptr != null)
  15433. assert(currentParser == null)
  15434. this.llhttp.llhttp_resume(this.ptr)
  15435. assert(this.timeoutType === TIMEOUT_BODY)
  15436. if (this.timeout) {
  15437. // istanbul ignore else: only for jest
  15438. if (this.timeout.refresh) {
  15439. this.timeout.refresh()
  15440. }
  15441. }
  15442. this.paused = false
  15443. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15444. this.readMore()
  15445. }
  15446. readMore () {
  15447. while (!this.paused && this.ptr) {
  15448. const chunk = this.socket.read()
  15449. if (chunk === null) {
  15450. break
  15451. }
  15452. this.execute(chunk)
  15453. }
  15454. }
  15455. execute (data) {
  15456. assert(this.ptr != null)
  15457. assert(currentParser == null)
  15458. assert(!this.paused)
  15459. const { socket, llhttp } = this
  15460. if (data.length > currentBufferSize) {
  15461. if (currentBufferPtr) {
  15462. llhttp.free(currentBufferPtr)
  15463. }
  15464. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15465. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15466. }
  15467. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15468. // Call `execute` on the wasm parser.
  15469. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15470. // and finally the length of bytes to parse.
  15471. // The return value is an error code or `constants.ERROR.OK`.
  15472. try {
  15473. let ret
  15474. try {
  15475. currentBufferRef = data
  15476. currentParser = this
  15477. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15478. /* eslint-disable-next-line no-useless-catch */
  15479. } catch (err) {
  15480. /* istanbul ignore next: difficult to make a test case for */
  15481. throw err
  15482. } finally {
  15483. currentParser = null
  15484. currentBufferRef = null
  15485. }
  15486. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15487. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15488. this.onUpgrade(data.slice(offset))
  15489. } else if (ret === constants.ERROR.PAUSED) {
  15490. this.paused = true
  15491. socket.unshift(data.slice(offset))
  15492. } else if (ret !== constants.ERROR.OK) {
  15493. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15494. let message = ''
  15495. /* istanbul ignore else: difficult to make a test case for */
  15496. if (ptr) {
  15497. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15498. message =
  15499. 'Response does not match the HTTP/1.1 protocol (' +
  15500. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15501. ')'
  15502. }
  15503. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15504. }
  15505. } catch (err) {
  15506. util.destroy(socket, err)
  15507. }
  15508. }
  15509. destroy () {
  15510. assert(this.ptr != null)
  15511. assert(currentParser == null)
  15512. this.llhttp.llhttp_free(this.ptr)
  15513. this.ptr = null
  15514. timers.clearTimeout(this.timeout)
  15515. this.timeout = null
  15516. this.timeoutValue = null
  15517. this.timeoutType = null
  15518. this.paused = false
  15519. }
  15520. onStatus (buf) {
  15521. this.statusText = buf.toString()
  15522. }
  15523. onMessageBegin () {
  15524. const { socket, client } = this
  15525. /* istanbul ignore next: difficult to make a test case for */
  15526. if (socket.destroyed) {
  15527. return -1
  15528. }
  15529. const request = client[kQueue][client[kRunningIdx]]
  15530. if (!request) {
  15531. return -1
  15532. }
  15533. }
  15534. onHeaderField (buf) {
  15535. const len = this.headers.length
  15536. if ((len & 1) === 0) {
  15537. this.headers.push(buf)
  15538. } else {
  15539. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15540. }
  15541. this.trackHeader(buf.length)
  15542. }
  15543. onHeaderValue (buf) {
  15544. let len = this.headers.length
  15545. if ((len & 1) === 1) {
  15546. this.headers.push(buf)
  15547. len += 1
  15548. } else {
  15549. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15550. }
  15551. const key = this.headers[len - 2]
  15552. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15553. this.keepAlive += buf.toString()
  15554. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15555. this.connection += buf.toString()
  15556. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15557. this.contentLength += buf.toString()
  15558. }
  15559. this.trackHeader(buf.length)
  15560. }
  15561. trackHeader (len) {
  15562. this.headersSize += len
  15563. if (this.headersSize >= this.headersMaxSize) {
  15564. util.destroy(this.socket, new HeadersOverflowError())
  15565. }
  15566. }
  15567. onUpgrade (head) {
  15568. const { upgrade, client, socket, headers, statusCode } = this
  15569. assert(upgrade)
  15570. const request = client[kQueue][client[kRunningIdx]]
  15571. assert(request)
  15572. assert(!socket.destroyed)
  15573. assert(socket === client[kSocket])
  15574. assert(!this.paused)
  15575. assert(request.upgrade || request.method === 'CONNECT')
  15576. this.statusCode = null
  15577. this.statusText = ''
  15578. this.shouldKeepAlive = null
  15579. assert(this.headers.length % 2 === 0)
  15580. this.headers = []
  15581. this.headersSize = 0
  15582. socket.unshift(head)
  15583. socket[kParser].destroy()
  15584. socket[kParser] = null
  15585. socket[kClient] = null
  15586. socket[kError] = null
  15587. socket
  15588. .removeListener('error', onSocketError)
  15589. .removeListener('readable', onSocketReadable)
  15590. .removeListener('end', onSocketEnd)
  15591. .removeListener('close', onSocketClose)
  15592. client[kSocket] = null
  15593. client[kQueue][client[kRunningIdx]++] = null
  15594. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15595. try {
  15596. request.onUpgrade(statusCode, headers, socket)
  15597. } catch (err) {
  15598. util.destroy(socket, err)
  15599. }
  15600. resume(client)
  15601. }
  15602. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15603. const { client, socket, headers, statusText } = this
  15604. /* istanbul ignore next: difficult to make a test case for */
  15605. if (socket.destroyed) {
  15606. return -1
  15607. }
  15608. const request = client[kQueue][client[kRunningIdx]]
  15609. /* istanbul ignore next: difficult to make a test case for */
  15610. if (!request) {
  15611. return -1
  15612. }
  15613. assert(!this.upgrade)
  15614. assert(this.statusCode < 200)
  15615. if (statusCode === 100) {
  15616. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15617. return -1
  15618. }
  15619. /* this can only happen if server is misbehaving */
  15620. if (upgrade && !request.upgrade) {
  15621. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15622. return -1
  15623. }
  15624. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15625. this.statusCode = statusCode
  15626. this.shouldKeepAlive = (
  15627. shouldKeepAlive ||
  15628. // Override llhttp value which does not allow keepAlive for HEAD.
  15629. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15630. )
  15631. if (this.statusCode >= 200) {
  15632. const bodyTimeout = request.bodyTimeout != null
  15633. ? request.bodyTimeout
  15634. : client[kBodyTimeout]
  15635. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15636. } else if (this.timeout) {
  15637. // istanbul ignore else: only for jest
  15638. if (this.timeout.refresh) {
  15639. this.timeout.refresh()
  15640. }
  15641. }
  15642. if (request.method === 'CONNECT') {
  15643. assert(client[kRunning] === 1)
  15644. this.upgrade = true
  15645. return 2
  15646. }
  15647. if (upgrade) {
  15648. assert(client[kRunning] === 1)
  15649. this.upgrade = true
  15650. return 2
  15651. }
  15652. assert(this.headers.length % 2 === 0)
  15653. this.headers = []
  15654. this.headersSize = 0
  15655. if (this.shouldKeepAlive && client[kPipelining]) {
  15656. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15657. if (keepAliveTimeout != null) {
  15658. const timeout = Math.min(
  15659. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15660. client[kKeepAliveMaxTimeout]
  15661. )
  15662. if (timeout <= 0) {
  15663. socket[kReset] = true
  15664. } else {
  15665. client[kKeepAliveTimeoutValue] = timeout
  15666. }
  15667. } else {
  15668. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15669. }
  15670. } else {
  15671. // Stop more requests from being dispatched.
  15672. socket[kReset] = true
  15673. }
  15674. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15675. if (request.aborted) {
  15676. return -1
  15677. }
  15678. if (request.method === 'HEAD') {
  15679. return 1
  15680. }
  15681. if (statusCode < 200) {
  15682. return 1
  15683. }
  15684. if (socket[kBlocking]) {
  15685. socket[kBlocking] = false
  15686. resume(client)
  15687. }
  15688. return pause ? constants.ERROR.PAUSED : 0
  15689. }
  15690. onBody (buf) {
  15691. const { client, socket, statusCode, maxResponseSize } = this
  15692. if (socket.destroyed) {
  15693. return -1
  15694. }
  15695. const request = client[kQueue][client[kRunningIdx]]
  15696. assert(request)
  15697. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15698. if (this.timeout) {
  15699. // istanbul ignore else: only for jest
  15700. if (this.timeout.refresh) {
  15701. this.timeout.refresh()
  15702. }
  15703. }
  15704. assert(statusCode >= 200)
  15705. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15706. util.destroy(socket, new ResponseExceededMaxSizeError())
  15707. return -1
  15708. }
  15709. this.bytesRead += buf.length
  15710. if (request.onData(buf) === false) {
  15711. return constants.ERROR.PAUSED
  15712. }
  15713. }
  15714. onMessageComplete () {
  15715. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15716. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15717. return -1
  15718. }
  15719. if (upgrade) {
  15720. return
  15721. }
  15722. const request = client[kQueue][client[kRunningIdx]]
  15723. assert(request)
  15724. assert(statusCode >= 100)
  15725. this.statusCode = null
  15726. this.statusText = ''
  15727. this.bytesRead = 0
  15728. this.contentLength = ''
  15729. this.keepAlive = ''
  15730. this.connection = ''
  15731. assert(this.headers.length % 2 === 0)
  15732. this.headers = []
  15733. this.headersSize = 0
  15734. if (statusCode < 200) {
  15735. return
  15736. }
  15737. /* istanbul ignore next: should be handled by llhttp? */
  15738. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  15739. util.destroy(socket, new ResponseContentLengthMismatchError())
  15740. return -1
  15741. }
  15742. request.onComplete(headers)
  15743. client[kQueue][client[kRunningIdx]++] = null
  15744. if (socket[kWriting]) {
  15745. assert.strictEqual(client[kRunning], 0)
  15746. // Response completed before request.
  15747. util.destroy(socket, new InformationalError('reset'))
  15748. return constants.ERROR.PAUSED
  15749. } else if (!shouldKeepAlive) {
  15750. util.destroy(socket, new InformationalError('reset'))
  15751. return constants.ERROR.PAUSED
  15752. } else if (socket[kReset] && client[kRunning] === 0) {
  15753. // Destroy socket once all requests have completed.
  15754. // The request at the tail of the pipeline is the one
  15755. // that requested reset and no further requests should
  15756. // have been queued since then.
  15757. util.destroy(socket, new InformationalError('reset'))
  15758. return constants.ERROR.PAUSED
  15759. } else if (client[kPipelining] === 1) {
  15760. // We must wait a full event loop cycle to reuse this socket to make sure
  15761. // that non-spec compliant servers are not closing the connection even if they
  15762. // said they won't.
  15763. setImmediate(resume, client)
  15764. } else {
  15765. resume(client)
  15766. }
  15767. }
  15768. }
  15769. function onParserTimeout (parser) {
  15770. const { socket, timeoutType, client } = parser
  15771. /* istanbul ignore else */
  15772. if (timeoutType === TIMEOUT_HEADERS) {
  15773. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  15774. assert(!parser.paused, 'cannot be paused while waiting for headers')
  15775. util.destroy(socket, new HeadersTimeoutError())
  15776. }
  15777. } else if (timeoutType === TIMEOUT_BODY) {
  15778. if (!parser.paused) {
  15779. util.destroy(socket, new BodyTimeoutError())
  15780. }
  15781. } else if (timeoutType === TIMEOUT_IDLE) {
  15782. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  15783. util.destroy(socket, new InformationalError('socket idle timeout'))
  15784. }
  15785. }
  15786. function onSocketReadable () {
  15787. const { [kParser]: parser } = this
  15788. if (parser) {
  15789. parser.readMore()
  15790. }
  15791. }
  15792. function onSocketError (err) {
  15793. const { [kClient]: client, [kParser]: parser } = this
  15794. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15795. if (client[kHTTPConnVersion] !== 'h2') {
  15796. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  15797. // to the user.
  15798. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  15799. // We treat all incoming data so for as a valid response.
  15800. parser.onMessageComplete()
  15801. return
  15802. }
  15803. }
  15804. this[kError] = err
  15805. onError(this[kClient], err)
  15806. }
  15807. function onError (client, err) {
  15808. if (
  15809. client[kRunning] === 0 &&
  15810. err.code !== 'UND_ERR_INFO' &&
  15811. err.code !== 'UND_ERR_SOCKET'
  15812. ) {
  15813. // Error is not caused by running request and not a recoverable
  15814. // socket error.
  15815. assert(client[kPendingIdx] === client[kRunningIdx])
  15816. const requests = client[kQueue].splice(client[kRunningIdx])
  15817. for (let i = 0; i < requests.length; i++) {
  15818. const request = requests[i]
  15819. errorRequest(client, request, err)
  15820. }
  15821. assert(client[kSize] === 0)
  15822. }
  15823. }
  15824. function onSocketEnd () {
  15825. const { [kParser]: parser, [kClient]: client } = this
  15826. if (client[kHTTPConnVersion] !== 'h2') {
  15827. if (parser.statusCode && !parser.shouldKeepAlive) {
  15828. // We treat all incoming data so far as a valid response.
  15829. parser.onMessageComplete()
  15830. return
  15831. }
  15832. }
  15833. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  15834. }
  15835. function onSocketClose () {
  15836. const { [kClient]: client, [kParser]: parser } = this
  15837. if (client[kHTTPConnVersion] === 'h1' && parser) {
  15838. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  15839. // We treat all incoming data so far as a valid response.
  15840. parser.onMessageComplete()
  15841. }
  15842. this[kParser].destroy()
  15843. this[kParser] = null
  15844. }
  15845. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  15846. client[kSocket] = null
  15847. if (client.destroyed) {
  15848. assert(client[kPending] === 0)
  15849. // Fail entire queue.
  15850. const requests = client[kQueue].splice(client[kRunningIdx])
  15851. for (let i = 0; i < requests.length; i++) {
  15852. const request = requests[i]
  15853. errorRequest(client, request, err)
  15854. }
  15855. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  15856. // Fail head of pipeline.
  15857. const request = client[kQueue][client[kRunningIdx]]
  15858. client[kQueue][client[kRunningIdx]++] = null
  15859. errorRequest(client, request, err)
  15860. }
  15861. client[kPendingIdx] = client[kRunningIdx]
  15862. assert(client[kRunning] === 0)
  15863. client.emit('disconnect', client[kUrl], [client], err)
  15864. resume(client)
  15865. }
  15866. async function connect (client) {
  15867. assert(!client[kConnecting])
  15868. assert(!client[kSocket])
  15869. let { host, hostname, protocol, port } = client[kUrl]
  15870. // Resolve ipv6
  15871. if (hostname[0] === '[') {
  15872. const idx = hostname.indexOf(']')
  15873. assert(idx !== -1)
  15874. const ip = hostname.substring(1, idx)
  15875. assert(net.isIP(ip))
  15876. hostname = ip
  15877. }
  15878. client[kConnecting] = true
  15879. if (channels.beforeConnect.hasSubscribers) {
  15880. channels.beforeConnect.publish({
  15881. connectParams: {
  15882. host,
  15883. hostname,
  15884. protocol,
  15885. port,
  15886. servername: client[kServerName],
  15887. localAddress: client[kLocalAddress]
  15888. },
  15889. connector: client[kConnector]
  15890. })
  15891. }
  15892. try {
  15893. const socket = await new Promise((resolve, reject) => {
  15894. client[kConnector]({
  15895. host,
  15896. hostname,
  15897. protocol,
  15898. port,
  15899. servername: client[kServerName],
  15900. localAddress: client[kLocalAddress]
  15901. }, (err, socket) => {
  15902. if (err) {
  15903. reject(err)
  15904. } else {
  15905. resolve(socket)
  15906. }
  15907. })
  15908. })
  15909. if (client.destroyed) {
  15910. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  15911. return
  15912. }
  15913. client[kConnecting] = false
  15914. assert(socket)
  15915. const isH2 = socket.alpnProtocol === 'h2'
  15916. if (isH2) {
  15917. if (!h2ExperimentalWarned) {
  15918. h2ExperimentalWarned = true
  15919. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  15920. code: 'UNDICI-H2'
  15921. })
  15922. }
  15923. const session = http2.connect(client[kUrl], {
  15924. createConnection: () => socket,
  15925. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  15926. })
  15927. client[kHTTPConnVersion] = 'h2'
  15928. session[kClient] = client
  15929. session[kSocket] = socket
  15930. session.on('error', onHttp2SessionError)
  15931. session.on('frameError', onHttp2FrameError)
  15932. session.on('end', onHttp2SessionEnd)
  15933. session.on('goaway', onHTTP2GoAway)
  15934. session.on('close', onSocketClose)
  15935. session.unref()
  15936. client[kHTTP2Session] = session
  15937. socket[kHTTP2Session] = session
  15938. } else {
  15939. if (!llhttpInstance) {
  15940. llhttpInstance = await llhttpPromise
  15941. llhttpPromise = null
  15942. }
  15943. socket[kNoRef] = false
  15944. socket[kWriting] = false
  15945. socket[kReset] = false
  15946. socket[kBlocking] = false
  15947. socket[kParser] = new Parser(client, socket, llhttpInstance)
  15948. }
  15949. socket[kCounter] = 0
  15950. socket[kMaxRequests] = client[kMaxRequests]
  15951. socket[kClient] = client
  15952. socket[kError] = null
  15953. socket
  15954. .on('error', onSocketError)
  15955. .on('readable', onSocketReadable)
  15956. .on('end', onSocketEnd)
  15957. .on('close', onSocketClose)
  15958. client[kSocket] = socket
  15959. if (channels.connected.hasSubscribers) {
  15960. channels.connected.publish({
  15961. connectParams: {
  15962. host,
  15963. hostname,
  15964. protocol,
  15965. port,
  15966. servername: client[kServerName],
  15967. localAddress: client[kLocalAddress]
  15968. },
  15969. connector: client[kConnector],
  15970. socket
  15971. })
  15972. }
  15973. client.emit('connect', client[kUrl], [client])
  15974. } catch (err) {
  15975. if (client.destroyed) {
  15976. return
  15977. }
  15978. client[kConnecting] = false
  15979. if (channels.connectError.hasSubscribers) {
  15980. channels.connectError.publish({
  15981. connectParams: {
  15982. host,
  15983. hostname,
  15984. protocol,
  15985. port,
  15986. servername: client[kServerName],
  15987. localAddress: client[kLocalAddress]
  15988. },
  15989. connector: client[kConnector],
  15990. error: err
  15991. })
  15992. }
  15993. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  15994. assert(client[kRunning] === 0)
  15995. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  15996. const request = client[kQueue][client[kPendingIdx]++]
  15997. errorRequest(client, request, err)
  15998. }
  15999. } else {
  16000. onError(client, err)
  16001. }
  16002. client.emit('connectionError', client[kUrl], [client], err)
  16003. }
  16004. resume(client)
  16005. }
  16006. function emitDrain (client) {
  16007. client[kNeedDrain] = 0
  16008. client.emit('drain', client[kUrl], [client])
  16009. }
  16010. function resume (client, sync) {
  16011. if (client[kResuming] === 2) {
  16012. return
  16013. }
  16014. client[kResuming] = 2
  16015. _resume(client, sync)
  16016. client[kResuming] = 0
  16017. if (client[kRunningIdx] > 256) {
  16018. client[kQueue].splice(0, client[kRunningIdx])
  16019. client[kPendingIdx] -= client[kRunningIdx]
  16020. client[kRunningIdx] = 0
  16021. }
  16022. }
  16023. function _resume (client, sync) {
  16024. while (true) {
  16025. if (client.destroyed) {
  16026. assert(client[kPending] === 0)
  16027. return
  16028. }
  16029. if (client[kClosedResolve] && !client[kSize]) {
  16030. client[kClosedResolve]()
  16031. client[kClosedResolve] = null
  16032. return
  16033. }
  16034. const socket = client[kSocket]
  16035. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16036. if (client[kSize] === 0) {
  16037. if (!socket[kNoRef] && socket.unref) {
  16038. socket.unref()
  16039. socket[kNoRef] = true
  16040. }
  16041. } else if (socket[kNoRef] && socket.ref) {
  16042. socket.ref()
  16043. socket[kNoRef] = false
  16044. }
  16045. if (client[kSize] === 0) {
  16046. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16047. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16048. }
  16049. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16050. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16051. const request = client[kQueue][client[kRunningIdx]]
  16052. const headersTimeout = request.headersTimeout != null
  16053. ? request.headersTimeout
  16054. : client[kHeadersTimeout]
  16055. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16056. }
  16057. }
  16058. }
  16059. if (client[kBusy]) {
  16060. client[kNeedDrain] = 2
  16061. } else if (client[kNeedDrain] === 2) {
  16062. if (sync) {
  16063. client[kNeedDrain] = 1
  16064. process.nextTick(emitDrain, client)
  16065. } else {
  16066. emitDrain(client)
  16067. }
  16068. continue
  16069. }
  16070. if (client[kPending] === 0) {
  16071. return
  16072. }
  16073. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16074. return
  16075. }
  16076. const request = client[kQueue][client[kPendingIdx]]
  16077. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16078. if (client[kRunning] > 0) {
  16079. return
  16080. }
  16081. client[kServerName] = request.servername
  16082. if (socket && socket.servername !== request.servername) {
  16083. util.destroy(socket, new InformationalError('servername changed'))
  16084. return
  16085. }
  16086. }
  16087. if (client[kConnecting]) {
  16088. return
  16089. }
  16090. if (!socket && !client[kHTTP2Session]) {
  16091. connect(client)
  16092. return
  16093. }
  16094. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16095. return
  16096. }
  16097. if (client[kRunning] > 0 && !request.idempotent) {
  16098. // Non-idempotent request cannot be retried.
  16099. // Ensure that no other requests are inflight and
  16100. // could cause failure.
  16101. return
  16102. }
  16103. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16104. // Don't dispatch an upgrade until all preceding requests have completed.
  16105. // A misbehaving server might upgrade the connection before all pipelined
  16106. // request has completed.
  16107. return
  16108. }
  16109. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16110. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16111. // Request with stream or iterator body can error while other requests
  16112. // are inflight and indirectly error those as well.
  16113. // Ensure this doesn't happen by waiting for inflight
  16114. // to complete before dispatching.
  16115. // Request with stream or iterator body cannot be retried.
  16116. // Ensure that no other requests are inflight and
  16117. // could cause failure.
  16118. return
  16119. }
  16120. if (!request.aborted && write(client, request)) {
  16121. client[kPendingIdx]++
  16122. } else {
  16123. client[kQueue].splice(client[kPendingIdx], 1)
  16124. }
  16125. }
  16126. }
  16127. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16128. function shouldSendContentLength (method) {
  16129. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16130. }
  16131. function write (client, request) {
  16132. if (client[kHTTPConnVersion] === 'h2') {
  16133. writeH2(client, client[kHTTP2Session], request)
  16134. return
  16135. }
  16136. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16137. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16138. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16139. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16140. // Sending a payload body on a request that does not
  16141. // expect it can cause undefined behavior on some
  16142. // servers and corrupt connection state. Do not
  16143. // re-use the connection for further requests.
  16144. const expectsPayload = (
  16145. method === 'PUT' ||
  16146. method === 'POST' ||
  16147. method === 'PATCH'
  16148. )
  16149. if (body && typeof body.read === 'function') {
  16150. // Try to read EOF in order to get length.
  16151. body.read(0)
  16152. }
  16153. const bodyLength = util.bodyLength(body)
  16154. let contentLength = bodyLength
  16155. if (contentLength === null) {
  16156. contentLength = request.contentLength
  16157. }
  16158. if (contentLength === 0 && !expectsPayload) {
  16159. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16160. // A user agent SHOULD NOT send a Content-Length header field when
  16161. // the request message does not contain a payload body and the method
  16162. // semantics do not anticipate such a body.
  16163. contentLength = null
  16164. }
  16165. // https://github.com/nodejs/undici/issues/2046
  16166. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16167. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16168. if (client[kStrictContentLength]) {
  16169. errorRequest(client, request, new RequestContentLengthMismatchError())
  16170. return false
  16171. }
  16172. process.emitWarning(new RequestContentLengthMismatchError())
  16173. }
  16174. const socket = client[kSocket]
  16175. try {
  16176. request.onConnect((err) => {
  16177. if (request.aborted || request.completed) {
  16178. return
  16179. }
  16180. errorRequest(client, request, err || new RequestAbortedError())
  16181. util.destroy(socket, new InformationalError('aborted'))
  16182. })
  16183. } catch (err) {
  16184. errorRequest(client, request, err)
  16185. }
  16186. if (request.aborted) {
  16187. return false
  16188. }
  16189. if (method === 'HEAD') {
  16190. // https://github.com/mcollina/undici/issues/258
  16191. // Close after a HEAD request to interop with misbehaving servers
  16192. // that may send a body in the response.
  16193. socket[kReset] = true
  16194. }
  16195. if (upgrade || method === 'CONNECT') {
  16196. // On CONNECT or upgrade, block pipeline from dispatching further
  16197. // requests on this connection.
  16198. socket[kReset] = true
  16199. }
  16200. if (reset != null) {
  16201. socket[kReset] = reset
  16202. }
  16203. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16204. socket[kReset] = true
  16205. }
  16206. if (blocking) {
  16207. socket[kBlocking] = true
  16208. }
  16209. let header = `${method} ${path} HTTP/1.1\r\n`
  16210. if (typeof host === 'string') {
  16211. header += `host: ${host}\r\n`
  16212. } else {
  16213. header += client[kHostHeader]
  16214. }
  16215. if (upgrade) {
  16216. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16217. } else if (client[kPipelining] && !socket[kReset]) {
  16218. header += 'connection: keep-alive\r\n'
  16219. } else {
  16220. header += 'connection: close\r\n'
  16221. }
  16222. if (headers) {
  16223. header += headers
  16224. }
  16225. if (channels.sendHeaders.hasSubscribers) {
  16226. channels.sendHeaders.publish({ request, headers: header, socket })
  16227. }
  16228. /* istanbul ignore else: assertion */
  16229. if (!body || bodyLength === 0) {
  16230. if (contentLength === 0) {
  16231. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16232. } else {
  16233. assert(contentLength === null, 'no body must not have content length')
  16234. socket.write(`${header}\r\n`, 'latin1')
  16235. }
  16236. request.onRequestSent()
  16237. } else if (util.isBuffer(body)) {
  16238. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16239. socket.cork()
  16240. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16241. socket.write(body)
  16242. socket.uncork()
  16243. request.onBodySent(body)
  16244. request.onRequestSent()
  16245. if (!expectsPayload) {
  16246. socket[kReset] = true
  16247. }
  16248. } else if (util.isBlobLike(body)) {
  16249. if (typeof body.stream === 'function') {
  16250. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16251. } else {
  16252. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16253. }
  16254. } else if (util.isStream(body)) {
  16255. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16256. } else if (util.isIterable(body)) {
  16257. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16258. } else {
  16259. assert(false)
  16260. }
  16261. return true
  16262. }
  16263. function writeH2 (client, session, request) {
  16264. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16265. let headers
  16266. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16267. else headers = reqHeaders
  16268. if (upgrade) {
  16269. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16270. return false
  16271. }
  16272. try {
  16273. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16274. request.onConnect((err) => {
  16275. if (request.aborted || request.completed) {
  16276. return
  16277. }
  16278. errorRequest(client, request, err || new RequestAbortedError())
  16279. })
  16280. } catch (err) {
  16281. errorRequest(client, request, err)
  16282. }
  16283. if (request.aborted) {
  16284. return false
  16285. }
  16286. /** @type {import('node:http2').ClientHttp2Stream} */
  16287. let stream
  16288. const h2State = client[kHTTP2SessionState]
  16289. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16290. headers[HTTP2_HEADER_METHOD] = method
  16291. if (method === 'CONNECT') {
  16292. session.ref()
  16293. // we are already connected, streams are pending, first request
  16294. // will create a new stream. We trigger a request to create the stream and wait until
  16295. // `ready` event is triggered
  16296. // We disabled endStream to allow the user to write to the stream
  16297. stream = session.request(headers, { endStream: false, signal })
  16298. if (stream.id && !stream.pending) {
  16299. request.onUpgrade(null, null, stream)
  16300. ++h2State.openStreams
  16301. } else {
  16302. stream.once('ready', () => {
  16303. request.onUpgrade(null, null, stream)
  16304. ++h2State.openStreams
  16305. })
  16306. }
  16307. stream.once('close', () => {
  16308. h2State.openStreams -= 1
  16309. // TODO(HTTP/2): unref only if current streams count is 0
  16310. if (h2State.openStreams === 0) session.unref()
  16311. })
  16312. return true
  16313. }
  16314. // https://tools.ietf.org/html/rfc7540#section-8.3
  16315. // :path and :scheme headers must be omited when sending CONNECT
  16316. headers[HTTP2_HEADER_PATH] = path
  16317. headers[HTTP2_HEADER_SCHEME] = 'https'
  16318. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16319. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16320. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16321. // Sending a payload body on a request that does not
  16322. // expect it can cause undefined behavior on some
  16323. // servers and corrupt connection state. Do not
  16324. // re-use the connection for further requests.
  16325. const expectsPayload = (
  16326. method === 'PUT' ||
  16327. method === 'POST' ||
  16328. method === 'PATCH'
  16329. )
  16330. if (body && typeof body.read === 'function') {
  16331. // Try to read EOF in order to get length.
  16332. body.read(0)
  16333. }
  16334. let contentLength = util.bodyLength(body)
  16335. if (contentLength == null) {
  16336. contentLength = request.contentLength
  16337. }
  16338. if (contentLength === 0 || !expectsPayload) {
  16339. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16340. // A user agent SHOULD NOT send a Content-Length header field when
  16341. // the request message does not contain a payload body and the method
  16342. // semantics do not anticipate such a body.
  16343. contentLength = null
  16344. }
  16345. // https://github.com/nodejs/undici/issues/2046
  16346. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16347. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16348. if (client[kStrictContentLength]) {
  16349. errorRequest(client, request, new RequestContentLengthMismatchError())
  16350. return false
  16351. }
  16352. process.emitWarning(new RequestContentLengthMismatchError())
  16353. }
  16354. if (contentLength != null) {
  16355. assert(body, 'no body must not have content length')
  16356. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16357. }
  16358. session.ref()
  16359. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16360. if (expectContinue) {
  16361. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16362. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16363. stream.once('continue', writeBodyH2)
  16364. } else {
  16365. stream = session.request(headers, {
  16366. endStream: shouldEndStream,
  16367. signal
  16368. })
  16369. writeBodyH2()
  16370. }
  16371. // Increment counter as we have new several streams open
  16372. ++h2State.openStreams
  16373. stream.once('response', headers => {
  16374. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16375. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16376. stream.pause()
  16377. }
  16378. })
  16379. stream.once('end', () => {
  16380. request.onComplete([])
  16381. })
  16382. stream.on('data', (chunk) => {
  16383. if (request.onData(chunk) === false) {
  16384. stream.pause()
  16385. }
  16386. })
  16387. stream.once('close', () => {
  16388. h2State.openStreams -= 1
  16389. // TODO(HTTP/2): unref only if current streams count is 0
  16390. if (h2State.openStreams === 0) {
  16391. session.unref()
  16392. }
  16393. })
  16394. stream.once('error', function (err) {
  16395. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16396. h2State.streams -= 1
  16397. util.destroy(stream, err)
  16398. }
  16399. })
  16400. stream.once('frameError', (type, code) => {
  16401. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16402. errorRequest(client, request, err)
  16403. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16404. h2State.streams -= 1
  16405. util.destroy(stream, err)
  16406. }
  16407. })
  16408. // stream.on('aborted', () => {
  16409. // // TODO(HTTP/2): Support aborted
  16410. // })
  16411. // stream.on('timeout', () => {
  16412. // // TODO(HTTP/2): Support timeout
  16413. // })
  16414. // stream.on('push', headers => {
  16415. // // TODO(HTTP/2): Suppor push
  16416. // })
  16417. // stream.on('trailers', headers => {
  16418. // // TODO(HTTP/2): Support trailers
  16419. // })
  16420. return true
  16421. function writeBodyH2 () {
  16422. /* istanbul ignore else: assertion */
  16423. if (!body) {
  16424. request.onRequestSent()
  16425. } else if (util.isBuffer(body)) {
  16426. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16427. stream.cork()
  16428. stream.write(body)
  16429. stream.uncork()
  16430. stream.end()
  16431. request.onBodySent(body)
  16432. request.onRequestSent()
  16433. } else if (util.isBlobLike(body)) {
  16434. if (typeof body.stream === 'function') {
  16435. writeIterable({
  16436. client,
  16437. request,
  16438. contentLength,
  16439. h2stream: stream,
  16440. expectsPayload,
  16441. body: body.stream(),
  16442. socket: client[kSocket],
  16443. header: ''
  16444. })
  16445. } else {
  16446. writeBlob({
  16447. body,
  16448. client,
  16449. request,
  16450. contentLength,
  16451. expectsPayload,
  16452. h2stream: stream,
  16453. header: '',
  16454. socket: client[kSocket]
  16455. })
  16456. }
  16457. } else if (util.isStream(body)) {
  16458. writeStream({
  16459. body,
  16460. client,
  16461. request,
  16462. contentLength,
  16463. expectsPayload,
  16464. socket: client[kSocket],
  16465. h2stream: stream,
  16466. header: ''
  16467. })
  16468. } else if (util.isIterable(body)) {
  16469. writeIterable({
  16470. body,
  16471. client,
  16472. request,
  16473. contentLength,
  16474. expectsPayload,
  16475. header: '',
  16476. h2stream: stream,
  16477. socket: client[kSocket]
  16478. })
  16479. } else {
  16480. assert(false)
  16481. }
  16482. }
  16483. }
  16484. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16485. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16486. if (client[kHTTPConnVersion] === 'h2') {
  16487. // For HTTP/2, is enough to pipe the stream
  16488. const pipe = pipeline(
  16489. body,
  16490. h2stream,
  16491. (err) => {
  16492. if (err) {
  16493. util.destroy(body, err)
  16494. util.destroy(h2stream, err)
  16495. } else {
  16496. request.onRequestSent()
  16497. }
  16498. }
  16499. )
  16500. pipe.on('data', onPipeData)
  16501. pipe.once('end', () => {
  16502. pipe.removeListener('data', onPipeData)
  16503. util.destroy(pipe)
  16504. })
  16505. function onPipeData (chunk) {
  16506. request.onBodySent(chunk)
  16507. }
  16508. return
  16509. }
  16510. let finished = false
  16511. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16512. const onData = function (chunk) {
  16513. if (finished) {
  16514. return
  16515. }
  16516. try {
  16517. if (!writer.write(chunk) && this.pause) {
  16518. this.pause()
  16519. }
  16520. } catch (err) {
  16521. util.destroy(this, err)
  16522. }
  16523. }
  16524. const onDrain = function () {
  16525. if (finished) {
  16526. return
  16527. }
  16528. if (body.resume) {
  16529. body.resume()
  16530. }
  16531. }
  16532. const onAbort = function () {
  16533. if (finished) {
  16534. return
  16535. }
  16536. const err = new RequestAbortedError()
  16537. queueMicrotask(() => onFinished(err))
  16538. }
  16539. const onFinished = function (err) {
  16540. if (finished) {
  16541. return
  16542. }
  16543. finished = true
  16544. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16545. socket
  16546. .off('drain', onDrain)
  16547. .off('error', onFinished)
  16548. body
  16549. .removeListener('data', onData)
  16550. .removeListener('end', onFinished)
  16551. .removeListener('error', onFinished)
  16552. .removeListener('close', onAbort)
  16553. if (!err) {
  16554. try {
  16555. writer.end()
  16556. } catch (er) {
  16557. err = er
  16558. }
  16559. }
  16560. writer.destroy(err)
  16561. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16562. util.destroy(body, err)
  16563. } else {
  16564. util.destroy(body)
  16565. }
  16566. }
  16567. body
  16568. .on('data', onData)
  16569. .on('end', onFinished)
  16570. .on('error', onFinished)
  16571. .on('close', onAbort)
  16572. if (body.resume) {
  16573. body.resume()
  16574. }
  16575. socket
  16576. .on('drain', onDrain)
  16577. .on('error', onFinished)
  16578. }
  16579. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16580. assert(contentLength === body.size, 'blob body must have content length')
  16581. const isH2 = client[kHTTPConnVersion] === 'h2'
  16582. try {
  16583. if (contentLength != null && contentLength !== body.size) {
  16584. throw new RequestContentLengthMismatchError()
  16585. }
  16586. const buffer = Buffer.from(await body.arrayBuffer())
  16587. if (isH2) {
  16588. h2stream.cork()
  16589. h2stream.write(buffer)
  16590. h2stream.uncork()
  16591. } else {
  16592. socket.cork()
  16593. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16594. socket.write(buffer)
  16595. socket.uncork()
  16596. }
  16597. request.onBodySent(buffer)
  16598. request.onRequestSent()
  16599. if (!expectsPayload) {
  16600. socket[kReset] = true
  16601. }
  16602. resume(client)
  16603. } catch (err) {
  16604. util.destroy(isH2 ? h2stream : socket, err)
  16605. }
  16606. }
  16607. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16608. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16609. let callback = null
  16610. function onDrain () {
  16611. if (callback) {
  16612. const cb = callback
  16613. callback = null
  16614. cb()
  16615. }
  16616. }
  16617. const waitForDrain = () => new Promise((resolve, reject) => {
  16618. assert(callback === null)
  16619. if (socket[kError]) {
  16620. reject(socket[kError])
  16621. } else {
  16622. callback = resolve
  16623. }
  16624. })
  16625. if (client[kHTTPConnVersion] === 'h2') {
  16626. h2stream
  16627. .on('close', onDrain)
  16628. .on('drain', onDrain)
  16629. try {
  16630. // It's up to the user to somehow abort the async iterable.
  16631. for await (const chunk of body) {
  16632. if (socket[kError]) {
  16633. throw socket[kError]
  16634. }
  16635. const res = h2stream.write(chunk)
  16636. request.onBodySent(chunk)
  16637. if (!res) {
  16638. await waitForDrain()
  16639. }
  16640. }
  16641. } catch (err) {
  16642. h2stream.destroy(err)
  16643. } finally {
  16644. request.onRequestSent()
  16645. h2stream.end()
  16646. h2stream
  16647. .off('close', onDrain)
  16648. .off('drain', onDrain)
  16649. }
  16650. return
  16651. }
  16652. socket
  16653. .on('close', onDrain)
  16654. .on('drain', onDrain)
  16655. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16656. try {
  16657. // It's up to the user to somehow abort the async iterable.
  16658. for await (const chunk of body) {
  16659. if (socket[kError]) {
  16660. throw socket[kError]
  16661. }
  16662. if (!writer.write(chunk)) {
  16663. await waitForDrain()
  16664. }
  16665. }
  16666. writer.end()
  16667. } catch (err) {
  16668. writer.destroy(err)
  16669. } finally {
  16670. socket
  16671. .off('close', onDrain)
  16672. .off('drain', onDrain)
  16673. }
  16674. }
  16675. class AsyncWriter {
  16676. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16677. this.socket = socket
  16678. this.request = request
  16679. this.contentLength = contentLength
  16680. this.client = client
  16681. this.bytesWritten = 0
  16682. this.expectsPayload = expectsPayload
  16683. this.header = header
  16684. socket[kWriting] = true
  16685. }
  16686. write (chunk) {
  16687. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16688. if (socket[kError]) {
  16689. throw socket[kError]
  16690. }
  16691. if (socket.destroyed) {
  16692. return false
  16693. }
  16694. const len = Buffer.byteLength(chunk)
  16695. if (!len) {
  16696. return true
  16697. }
  16698. // We should defer writing chunks.
  16699. if (contentLength !== null && bytesWritten + len > contentLength) {
  16700. if (client[kStrictContentLength]) {
  16701. throw new RequestContentLengthMismatchError()
  16702. }
  16703. process.emitWarning(new RequestContentLengthMismatchError())
  16704. }
  16705. socket.cork()
  16706. if (bytesWritten === 0) {
  16707. if (!expectsPayload) {
  16708. socket[kReset] = true
  16709. }
  16710. if (contentLength === null) {
  16711. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16712. } else {
  16713. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16714. }
  16715. }
  16716. if (contentLength === null) {
  16717. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16718. }
  16719. this.bytesWritten += len
  16720. const ret = socket.write(chunk)
  16721. socket.uncork()
  16722. request.onBodySent(chunk)
  16723. if (!ret) {
  16724. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16725. // istanbul ignore else: only for jest
  16726. if (socket[kParser].timeout.refresh) {
  16727. socket[kParser].timeout.refresh()
  16728. }
  16729. }
  16730. }
  16731. return ret
  16732. }
  16733. end () {
  16734. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  16735. request.onRequestSent()
  16736. socket[kWriting] = false
  16737. if (socket[kError]) {
  16738. throw socket[kError]
  16739. }
  16740. if (socket.destroyed) {
  16741. return
  16742. }
  16743. if (bytesWritten === 0) {
  16744. if (expectsPayload) {
  16745. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16746. // A user agent SHOULD send a Content-Length in a request message when
  16747. // no Transfer-Encoding is sent and the request method defines a meaning
  16748. // for an enclosed payload body.
  16749. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16750. } else {
  16751. socket.write(`${header}\r\n`, 'latin1')
  16752. }
  16753. } else if (contentLength === null) {
  16754. socket.write('\r\n0\r\n\r\n', 'latin1')
  16755. }
  16756. if (contentLength !== null && bytesWritten !== contentLength) {
  16757. if (client[kStrictContentLength]) {
  16758. throw new RequestContentLengthMismatchError()
  16759. } else {
  16760. process.emitWarning(new RequestContentLengthMismatchError())
  16761. }
  16762. }
  16763. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16764. // istanbul ignore else: only for jest
  16765. if (socket[kParser].timeout.refresh) {
  16766. socket[kParser].timeout.refresh()
  16767. }
  16768. }
  16769. resume(client)
  16770. }
  16771. destroy (err) {
  16772. const { socket, client } = this
  16773. socket[kWriting] = false
  16774. if (err) {
  16775. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  16776. util.destroy(socket, err)
  16777. }
  16778. }
  16779. }
  16780. function errorRequest (client, request, err) {
  16781. try {
  16782. request.onError(err)
  16783. assert(request.aborted)
  16784. } catch (err) {
  16785. client.emit('error', err)
  16786. }
  16787. }
  16788. module.exports = Client
  16789. /***/ }),
  16790. /***/ 6436:
  16791. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16792. "use strict";
  16793. /* istanbul ignore file: only for Node 12 */
  16794. const { kConnected, kSize } = __nccwpck_require__(2785)
  16795. class CompatWeakRef {
  16796. constructor (value) {
  16797. this.value = value
  16798. }
  16799. deref () {
  16800. return this.value[kConnected] === 0 && this.value[kSize] === 0
  16801. ? undefined
  16802. : this.value
  16803. }
  16804. }
  16805. class CompatFinalizer {
  16806. constructor (finalizer) {
  16807. this.finalizer = finalizer
  16808. }
  16809. register (dispatcher, key) {
  16810. if (dispatcher.on) {
  16811. dispatcher.on('disconnect', () => {
  16812. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  16813. this.finalizer(key)
  16814. }
  16815. })
  16816. }
  16817. }
  16818. }
  16819. module.exports = function () {
  16820. // FIXME: remove workaround when the Node bug is fixed
  16821. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  16822. if (process.env.NODE_V8_COVERAGE) {
  16823. return {
  16824. WeakRef: CompatWeakRef,
  16825. FinalizationRegistry: CompatFinalizer
  16826. }
  16827. }
  16828. return {
  16829. WeakRef: global.WeakRef || CompatWeakRef,
  16830. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  16831. }
  16832. }
  16833. /***/ }),
  16834. /***/ 663:
  16835. /***/ ((module) => {
  16836. "use strict";
  16837. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  16838. const maxAttributeValueSize = 1024
  16839. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  16840. const maxNameValuePairSize = 4096
  16841. module.exports = {
  16842. maxAttributeValueSize,
  16843. maxNameValuePairSize
  16844. }
  16845. /***/ }),
  16846. /***/ 1724:
  16847. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16848. "use strict";
  16849. const { parseSetCookie } = __nccwpck_require__(4408)
  16850. const { stringify, getHeadersList } = __nccwpck_require__(3121)
  16851. const { webidl } = __nccwpck_require__(1744)
  16852. const { Headers } = __nccwpck_require__(554)
  16853. /**
  16854. * @typedef {Object} Cookie
  16855. * @property {string} name
  16856. * @property {string} value
  16857. * @property {Date|number|undefined} expires
  16858. * @property {number|undefined} maxAge
  16859. * @property {string|undefined} domain
  16860. * @property {string|undefined} path
  16861. * @property {boolean|undefined} secure
  16862. * @property {boolean|undefined} httpOnly
  16863. * @property {'Strict'|'Lax'|'None'} sameSite
  16864. * @property {string[]} unparsed
  16865. */
  16866. /**
  16867. * @param {Headers} headers
  16868. * @returns {Record<string, string>}
  16869. */
  16870. function getCookies (headers) {
  16871. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  16872. webidl.brandCheck(headers, Headers, { strict: false })
  16873. const cookie = headers.get('cookie')
  16874. const out = {}
  16875. if (!cookie) {
  16876. return out
  16877. }
  16878. for (const piece of cookie.split(';')) {
  16879. const [name, ...value] = piece.split('=')
  16880. out[name.trim()] = value.join('=')
  16881. }
  16882. return out
  16883. }
  16884. /**
  16885. * @param {Headers} headers
  16886. * @param {string} name
  16887. * @param {{ path?: string, domain?: string }|undefined} attributes
  16888. * @returns {void}
  16889. */
  16890. function deleteCookie (headers, name, attributes) {
  16891. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  16892. webidl.brandCheck(headers, Headers, { strict: false })
  16893. name = webidl.converters.DOMString(name)
  16894. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  16895. // Matches behavior of
  16896. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  16897. setCookie(headers, {
  16898. name,
  16899. value: '',
  16900. expires: new Date(0),
  16901. ...attributes
  16902. })
  16903. }
  16904. /**
  16905. * @param {Headers} headers
  16906. * @returns {Cookie[]}
  16907. */
  16908. function getSetCookies (headers) {
  16909. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  16910. webidl.brandCheck(headers, Headers, { strict: false })
  16911. const cookies = getHeadersList(headers).cookies
  16912. if (!cookies) {
  16913. return []
  16914. }
  16915. // In older versions of undici, cookies is a list of name:value.
  16916. return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
  16917. }
  16918. /**
  16919. * @param {Headers} headers
  16920. * @param {Cookie} cookie
  16921. * @returns {void}
  16922. */
  16923. function setCookie (headers, cookie) {
  16924. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  16925. webidl.brandCheck(headers, Headers, { strict: false })
  16926. cookie = webidl.converters.Cookie(cookie)
  16927. const str = stringify(cookie)
  16928. if (str) {
  16929. headers.append('Set-Cookie', stringify(cookie))
  16930. }
  16931. }
  16932. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  16933. {
  16934. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16935. key: 'path',
  16936. defaultValue: null
  16937. },
  16938. {
  16939. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16940. key: 'domain',
  16941. defaultValue: null
  16942. }
  16943. ])
  16944. webidl.converters.Cookie = webidl.dictionaryConverter([
  16945. {
  16946. converter: webidl.converters.DOMString,
  16947. key: 'name'
  16948. },
  16949. {
  16950. converter: webidl.converters.DOMString,
  16951. key: 'value'
  16952. },
  16953. {
  16954. converter: webidl.nullableConverter((value) => {
  16955. if (typeof value === 'number') {
  16956. return webidl.converters['unsigned long long'](value)
  16957. }
  16958. return new Date(value)
  16959. }),
  16960. key: 'expires',
  16961. defaultValue: null
  16962. },
  16963. {
  16964. converter: webidl.nullableConverter(webidl.converters['long long']),
  16965. key: 'maxAge',
  16966. defaultValue: null
  16967. },
  16968. {
  16969. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16970. key: 'domain',
  16971. defaultValue: null
  16972. },
  16973. {
  16974. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16975. key: 'path',
  16976. defaultValue: null
  16977. },
  16978. {
  16979. converter: webidl.nullableConverter(webidl.converters.boolean),
  16980. key: 'secure',
  16981. defaultValue: null
  16982. },
  16983. {
  16984. converter: webidl.nullableConverter(webidl.converters.boolean),
  16985. key: 'httpOnly',
  16986. defaultValue: null
  16987. },
  16988. {
  16989. converter: webidl.converters.USVString,
  16990. key: 'sameSite',
  16991. allowedValues: ['Strict', 'Lax', 'None']
  16992. },
  16993. {
  16994. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  16995. key: 'unparsed',
  16996. defaultValue: []
  16997. }
  16998. ])
  16999. module.exports = {
  17000. getCookies,
  17001. deleteCookie,
  17002. getSetCookies,
  17003. setCookie
  17004. }
  17005. /***/ }),
  17006. /***/ 4408:
  17007. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17008. "use strict";
  17009. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17010. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17011. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17012. const assert = __nccwpck_require__(9491)
  17013. /**
  17014. * @description Parses the field-value attributes of a set-cookie header string.
  17015. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17016. * @param {string} header
  17017. * @returns if the header is invalid, null will be returned
  17018. */
  17019. function parseSetCookie (header) {
  17020. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17021. // character (CTL characters excluding HTAB): Abort these steps and
  17022. // ignore the set-cookie-string entirely.
  17023. if (isCTLExcludingHtab(header)) {
  17024. return null
  17025. }
  17026. let nameValuePair = ''
  17027. let unparsedAttributes = ''
  17028. let name = ''
  17029. let value = ''
  17030. // 2. If the set-cookie-string contains a %x3B (";") character:
  17031. if (header.includes(';')) {
  17032. // 1. The name-value-pair string consists of the characters up to,
  17033. // but not including, the first %x3B (";"), and the unparsed-
  17034. // attributes consist of the remainder of the set-cookie-string
  17035. // (including the %x3B (";") in question).
  17036. const position = { position: 0 }
  17037. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17038. unparsedAttributes = header.slice(position.position)
  17039. } else {
  17040. // Otherwise:
  17041. // 1. The name-value-pair string consists of all the characters
  17042. // contained in the set-cookie-string, and the unparsed-
  17043. // attributes is the empty string.
  17044. nameValuePair = header
  17045. }
  17046. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17047. // the name string is empty, and the value string is the value of
  17048. // name-value-pair.
  17049. if (!nameValuePair.includes('=')) {
  17050. value = nameValuePair
  17051. } else {
  17052. // Otherwise, the name string consists of the characters up to, but
  17053. // not including, the first %x3D ("=") character, and the (possibly
  17054. // empty) value string consists of the characters after the first
  17055. // %x3D ("=") character.
  17056. const position = { position: 0 }
  17057. name = collectASequenceOfCodePointsFast(
  17058. '=',
  17059. nameValuePair,
  17060. position
  17061. )
  17062. value = nameValuePair.slice(position.position + 1)
  17063. }
  17064. // 4. Remove any leading or trailing WSP characters from the name
  17065. // string and the value string.
  17066. name = name.trim()
  17067. value = value.trim()
  17068. // 5. If the sum of the lengths of the name string and the value string
  17069. // is more than 4096 octets, abort these steps and ignore the set-
  17070. // cookie-string entirely.
  17071. if (name.length + value.length > maxNameValuePairSize) {
  17072. return null
  17073. }
  17074. // 6. The cookie-name is the name string, and the cookie-value is the
  17075. // value string.
  17076. return {
  17077. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17078. }
  17079. }
  17080. /**
  17081. * Parses the remaining attributes of a set-cookie header
  17082. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17083. * @param {string} unparsedAttributes
  17084. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17085. */
  17086. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17087. // 1. If the unparsed-attributes string is empty, skip the rest of
  17088. // these steps.
  17089. if (unparsedAttributes.length === 0) {
  17090. return cookieAttributeList
  17091. }
  17092. // 2. Discard the first character of the unparsed-attributes (which
  17093. // will be a %x3B (";") character).
  17094. assert(unparsedAttributes[0] === ';')
  17095. unparsedAttributes = unparsedAttributes.slice(1)
  17096. let cookieAv = ''
  17097. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17098. // character:
  17099. if (unparsedAttributes.includes(';')) {
  17100. // 1. Consume the characters of the unparsed-attributes up to, but
  17101. // not including, the first %x3B (";") character.
  17102. cookieAv = collectASequenceOfCodePointsFast(
  17103. ';',
  17104. unparsedAttributes,
  17105. { position: 0 }
  17106. )
  17107. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17108. } else {
  17109. // Otherwise:
  17110. // 1. Consume the remainder of the unparsed-attributes.
  17111. cookieAv = unparsedAttributes
  17112. unparsedAttributes = ''
  17113. }
  17114. // Let the cookie-av string be the characters consumed in this step.
  17115. let attributeName = ''
  17116. let attributeValue = ''
  17117. // 4. If the cookie-av string contains a %x3D ("=") character:
  17118. if (cookieAv.includes('=')) {
  17119. // 1. The (possibly empty) attribute-name string consists of the
  17120. // characters up to, but not including, the first %x3D ("=")
  17121. // character, and the (possibly empty) attribute-value string
  17122. // consists of the characters after the first %x3D ("=")
  17123. // character.
  17124. const position = { position: 0 }
  17125. attributeName = collectASequenceOfCodePointsFast(
  17126. '=',
  17127. cookieAv,
  17128. position
  17129. )
  17130. attributeValue = cookieAv.slice(position.position + 1)
  17131. } else {
  17132. // Otherwise:
  17133. // 1. The attribute-name string consists of the entire cookie-av
  17134. // string, and the attribute-value string is empty.
  17135. attributeName = cookieAv
  17136. }
  17137. // 5. Remove any leading or trailing WSP characters from the attribute-
  17138. // name string and the attribute-value string.
  17139. attributeName = attributeName.trim()
  17140. attributeValue = attributeValue.trim()
  17141. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17142. // cookie-av string and return to Step 1 of this algorithm.
  17143. if (attributeValue.length > maxAttributeValueSize) {
  17144. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17145. }
  17146. // 7. Process the attribute-name and attribute-value according to the
  17147. // requirements in the following subsections. (Notice that
  17148. // attributes with unrecognized attribute-names are ignored.)
  17149. const attributeNameLowercase = attributeName.toLowerCase()
  17150. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17151. // If the attribute-name case-insensitively matches the string
  17152. // "Expires", the user agent MUST process the cookie-av as follows.
  17153. if (attributeNameLowercase === 'expires') {
  17154. // 1. Let the expiry-time be the result of parsing the attribute-value
  17155. // as cookie-date (see Section 5.1.1).
  17156. const expiryTime = new Date(attributeValue)
  17157. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17158. // the cookie-av.
  17159. cookieAttributeList.expires = expiryTime
  17160. } else if (attributeNameLowercase === 'max-age') {
  17161. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17162. // If the attribute-name case-insensitively matches the string "Max-
  17163. // Age", the user agent MUST process the cookie-av as follows.
  17164. // 1. If the first character of the attribute-value is not a DIGIT or a
  17165. // "-" character, ignore the cookie-av.
  17166. const charCode = attributeValue.charCodeAt(0)
  17167. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17168. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17169. }
  17170. // 2. If the remainder of attribute-value contains a non-DIGIT
  17171. // character, ignore the cookie-av.
  17172. if (!/^\d+$/.test(attributeValue)) {
  17173. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17174. }
  17175. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17176. const deltaSeconds = Number(attributeValue)
  17177. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17178. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17179. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17180. // age-limit.
  17181. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17182. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17183. // time be the earliest representable date and time. Otherwise, let
  17184. // the expiry-time be the current date and time plus delta-seconds
  17185. // seconds.
  17186. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17187. // 7. Append an attribute to the cookie-attribute-list with an
  17188. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17189. cookieAttributeList.maxAge = deltaSeconds
  17190. } else if (attributeNameLowercase === 'domain') {
  17191. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17192. // If the attribute-name case-insensitively matches the string "Domain",
  17193. // the user agent MUST process the cookie-av as follows.
  17194. // 1. Let cookie-domain be the attribute-value.
  17195. let cookieDomain = attributeValue
  17196. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17197. // cookie-domain without its leading %x2E (".").
  17198. if (cookieDomain[0] === '.') {
  17199. cookieDomain = cookieDomain.slice(1)
  17200. }
  17201. // 3. Convert the cookie-domain to lower case.
  17202. cookieDomain = cookieDomain.toLowerCase()
  17203. // 4. Append an attribute to the cookie-attribute-list with an
  17204. // attribute-name of Domain and an attribute-value of cookie-domain.
  17205. cookieAttributeList.domain = cookieDomain
  17206. } else if (attributeNameLowercase === 'path') {
  17207. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17208. // If the attribute-name case-insensitively matches the string "Path",
  17209. // the user agent MUST process the cookie-av as follows.
  17210. // 1. If the attribute-value is empty or if the first character of the
  17211. // attribute-value is not %x2F ("/"):
  17212. let cookiePath = ''
  17213. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17214. // 1. Let cookie-path be the default-path.
  17215. cookiePath = '/'
  17216. } else {
  17217. // Otherwise:
  17218. // 1. Let cookie-path be the attribute-value.
  17219. cookiePath = attributeValue
  17220. }
  17221. // 2. Append an attribute to the cookie-attribute-list with an
  17222. // attribute-name of Path and an attribute-value of cookie-path.
  17223. cookieAttributeList.path = cookiePath
  17224. } else if (attributeNameLowercase === 'secure') {
  17225. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17226. // If the attribute-name case-insensitively matches the string "Secure",
  17227. // the user agent MUST append an attribute to the cookie-attribute-list
  17228. // with an attribute-name of Secure and an empty attribute-value.
  17229. cookieAttributeList.secure = true
  17230. } else if (attributeNameLowercase === 'httponly') {
  17231. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17232. // If the attribute-name case-insensitively matches the string
  17233. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17234. // attribute-list with an attribute-name of HttpOnly and an empty
  17235. // attribute-value.
  17236. cookieAttributeList.httpOnly = true
  17237. } else if (attributeNameLowercase === 'samesite') {
  17238. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17239. // If the attribute-name case-insensitively matches the string
  17240. // "SameSite", the user agent MUST process the cookie-av as follows:
  17241. // 1. Let enforcement be "Default".
  17242. let enforcement = 'Default'
  17243. const attributeValueLowercase = attributeValue.toLowerCase()
  17244. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17245. // "None", set enforcement to "None".
  17246. if (attributeValueLowercase.includes('none')) {
  17247. enforcement = 'None'
  17248. }
  17249. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17250. // "Strict", set enforcement to "Strict".
  17251. if (attributeValueLowercase.includes('strict')) {
  17252. enforcement = 'Strict'
  17253. }
  17254. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17255. // "Lax", set enforcement to "Lax".
  17256. if (attributeValueLowercase.includes('lax')) {
  17257. enforcement = 'Lax'
  17258. }
  17259. // 5. Append an attribute to the cookie-attribute-list with an
  17260. // attribute-name of "SameSite" and an attribute-value of
  17261. // enforcement.
  17262. cookieAttributeList.sameSite = enforcement
  17263. } else {
  17264. cookieAttributeList.unparsed ??= []
  17265. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17266. }
  17267. // 8. Return to Step 1 of this algorithm.
  17268. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17269. }
  17270. module.exports = {
  17271. parseSetCookie,
  17272. parseUnparsedAttributes
  17273. }
  17274. /***/ }),
  17275. /***/ 3121:
  17276. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17277. "use strict";
  17278. const assert = __nccwpck_require__(9491)
  17279. const { kHeadersList } = __nccwpck_require__(2785)
  17280. function isCTLExcludingHtab (value) {
  17281. if (value.length === 0) {
  17282. return false
  17283. }
  17284. for (const char of value) {
  17285. const code = char.charCodeAt(0)
  17286. if (
  17287. (code >= 0x00 || code <= 0x08) ||
  17288. (code >= 0x0A || code <= 0x1F) ||
  17289. code === 0x7F
  17290. ) {
  17291. return false
  17292. }
  17293. }
  17294. }
  17295. /**
  17296. CHAR = <any US-ASCII character (octets 0 - 127)>
  17297. token = 1*<any CHAR except CTLs or separators>
  17298. separators = "(" | ")" | "<" | ">" | "@"
  17299. | "," | ";" | ":" | "\" | <">
  17300. | "/" | "[" | "]" | "?" | "="
  17301. | "{" | "}" | SP | HT
  17302. * @param {string} name
  17303. */
  17304. function validateCookieName (name) {
  17305. for (const char of name) {
  17306. const code = char.charCodeAt(0)
  17307. if (
  17308. (code <= 0x20 || code > 0x7F) ||
  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. char === '?' ||
  17323. char === '=' ||
  17324. char === '{' ||
  17325. char === '}'
  17326. ) {
  17327. throw new Error('Invalid cookie name')
  17328. }
  17329. }
  17330. }
  17331. /**
  17332. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17333. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17334. ; US-ASCII characters excluding CTLs,
  17335. ; whitespace DQUOTE, comma, semicolon,
  17336. ; and backslash
  17337. * @param {string} value
  17338. */
  17339. function validateCookieValue (value) {
  17340. for (const char of value) {
  17341. const code = char.charCodeAt(0)
  17342. if (
  17343. code < 0x21 || // exclude CTLs (0-31)
  17344. code === 0x22 ||
  17345. code === 0x2C ||
  17346. code === 0x3B ||
  17347. code === 0x5C ||
  17348. code > 0x7E // non-ascii
  17349. ) {
  17350. throw new Error('Invalid header value')
  17351. }
  17352. }
  17353. }
  17354. /**
  17355. * path-value = <any CHAR except CTLs or ";">
  17356. * @param {string} path
  17357. */
  17358. function validateCookiePath (path) {
  17359. for (const char of path) {
  17360. const code = char.charCodeAt(0)
  17361. if (code < 0x21 || char === ';') {
  17362. throw new Error('Invalid cookie path')
  17363. }
  17364. }
  17365. }
  17366. /**
  17367. * I have no idea why these values aren't allowed to be honest,
  17368. * but Deno tests these. - Khafra
  17369. * @param {string} domain
  17370. */
  17371. function validateCookieDomain (domain) {
  17372. if (
  17373. domain.startsWith('-') ||
  17374. domain.endsWith('.') ||
  17375. domain.endsWith('-')
  17376. ) {
  17377. throw new Error('Invalid cookie domain')
  17378. }
  17379. }
  17380. /**
  17381. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17382. * @param {number|Date} date
  17383. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17384. ; fixed length/zone/capitalization subset of the format
  17385. ; see Section 3.3 of [RFC5322]
  17386. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17387. / %x54.75.65 ; "Tue", case-sensitive
  17388. / %x57.65.64 ; "Wed", case-sensitive
  17389. / %x54.68.75 ; "Thu", case-sensitive
  17390. / %x46.72.69 ; "Fri", case-sensitive
  17391. / %x53.61.74 ; "Sat", case-sensitive
  17392. / %x53.75.6E ; "Sun", case-sensitive
  17393. date1 = day SP month SP year
  17394. ; e.g., 02 Jun 1982
  17395. day = 2DIGIT
  17396. month = %x4A.61.6E ; "Jan", case-sensitive
  17397. / %x46.65.62 ; "Feb", case-sensitive
  17398. / %x4D.61.72 ; "Mar", case-sensitive
  17399. / %x41.70.72 ; "Apr", case-sensitive
  17400. / %x4D.61.79 ; "May", case-sensitive
  17401. / %x4A.75.6E ; "Jun", case-sensitive
  17402. / %x4A.75.6C ; "Jul", case-sensitive
  17403. / %x41.75.67 ; "Aug", case-sensitive
  17404. / %x53.65.70 ; "Sep", case-sensitive
  17405. / %x4F.63.74 ; "Oct", case-sensitive
  17406. / %x4E.6F.76 ; "Nov", case-sensitive
  17407. / %x44.65.63 ; "Dec", case-sensitive
  17408. year = 4DIGIT
  17409. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17410. time-of-day = hour ":" minute ":" second
  17411. ; 00:00:00 - 23:59:60 (leap second)
  17412. hour = 2DIGIT
  17413. minute = 2DIGIT
  17414. second = 2DIGIT
  17415. */
  17416. function toIMFDate (date) {
  17417. if (typeof date === 'number') {
  17418. date = new Date(date)
  17419. }
  17420. const days = [
  17421. 'Sun', 'Mon', 'Tue', 'Wed',
  17422. 'Thu', 'Fri', 'Sat'
  17423. ]
  17424. const months = [
  17425. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17426. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17427. ]
  17428. const dayName = days[date.getUTCDay()]
  17429. const day = date.getUTCDate().toString().padStart(2, '0')
  17430. const month = months[date.getUTCMonth()]
  17431. const year = date.getUTCFullYear()
  17432. const hour = date.getUTCHours().toString().padStart(2, '0')
  17433. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17434. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17435. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17436. }
  17437. /**
  17438. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17439. ; In practice, both expires-av and max-age-av
  17440. ; are limited to dates representable by the
  17441. ; user agent.
  17442. * @param {number} maxAge
  17443. */
  17444. function validateCookieMaxAge (maxAge) {
  17445. if (maxAge < 0) {
  17446. throw new Error('Invalid cookie max-age')
  17447. }
  17448. }
  17449. /**
  17450. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17451. * @param {import('./index').Cookie} cookie
  17452. */
  17453. function stringify (cookie) {
  17454. if (cookie.name.length === 0) {
  17455. return null
  17456. }
  17457. validateCookieName(cookie.name)
  17458. validateCookieValue(cookie.value)
  17459. const out = [`${cookie.name}=${cookie.value}`]
  17460. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17461. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17462. if (cookie.name.startsWith('__Secure-')) {
  17463. cookie.secure = true
  17464. }
  17465. if (cookie.name.startsWith('__Host-')) {
  17466. cookie.secure = true
  17467. cookie.domain = null
  17468. cookie.path = '/'
  17469. }
  17470. if (cookie.secure) {
  17471. out.push('Secure')
  17472. }
  17473. if (cookie.httpOnly) {
  17474. out.push('HttpOnly')
  17475. }
  17476. if (typeof cookie.maxAge === 'number') {
  17477. validateCookieMaxAge(cookie.maxAge)
  17478. out.push(`Max-Age=${cookie.maxAge}`)
  17479. }
  17480. if (cookie.domain) {
  17481. validateCookieDomain(cookie.domain)
  17482. out.push(`Domain=${cookie.domain}`)
  17483. }
  17484. if (cookie.path) {
  17485. validateCookiePath(cookie.path)
  17486. out.push(`Path=${cookie.path}`)
  17487. }
  17488. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17489. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17490. }
  17491. if (cookie.sameSite) {
  17492. out.push(`SameSite=${cookie.sameSite}`)
  17493. }
  17494. for (const part of cookie.unparsed) {
  17495. if (!part.includes('=')) {
  17496. throw new Error('Invalid unparsed')
  17497. }
  17498. const [key, ...value] = part.split('=')
  17499. out.push(`${key.trim()}=${value.join('=')}`)
  17500. }
  17501. return out.join('; ')
  17502. }
  17503. let kHeadersListNode
  17504. function getHeadersList (headers) {
  17505. if (headers[kHeadersList]) {
  17506. return headers[kHeadersList]
  17507. }
  17508. if (!kHeadersListNode) {
  17509. kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
  17510. (symbol) => symbol.description === 'headers list'
  17511. )
  17512. assert(kHeadersListNode, 'Headers cannot be parsed')
  17513. }
  17514. const headersList = headers[kHeadersListNode]
  17515. assert(headersList)
  17516. return headersList
  17517. }
  17518. module.exports = {
  17519. isCTLExcludingHtab,
  17520. stringify,
  17521. getHeadersList
  17522. }
  17523. /***/ }),
  17524. /***/ 2067:
  17525. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17526. "use strict";
  17527. const net = __nccwpck_require__(1808)
  17528. const assert = __nccwpck_require__(9491)
  17529. const util = __nccwpck_require__(3983)
  17530. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17531. let tls // include tls conditionally since it is not always available
  17532. // TODO: session re-use does not wait for the first
  17533. // connection to resolve the session and might therefore
  17534. // resolve the same servername multiple times even when
  17535. // re-use is enabled.
  17536. let SessionCache
  17537. // FIXME: remove workaround when the Node bug is fixed
  17538. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17539. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17540. SessionCache = class WeakSessionCache {
  17541. constructor (maxCachedSessions) {
  17542. this._maxCachedSessions = maxCachedSessions
  17543. this._sessionCache = new Map()
  17544. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17545. if (this._sessionCache.size < this._maxCachedSessions) {
  17546. return
  17547. }
  17548. const ref = this._sessionCache.get(key)
  17549. if (ref !== undefined && ref.deref() === undefined) {
  17550. this._sessionCache.delete(key)
  17551. }
  17552. })
  17553. }
  17554. get (sessionKey) {
  17555. const ref = this._sessionCache.get(sessionKey)
  17556. return ref ? ref.deref() : null
  17557. }
  17558. set (sessionKey, session) {
  17559. if (this._maxCachedSessions === 0) {
  17560. return
  17561. }
  17562. this._sessionCache.set(sessionKey, new WeakRef(session))
  17563. this._sessionRegistry.register(session, sessionKey)
  17564. }
  17565. }
  17566. } else {
  17567. SessionCache = class SimpleSessionCache {
  17568. constructor (maxCachedSessions) {
  17569. this._maxCachedSessions = maxCachedSessions
  17570. this._sessionCache = new Map()
  17571. }
  17572. get (sessionKey) {
  17573. return this._sessionCache.get(sessionKey)
  17574. }
  17575. set (sessionKey, session) {
  17576. if (this._maxCachedSessions === 0) {
  17577. return
  17578. }
  17579. if (this._sessionCache.size >= this._maxCachedSessions) {
  17580. // remove the oldest session
  17581. const { value: oldestKey } = this._sessionCache.keys().next()
  17582. this._sessionCache.delete(oldestKey)
  17583. }
  17584. this._sessionCache.set(sessionKey, session)
  17585. }
  17586. }
  17587. }
  17588. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17589. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17590. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17591. }
  17592. const options = { path: socketPath, ...opts }
  17593. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17594. timeout = timeout == null ? 10e3 : timeout
  17595. allowH2 = allowH2 != null ? allowH2 : false
  17596. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17597. let socket
  17598. if (protocol === 'https:') {
  17599. if (!tls) {
  17600. tls = __nccwpck_require__(4404)
  17601. }
  17602. servername = servername || options.servername || util.getServerName(host) || null
  17603. const sessionKey = servername || hostname
  17604. const session = sessionCache.get(sessionKey) || null
  17605. assert(sessionKey)
  17606. socket = tls.connect({
  17607. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17608. ...options,
  17609. servername,
  17610. session,
  17611. localAddress,
  17612. // TODO(HTTP/2): Add support for h2c
  17613. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17614. socket: httpSocket, // upgrade socket connection
  17615. port: port || 443,
  17616. host: hostname
  17617. })
  17618. socket
  17619. .on('session', function (session) {
  17620. // TODO (fix): Can a session become invalid once established? Don't think so?
  17621. sessionCache.set(sessionKey, session)
  17622. })
  17623. } else {
  17624. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17625. socket = net.connect({
  17626. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17627. ...options,
  17628. localAddress,
  17629. port: port || 80,
  17630. host: hostname
  17631. })
  17632. }
  17633. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17634. if (options.keepAlive == null || options.keepAlive) {
  17635. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17636. socket.setKeepAlive(true, keepAliveInitialDelay)
  17637. }
  17638. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17639. socket
  17640. .setNoDelay(true)
  17641. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17642. cancelTimeout()
  17643. if (callback) {
  17644. const cb = callback
  17645. callback = null
  17646. cb(null, this)
  17647. }
  17648. })
  17649. .on('error', function (err) {
  17650. cancelTimeout()
  17651. if (callback) {
  17652. const cb = callback
  17653. callback = null
  17654. cb(err)
  17655. }
  17656. })
  17657. return socket
  17658. }
  17659. }
  17660. function setupTimeout (onConnectTimeout, timeout) {
  17661. if (!timeout) {
  17662. return () => {}
  17663. }
  17664. let s1 = null
  17665. let s2 = null
  17666. const timeoutId = setTimeout(() => {
  17667. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17668. s1 = setImmediate(() => {
  17669. if (process.platform === 'win32') {
  17670. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17671. s2 = setImmediate(() => onConnectTimeout())
  17672. } else {
  17673. onConnectTimeout()
  17674. }
  17675. })
  17676. }, timeout)
  17677. return () => {
  17678. clearTimeout(timeoutId)
  17679. clearImmediate(s1)
  17680. clearImmediate(s2)
  17681. }
  17682. }
  17683. function onConnectTimeout (socket) {
  17684. util.destroy(socket, new ConnectTimeoutError())
  17685. }
  17686. module.exports = buildConnector
  17687. /***/ }),
  17688. /***/ 4462:
  17689. /***/ ((module) => {
  17690. "use strict";
  17691. /** @type {Record<string, string | undefined>} */
  17692. const headerNameLowerCasedRecord = {}
  17693. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17694. const wellknownHeaderNames = [
  17695. 'Accept',
  17696. 'Accept-Encoding',
  17697. 'Accept-Language',
  17698. 'Accept-Ranges',
  17699. 'Access-Control-Allow-Credentials',
  17700. 'Access-Control-Allow-Headers',
  17701. 'Access-Control-Allow-Methods',
  17702. 'Access-Control-Allow-Origin',
  17703. 'Access-Control-Expose-Headers',
  17704. 'Access-Control-Max-Age',
  17705. 'Access-Control-Request-Headers',
  17706. 'Access-Control-Request-Method',
  17707. 'Age',
  17708. 'Allow',
  17709. 'Alt-Svc',
  17710. 'Alt-Used',
  17711. 'Authorization',
  17712. 'Cache-Control',
  17713. 'Clear-Site-Data',
  17714. 'Connection',
  17715. 'Content-Disposition',
  17716. 'Content-Encoding',
  17717. 'Content-Language',
  17718. 'Content-Length',
  17719. 'Content-Location',
  17720. 'Content-Range',
  17721. 'Content-Security-Policy',
  17722. 'Content-Security-Policy-Report-Only',
  17723. 'Content-Type',
  17724. 'Cookie',
  17725. 'Cross-Origin-Embedder-Policy',
  17726. 'Cross-Origin-Opener-Policy',
  17727. 'Cross-Origin-Resource-Policy',
  17728. 'Date',
  17729. 'Device-Memory',
  17730. 'Downlink',
  17731. 'ECT',
  17732. 'ETag',
  17733. 'Expect',
  17734. 'Expect-CT',
  17735. 'Expires',
  17736. 'Forwarded',
  17737. 'From',
  17738. 'Host',
  17739. 'If-Match',
  17740. 'If-Modified-Since',
  17741. 'If-None-Match',
  17742. 'If-Range',
  17743. 'If-Unmodified-Since',
  17744. 'Keep-Alive',
  17745. 'Last-Modified',
  17746. 'Link',
  17747. 'Location',
  17748. 'Max-Forwards',
  17749. 'Origin',
  17750. 'Permissions-Policy',
  17751. 'Pragma',
  17752. 'Proxy-Authenticate',
  17753. 'Proxy-Authorization',
  17754. 'RTT',
  17755. 'Range',
  17756. 'Referer',
  17757. 'Referrer-Policy',
  17758. 'Refresh',
  17759. 'Retry-After',
  17760. 'Sec-WebSocket-Accept',
  17761. 'Sec-WebSocket-Extensions',
  17762. 'Sec-WebSocket-Key',
  17763. 'Sec-WebSocket-Protocol',
  17764. 'Sec-WebSocket-Version',
  17765. 'Server',
  17766. 'Server-Timing',
  17767. 'Service-Worker-Allowed',
  17768. 'Service-Worker-Navigation-Preload',
  17769. 'Set-Cookie',
  17770. 'SourceMap',
  17771. 'Strict-Transport-Security',
  17772. 'Supports-Loading-Mode',
  17773. 'TE',
  17774. 'Timing-Allow-Origin',
  17775. 'Trailer',
  17776. 'Transfer-Encoding',
  17777. 'Upgrade',
  17778. 'Upgrade-Insecure-Requests',
  17779. 'User-Agent',
  17780. 'Vary',
  17781. 'Via',
  17782. 'WWW-Authenticate',
  17783. 'X-Content-Type-Options',
  17784. 'X-DNS-Prefetch-Control',
  17785. 'X-Frame-Options',
  17786. 'X-Permitted-Cross-Domain-Policies',
  17787. 'X-Powered-By',
  17788. 'X-Requested-With',
  17789. 'X-XSS-Protection'
  17790. ]
  17791. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  17792. const key = wellknownHeaderNames[i]
  17793. const lowerCasedKey = key.toLowerCase()
  17794. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  17795. lowerCasedKey
  17796. }
  17797. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  17798. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  17799. module.exports = {
  17800. wellknownHeaderNames,
  17801. headerNameLowerCasedRecord
  17802. }
  17803. /***/ }),
  17804. /***/ 8045:
  17805. /***/ ((module) => {
  17806. "use strict";
  17807. class UndiciError extends Error {
  17808. constructor (message) {
  17809. super(message)
  17810. this.name = 'UndiciError'
  17811. this.code = 'UND_ERR'
  17812. }
  17813. }
  17814. class ConnectTimeoutError extends UndiciError {
  17815. constructor (message) {
  17816. super(message)
  17817. Error.captureStackTrace(this, ConnectTimeoutError)
  17818. this.name = 'ConnectTimeoutError'
  17819. this.message = message || 'Connect Timeout Error'
  17820. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  17821. }
  17822. }
  17823. class HeadersTimeoutError extends UndiciError {
  17824. constructor (message) {
  17825. super(message)
  17826. Error.captureStackTrace(this, HeadersTimeoutError)
  17827. this.name = 'HeadersTimeoutError'
  17828. this.message = message || 'Headers Timeout Error'
  17829. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  17830. }
  17831. }
  17832. class HeadersOverflowError extends UndiciError {
  17833. constructor (message) {
  17834. super(message)
  17835. Error.captureStackTrace(this, HeadersOverflowError)
  17836. this.name = 'HeadersOverflowError'
  17837. this.message = message || 'Headers Overflow Error'
  17838. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  17839. }
  17840. }
  17841. class BodyTimeoutError extends UndiciError {
  17842. constructor (message) {
  17843. super(message)
  17844. Error.captureStackTrace(this, BodyTimeoutError)
  17845. this.name = 'BodyTimeoutError'
  17846. this.message = message || 'Body Timeout Error'
  17847. this.code = 'UND_ERR_BODY_TIMEOUT'
  17848. }
  17849. }
  17850. class ResponseStatusCodeError extends UndiciError {
  17851. constructor (message, statusCode, headers, body) {
  17852. super(message)
  17853. Error.captureStackTrace(this, ResponseStatusCodeError)
  17854. this.name = 'ResponseStatusCodeError'
  17855. this.message = message || 'Response Status Code Error'
  17856. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  17857. this.body = body
  17858. this.status = statusCode
  17859. this.statusCode = statusCode
  17860. this.headers = headers
  17861. }
  17862. }
  17863. class InvalidArgumentError extends UndiciError {
  17864. constructor (message) {
  17865. super(message)
  17866. Error.captureStackTrace(this, InvalidArgumentError)
  17867. this.name = 'InvalidArgumentError'
  17868. this.message = message || 'Invalid Argument Error'
  17869. this.code = 'UND_ERR_INVALID_ARG'
  17870. }
  17871. }
  17872. class InvalidReturnValueError extends UndiciError {
  17873. constructor (message) {
  17874. super(message)
  17875. Error.captureStackTrace(this, InvalidReturnValueError)
  17876. this.name = 'InvalidReturnValueError'
  17877. this.message = message || 'Invalid Return Value Error'
  17878. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  17879. }
  17880. }
  17881. class RequestAbortedError extends UndiciError {
  17882. constructor (message) {
  17883. super(message)
  17884. Error.captureStackTrace(this, RequestAbortedError)
  17885. this.name = 'AbortError'
  17886. this.message = message || 'Request aborted'
  17887. this.code = 'UND_ERR_ABORTED'
  17888. }
  17889. }
  17890. class InformationalError extends UndiciError {
  17891. constructor (message) {
  17892. super(message)
  17893. Error.captureStackTrace(this, InformationalError)
  17894. this.name = 'InformationalError'
  17895. this.message = message || 'Request information'
  17896. this.code = 'UND_ERR_INFO'
  17897. }
  17898. }
  17899. class RequestContentLengthMismatchError extends UndiciError {
  17900. constructor (message) {
  17901. super(message)
  17902. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  17903. this.name = 'RequestContentLengthMismatchError'
  17904. this.message = message || 'Request body length does not match content-length header'
  17905. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  17906. }
  17907. }
  17908. class ResponseContentLengthMismatchError extends UndiciError {
  17909. constructor (message) {
  17910. super(message)
  17911. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  17912. this.name = 'ResponseContentLengthMismatchError'
  17913. this.message = message || 'Response body length does not match content-length header'
  17914. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  17915. }
  17916. }
  17917. class ClientDestroyedError extends UndiciError {
  17918. constructor (message) {
  17919. super(message)
  17920. Error.captureStackTrace(this, ClientDestroyedError)
  17921. this.name = 'ClientDestroyedError'
  17922. this.message = message || 'The client is destroyed'
  17923. this.code = 'UND_ERR_DESTROYED'
  17924. }
  17925. }
  17926. class ClientClosedError extends UndiciError {
  17927. constructor (message) {
  17928. super(message)
  17929. Error.captureStackTrace(this, ClientClosedError)
  17930. this.name = 'ClientClosedError'
  17931. this.message = message || 'The client is closed'
  17932. this.code = 'UND_ERR_CLOSED'
  17933. }
  17934. }
  17935. class SocketError extends UndiciError {
  17936. constructor (message, socket) {
  17937. super(message)
  17938. Error.captureStackTrace(this, SocketError)
  17939. this.name = 'SocketError'
  17940. this.message = message || 'Socket error'
  17941. this.code = 'UND_ERR_SOCKET'
  17942. this.socket = socket
  17943. }
  17944. }
  17945. class NotSupportedError extends UndiciError {
  17946. constructor (message) {
  17947. super(message)
  17948. Error.captureStackTrace(this, NotSupportedError)
  17949. this.name = 'NotSupportedError'
  17950. this.message = message || 'Not supported error'
  17951. this.code = 'UND_ERR_NOT_SUPPORTED'
  17952. }
  17953. }
  17954. class BalancedPoolMissingUpstreamError extends UndiciError {
  17955. constructor (message) {
  17956. super(message)
  17957. Error.captureStackTrace(this, NotSupportedError)
  17958. this.name = 'MissingUpstreamError'
  17959. this.message = message || 'No upstream has been added to the BalancedPool'
  17960. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  17961. }
  17962. }
  17963. class HTTPParserError extends Error {
  17964. constructor (message, code, data) {
  17965. super(message)
  17966. Error.captureStackTrace(this, HTTPParserError)
  17967. this.name = 'HTTPParserError'
  17968. this.code = code ? `HPE_${code}` : undefined
  17969. this.data = data ? data.toString() : undefined
  17970. }
  17971. }
  17972. class ResponseExceededMaxSizeError extends UndiciError {
  17973. constructor (message) {
  17974. super(message)
  17975. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  17976. this.name = 'ResponseExceededMaxSizeError'
  17977. this.message = message || 'Response content exceeded max size'
  17978. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  17979. }
  17980. }
  17981. class RequestRetryError extends UndiciError {
  17982. constructor (message, code, { headers, data }) {
  17983. super(message)
  17984. Error.captureStackTrace(this, RequestRetryError)
  17985. this.name = 'RequestRetryError'
  17986. this.message = message || 'Request retry error'
  17987. this.code = 'UND_ERR_REQ_RETRY'
  17988. this.statusCode = code
  17989. this.data = data
  17990. this.headers = headers
  17991. }
  17992. }
  17993. module.exports = {
  17994. HTTPParserError,
  17995. UndiciError,
  17996. HeadersTimeoutError,
  17997. HeadersOverflowError,
  17998. BodyTimeoutError,
  17999. RequestContentLengthMismatchError,
  18000. ConnectTimeoutError,
  18001. ResponseStatusCodeError,
  18002. InvalidArgumentError,
  18003. InvalidReturnValueError,
  18004. RequestAbortedError,
  18005. ClientDestroyedError,
  18006. ClientClosedError,
  18007. InformationalError,
  18008. SocketError,
  18009. NotSupportedError,
  18010. ResponseContentLengthMismatchError,
  18011. BalancedPoolMissingUpstreamError,
  18012. ResponseExceededMaxSizeError,
  18013. RequestRetryError
  18014. }
  18015. /***/ }),
  18016. /***/ 2905:
  18017. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18018. "use strict";
  18019. const {
  18020. InvalidArgumentError,
  18021. NotSupportedError
  18022. } = __nccwpck_require__(8045)
  18023. const assert = __nccwpck_require__(9491)
  18024. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18025. const util = __nccwpck_require__(3983)
  18026. // tokenRegExp and headerCharRegex have been lifted from
  18027. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18028. /**
  18029. * Verifies that the given val is a valid HTTP token
  18030. * per the rules defined in RFC 7230
  18031. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18032. */
  18033. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18034. /**
  18035. * Matches if val contains an invalid field-vchar
  18036. * field-value = *( field-content / obs-fold )
  18037. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18038. * field-vchar = VCHAR / obs-text
  18039. */
  18040. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18041. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18042. const invalidPathRegex = /[^\u0021-\u00ff]/
  18043. const kHandler = Symbol('handler')
  18044. const channels = {}
  18045. let extractBody
  18046. try {
  18047. const diagnosticsChannel = __nccwpck_require__(7643)
  18048. channels.create = diagnosticsChannel.channel('undici:request:create')
  18049. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18050. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18051. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18052. channels.error = diagnosticsChannel.channel('undici:request:error')
  18053. } catch {
  18054. channels.create = { hasSubscribers: false }
  18055. channels.bodySent = { hasSubscribers: false }
  18056. channels.headers = { hasSubscribers: false }
  18057. channels.trailers = { hasSubscribers: false }
  18058. channels.error = { hasSubscribers: false }
  18059. }
  18060. class Request {
  18061. constructor (origin, {
  18062. path,
  18063. method,
  18064. body,
  18065. headers,
  18066. query,
  18067. idempotent,
  18068. blocking,
  18069. upgrade,
  18070. headersTimeout,
  18071. bodyTimeout,
  18072. reset,
  18073. throwOnError,
  18074. expectContinue
  18075. }, handler) {
  18076. if (typeof path !== 'string') {
  18077. throw new InvalidArgumentError('path must be a string')
  18078. } else if (
  18079. path[0] !== '/' &&
  18080. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18081. method !== 'CONNECT'
  18082. ) {
  18083. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18084. } else if (invalidPathRegex.exec(path) !== null) {
  18085. throw new InvalidArgumentError('invalid request path')
  18086. }
  18087. if (typeof method !== 'string') {
  18088. throw new InvalidArgumentError('method must be a string')
  18089. } else if (tokenRegExp.exec(method) === null) {
  18090. throw new InvalidArgumentError('invalid request method')
  18091. }
  18092. if (upgrade && typeof upgrade !== 'string') {
  18093. throw new InvalidArgumentError('upgrade must be a string')
  18094. }
  18095. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18096. throw new InvalidArgumentError('invalid headersTimeout')
  18097. }
  18098. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18099. throw new InvalidArgumentError('invalid bodyTimeout')
  18100. }
  18101. if (reset != null && typeof reset !== 'boolean') {
  18102. throw new InvalidArgumentError('invalid reset')
  18103. }
  18104. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18105. throw new InvalidArgumentError('invalid expectContinue')
  18106. }
  18107. this.headersTimeout = headersTimeout
  18108. this.bodyTimeout = bodyTimeout
  18109. this.throwOnError = throwOnError === true
  18110. this.method = method
  18111. this.abort = null
  18112. if (body == null) {
  18113. this.body = null
  18114. } else if (util.isStream(body)) {
  18115. this.body = body
  18116. const rState = this.body._readableState
  18117. if (!rState || !rState.autoDestroy) {
  18118. this.endHandler = function autoDestroy () {
  18119. util.destroy(this)
  18120. }
  18121. this.body.on('end', this.endHandler)
  18122. }
  18123. this.errorHandler = err => {
  18124. if (this.abort) {
  18125. this.abort(err)
  18126. } else {
  18127. this.error = err
  18128. }
  18129. }
  18130. this.body.on('error', this.errorHandler)
  18131. } else if (util.isBuffer(body)) {
  18132. this.body = body.byteLength ? body : null
  18133. } else if (ArrayBuffer.isView(body)) {
  18134. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18135. } else if (body instanceof ArrayBuffer) {
  18136. this.body = body.byteLength ? Buffer.from(body) : null
  18137. } else if (typeof body === 'string') {
  18138. this.body = body.length ? Buffer.from(body) : null
  18139. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18140. this.body = body
  18141. } else {
  18142. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18143. }
  18144. this.completed = false
  18145. this.aborted = false
  18146. this.upgrade = upgrade || null
  18147. this.path = query ? util.buildURL(path, query) : path
  18148. this.origin = origin
  18149. this.idempotent = idempotent == null
  18150. ? method === 'HEAD' || method === 'GET'
  18151. : idempotent
  18152. this.blocking = blocking == null ? false : blocking
  18153. this.reset = reset == null ? null : reset
  18154. this.host = null
  18155. this.contentLength = null
  18156. this.contentType = null
  18157. this.headers = ''
  18158. // Only for H2
  18159. this.expectContinue = expectContinue != null ? expectContinue : false
  18160. if (Array.isArray(headers)) {
  18161. if (headers.length % 2 !== 0) {
  18162. throw new InvalidArgumentError('headers array must be even')
  18163. }
  18164. for (let i = 0; i < headers.length; i += 2) {
  18165. processHeader(this, headers[i], headers[i + 1])
  18166. }
  18167. } else if (headers && typeof headers === 'object') {
  18168. const keys = Object.keys(headers)
  18169. for (let i = 0; i < keys.length; i++) {
  18170. const key = keys[i]
  18171. processHeader(this, key, headers[key])
  18172. }
  18173. } else if (headers != null) {
  18174. throw new InvalidArgumentError('headers must be an object or an array')
  18175. }
  18176. if (util.isFormDataLike(this.body)) {
  18177. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18178. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18179. }
  18180. if (!extractBody) {
  18181. extractBody = (__nccwpck_require__(9990).extractBody)
  18182. }
  18183. const [bodyStream, contentType] = extractBody(body)
  18184. if (this.contentType == null) {
  18185. this.contentType = contentType
  18186. this.headers += `content-type: ${contentType}\r\n`
  18187. }
  18188. this.body = bodyStream.stream
  18189. this.contentLength = bodyStream.length
  18190. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18191. this.contentType = body.type
  18192. this.headers += `content-type: ${body.type}\r\n`
  18193. }
  18194. util.validateHandler(handler, method, upgrade)
  18195. this.servername = util.getServerName(this.host)
  18196. this[kHandler] = handler
  18197. if (channels.create.hasSubscribers) {
  18198. channels.create.publish({ request: this })
  18199. }
  18200. }
  18201. onBodySent (chunk) {
  18202. if (this[kHandler].onBodySent) {
  18203. try {
  18204. return this[kHandler].onBodySent(chunk)
  18205. } catch (err) {
  18206. this.abort(err)
  18207. }
  18208. }
  18209. }
  18210. onRequestSent () {
  18211. if (channels.bodySent.hasSubscribers) {
  18212. channels.bodySent.publish({ request: this })
  18213. }
  18214. if (this[kHandler].onRequestSent) {
  18215. try {
  18216. return this[kHandler].onRequestSent()
  18217. } catch (err) {
  18218. this.abort(err)
  18219. }
  18220. }
  18221. }
  18222. onConnect (abort) {
  18223. assert(!this.aborted)
  18224. assert(!this.completed)
  18225. if (this.error) {
  18226. abort(this.error)
  18227. } else {
  18228. this.abort = abort
  18229. return this[kHandler].onConnect(abort)
  18230. }
  18231. }
  18232. onHeaders (statusCode, headers, resume, statusText) {
  18233. assert(!this.aborted)
  18234. assert(!this.completed)
  18235. if (channels.headers.hasSubscribers) {
  18236. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18237. }
  18238. try {
  18239. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18240. } catch (err) {
  18241. this.abort(err)
  18242. }
  18243. }
  18244. onData (chunk) {
  18245. assert(!this.aborted)
  18246. assert(!this.completed)
  18247. try {
  18248. return this[kHandler].onData(chunk)
  18249. } catch (err) {
  18250. this.abort(err)
  18251. return false
  18252. }
  18253. }
  18254. onUpgrade (statusCode, headers, socket) {
  18255. assert(!this.aborted)
  18256. assert(!this.completed)
  18257. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18258. }
  18259. onComplete (trailers) {
  18260. this.onFinally()
  18261. assert(!this.aborted)
  18262. this.completed = true
  18263. if (channels.trailers.hasSubscribers) {
  18264. channels.trailers.publish({ request: this, trailers })
  18265. }
  18266. try {
  18267. return this[kHandler].onComplete(trailers)
  18268. } catch (err) {
  18269. // TODO (fix): This might be a bad idea?
  18270. this.onError(err)
  18271. }
  18272. }
  18273. onError (error) {
  18274. this.onFinally()
  18275. if (channels.error.hasSubscribers) {
  18276. channels.error.publish({ request: this, error })
  18277. }
  18278. if (this.aborted) {
  18279. return
  18280. }
  18281. this.aborted = true
  18282. return this[kHandler].onError(error)
  18283. }
  18284. onFinally () {
  18285. if (this.errorHandler) {
  18286. this.body.off('error', this.errorHandler)
  18287. this.errorHandler = null
  18288. }
  18289. if (this.endHandler) {
  18290. this.body.off('end', this.endHandler)
  18291. this.endHandler = null
  18292. }
  18293. }
  18294. // TODO: adjust to support H2
  18295. addHeader (key, value) {
  18296. processHeader(this, key, value)
  18297. return this
  18298. }
  18299. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18300. // TODO: Migrate header parsing here, to make Requests
  18301. // HTTP agnostic
  18302. return new Request(origin, opts, handler)
  18303. }
  18304. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18305. const headers = opts.headers
  18306. opts = { ...opts, headers: null }
  18307. const request = new Request(origin, opts, handler)
  18308. request.headers = {}
  18309. if (Array.isArray(headers)) {
  18310. if (headers.length % 2 !== 0) {
  18311. throw new InvalidArgumentError('headers array must be even')
  18312. }
  18313. for (let i = 0; i < headers.length; i += 2) {
  18314. processHeader(request, headers[i], headers[i + 1], true)
  18315. }
  18316. } else if (headers && typeof headers === 'object') {
  18317. const keys = Object.keys(headers)
  18318. for (let i = 0; i < keys.length; i++) {
  18319. const key = keys[i]
  18320. processHeader(request, key, headers[key], true)
  18321. }
  18322. } else if (headers != null) {
  18323. throw new InvalidArgumentError('headers must be an object or an array')
  18324. }
  18325. return request
  18326. }
  18327. static [kHTTP2CopyHeaders] (raw) {
  18328. const rawHeaders = raw.split('\r\n')
  18329. const headers = {}
  18330. for (const header of rawHeaders) {
  18331. const [key, value] = header.split(': ')
  18332. if (value == null || value.length === 0) continue
  18333. if (headers[key]) headers[key] += `,${value}`
  18334. else headers[key] = value
  18335. }
  18336. return headers
  18337. }
  18338. }
  18339. function processHeaderValue (key, val, skipAppend) {
  18340. if (val && typeof val === 'object') {
  18341. throw new InvalidArgumentError(`invalid ${key} header`)
  18342. }
  18343. val = val != null ? `${val}` : ''
  18344. if (headerCharRegex.exec(val) !== null) {
  18345. throw new InvalidArgumentError(`invalid ${key} header`)
  18346. }
  18347. return skipAppend ? val : `${key}: ${val}\r\n`
  18348. }
  18349. function processHeader (request, key, val, skipAppend = false) {
  18350. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18351. throw new InvalidArgumentError(`invalid ${key} header`)
  18352. } else if (val === undefined) {
  18353. return
  18354. }
  18355. if (
  18356. request.host === null &&
  18357. key.length === 4 &&
  18358. key.toLowerCase() === 'host'
  18359. ) {
  18360. if (headerCharRegex.exec(val) !== null) {
  18361. throw new InvalidArgumentError(`invalid ${key} header`)
  18362. }
  18363. // Consumed by Client
  18364. request.host = val
  18365. } else if (
  18366. request.contentLength === null &&
  18367. key.length === 14 &&
  18368. key.toLowerCase() === 'content-length'
  18369. ) {
  18370. request.contentLength = parseInt(val, 10)
  18371. if (!Number.isFinite(request.contentLength)) {
  18372. throw new InvalidArgumentError('invalid content-length header')
  18373. }
  18374. } else if (
  18375. request.contentType === null &&
  18376. key.length === 12 &&
  18377. key.toLowerCase() === 'content-type'
  18378. ) {
  18379. request.contentType = val
  18380. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18381. else request.headers += processHeaderValue(key, val)
  18382. } else if (
  18383. key.length === 17 &&
  18384. key.toLowerCase() === 'transfer-encoding'
  18385. ) {
  18386. throw new InvalidArgumentError('invalid transfer-encoding header')
  18387. } else if (
  18388. key.length === 10 &&
  18389. key.toLowerCase() === 'connection'
  18390. ) {
  18391. const value = typeof val === 'string' ? val.toLowerCase() : null
  18392. if (value !== 'close' && value !== 'keep-alive') {
  18393. throw new InvalidArgumentError('invalid connection header')
  18394. } else if (value === 'close') {
  18395. request.reset = true
  18396. }
  18397. } else if (
  18398. key.length === 10 &&
  18399. key.toLowerCase() === 'keep-alive'
  18400. ) {
  18401. throw new InvalidArgumentError('invalid keep-alive header')
  18402. } else if (
  18403. key.length === 7 &&
  18404. key.toLowerCase() === 'upgrade'
  18405. ) {
  18406. throw new InvalidArgumentError('invalid upgrade header')
  18407. } else if (
  18408. key.length === 6 &&
  18409. key.toLowerCase() === 'expect'
  18410. ) {
  18411. throw new NotSupportedError('expect header not supported')
  18412. } else if (tokenRegExp.exec(key) === null) {
  18413. throw new InvalidArgumentError('invalid header key')
  18414. } else {
  18415. if (Array.isArray(val)) {
  18416. for (let i = 0; i < val.length; i++) {
  18417. if (skipAppend) {
  18418. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18419. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18420. } else {
  18421. request.headers += processHeaderValue(key, val[i])
  18422. }
  18423. }
  18424. } else {
  18425. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18426. else request.headers += processHeaderValue(key, val)
  18427. }
  18428. }
  18429. }
  18430. module.exports = Request
  18431. /***/ }),
  18432. /***/ 2785:
  18433. /***/ ((module) => {
  18434. module.exports = {
  18435. kClose: Symbol('close'),
  18436. kDestroy: Symbol('destroy'),
  18437. kDispatch: Symbol('dispatch'),
  18438. kUrl: Symbol('url'),
  18439. kWriting: Symbol('writing'),
  18440. kResuming: Symbol('resuming'),
  18441. kQueue: Symbol('queue'),
  18442. kConnect: Symbol('connect'),
  18443. kConnecting: Symbol('connecting'),
  18444. kHeadersList: Symbol('headers list'),
  18445. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18446. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18447. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18448. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18449. kKeepAlive: Symbol('keep alive'),
  18450. kHeadersTimeout: Symbol('headers timeout'),
  18451. kBodyTimeout: Symbol('body timeout'),
  18452. kServerName: Symbol('server name'),
  18453. kLocalAddress: Symbol('local address'),
  18454. kHost: Symbol('host'),
  18455. kNoRef: Symbol('no ref'),
  18456. kBodyUsed: Symbol('used'),
  18457. kRunning: Symbol('running'),
  18458. kBlocking: Symbol('blocking'),
  18459. kPending: Symbol('pending'),
  18460. kSize: Symbol('size'),
  18461. kBusy: Symbol('busy'),
  18462. kQueued: Symbol('queued'),
  18463. kFree: Symbol('free'),
  18464. kConnected: Symbol('connected'),
  18465. kClosed: Symbol('closed'),
  18466. kNeedDrain: Symbol('need drain'),
  18467. kReset: Symbol('reset'),
  18468. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18469. kMaxHeadersSize: Symbol('max headers size'),
  18470. kRunningIdx: Symbol('running index'),
  18471. kPendingIdx: Symbol('pending index'),
  18472. kError: Symbol('error'),
  18473. kClients: Symbol('clients'),
  18474. kClient: Symbol('client'),
  18475. kParser: Symbol('parser'),
  18476. kOnDestroyed: Symbol('destroy callbacks'),
  18477. kPipelining: Symbol('pipelining'),
  18478. kSocket: Symbol('socket'),
  18479. kHostHeader: Symbol('host header'),
  18480. kConnector: Symbol('connector'),
  18481. kStrictContentLength: Symbol('strict content length'),
  18482. kMaxRedirections: Symbol('maxRedirections'),
  18483. kMaxRequests: Symbol('maxRequestsPerClient'),
  18484. kProxy: Symbol('proxy agent options'),
  18485. kCounter: Symbol('socket request counter'),
  18486. kInterceptors: Symbol('dispatch interceptors'),
  18487. kMaxResponseSize: Symbol('max response size'),
  18488. kHTTP2Session: Symbol('http2Session'),
  18489. kHTTP2SessionState: Symbol('http2Session state'),
  18490. kHTTP2BuildRequest: Symbol('http2 build request'),
  18491. kHTTP1BuildRequest: Symbol('http1 build request'),
  18492. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18493. kHTTPConnVersion: Symbol('http connection version'),
  18494. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18495. kConstruct: Symbol('constructable')
  18496. }
  18497. /***/ }),
  18498. /***/ 3983:
  18499. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18500. "use strict";
  18501. const assert = __nccwpck_require__(9491)
  18502. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18503. const { IncomingMessage } = __nccwpck_require__(3685)
  18504. const stream = __nccwpck_require__(2781)
  18505. const net = __nccwpck_require__(1808)
  18506. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18507. const { Blob } = __nccwpck_require__(4300)
  18508. const nodeUtil = __nccwpck_require__(3837)
  18509. const { stringify } = __nccwpck_require__(3477)
  18510. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18511. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18512. function nop () {}
  18513. function isStream (obj) {
  18514. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18515. }
  18516. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18517. function isBlobLike (object) {
  18518. return (Blob && object instanceof Blob) || (
  18519. object &&
  18520. typeof object === 'object' &&
  18521. (typeof object.stream === 'function' ||
  18522. typeof object.arrayBuffer === 'function') &&
  18523. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18524. )
  18525. }
  18526. function buildURL (url, queryParams) {
  18527. if (url.includes('?') || url.includes('#')) {
  18528. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18529. }
  18530. const stringified = stringify(queryParams)
  18531. if (stringified) {
  18532. url += '?' + stringified
  18533. }
  18534. return url
  18535. }
  18536. function parseURL (url) {
  18537. if (typeof url === 'string') {
  18538. url = new URL(url)
  18539. if (!/^https?:/.test(url.origin || url.protocol)) {
  18540. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18541. }
  18542. return url
  18543. }
  18544. if (!url || typeof url !== 'object') {
  18545. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18546. }
  18547. if (!/^https?:/.test(url.origin || url.protocol)) {
  18548. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18549. }
  18550. if (!(url instanceof URL)) {
  18551. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18552. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18553. }
  18554. if (url.path != null && typeof url.path !== 'string') {
  18555. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18556. }
  18557. if (url.pathname != null && typeof url.pathname !== 'string') {
  18558. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18559. }
  18560. if (url.hostname != null && typeof url.hostname !== 'string') {
  18561. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18562. }
  18563. if (url.origin != null && typeof url.origin !== 'string') {
  18564. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18565. }
  18566. const port = url.port != null
  18567. ? url.port
  18568. : (url.protocol === 'https:' ? 443 : 80)
  18569. let origin = url.origin != null
  18570. ? url.origin
  18571. : `${url.protocol}//${url.hostname}:${port}`
  18572. let path = url.path != null
  18573. ? url.path
  18574. : `${url.pathname || ''}${url.search || ''}`
  18575. if (origin.endsWith('/')) {
  18576. origin = origin.substring(0, origin.length - 1)
  18577. }
  18578. if (path && !path.startsWith('/')) {
  18579. path = `/${path}`
  18580. }
  18581. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18582. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18583. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18584. // If first parameter is an absolute URL, a given second param will be ignored.
  18585. url = new URL(origin + path)
  18586. }
  18587. return url
  18588. }
  18589. function parseOrigin (url) {
  18590. url = parseURL(url)
  18591. if (url.pathname !== '/' || url.search || url.hash) {
  18592. throw new InvalidArgumentError('invalid url')
  18593. }
  18594. return url
  18595. }
  18596. function getHostname (host) {
  18597. if (host[0] === '[') {
  18598. const idx = host.indexOf(']')
  18599. assert(idx !== -1)
  18600. return host.substring(1, idx)
  18601. }
  18602. const idx = host.indexOf(':')
  18603. if (idx === -1) return host
  18604. return host.substring(0, idx)
  18605. }
  18606. // IP addresses are not valid server names per RFC6066
  18607. // > Currently, the only server names supported are DNS hostnames
  18608. function getServerName (host) {
  18609. if (!host) {
  18610. return null
  18611. }
  18612. assert.strictEqual(typeof host, 'string')
  18613. const servername = getHostname(host)
  18614. if (net.isIP(servername)) {
  18615. return ''
  18616. }
  18617. return servername
  18618. }
  18619. function deepClone (obj) {
  18620. return JSON.parse(JSON.stringify(obj))
  18621. }
  18622. function isAsyncIterable (obj) {
  18623. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18624. }
  18625. function isIterable (obj) {
  18626. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18627. }
  18628. function bodyLength (body) {
  18629. if (body == null) {
  18630. return 0
  18631. } else if (isStream(body)) {
  18632. const state = body._readableState
  18633. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18634. ? state.length
  18635. : null
  18636. } else if (isBlobLike(body)) {
  18637. return body.size != null ? body.size : null
  18638. } else if (isBuffer(body)) {
  18639. return body.byteLength
  18640. }
  18641. return null
  18642. }
  18643. function isDestroyed (stream) {
  18644. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18645. }
  18646. function isReadableAborted (stream) {
  18647. const state = stream && stream._readableState
  18648. return isDestroyed(stream) && state && !state.endEmitted
  18649. }
  18650. function destroy (stream, err) {
  18651. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18652. return
  18653. }
  18654. if (typeof stream.destroy === 'function') {
  18655. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18656. // See: https://github.com/nodejs/node/pull/38505/files
  18657. stream.socket = null
  18658. }
  18659. stream.destroy(err)
  18660. } else if (err) {
  18661. process.nextTick((stream, err) => {
  18662. stream.emit('error', err)
  18663. }, stream, err)
  18664. }
  18665. if (stream.destroyed !== true) {
  18666. stream[kDestroyed] = true
  18667. }
  18668. }
  18669. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18670. function parseKeepAliveTimeout (val) {
  18671. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18672. return m ? parseInt(m[1], 10) * 1000 : null
  18673. }
  18674. /**
  18675. * Retrieves a header name and returns its lowercase value.
  18676. * @param {string | Buffer} value Header name
  18677. * @returns {string}
  18678. */
  18679. function headerNameToString (value) {
  18680. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18681. }
  18682. function parseHeaders (headers, obj = {}) {
  18683. // For H2 support
  18684. if (!Array.isArray(headers)) return headers
  18685. for (let i = 0; i < headers.length; i += 2) {
  18686. const key = headers[i].toString().toLowerCase()
  18687. let val = obj[key]
  18688. if (!val) {
  18689. if (Array.isArray(headers[i + 1])) {
  18690. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18691. } else {
  18692. obj[key] = headers[i + 1].toString('utf8')
  18693. }
  18694. } else {
  18695. if (!Array.isArray(val)) {
  18696. val = [val]
  18697. obj[key] = val
  18698. }
  18699. val.push(headers[i + 1].toString('utf8'))
  18700. }
  18701. }
  18702. // See https://github.com/nodejs/node/pull/46528
  18703. if ('content-length' in obj && 'content-disposition' in obj) {
  18704. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18705. }
  18706. return obj
  18707. }
  18708. function parseRawHeaders (headers) {
  18709. const ret = []
  18710. let hasContentLength = false
  18711. let contentDispositionIdx = -1
  18712. for (let n = 0; n < headers.length; n += 2) {
  18713. const key = headers[n + 0].toString()
  18714. const val = headers[n + 1].toString('utf8')
  18715. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18716. ret.push(key, val)
  18717. hasContentLength = true
  18718. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18719. contentDispositionIdx = ret.push(key, val) - 1
  18720. } else {
  18721. ret.push(key, val)
  18722. }
  18723. }
  18724. // See https://github.com/nodejs/node/pull/46528
  18725. if (hasContentLength && contentDispositionIdx !== -1) {
  18726. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18727. }
  18728. return ret
  18729. }
  18730. function isBuffer (buffer) {
  18731. // See, https://github.com/mcollina/undici/pull/319
  18732. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18733. }
  18734. function validateHandler (handler, method, upgrade) {
  18735. if (!handler || typeof handler !== 'object') {
  18736. throw new InvalidArgumentError('handler must be an object')
  18737. }
  18738. if (typeof handler.onConnect !== 'function') {
  18739. throw new InvalidArgumentError('invalid onConnect method')
  18740. }
  18741. if (typeof handler.onError !== 'function') {
  18742. throw new InvalidArgumentError('invalid onError method')
  18743. }
  18744. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  18745. throw new InvalidArgumentError('invalid onBodySent method')
  18746. }
  18747. if (upgrade || method === 'CONNECT') {
  18748. if (typeof handler.onUpgrade !== 'function') {
  18749. throw new InvalidArgumentError('invalid onUpgrade method')
  18750. }
  18751. } else {
  18752. if (typeof handler.onHeaders !== 'function') {
  18753. throw new InvalidArgumentError('invalid onHeaders method')
  18754. }
  18755. if (typeof handler.onData !== 'function') {
  18756. throw new InvalidArgumentError('invalid onData method')
  18757. }
  18758. if (typeof handler.onComplete !== 'function') {
  18759. throw new InvalidArgumentError('invalid onComplete method')
  18760. }
  18761. }
  18762. }
  18763. // A body is disturbed if it has been read from and it cannot
  18764. // be re-used without losing state or data.
  18765. function isDisturbed (body) {
  18766. return !!(body && (
  18767. stream.isDisturbed
  18768. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  18769. : body[kBodyUsed] ||
  18770. body.readableDidRead ||
  18771. (body._readableState && body._readableState.dataEmitted) ||
  18772. isReadableAborted(body)
  18773. ))
  18774. }
  18775. function isErrored (body) {
  18776. return !!(body && (
  18777. stream.isErrored
  18778. ? stream.isErrored(body)
  18779. : /state: 'errored'/.test(nodeUtil.inspect(body)
  18780. )))
  18781. }
  18782. function isReadable (body) {
  18783. return !!(body && (
  18784. stream.isReadable
  18785. ? stream.isReadable(body)
  18786. : /state: 'readable'/.test(nodeUtil.inspect(body)
  18787. )))
  18788. }
  18789. function getSocketInfo (socket) {
  18790. return {
  18791. localAddress: socket.localAddress,
  18792. localPort: socket.localPort,
  18793. remoteAddress: socket.remoteAddress,
  18794. remotePort: socket.remotePort,
  18795. remoteFamily: socket.remoteFamily,
  18796. timeout: socket.timeout,
  18797. bytesWritten: socket.bytesWritten,
  18798. bytesRead: socket.bytesRead
  18799. }
  18800. }
  18801. async function * convertIterableToBuffer (iterable) {
  18802. for await (const chunk of iterable) {
  18803. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  18804. }
  18805. }
  18806. let ReadableStream
  18807. function ReadableStreamFrom (iterable) {
  18808. if (!ReadableStream) {
  18809. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  18810. }
  18811. if (ReadableStream.from) {
  18812. return ReadableStream.from(convertIterableToBuffer(iterable))
  18813. }
  18814. let iterator
  18815. return new ReadableStream(
  18816. {
  18817. async start () {
  18818. iterator = iterable[Symbol.asyncIterator]()
  18819. },
  18820. async pull (controller) {
  18821. const { done, value } = await iterator.next()
  18822. if (done) {
  18823. queueMicrotask(() => {
  18824. controller.close()
  18825. })
  18826. } else {
  18827. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  18828. controller.enqueue(new Uint8Array(buf))
  18829. }
  18830. return controller.desiredSize > 0
  18831. },
  18832. async cancel (reason) {
  18833. await iterator.return()
  18834. }
  18835. },
  18836. 0
  18837. )
  18838. }
  18839. // The chunk should be a FormData instance and contains
  18840. // all the required methods.
  18841. function isFormDataLike (object) {
  18842. return (
  18843. object &&
  18844. typeof object === 'object' &&
  18845. typeof object.append === 'function' &&
  18846. typeof object.delete === 'function' &&
  18847. typeof object.get === 'function' &&
  18848. typeof object.getAll === 'function' &&
  18849. typeof object.has === 'function' &&
  18850. typeof object.set === 'function' &&
  18851. object[Symbol.toStringTag] === 'FormData'
  18852. )
  18853. }
  18854. function throwIfAborted (signal) {
  18855. if (!signal) { return }
  18856. if (typeof signal.throwIfAborted === 'function') {
  18857. signal.throwIfAborted()
  18858. } else {
  18859. if (signal.aborted) {
  18860. // DOMException not available < v17.0.0
  18861. const err = new Error('The operation was aborted')
  18862. err.name = 'AbortError'
  18863. throw err
  18864. }
  18865. }
  18866. }
  18867. function addAbortListener (signal, listener) {
  18868. if ('addEventListener' in signal) {
  18869. signal.addEventListener('abort', listener, { once: true })
  18870. return () => signal.removeEventListener('abort', listener)
  18871. }
  18872. signal.addListener('abort', listener)
  18873. return () => signal.removeListener('abort', listener)
  18874. }
  18875. const hasToWellFormed = !!String.prototype.toWellFormed
  18876. /**
  18877. * @param {string} val
  18878. */
  18879. function toUSVString (val) {
  18880. if (hasToWellFormed) {
  18881. return `${val}`.toWellFormed()
  18882. } else if (nodeUtil.toUSVString) {
  18883. return nodeUtil.toUSVString(val)
  18884. }
  18885. return `${val}`
  18886. }
  18887. // Parsed accordingly to RFC 9110
  18888. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  18889. function parseRangeHeader (range) {
  18890. if (range == null || range === '') return { start: 0, end: null, size: null }
  18891. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  18892. return m
  18893. ? {
  18894. start: parseInt(m[1]),
  18895. end: m[2] ? parseInt(m[2]) : null,
  18896. size: m[3] ? parseInt(m[3]) : null
  18897. }
  18898. : null
  18899. }
  18900. const kEnumerableProperty = Object.create(null)
  18901. kEnumerableProperty.enumerable = true
  18902. module.exports = {
  18903. kEnumerableProperty,
  18904. nop,
  18905. isDisturbed,
  18906. isErrored,
  18907. isReadable,
  18908. toUSVString,
  18909. isReadableAborted,
  18910. isBlobLike,
  18911. parseOrigin,
  18912. parseURL,
  18913. getServerName,
  18914. isStream,
  18915. isIterable,
  18916. isAsyncIterable,
  18917. isDestroyed,
  18918. headerNameToString,
  18919. parseRawHeaders,
  18920. parseHeaders,
  18921. parseKeepAliveTimeout,
  18922. destroy,
  18923. bodyLength,
  18924. deepClone,
  18925. ReadableStreamFrom,
  18926. isBuffer,
  18927. validateHandler,
  18928. getSocketInfo,
  18929. isFormDataLike,
  18930. buildURL,
  18931. throwIfAborted,
  18932. addAbortListener,
  18933. parseRangeHeader,
  18934. nodeMajor,
  18935. nodeMinor,
  18936. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  18937. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  18938. }
  18939. /***/ }),
  18940. /***/ 4839:
  18941. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18942. "use strict";
  18943. const Dispatcher = __nccwpck_require__(412)
  18944. const {
  18945. ClientDestroyedError,
  18946. ClientClosedError,
  18947. InvalidArgumentError
  18948. } = __nccwpck_require__(8045)
  18949. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  18950. const kDestroyed = Symbol('destroyed')
  18951. const kClosed = Symbol('closed')
  18952. const kOnDestroyed = Symbol('onDestroyed')
  18953. const kOnClosed = Symbol('onClosed')
  18954. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  18955. class DispatcherBase extends Dispatcher {
  18956. constructor () {
  18957. super()
  18958. this[kDestroyed] = false
  18959. this[kOnDestroyed] = null
  18960. this[kClosed] = false
  18961. this[kOnClosed] = []
  18962. }
  18963. get destroyed () {
  18964. return this[kDestroyed]
  18965. }
  18966. get closed () {
  18967. return this[kClosed]
  18968. }
  18969. get interceptors () {
  18970. return this[kInterceptors]
  18971. }
  18972. set interceptors (newInterceptors) {
  18973. if (newInterceptors) {
  18974. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  18975. const interceptor = this[kInterceptors][i]
  18976. if (typeof interceptor !== 'function') {
  18977. throw new InvalidArgumentError('interceptor must be an function')
  18978. }
  18979. }
  18980. }
  18981. this[kInterceptors] = newInterceptors
  18982. }
  18983. close (callback) {
  18984. if (callback === undefined) {
  18985. return new Promise((resolve, reject) => {
  18986. this.close((err, data) => {
  18987. return err ? reject(err) : resolve(data)
  18988. })
  18989. })
  18990. }
  18991. if (typeof callback !== 'function') {
  18992. throw new InvalidArgumentError('invalid callback')
  18993. }
  18994. if (this[kDestroyed]) {
  18995. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  18996. return
  18997. }
  18998. if (this[kClosed]) {
  18999. if (this[kOnClosed]) {
  19000. this[kOnClosed].push(callback)
  19001. } else {
  19002. queueMicrotask(() => callback(null, null))
  19003. }
  19004. return
  19005. }
  19006. this[kClosed] = true
  19007. this[kOnClosed].push(callback)
  19008. const onClosed = () => {
  19009. const callbacks = this[kOnClosed]
  19010. this[kOnClosed] = null
  19011. for (let i = 0; i < callbacks.length; i++) {
  19012. callbacks[i](null, null)
  19013. }
  19014. }
  19015. // Should not error.
  19016. this[kClose]()
  19017. .then(() => this.destroy())
  19018. .then(() => {
  19019. queueMicrotask(onClosed)
  19020. })
  19021. }
  19022. destroy (err, callback) {
  19023. if (typeof err === 'function') {
  19024. callback = err
  19025. err = null
  19026. }
  19027. if (callback === undefined) {
  19028. return new Promise((resolve, reject) => {
  19029. this.destroy(err, (err, data) => {
  19030. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19031. })
  19032. })
  19033. }
  19034. if (typeof callback !== 'function') {
  19035. throw new InvalidArgumentError('invalid callback')
  19036. }
  19037. if (this[kDestroyed]) {
  19038. if (this[kOnDestroyed]) {
  19039. this[kOnDestroyed].push(callback)
  19040. } else {
  19041. queueMicrotask(() => callback(null, null))
  19042. }
  19043. return
  19044. }
  19045. if (!err) {
  19046. err = new ClientDestroyedError()
  19047. }
  19048. this[kDestroyed] = true
  19049. this[kOnDestroyed] = this[kOnDestroyed] || []
  19050. this[kOnDestroyed].push(callback)
  19051. const onDestroyed = () => {
  19052. const callbacks = this[kOnDestroyed]
  19053. this[kOnDestroyed] = null
  19054. for (let i = 0; i < callbacks.length; i++) {
  19055. callbacks[i](null, null)
  19056. }
  19057. }
  19058. // Should not error.
  19059. this[kDestroy](err).then(() => {
  19060. queueMicrotask(onDestroyed)
  19061. })
  19062. }
  19063. [kInterceptedDispatch] (opts, handler) {
  19064. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19065. this[kInterceptedDispatch] = this[kDispatch]
  19066. return this[kDispatch](opts, handler)
  19067. }
  19068. let dispatch = this[kDispatch].bind(this)
  19069. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19070. dispatch = this[kInterceptors][i](dispatch)
  19071. }
  19072. this[kInterceptedDispatch] = dispatch
  19073. return dispatch(opts, handler)
  19074. }
  19075. dispatch (opts, handler) {
  19076. if (!handler || typeof handler !== 'object') {
  19077. throw new InvalidArgumentError('handler must be an object')
  19078. }
  19079. try {
  19080. if (!opts || typeof opts !== 'object') {
  19081. throw new InvalidArgumentError('opts must be an object.')
  19082. }
  19083. if (this[kDestroyed] || this[kOnDestroyed]) {
  19084. throw new ClientDestroyedError()
  19085. }
  19086. if (this[kClosed]) {
  19087. throw new ClientClosedError()
  19088. }
  19089. return this[kInterceptedDispatch](opts, handler)
  19090. } catch (err) {
  19091. if (typeof handler.onError !== 'function') {
  19092. throw new InvalidArgumentError('invalid onError method')
  19093. }
  19094. handler.onError(err)
  19095. return false
  19096. }
  19097. }
  19098. }
  19099. module.exports = DispatcherBase
  19100. /***/ }),
  19101. /***/ 412:
  19102. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19103. "use strict";
  19104. const EventEmitter = __nccwpck_require__(2361)
  19105. class Dispatcher extends EventEmitter {
  19106. dispatch () {
  19107. throw new Error('not implemented')
  19108. }
  19109. close () {
  19110. throw new Error('not implemented')
  19111. }
  19112. destroy () {
  19113. throw new Error('not implemented')
  19114. }
  19115. }
  19116. module.exports = Dispatcher
  19117. /***/ }),
  19118. /***/ 9990:
  19119. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19120. "use strict";
  19121. const Busboy = __nccwpck_require__(727)
  19122. const util = __nccwpck_require__(3983)
  19123. const {
  19124. ReadableStreamFrom,
  19125. isBlobLike,
  19126. isReadableStreamLike,
  19127. readableStreamClose,
  19128. createDeferredPromise,
  19129. fullyReadBody
  19130. } = __nccwpck_require__(2538)
  19131. const { FormData } = __nccwpck_require__(2015)
  19132. const { kState } = __nccwpck_require__(5861)
  19133. const { webidl } = __nccwpck_require__(1744)
  19134. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19135. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19136. const { kBodyUsed } = __nccwpck_require__(2785)
  19137. const assert = __nccwpck_require__(9491)
  19138. const { isErrored } = __nccwpck_require__(3983)
  19139. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19140. const { File: UndiciFile } = __nccwpck_require__(8511)
  19141. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19142. let ReadableStream = globalThis.ReadableStream
  19143. /** @type {globalThis['File']} */
  19144. const File = NativeFile ?? UndiciFile
  19145. const textEncoder = new TextEncoder()
  19146. const textDecoder = new TextDecoder()
  19147. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19148. function extractBody (object, keepalive = false) {
  19149. if (!ReadableStream) {
  19150. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19151. }
  19152. // 1. Let stream be null.
  19153. let stream = null
  19154. // 2. If object is a ReadableStream object, then set stream to object.
  19155. if (object instanceof ReadableStream) {
  19156. stream = object
  19157. } else if (isBlobLike(object)) {
  19158. // 3. Otherwise, if object is a Blob object, set stream to the
  19159. // result of running object’s get stream.
  19160. stream = object.stream()
  19161. } else {
  19162. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19163. // up stream.
  19164. stream = new ReadableStream({
  19165. async pull (controller) {
  19166. controller.enqueue(
  19167. typeof source === 'string' ? textEncoder.encode(source) : source
  19168. )
  19169. queueMicrotask(() => readableStreamClose(controller))
  19170. },
  19171. start () {},
  19172. type: undefined
  19173. })
  19174. }
  19175. // 5. Assert: stream is a ReadableStream object.
  19176. assert(isReadableStreamLike(stream))
  19177. // 6. Let action be null.
  19178. let action = null
  19179. // 7. Let source be null.
  19180. let source = null
  19181. // 8. Let length be null.
  19182. let length = null
  19183. // 9. Let type be null.
  19184. let type = null
  19185. // 10. Switch on object:
  19186. if (typeof object === 'string') {
  19187. // Set source to the UTF-8 encoding of object.
  19188. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19189. source = object
  19190. // Set type to `text/plain;charset=UTF-8`.
  19191. type = 'text/plain;charset=UTF-8'
  19192. } else if (object instanceof URLSearchParams) {
  19193. // URLSearchParams
  19194. // spec says to run application/x-www-form-urlencoded on body.list
  19195. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19196. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19197. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19198. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19199. source = object.toString()
  19200. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19201. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19202. } else if (isArrayBuffer(object)) {
  19203. // BufferSource/ArrayBuffer
  19204. // Set source to a copy of the bytes held by object.
  19205. source = new Uint8Array(object.slice())
  19206. } else if (ArrayBuffer.isView(object)) {
  19207. // BufferSource/ArrayBufferView
  19208. // Set source to a copy of the bytes held by object.
  19209. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19210. } else if (util.isFormDataLike(object)) {
  19211. const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
  19212. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19213. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19214. const escape = (str) =>
  19215. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19216. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19217. // Set action to this step: run the multipart/form-data
  19218. // encoding algorithm, with object’s entry list and UTF-8.
  19219. // - This ensures that the body is immutable and can't be changed afterwords
  19220. // - That the content-length is calculated in advance.
  19221. // - And that all parts are pre-encoded and ready to be sent.
  19222. const blobParts = []
  19223. const rn = new Uint8Array([13, 10]) // '\r\n'
  19224. length = 0
  19225. let hasUnknownSizeValue = false
  19226. for (const [name, value] of object) {
  19227. if (typeof value === 'string') {
  19228. const chunk = textEncoder.encode(prefix +
  19229. `; name="${escape(normalizeLinefeeds(name))}"` +
  19230. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19231. blobParts.push(chunk)
  19232. length += chunk.byteLength
  19233. } else {
  19234. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19235. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19236. `Content-Type: ${
  19237. value.type || 'application/octet-stream'
  19238. }\r\n\r\n`)
  19239. blobParts.push(chunk, value, rn)
  19240. if (typeof value.size === 'number') {
  19241. length += chunk.byteLength + value.size + rn.byteLength
  19242. } else {
  19243. hasUnknownSizeValue = true
  19244. }
  19245. }
  19246. }
  19247. const chunk = textEncoder.encode(`--${boundary}--`)
  19248. blobParts.push(chunk)
  19249. length += chunk.byteLength
  19250. if (hasUnknownSizeValue) {
  19251. length = null
  19252. }
  19253. // Set source to object.
  19254. source = object
  19255. action = async function * () {
  19256. for (const part of blobParts) {
  19257. if (part.stream) {
  19258. yield * part.stream()
  19259. } else {
  19260. yield part
  19261. }
  19262. }
  19263. }
  19264. // Set type to `multipart/form-data; boundary=`,
  19265. // followed by the multipart/form-data boundary string generated
  19266. // by the multipart/form-data encoding algorithm.
  19267. type = 'multipart/form-data; boundary=' + boundary
  19268. } else if (isBlobLike(object)) {
  19269. // Blob
  19270. // Set source to object.
  19271. source = object
  19272. // Set length to object’s size.
  19273. length = object.size
  19274. // If object’s type attribute is not the empty byte sequence, set
  19275. // type to its value.
  19276. if (object.type) {
  19277. type = object.type
  19278. }
  19279. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19280. // If keepalive is true, then throw a TypeError.
  19281. if (keepalive) {
  19282. throw new TypeError('keepalive')
  19283. }
  19284. // If object is disturbed or locked, then throw a TypeError.
  19285. if (util.isDisturbed(object) || object.locked) {
  19286. throw new TypeError(
  19287. 'Response body object should not be disturbed or locked'
  19288. )
  19289. }
  19290. stream =
  19291. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19292. }
  19293. // 11. If source is a byte sequence, then set action to a
  19294. // step that returns source and length to source’s length.
  19295. if (typeof source === 'string' || util.isBuffer(source)) {
  19296. length = Buffer.byteLength(source)
  19297. }
  19298. // 12. If action is non-null, then run these steps in in parallel:
  19299. if (action != null) {
  19300. // Run action.
  19301. let iterator
  19302. stream = new ReadableStream({
  19303. async start () {
  19304. iterator = action(object)[Symbol.asyncIterator]()
  19305. },
  19306. async pull (controller) {
  19307. const { value, done } = await iterator.next()
  19308. if (done) {
  19309. // When running action is done, close stream.
  19310. queueMicrotask(() => {
  19311. controller.close()
  19312. })
  19313. } else {
  19314. // Whenever one or more bytes are available and stream is not errored,
  19315. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19316. // bytes into stream.
  19317. if (!isErrored(stream)) {
  19318. controller.enqueue(new Uint8Array(value))
  19319. }
  19320. }
  19321. return controller.desiredSize > 0
  19322. },
  19323. async cancel (reason) {
  19324. await iterator.return()
  19325. },
  19326. type: undefined
  19327. })
  19328. }
  19329. // 13. Let body be a body whose stream is stream, source is source,
  19330. // and length is length.
  19331. const body = { stream, source, length }
  19332. // 14. Return (body, type).
  19333. return [body, type]
  19334. }
  19335. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19336. function safelyExtractBody (object, keepalive = false) {
  19337. if (!ReadableStream) {
  19338. // istanbul ignore next
  19339. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19340. }
  19341. // To safely extract a body and a `Content-Type` value from
  19342. // a byte sequence or BodyInit object object, run these steps:
  19343. // 1. If object is a ReadableStream object, then:
  19344. if (object instanceof ReadableStream) {
  19345. // Assert: object is neither disturbed nor locked.
  19346. // istanbul ignore next
  19347. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19348. // istanbul ignore next
  19349. assert(!object.locked, 'The stream is locked.')
  19350. }
  19351. // 2. Return the results of extracting object.
  19352. return extractBody(object, keepalive)
  19353. }
  19354. function cloneBody (body) {
  19355. // To clone a body body, run these steps:
  19356. // https://fetch.spec.whatwg.org/#concept-body-clone
  19357. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19358. const [out1, out2] = body.stream.tee()
  19359. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19360. // This, for whatever reasons, unrefs out2Clone which allows
  19361. // the process to exit by itself.
  19362. const [, finalClone] = out2Clone.tee()
  19363. // 2. Set body’s stream to out1.
  19364. body.stream = out1
  19365. // 3. Return a body whose stream is out2 and other members are copied from body.
  19366. return {
  19367. stream: finalClone,
  19368. length: body.length,
  19369. source: body.source
  19370. }
  19371. }
  19372. async function * consumeBody (body) {
  19373. if (body) {
  19374. if (isUint8Array(body)) {
  19375. yield body
  19376. } else {
  19377. const stream = body.stream
  19378. if (util.isDisturbed(stream)) {
  19379. throw new TypeError('The body has already been consumed.')
  19380. }
  19381. if (stream.locked) {
  19382. throw new TypeError('The stream is locked.')
  19383. }
  19384. // Compat.
  19385. stream[kBodyUsed] = true
  19386. yield * stream
  19387. }
  19388. }
  19389. }
  19390. function throwIfAborted (state) {
  19391. if (state.aborted) {
  19392. throw new DOMException('The operation was aborted.', 'AbortError')
  19393. }
  19394. }
  19395. function bodyMixinMethods (instance) {
  19396. const methods = {
  19397. blob () {
  19398. // The blob() method steps are to return the result of
  19399. // running consume body with this and the following step
  19400. // given a byte sequence bytes: return a Blob whose
  19401. // contents are bytes and whose type attribute is this’s
  19402. // MIME type.
  19403. return specConsumeBody(this, (bytes) => {
  19404. let mimeType = bodyMimeType(this)
  19405. if (mimeType === 'failure') {
  19406. mimeType = ''
  19407. } else if (mimeType) {
  19408. mimeType = serializeAMimeType(mimeType)
  19409. }
  19410. // Return a Blob whose contents are bytes and type attribute
  19411. // is mimeType.
  19412. return new Blob([bytes], { type: mimeType })
  19413. }, instance)
  19414. },
  19415. arrayBuffer () {
  19416. // The arrayBuffer() method steps are to return the result
  19417. // of running consume body with this and the following step
  19418. // given a byte sequence bytes: return a new ArrayBuffer
  19419. // whose contents are bytes.
  19420. return specConsumeBody(this, (bytes) => {
  19421. return new Uint8Array(bytes).buffer
  19422. }, instance)
  19423. },
  19424. text () {
  19425. // The text() method steps are to return the result of running
  19426. // consume body with this and UTF-8 decode.
  19427. return specConsumeBody(this, utf8DecodeBytes, instance)
  19428. },
  19429. json () {
  19430. // The json() method steps are to return the result of running
  19431. // consume body with this and parse JSON from bytes.
  19432. return specConsumeBody(this, parseJSONFromBytes, instance)
  19433. },
  19434. async formData () {
  19435. webidl.brandCheck(this, instance)
  19436. throwIfAborted(this[kState])
  19437. const contentType = this.headers.get('Content-Type')
  19438. // If mimeType’s essence is "multipart/form-data", then:
  19439. if (/multipart\/form-data/.test(contentType)) {
  19440. const headers = {}
  19441. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19442. const responseFormData = new FormData()
  19443. let busboy
  19444. try {
  19445. busboy = new Busboy({
  19446. headers,
  19447. preservePath: true
  19448. })
  19449. } catch (err) {
  19450. throw new DOMException(`${err}`, 'AbortError')
  19451. }
  19452. busboy.on('field', (name, value) => {
  19453. responseFormData.append(name, value)
  19454. })
  19455. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19456. const chunks = []
  19457. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19458. let base64chunk = ''
  19459. value.on('data', (chunk) => {
  19460. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19461. const end = base64chunk.length - base64chunk.length % 4
  19462. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19463. base64chunk = base64chunk.slice(end)
  19464. })
  19465. value.on('end', () => {
  19466. chunks.push(Buffer.from(base64chunk, 'base64'))
  19467. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19468. })
  19469. } else {
  19470. value.on('data', (chunk) => {
  19471. chunks.push(chunk)
  19472. })
  19473. value.on('end', () => {
  19474. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19475. })
  19476. }
  19477. })
  19478. const busboyResolve = new Promise((resolve, reject) => {
  19479. busboy.on('finish', resolve)
  19480. busboy.on('error', (err) => reject(new TypeError(err)))
  19481. })
  19482. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19483. busboy.end()
  19484. await busboyResolve
  19485. return responseFormData
  19486. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19487. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19488. // 1. Let entries be the result of parsing bytes.
  19489. let entries
  19490. try {
  19491. let text = ''
  19492. // application/x-www-form-urlencoded parser will keep the BOM.
  19493. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19494. // Note that streaming decoder is stateful and cannot be reused
  19495. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19496. for await (const chunk of consumeBody(this[kState].body)) {
  19497. if (!isUint8Array(chunk)) {
  19498. throw new TypeError('Expected Uint8Array chunk')
  19499. }
  19500. text += streamingDecoder.decode(chunk, { stream: true })
  19501. }
  19502. text += streamingDecoder.decode()
  19503. entries = new URLSearchParams(text)
  19504. } catch (err) {
  19505. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19506. // 2. If entries is failure, then throw a TypeError.
  19507. throw Object.assign(new TypeError(), { cause: err })
  19508. }
  19509. // 3. Return a new FormData object whose entries are entries.
  19510. const formData = new FormData()
  19511. for (const [name, value] of entries) {
  19512. formData.append(name, value)
  19513. }
  19514. return formData
  19515. } else {
  19516. // Wait a tick before checking if the request has been aborted.
  19517. // Otherwise, a TypeError can be thrown when an AbortError should.
  19518. await Promise.resolve()
  19519. throwIfAborted(this[kState])
  19520. // Otherwise, throw a TypeError.
  19521. throw webidl.errors.exception({
  19522. header: `${instance.name}.formData`,
  19523. message: 'Could not parse content as FormData.'
  19524. })
  19525. }
  19526. }
  19527. }
  19528. return methods
  19529. }
  19530. function mixinBody (prototype) {
  19531. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19532. }
  19533. /**
  19534. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19535. * @param {Response|Request} object
  19536. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19537. * @param {Response|Request} instance
  19538. */
  19539. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19540. webidl.brandCheck(object, instance)
  19541. throwIfAborted(object[kState])
  19542. // 1. If object is unusable, then return a promise rejected
  19543. // with a TypeError.
  19544. if (bodyUnusable(object[kState].body)) {
  19545. throw new TypeError('Body is unusable')
  19546. }
  19547. // 2. Let promise be a new promise.
  19548. const promise = createDeferredPromise()
  19549. // 3. Let errorSteps given error be to reject promise with error.
  19550. const errorSteps = (error) => promise.reject(error)
  19551. // 4. Let successSteps given a byte sequence data be to resolve
  19552. // promise with the result of running convertBytesToJSValue
  19553. // with data. If that threw an exception, then run errorSteps
  19554. // with that exception.
  19555. const successSteps = (data) => {
  19556. try {
  19557. promise.resolve(convertBytesToJSValue(data))
  19558. } catch (e) {
  19559. errorSteps(e)
  19560. }
  19561. }
  19562. // 5. If object’s body is null, then run successSteps with an
  19563. // empty byte sequence.
  19564. if (object[kState].body == null) {
  19565. successSteps(new Uint8Array())
  19566. return promise.promise
  19567. }
  19568. // 6. Otherwise, fully read object’s body given successSteps,
  19569. // errorSteps, and object’s relevant global object.
  19570. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19571. // 7. Return promise.
  19572. return promise.promise
  19573. }
  19574. // https://fetch.spec.whatwg.org/#body-unusable
  19575. function bodyUnusable (body) {
  19576. // An object including the Body interface mixin is
  19577. // said to be unusable if its body is non-null and
  19578. // its body’s stream is disturbed or locked.
  19579. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19580. }
  19581. /**
  19582. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19583. * @param {Buffer} buffer
  19584. */
  19585. function utf8DecodeBytes (buffer) {
  19586. if (buffer.length === 0) {
  19587. return ''
  19588. }
  19589. // 1. Let buffer be the result of peeking three bytes from
  19590. // ioQueue, converted to a byte sequence.
  19591. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19592. // bytes from ioQueue. (Do nothing with those bytes.)
  19593. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19594. buffer = buffer.subarray(3)
  19595. }
  19596. // 3. Process a queue with an instance of UTF-8’s
  19597. // decoder, ioQueue, output, and "replacement".
  19598. const output = textDecoder.decode(buffer)
  19599. // 4. Return output.
  19600. return output
  19601. }
  19602. /**
  19603. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19604. * @param {Uint8Array} bytes
  19605. */
  19606. function parseJSONFromBytes (bytes) {
  19607. return JSON.parse(utf8DecodeBytes(bytes))
  19608. }
  19609. /**
  19610. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19611. * @param {import('./response').Response|import('./request').Request} object
  19612. */
  19613. function bodyMimeType (object) {
  19614. const { headersList } = object[kState]
  19615. const contentType = headersList.get('content-type')
  19616. if (contentType === null) {
  19617. return 'failure'
  19618. }
  19619. return parseMIMEType(contentType)
  19620. }
  19621. module.exports = {
  19622. extractBody,
  19623. safelyExtractBody,
  19624. cloneBody,
  19625. mixinBody
  19626. }
  19627. /***/ }),
  19628. /***/ 1037:
  19629. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19630. "use strict";
  19631. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19632. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19633. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19634. const nullBodyStatus = [101, 204, 205, 304]
  19635. const redirectStatus = [301, 302, 303, 307, 308]
  19636. const redirectStatusSet = new Set(redirectStatus)
  19637. // https://fetch.spec.whatwg.org/#block-bad-port
  19638. const badPorts = [
  19639. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19640. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19641. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19642. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19643. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19644. '10080'
  19645. ]
  19646. const badPortsSet = new Set(badPorts)
  19647. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19648. const referrerPolicy = [
  19649. '',
  19650. 'no-referrer',
  19651. 'no-referrer-when-downgrade',
  19652. 'same-origin',
  19653. 'origin',
  19654. 'strict-origin',
  19655. 'origin-when-cross-origin',
  19656. 'strict-origin-when-cross-origin',
  19657. 'unsafe-url'
  19658. ]
  19659. const referrerPolicySet = new Set(referrerPolicy)
  19660. const requestRedirect = ['follow', 'manual', 'error']
  19661. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19662. const safeMethodsSet = new Set(safeMethods)
  19663. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19664. const requestCredentials = ['omit', 'same-origin', 'include']
  19665. const requestCache = [
  19666. 'default',
  19667. 'no-store',
  19668. 'reload',
  19669. 'no-cache',
  19670. 'force-cache',
  19671. 'only-if-cached'
  19672. ]
  19673. // https://fetch.spec.whatwg.org/#request-body-header-name
  19674. const requestBodyHeader = [
  19675. 'content-encoding',
  19676. 'content-language',
  19677. 'content-location',
  19678. 'content-type',
  19679. // See https://github.com/nodejs/undici/issues/2021
  19680. // 'Content-Length' is a forbidden header name, which is typically
  19681. // removed in the Headers implementation. However, undici doesn't
  19682. // filter out headers, so we add it here.
  19683. 'content-length'
  19684. ]
  19685. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19686. const requestDuplex = [
  19687. 'half'
  19688. ]
  19689. // http://fetch.spec.whatwg.org/#forbidden-method
  19690. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19691. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19692. const subresource = [
  19693. 'audio',
  19694. 'audioworklet',
  19695. 'font',
  19696. 'image',
  19697. 'manifest',
  19698. 'paintworklet',
  19699. 'script',
  19700. 'style',
  19701. 'track',
  19702. 'video',
  19703. 'xslt',
  19704. ''
  19705. ]
  19706. const subresourceSet = new Set(subresource)
  19707. /** @type {globalThis['DOMException']} */
  19708. const DOMException = globalThis.DOMException ?? (() => {
  19709. // DOMException was only made a global in Node v17.0.0,
  19710. // but fetch supports >= v16.8.
  19711. try {
  19712. atob('~')
  19713. } catch (err) {
  19714. return Object.getPrototypeOf(err).constructor
  19715. }
  19716. })()
  19717. let channel
  19718. /** @type {globalThis['structuredClone']} */
  19719. const structuredClone =
  19720. globalThis.structuredClone ??
  19721. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19722. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19723. function structuredClone (value, options = undefined) {
  19724. if (arguments.length === 0) {
  19725. throw new TypeError('missing argument')
  19726. }
  19727. if (!channel) {
  19728. channel = new MessageChannel()
  19729. }
  19730. channel.port1.unref()
  19731. channel.port2.unref()
  19732. channel.port1.postMessage(value, options?.transfer)
  19733. return receiveMessageOnPort(channel.port2).message
  19734. }
  19735. module.exports = {
  19736. DOMException,
  19737. structuredClone,
  19738. subresource,
  19739. forbiddenMethods,
  19740. requestBodyHeader,
  19741. referrerPolicy,
  19742. requestRedirect,
  19743. requestMode,
  19744. requestCredentials,
  19745. requestCache,
  19746. redirectStatus,
  19747. corsSafeListedMethods,
  19748. nullBodyStatus,
  19749. safeMethods,
  19750. badPorts,
  19751. requestDuplex,
  19752. subresourceSet,
  19753. badPortsSet,
  19754. redirectStatusSet,
  19755. corsSafeListedMethodsSet,
  19756. safeMethodsSet,
  19757. forbiddenMethodsSet,
  19758. referrerPolicySet
  19759. }
  19760. /***/ }),
  19761. /***/ 685:
  19762. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19763. const assert = __nccwpck_require__(9491)
  19764. const { atob } = __nccwpck_require__(4300)
  19765. const { isomorphicDecode } = __nccwpck_require__(2538)
  19766. const encoder = new TextEncoder()
  19767. /**
  19768. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  19769. */
  19770. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  19771. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  19772. /**
  19773. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  19774. */
  19775. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  19776. // https://fetch.spec.whatwg.org/#data-url-processor
  19777. /** @param {URL} dataURL */
  19778. function dataURLProcessor (dataURL) {
  19779. // 1. Assert: dataURL’s scheme is "data".
  19780. assert(dataURL.protocol === 'data:')
  19781. // 2. Let input be the result of running the URL
  19782. // serializer on dataURL with exclude fragment
  19783. // set to true.
  19784. let input = URLSerializer(dataURL, true)
  19785. // 3. Remove the leading "data:" string from input.
  19786. input = input.slice(5)
  19787. // 4. Let position point at the start of input.
  19788. const position = { position: 0 }
  19789. // 5. Let mimeType be the result of collecting a
  19790. // sequence of code points that are not equal
  19791. // to U+002C (,), given position.
  19792. let mimeType = collectASequenceOfCodePointsFast(
  19793. ',',
  19794. input,
  19795. position
  19796. )
  19797. // 6. Strip leading and trailing ASCII whitespace
  19798. // from mimeType.
  19799. // Undici implementation note: we need to store the
  19800. // length because if the mimetype has spaces removed,
  19801. // the wrong amount will be sliced from the input in
  19802. // step #9
  19803. const mimeTypeLength = mimeType.length
  19804. mimeType = removeASCIIWhitespace(mimeType, true, true)
  19805. // 7. If position is past the end of input, then
  19806. // return failure
  19807. if (position.position >= input.length) {
  19808. return 'failure'
  19809. }
  19810. // 8. Advance position by 1.
  19811. position.position++
  19812. // 9. Let encodedBody be the remainder of input.
  19813. const encodedBody = input.slice(mimeTypeLength + 1)
  19814. // 10. Let body be the percent-decoding of encodedBody.
  19815. let body = stringPercentDecode(encodedBody)
  19816. // 11. If mimeType ends with U+003B (;), followed by
  19817. // zero or more U+0020 SPACE, followed by an ASCII
  19818. // case-insensitive match for "base64", then:
  19819. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  19820. // 1. Let stringBody be the isomorphic decode of body.
  19821. const stringBody = isomorphicDecode(body)
  19822. // 2. Set body to the forgiving-base64 decode of
  19823. // stringBody.
  19824. body = forgivingBase64(stringBody)
  19825. // 3. If body is failure, then return failure.
  19826. if (body === 'failure') {
  19827. return 'failure'
  19828. }
  19829. // 4. Remove the last 6 code points from mimeType.
  19830. mimeType = mimeType.slice(0, -6)
  19831. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  19832. // if any.
  19833. mimeType = mimeType.replace(/(\u0020)+$/, '')
  19834. // 6. Remove the last U+003B (;) code point from mimeType.
  19835. mimeType = mimeType.slice(0, -1)
  19836. }
  19837. // 12. If mimeType starts with U+003B (;), then prepend
  19838. // "text/plain" to mimeType.
  19839. if (mimeType.startsWith(';')) {
  19840. mimeType = 'text/plain' + mimeType
  19841. }
  19842. // 13. Let mimeTypeRecord be the result of parsing
  19843. // mimeType.
  19844. let mimeTypeRecord = parseMIMEType(mimeType)
  19845. // 14. If mimeTypeRecord is failure, then set
  19846. // mimeTypeRecord to text/plain;charset=US-ASCII.
  19847. if (mimeTypeRecord === 'failure') {
  19848. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  19849. }
  19850. // 15. Return a new data: URL struct whose MIME
  19851. // type is mimeTypeRecord and body is body.
  19852. // https://fetch.spec.whatwg.org/#data-url-struct
  19853. return { mimeType: mimeTypeRecord, body }
  19854. }
  19855. // https://url.spec.whatwg.org/#concept-url-serializer
  19856. /**
  19857. * @param {URL} url
  19858. * @param {boolean} excludeFragment
  19859. */
  19860. function URLSerializer (url, excludeFragment = false) {
  19861. if (!excludeFragment) {
  19862. return url.href
  19863. }
  19864. const href = url.href
  19865. const hashLength = url.hash.length
  19866. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  19867. }
  19868. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  19869. /**
  19870. * @param {(char: string) => boolean} condition
  19871. * @param {string} input
  19872. * @param {{ position: number }} position
  19873. */
  19874. function collectASequenceOfCodePoints (condition, input, position) {
  19875. // 1. Let result be the empty string.
  19876. let result = ''
  19877. // 2. While position doesn’t point past the end of input and the
  19878. // code point at position within input meets the condition condition:
  19879. while (position.position < input.length && condition(input[position.position])) {
  19880. // 1. Append that code point to the end of result.
  19881. result += input[position.position]
  19882. // 2. Advance position by 1.
  19883. position.position++
  19884. }
  19885. // 3. Return result.
  19886. return result
  19887. }
  19888. /**
  19889. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  19890. * @param {string} char
  19891. * @param {string} input
  19892. * @param {{ position: number }} position
  19893. */
  19894. function collectASequenceOfCodePointsFast (char, input, position) {
  19895. const idx = input.indexOf(char, position.position)
  19896. const start = position.position
  19897. if (idx === -1) {
  19898. position.position = input.length
  19899. return input.slice(start)
  19900. }
  19901. position.position = idx
  19902. return input.slice(start, position.position)
  19903. }
  19904. // https://url.spec.whatwg.org/#string-percent-decode
  19905. /** @param {string} input */
  19906. function stringPercentDecode (input) {
  19907. // 1. Let bytes be the UTF-8 encoding of input.
  19908. const bytes = encoder.encode(input)
  19909. // 2. Return the percent-decoding of bytes.
  19910. return percentDecode(bytes)
  19911. }
  19912. // https://url.spec.whatwg.org/#percent-decode
  19913. /** @param {Uint8Array} input */
  19914. function percentDecode (input) {
  19915. // 1. Let output be an empty byte sequence.
  19916. /** @type {number[]} */
  19917. const output = []
  19918. // 2. For each byte byte in input:
  19919. for (let i = 0; i < input.length; i++) {
  19920. const byte = input[i]
  19921. // 1. If byte is not 0x25 (%), then append byte to output.
  19922. if (byte !== 0x25) {
  19923. output.push(byte)
  19924. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  19925. // after byte in input are not in the ranges
  19926. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  19927. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  19928. // to output.
  19929. } else if (
  19930. byte === 0x25 &&
  19931. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  19932. ) {
  19933. output.push(0x25)
  19934. // 3. Otherwise:
  19935. } else {
  19936. // 1. Let bytePoint be the two bytes after byte in input,
  19937. // decoded, and then interpreted as hexadecimal number.
  19938. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  19939. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  19940. // 2. Append a byte whose value is bytePoint to output.
  19941. output.push(bytePoint)
  19942. // 3. Skip the next two bytes in input.
  19943. i += 2
  19944. }
  19945. }
  19946. // 3. Return output.
  19947. return Uint8Array.from(output)
  19948. }
  19949. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  19950. /** @param {string} input */
  19951. function parseMIMEType (input) {
  19952. // 1. Remove any leading and trailing HTTP whitespace
  19953. // from input.
  19954. input = removeHTTPWhitespace(input, true, true)
  19955. // 2. Let position be a position variable for input,
  19956. // initially pointing at the start of input.
  19957. const position = { position: 0 }
  19958. // 3. Let type be the result of collecting a sequence
  19959. // of code points that are not U+002F (/) from
  19960. // input, given position.
  19961. const type = collectASequenceOfCodePointsFast(
  19962. '/',
  19963. input,
  19964. position
  19965. )
  19966. // 4. If type is the empty string or does not solely
  19967. // contain HTTP token code points, then return failure.
  19968. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  19969. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  19970. return 'failure'
  19971. }
  19972. // 5. If position is past the end of input, then return
  19973. // failure
  19974. if (position.position > input.length) {
  19975. return 'failure'
  19976. }
  19977. // 6. Advance position by 1. (This skips past U+002F (/).)
  19978. position.position++
  19979. // 7. Let subtype be the result of collecting a sequence of
  19980. // code points that are not U+003B (;) from input, given
  19981. // position.
  19982. let subtype = collectASequenceOfCodePointsFast(
  19983. ';',
  19984. input,
  19985. position
  19986. )
  19987. // 8. Remove any trailing HTTP whitespace from subtype.
  19988. subtype = removeHTTPWhitespace(subtype, false, true)
  19989. // 9. If subtype is the empty string or does not solely
  19990. // contain HTTP token code points, then return failure.
  19991. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  19992. return 'failure'
  19993. }
  19994. const typeLowercase = type.toLowerCase()
  19995. const subtypeLowercase = subtype.toLowerCase()
  19996. // 10. Let mimeType be a new MIME type record whose type
  19997. // is type, in ASCII lowercase, and subtype is subtype,
  19998. // in ASCII lowercase.
  19999. // https://mimesniff.spec.whatwg.org/#mime-type
  20000. const mimeType = {
  20001. type: typeLowercase,
  20002. subtype: subtypeLowercase,
  20003. /** @type {Map<string, string>} */
  20004. parameters: new Map(),
  20005. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20006. essence: `${typeLowercase}/${subtypeLowercase}`
  20007. }
  20008. // 11. While position is not past the end of input:
  20009. while (position.position < input.length) {
  20010. // 1. Advance position by 1. (This skips past U+003B (;).)
  20011. position.position++
  20012. // 2. Collect a sequence of code points that are HTTP
  20013. // whitespace from input given position.
  20014. collectASequenceOfCodePoints(
  20015. // https://fetch.spec.whatwg.org/#http-whitespace
  20016. char => HTTP_WHITESPACE_REGEX.test(char),
  20017. input,
  20018. position
  20019. )
  20020. // 3. Let parameterName be the result of collecting a
  20021. // sequence of code points that are not U+003B (;)
  20022. // or U+003D (=) from input, given position.
  20023. let parameterName = collectASequenceOfCodePoints(
  20024. (char) => char !== ';' && char !== '=',
  20025. input,
  20026. position
  20027. )
  20028. // 4. Set parameterName to parameterName, in ASCII
  20029. // lowercase.
  20030. parameterName = parameterName.toLowerCase()
  20031. // 5. If position is not past the end of input, then:
  20032. if (position.position < input.length) {
  20033. // 1. If the code point at position within input is
  20034. // U+003B (;), then continue.
  20035. if (input[position.position] === ';') {
  20036. continue
  20037. }
  20038. // 2. Advance position by 1. (This skips past U+003D (=).)
  20039. position.position++
  20040. }
  20041. // 6. If position is past the end of input, then break.
  20042. if (position.position > input.length) {
  20043. break
  20044. }
  20045. // 7. Let parameterValue be null.
  20046. let parameterValue = null
  20047. // 8. If the code point at position within input is
  20048. // U+0022 ("), then:
  20049. if (input[position.position] === '"') {
  20050. // 1. Set parameterValue to the result of collecting
  20051. // an HTTP quoted string from input, given position
  20052. // and the extract-value flag.
  20053. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20054. // 2. Collect a sequence of code points that are not
  20055. // U+003B (;) from input, given position.
  20056. collectASequenceOfCodePointsFast(
  20057. ';',
  20058. input,
  20059. position
  20060. )
  20061. // 9. Otherwise:
  20062. } else {
  20063. // 1. Set parameterValue to the result of collecting
  20064. // a sequence of code points that are not U+003B (;)
  20065. // from input, given position.
  20066. parameterValue = collectASequenceOfCodePointsFast(
  20067. ';',
  20068. input,
  20069. position
  20070. )
  20071. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20072. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20073. // 3. If parameterValue is the empty string, then continue.
  20074. if (parameterValue.length === 0) {
  20075. continue
  20076. }
  20077. }
  20078. // 10. If all of the following are true
  20079. // - parameterName is not the empty string
  20080. // - parameterName solely contains HTTP token code points
  20081. // - parameterValue solely contains HTTP quoted-string token code points
  20082. // - mimeType’s parameters[parameterName] does not exist
  20083. // then set mimeType’s parameters[parameterName] to parameterValue.
  20084. if (
  20085. parameterName.length !== 0 &&
  20086. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20087. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20088. !mimeType.parameters.has(parameterName)
  20089. ) {
  20090. mimeType.parameters.set(parameterName, parameterValue)
  20091. }
  20092. }
  20093. // 12. Return mimeType.
  20094. return mimeType
  20095. }
  20096. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20097. /** @param {string} data */
  20098. function forgivingBase64 (data) {
  20099. // 1. Remove all ASCII whitespace from data.
  20100. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20101. // 2. If data’s code point length divides by 4 leaving
  20102. // no remainder, then:
  20103. if (data.length % 4 === 0) {
  20104. // 1. If data ends with one or two U+003D (=) code points,
  20105. // then remove them from data.
  20106. data = data.replace(/=?=$/, '')
  20107. }
  20108. // 3. If data’s code point length divides by 4 leaving
  20109. // a remainder of 1, then return failure.
  20110. if (data.length % 4 === 1) {
  20111. return 'failure'
  20112. }
  20113. // 4. If data contains a code point that is not one of
  20114. // U+002B (+)
  20115. // U+002F (/)
  20116. // ASCII alphanumeric
  20117. // then return failure.
  20118. if (/[^+/0-9A-Za-z]/.test(data)) {
  20119. return 'failure'
  20120. }
  20121. const binary = atob(data)
  20122. const bytes = new Uint8Array(binary.length)
  20123. for (let byte = 0; byte < binary.length; byte++) {
  20124. bytes[byte] = binary.charCodeAt(byte)
  20125. }
  20126. return bytes
  20127. }
  20128. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20129. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20130. /**
  20131. * @param {string} input
  20132. * @param {{ position: number }} position
  20133. * @param {boolean?} extractValue
  20134. */
  20135. function collectAnHTTPQuotedString (input, position, extractValue) {
  20136. // 1. Let positionStart be position.
  20137. const positionStart = position.position
  20138. // 2. Let value be the empty string.
  20139. let value = ''
  20140. // 3. Assert: the code point at position within input
  20141. // is U+0022 (").
  20142. assert(input[position.position] === '"')
  20143. // 4. Advance position by 1.
  20144. position.position++
  20145. // 5. While true:
  20146. while (true) {
  20147. // 1. Append the result of collecting a sequence of code points
  20148. // that are not U+0022 (") or U+005C (\) from input, given
  20149. // position, to value.
  20150. value += collectASequenceOfCodePoints(
  20151. (char) => char !== '"' && char !== '\\',
  20152. input,
  20153. position
  20154. )
  20155. // 2. If position is past the end of input, then break.
  20156. if (position.position >= input.length) {
  20157. break
  20158. }
  20159. // 3. Let quoteOrBackslash be the code point at position within
  20160. // input.
  20161. const quoteOrBackslash = input[position.position]
  20162. // 4. Advance position by 1.
  20163. position.position++
  20164. // 5. If quoteOrBackslash is U+005C (\), then:
  20165. if (quoteOrBackslash === '\\') {
  20166. // 1. If position is past the end of input, then append
  20167. // U+005C (\) to value and break.
  20168. if (position.position >= input.length) {
  20169. value += '\\'
  20170. break
  20171. }
  20172. // 2. Append the code point at position within input to value.
  20173. value += input[position.position]
  20174. // 3. Advance position by 1.
  20175. position.position++
  20176. // 6. Otherwise:
  20177. } else {
  20178. // 1. Assert: quoteOrBackslash is U+0022 (").
  20179. assert(quoteOrBackslash === '"')
  20180. // 2. Break.
  20181. break
  20182. }
  20183. }
  20184. // 6. If the extract-value flag is set, then return value.
  20185. if (extractValue) {
  20186. return value
  20187. }
  20188. // 7. Return the code points from positionStart to position,
  20189. // inclusive, within input.
  20190. return input.slice(positionStart, position.position)
  20191. }
  20192. /**
  20193. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20194. */
  20195. function serializeAMimeType (mimeType) {
  20196. assert(mimeType !== 'failure')
  20197. const { parameters, essence } = mimeType
  20198. // 1. Let serialization be the concatenation of mimeType’s
  20199. // type, U+002F (/), and mimeType’s subtype.
  20200. let serialization = essence
  20201. // 2. For each name → value of mimeType’s parameters:
  20202. for (let [name, value] of parameters.entries()) {
  20203. // 1. Append U+003B (;) to serialization.
  20204. serialization += ';'
  20205. // 2. Append name to serialization.
  20206. serialization += name
  20207. // 3. Append U+003D (=) to serialization.
  20208. serialization += '='
  20209. // 4. If value does not solely contain HTTP token code
  20210. // points or value is the empty string, then:
  20211. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20212. // 1. Precede each occurence of U+0022 (") or
  20213. // U+005C (\) in value with U+005C (\).
  20214. value = value.replace(/(\\|")/g, '\\$1')
  20215. // 2. Prepend U+0022 (") to value.
  20216. value = '"' + value
  20217. // 3. Append U+0022 (") to value.
  20218. value += '"'
  20219. }
  20220. // 5. Append value to serialization.
  20221. serialization += value
  20222. }
  20223. // 3. Return serialization.
  20224. return serialization
  20225. }
  20226. /**
  20227. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20228. * @param {string} char
  20229. */
  20230. function isHTTPWhiteSpace (char) {
  20231. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20232. }
  20233. /**
  20234. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20235. * @param {string} str
  20236. */
  20237. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20238. let lead = 0
  20239. let trail = str.length - 1
  20240. if (leading) {
  20241. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20242. }
  20243. if (trailing) {
  20244. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20245. }
  20246. return str.slice(lead, trail + 1)
  20247. }
  20248. /**
  20249. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20250. * @param {string} char
  20251. */
  20252. function isASCIIWhitespace (char) {
  20253. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20254. }
  20255. /**
  20256. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20257. */
  20258. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20259. let lead = 0
  20260. let trail = str.length - 1
  20261. if (leading) {
  20262. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20263. }
  20264. if (trailing) {
  20265. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20266. }
  20267. return str.slice(lead, trail + 1)
  20268. }
  20269. module.exports = {
  20270. dataURLProcessor,
  20271. URLSerializer,
  20272. collectASequenceOfCodePoints,
  20273. collectASequenceOfCodePointsFast,
  20274. stringPercentDecode,
  20275. parseMIMEType,
  20276. collectAnHTTPQuotedString,
  20277. serializeAMimeType
  20278. }
  20279. /***/ }),
  20280. /***/ 8511:
  20281. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20282. "use strict";
  20283. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20284. const { types } = __nccwpck_require__(3837)
  20285. const { kState } = __nccwpck_require__(5861)
  20286. const { isBlobLike } = __nccwpck_require__(2538)
  20287. const { webidl } = __nccwpck_require__(1744)
  20288. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20289. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20290. const encoder = new TextEncoder()
  20291. class File extends Blob {
  20292. constructor (fileBits, fileName, options = {}) {
  20293. // The File constructor is invoked with two or three parameters, depending
  20294. // on whether the optional dictionary parameter is used. When the File()
  20295. // constructor is invoked, user agents must run the following steps:
  20296. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20297. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20298. fileName = webidl.converters.USVString(fileName)
  20299. options = webidl.converters.FilePropertyBag(options)
  20300. // 1. Let bytes be the result of processing blob parts given fileBits and
  20301. // options.
  20302. // Note: Blob handles this for us
  20303. // 2. Let n be the fileName argument to the constructor.
  20304. const n = fileName
  20305. // 3. Process FilePropertyBag dictionary argument by running the following
  20306. // substeps:
  20307. // 1. If the type member is provided and is not the empty string, let t
  20308. // be set to the type dictionary member. If t contains any characters
  20309. // outside the range U+0020 to U+007E, then set t to the empty string
  20310. // and return from these substeps.
  20311. // 2. Convert every character in t to ASCII lowercase.
  20312. let t = options.type
  20313. let d
  20314. // eslint-disable-next-line no-labels
  20315. substep: {
  20316. if (t) {
  20317. t = parseMIMEType(t)
  20318. if (t === 'failure') {
  20319. t = ''
  20320. // eslint-disable-next-line no-labels
  20321. break substep
  20322. }
  20323. t = serializeAMimeType(t).toLowerCase()
  20324. }
  20325. // 3. If the lastModified member is provided, let d be set to the
  20326. // lastModified dictionary member. If it is not provided, set d to the
  20327. // current date and time represented as the number of milliseconds since
  20328. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20329. d = options.lastModified
  20330. }
  20331. // 4. Return a new File object F such that:
  20332. // F refers to the bytes byte sequence.
  20333. // F.size is set to the number of total bytes in bytes.
  20334. // F.name is set to n.
  20335. // F.type is set to t.
  20336. // F.lastModified is set to d.
  20337. super(processBlobParts(fileBits, options), { type: t })
  20338. this[kState] = {
  20339. name: n,
  20340. lastModified: d,
  20341. type: t
  20342. }
  20343. }
  20344. get name () {
  20345. webidl.brandCheck(this, File)
  20346. return this[kState].name
  20347. }
  20348. get lastModified () {
  20349. webidl.brandCheck(this, File)
  20350. return this[kState].lastModified
  20351. }
  20352. get type () {
  20353. webidl.brandCheck(this, File)
  20354. return this[kState].type
  20355. }
  20356. }
  20357. class FileLike {
  20358. constructor (blobLike, fileName, options = {}) {
  20359. // TODO: argument idl type check
  20360. // The File constructor is invoked with two or three parameters, depending
  20361. // on whether the optional dictionary parameter is used. When the File()
  20362. // constructor is invoked, user agents must run the following steps:
  20363. // 1. Let bytes be the result of processing blob parts given fileBits and
  20364. // options.
  20365. // 2. Let n be the fileName argument to the constructor.
  20366. const n = fileName
  20367. // 3. Process FilePropertyBag dictionary argument by running the following
  20368. // substeps:
  20369. // 1. If the type member is provided and is not the empty string, let t
  20370. // be set to the type dictionary member. If t contains any characters
  20371. // outside the range U+0020 to U+007E, then set t to the empty string
  20372. // and return from these substeps.
  20373. // TODO
  20374. const t = options.type
  20375. // 2. Convert every character in t to ASCII lowercase.
  20376. // TODO
  20377. // 3. If the lastModified member is provided, let d be set to the
  20378. // lastModified dictionary member. If it is not provided, set d to the
  20379. // current date and time represented as the number of milliseconds since
  20380. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20381. const d = options.lastModified ?? Date.now()
  20382. // 4. Return a new File object F such that:
  20383. // F refers to the bytes byte sequence.
  20384. // F.size is set to the number of total bytes in bytes.
  20385. // F.name is set to n.
  20386. // F.type is set to t.
  20387. // F.lastModified is set to d.
  20388. this[kState] = {
  20389. blobLike,
  20390. name: n,
  20391. type: t,
  20392. lastModified: d
  20393. }
  20394. }
  20395. stream (...args) {
  20396. webidl.brandCheck(this, FileLike)
  20397. return this[kState].blobLike.stream(...args)
  20398. }
  20399. arrayBuffer (...args) {
  20400. webidl.brandCheck(this, FileLike)
  20401. return this[kState].blobLike.arrayBuffer(...args)
  20402. }
  20403. slice (...args) {
  20404. webidl.brandCheck(this, FileLike)
  20405. return this[kState].blobLike.slice(...args)
  20406. }
  20407. text (...args) {
  20408. webidl.brandCheck(this, FileLike)
  20409. return this[kState].blobLike.text(...args)
  20410. }
  20411. get size () {
  20412. webidl.brandCheck(this, FileLike)
  20413. return this[kState].blobLike.size
  20414. }
  20415. get type () {
  20416. webidl.brandCheck(this, FileLike)
  20417. return this[kState].blobLike.type
  20418. }
  20419. get name () {
  20420. webidl.brandCheck(this, FileLike)
  20421. return this[kState].name
  20422. }
  20423. get lastModified () {
  20424. webidl.brandCheck(this, FileLike)
  20425. return this[kState].lastModified
  20426. }
  20427. get [Symbol.toStringTag] () {
  20428. return 'File'
  20429. }
  20430. }
  20431. Object.defineProperties(File.prototype, {
  20432. [Symbol.toStringTag]: {
  20433. value: 'File',
  20434. configurable: true
  20435. },
  20436. name: kEnumerableProperty,
  20437. lastModified: kEnumerableProperty
  20438. })
  20439. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20440. webidl.converters.BlobPart = function (V, opts) {
  20441. if (webidl.util.Type(V) === 'Object') {
  20442. if (isBlobLike(V)) {
  20443. return webidl.converters.Blob(V, { strict: false })
  20444. }
  20445. if (
  20446. ArrayBuffer.isView(V) ||
  20447. types.isAnyArrayBuffer(V)
  20448. ) {
  20449. return webidl.converters.BufferSource(V, opts)
  20450. }
  20451. }
  20452. return webidl.converters.USVString(V, opts)
  20453. }
  20454. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20455. webidl.converters.BlobPart
  20456. )
  20457. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20458. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20459. {
  20460. key: 'lastModified',
  20461. converter: webidl.converters['long long'],
  20462. get defaultValue () {
  20463. return Date.now()
  20464. }
  20465. },
  20466. {
  20467. key: 'type',
  20468. converter: webidl.converters.DOMString,
  20469. defaultValue: ''
  20470. },
  20471. {
  20472. key: 'endings',
  20473. converter: (value) => {
  20474. value = webidl.converters.DOMString(value)
  20475. value = value.toLowerCase()
  20476. if (value !== 'native') {
  20477. value = 'transparent'
  20478. }
  20479. return value
  20480. },
  20481. defaultValue: 'transparent'
  20482. }
  20483. ])
  20484. /**
  20485. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20486. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20487. * @param {{ type: string, endings: string }} options
  20488. */
  20489. function processBlobParts (parts, options) {
  20490. // 1. Let bytes be an empty sequence of bytes.
  20491. /** @type {NodeJS.TypedArray[]} */
  20492. const bytes = []
  20493. // 2. For each element in parts:
  20494. for (const element of parts) {
  20495. // 1. If element is a USVString, run the following substeps:
  20496. if (typeof element === 'string') {
  20497. // 1. Let s be element.
  20498. let s = element
  20499. // 2. If the endings member of options is "native", set s
  20500. // to the result of converting line endings to native
  20501. // of element.
  20502. if (options.endings === 'native') {
  20503. s = convertLineEndingsNative(s)
  20504. }
  20505. // 3. Append the result of UTF-8 encoding s to bytes.
  20506. bytes.push(encoder.encode(s))
  20507. } else if (
  20508. types.isAnyArrayBuffer(element) ||
  20509. types.isTypedArray(element)
  20510. ) {
  20511. // 2. If element is a BufferSource, get a copy of the
  20512. // bytes held by the buffer source, and append those
  20513. // bytes to bytes.
  20514. if (!element.buffer) { // ArrayBuffer
  20515. bytes.push(new Uint8Array(element))
  20516. } else {
  20517. bytes.push(
  20518. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20519. )
  20520. }
  20521. } else if (isBlobLike(element)) {
  20522. // 3. If element is a Blob, append the bytes it represents
  20523. // to bytes.
  20524. bytes.push(element)
  20525. }
  20526. }
  20527. // 3. Return bytes.
  20528. return bytes
  20529. }
  20530. /**
  20531. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20532. * @param {string} s
  20533. */
  20534. function convertLineEndingsNative (s) {
  20535. // 1. Let native line ending be be the code point U+000A LF.
  20536. let nativeLineEnding = '\n'
  20537. // 2. If the underlying platform’s conventions are to
  20538. // represent newlines as a carriage return and line feed
  20539. // sequence, set native line ending to the code point
  20540. // U+000D CR followed by the code point U+000A LF.
  20541. if (process.platform === 'win32') {
  20542. nativeLineEnding = '\r\n'
  20543. }
  20544. return s.replace(/\r?\n/g, nativeLineEnding)
  20545. }
  20546. // If this function is moved to ./util.js, some tools (such as
  20547. // rollup) will warn about circular dependencies. See:
  20548. // https://github.com/nodejs/undici/issues/1629
  20549. function isFileLike (object) {
  20550. return (
  20551. (NativeFile && object instanceof NativeFile) ||
  20552. object instanceof File || (
  20553. object &&
  20554. (typeof object.stream === 'function' ||
  20555. typeof object.arrayBuffer === 'function') &&
  20556. object[Symbol.toStringTag] === 'File'
  20557. )
  20558. )
  20559. }
  20560. module.exports = { File, FileLike, isFileLike }
  20561. /***/ }),
  20562. /***/ 2015:
  20563. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20564. "use strict";
  20565. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20566. const { kState } = __nccwpck_require__(5861)
  20567. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20568. const { webidl } = __nccwpck_require__(1744)
  20569. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20570. /** @type {globalThis['File']} */
  20571. const File = NativeFile ?? UndiciFile
  20572. // https://xhr.spec.whatwg.org/#formdata
  20573. class FormData {
  20574. constructor (form) {
  20575. if (form !== undefined) {
  20576. throw webidl.errors.conversionFailed({
  20577. prefix: 'FormData constructor',
  20578. argument: 'Argument 1',
  20579. types: ['undefined']
  20580. })
  20581. }
  20582. this[kState] = []
  20583. }
  20584. append (name, value, filename = undefined) {
  20585. webidl.brandCheck(this, FormData)
  20586. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20587. if (arguments.length === 3 && !isBlobLike(value)) {
  20588. throw new TypeError(
  20589. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20590. )
  20591. }
  20592. // 1. Let value be value if given; otherwise blobValue.
  20593. name = webidl.converters.USVString(name)
  20594. value = isBlobLike(value)
  20595. ? webidl.converters.Blob(value, { strict: false })
  20596. : webidl.converters.USVString(value)
  20597. filename = arguments.length === 3
  20598. ? webidl.converters.USVString(filename)
  20599. : undefined
  20600. // 2. Let entry be the result of creating an entry with
  20601. // name, value, and filename if given.
  20602. const entry = makeEntry(name, value, filename)
  20603. // 3. Append entry to this’s entry list.
  20604. this[kState].push(entry)
  20605. }
  20606. delete (name) {
  20607. webidl.brandCheck(this, FormData)
  20608. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20609. name = webidl.converters.USVString(name)
  20610. // The delete(name) method steps are to remove all entries whose name
  20611. // is name from this’s entry list.
  20612. this[kState] = this[kState].filter(entry => entry.name !== name)
  20613. }
  20614. get (name) {
  20615. webidl.brandCheck(this, FormData)
  20616. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20617. name = webidl.converters.USVString(name)
  20618. // 1. If there is no entry whose name is name in this’s entry list,
  20619. // then return null.
  20620. const idx = this[kState].findIndex((entry) => entry.name === name)
  20621. if (idx === -1) {
  20622. return null
  20623. }
  20624. // 2. Return the value of the first entry whose name is name from
  20625. // this’s entry list.
  20626. return this[kState][idx].value
  20627. }
  20628. getAll (name) {
  20629. webidl.brandCheck(this, FormData)
  20630. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20631. name = webidl.converters.USVString(name)
  20632. // 1. If there is no entry whose name is name in this’s entry list,
  20633. // then return the empty list.
  20634. // 2. Return the values of all entries whose name is name, in order,
  20635. // from this’s entry list.
  20636. return this[kState]
  20637. .filter((entry) => entry.name === name)
  20638. .map((entry) => entry.value)
  20639. }
  20640. has (name) {
  20641. webidl.brandCheck(this, FormData)
  20642. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20643. name = webidl.converters.USVString(name)
  20644. // The has(name) method steps are to return true if there is an entry
  20645. // whose name is name in this’s entry list; otherwise false.
  20646. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20647. }
  20648. set (name, value, filename = undefined) {
  20649. webidl.brandCheck(this, FormData)
  20650. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20651. if (arguments.length === 3 && !isBlobLike(value)) {
  20652. throw new TypeError(
  20653. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20654. )
  20655. }
  20656. // The set(name, value) and set(name, blobValue, filename) method steps
  20657. // are:
  20658. // 1. Let value be value if given; otherwise blobValue.
  20659. name = webidl.converters.USVString(name)
  20660. value = isBlobLike(value)
  20661. ? webidl.converters.Blob(value, { strict: false })
  20662. : webidl.converters.USVString(value)
  20663. filename = arguments.length === 3
  20664. ? toUSVString(filename)
  20665. : undefined
  20666. // 2. Let entry be the result of creating an entry with name, value, and
  20667. // filename if given.
  20668. const entry = makeEntry(name, value, filename)
  20669. // 3. If there are entries in this’s entry list whose name is name, then
  20670. // replace the first such entry with entry and remove the others.
  20671. const idx = this[kState].findIndex((entry) => entry.name === name)
  20672. if (idx !== -1) {
  20673. this[kState] = [
  20674. ...this[kState].slice(0, idx),
  20675. entry,
  20676. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20677. ]
  20678. } else {
  20679. // 4. Otherwise, append entry to this’s entry list.
  20680. this[kState].push(entry)
  20681. }
  20682. }
  20683. entries () {
  20684. webidl.brandCheck(this, FormData)
  20685. return makeIterator(
  20686. () => this[kState].map(pair => [pair.name, pair.value]),
  20687. 'FormData',
  20688. 'key+value'
  20689. )
  20690. }
  20691. keys () {
  20692. webidl.brandCheck(this, FormData)
  20693. return makeIterator(
  20694. () => this[kState].map(pair => [pair.name, pair.value]),
  20695. 'FormData',
  20696. 'key'
  20697. )
  20698. }
  20699. values () {
  20700. webidl.brandCheck(this, FormData)
  20701. return makeIterator(
  20702. () => this[kState].map(pair => [pair.name, pair.value]),
  20703. 'FormData',
  20704. 'value'
  20705. )
  20706. }
  20707. /**
  20708. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20709. * @param {unknown} thisArg
  20710. */
  20711. forEach (callbackFn, thisArg = globalThis) {
  20712. webidl.brandCheck(this, FormData)
  20713. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20714. if (typeof callbackFn !== 'function') {
  20715. throw new TypeError(
  20716. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20717. )
  20718. }
  20719. for (const [key, value] of this) {
  20720. callbackFn.apply(thisArg, [value, key, this])
  20721. }
  20722. }
  20723. }
  20724. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20725. Object.defineProperties(FormData.prototype, {
  20726. [Symbol.toStringTag]: {
  20727. value: 'FormData',
  20728. configurable: true
  20729. }
  20730. })
  20731. /**
  20732. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  20733. * @param {string} name
  20734. * @param {string|Blob} value
  20735. * @param {?string} filename
  20736. * @returns
  20737. */
  20738. function makeEntry (name, value, filename) {
  20739. // 1. Set name to the result of converting name into a scalar value string.
  20740. // "To convert a string into a scalar value string, replace any surrogates
  20741. // with U+FFFD."
  20742. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  20743. name = Buffer.from(name).toString('utf8')
  20744. // 2. If value is a string, then set value to the result of converting
  20745. // value into a scalar value string.
  20746. if (typeof value === 'string') {
  20747. value = Buffer.from(value).toString('utf8')
  20748. } else {
  20749. // 3. Otherwise:
  20750. // 1. If value is not a File object, then set value to a new File object,
  20751. // representing the same bytes, whose name attribute value is "blob"
  20752. if (!isFileLike(value)) {
  20753. value = value instanceof Blob
  20754. ? new File([value], 'blob', { type: value.type })
  20755. : new FileLike(value, 'blob', { type: value.type })
  20756. }
  20757. // 2. If filename is given, then set value to a new File object,
  20758. // representing the same bytes, whose name attribute is filename.
  20759. if (filename !== undefined) {
  20760. /** @type {FilePropertyBag} */
  20761. const options = {
  20762. type: value.type,
  20763. lastModified: value.lastModified
  20764. }
  20765. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  20766. ? new File([value], filename, options)
  20767. : new FileLike(value, filename, options)
  20768. }
  20769. }
  20770. // 4. Return an entry whose name is name and whose value is value.
  20771. return { name, value }
  20772. }
  20773. module.exports = { FormData }
  20774. /***/ }),
  20775. /***/ 1246:
  20776. /***/ ((module) => {
  20777. "use strict";
  20778. // In case of breaking changes, increase the version
  20779. // number to avoid conflicts.
  20780. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  20781. function getGlobalOrigin () {
  20782. return globalThis[globalOrigin]
  20783. }
  20784. function setGlobalOrigin (newOrigin) {
  20785. if (newOrigin === undefined) {
  20786. Object.defineProperty(globalThis, globalOrigin, {
  20787. value: undefined,
  20788. writable: true,
  20789. enumerable: false,
  20790. configurable: false
  20791. })
  20792. return
  20793. }
  20794. const parsedURL = new URL(newOrigin)
  20795. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  20796. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  20797. }
  20798. Object.defineProperty(globalThis, globalOrigin, {
  20799. value: parsedURL,
  20800. writable: true,
  20801. enumerable: false,
  20802. configurable: false
  20803. })
  20804. }
  20805. module.exports = {
  20806. getGlobalOrigin,
  20807. setGlobalOrigin
  20808. }
  20809. /***/ }),
  20810. /***/ 554:
  20811. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20812. "use strict";
  20813. // https://github.com/Ethan-Arrowood/undici-fetch
  20814. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  20815. const { kGuard } = __nccwpck_require__(5861)
  20816. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20817. const {
  20818. makeIterator,
  20819. isValidHeaderName,
  20820. isValidHeaderValue
  20821. } = __nccwpck_require__(2538)
  20822. const { webidl } = __nccwpck_require__(1744)
  20823. const assert = __nccwpck_require__(9491)
  20824. const kHeadersMap = Symbol('headers map')
  20825. const kHeadersSortedMap = Symbol('headers map sorted')
  20826. /**
  20827. * @param {number} code
  20828. */
  20829. function isHTTPWhiteSpaceCharCode (code) {
  20830. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  20831. }
  20832. /**
  20833. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  20834. * @param {string} potentialValue
  20835. */
  20836. function headerValueNormalize (potentialValue) {
  20837. // To normalize a byte sequence potentialValue, remove
  20838. // any leading and trailing HTTP whitespace bytes from
  20839. // potentialValue.
  20840. let i = 0; let j = potentialValue.length
  20841. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  20842. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  20843. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  20844. }
  20845. function fill (headers, object) {
  20846. // To fill a Headers object headers with a given object object, run these steps:
  20847. // 1. If object is a sequence, then for each header in object:
  20848. // Note: webidl conversion to array has already been done.
  20849. if (Array.isArray(object)) {
  20850. for (let i = 0; i < object.length; ++i) {
  20851. const header = object[i]
  20852. // 1. If header does not contain exactly two items, then throw a TypeError.
  20853. if (header.length !== 2) {
  20854. throw webidl.errors.exception({
  20855. header: 'Headers constructor',
  20856. message: `expected name/value pair to be length 2, found ${header.length}.`
  20857. })
  20858. }
  20859. // 2. Append (header’s first item, header’s second item) to headers.
  20860. appendHeader(headers, header[0], header[1])
  20861. }
  20862. } else if (typeof object === 'object' && object !== null) {
  20863. // Note: null should throw
  20864. // 2. Otherwise, object is a record, then for each key → value in object,
  20865. // append (key, value) to headers
  20866. const keys = Object.keys(object)
  20867. for (let i = 0; i < keys.length; ++i) {
  20868. appendHeader(headers, keys[i], object[keys[i]])
  20869. }
  20870. } else {
  20871. throw webidl.errors.conversionFailed({
  20872. prefix: 'Headers constructor',
  20873. argument: 'Argument 1',
  20874. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  20875. })
  20876. }
  20877. }
  20878. /**
  20879. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  20880. */
  20881. function appendHeader (headers, name, value) {
  20882. // 1. Normalize value.
  20883. value = headerValueNormalize(value)
  20884. // 2. If name is not a header name or value is not a
  20885. // header value, then throw a TypeError.
  20886. if (!isValidHeaderName(name)) {
  20887. throw webidl.errors.invalidArgument({
  20888. prefix: 'Headers.append',
  20889. value: name,
  20890. type: 'header name'
  20891. })
  20892. } else if (!isValidHeaderValue(value)) {
  20893. throw webidl.errors.invalidArgument({
  20894. prefix: 'Headers.append',
  20895. value,
  20896. type: 'header value'
  20897. })
  20898. }
  20899. // 3. If headers’s guard is "immutable", then throw a TypeError.
  20900. // 4. Otherwise, if headers’s guard is "request" and name is a
  20901. // forbidden header name, return.
  20902. // Note: undici does not implement forbidden header names
  20903. if (headers[kGuard] === 'immutable') {
  20904. throw new TypeError('immutable')
  20905. } else if (headers[kGuard] === 'request-no-cors') {
  20906. // 5. Otherwise, if headers’s guard is "request-no-cors":
  20907. // TODO
  20908. }
  20909. // 6. Otherwise, if headers’s guard is "response" and name is a
  20910. // forbidden response-header name, return.
  20911. // 7. Append (name, value) to headers’s header list.
  20912. return headers[kHeadersList].append(name, value)
  20913. // 8. If headers’s guard is "request-no-cors", then remove
  20914. // privileged no-CORS request headers from headers
  20915. }
  20916. class HeadersList {
  20917. /** @type {[string, string][]|null} */
  20918. cookies = null
  20919. constructor (init) {
  20920. if (init instanceof HeadersList) {
  20921. this[kHeadersMap] = new Map(init[kHeadersMap])
  20922. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  20923. this.cookies = init.cookies === null ? null : [...init.cookies]
  20924. } else {
  20925. this[kHeadersMap] = new Map(init)
  20926. this[kHeadersSortedMap] = null
  20927. }
  20928. }
  20929. // https://fetch.spec.whatwg.org/#header-list-contains
  20930. contains (name) {
  20931. // A header list list contains a header name name if list
  20932. // contains a header whose name is a byte-case-insensitive
  20933. // match for name.
  20934. name = name.toLowerCase()
  20935. return this[kHeadersMap].has(name)
  20936. }
  20937. clear () {
  20938. this[kHeadersMap].clear()
  20939. this[kHeadersSortedMap] = null
  20940. this.cookies = null
  20941. }
  20942. // https://fetch.spec.whatwg.org/#concept-header-list-append
  20943. append (name, value) {
  20944. this[kHeadersSortedMap] = null
  20945. // 1. If list contains name, then set name to the first such
  20946. // header’s name.
  20947. const lowercaseName = name.toLowerCase()
  20948. const exists = this[kHeadersMap].get(lowercaseName)
  20949. // 2. Append (name, value) to list.
  20950. if (exists) {
  20951. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  20952. this[kHeadersMap].set(lowercaseName, {
  20953. name: exists.name,
  20954. value: `${exists.value}${delimiter}${value}`
  20955. })
  20956. } else {
  20957. this[kHeadersMap].set(lowercaseName, { name, value })
  20958. }
  20959. if (lowercaseName === 'set-cookie') {
  20960. this.cookies ??= []
  20961. this.cookies.push(value)
  20962. }
  20963. }
  20964. // https://fetch.spec.whatwg.org/#concept-header-list-set
  20965. set (name, value) {
  20966. this[kHeadersSortedMap] = null
  20967. const lowercaseName = name.toLowerCase()
  20968. if (lowercaseName === 'set-cookie') {
  20969. this.cookies = [value]
  20970. }
  20971. // 1. If list contains name, then set the value of
  20972. // the first such header to value and remove the
  20973. // others.
  20974. // 2. Otherwise, append header (name, value) to list.
  20975. this[kHeadersMap].set(lowercaseName, { name, value })
  20976. }
  20977. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  20978. delete (name) {
  20979. this[kHeadersSortedMap] = null
  20980. name = name.toLowerCase()
  20981. if (name === 'set-cookie') {
  20982. this.cookies = null
  20983. }
  20984. this[kHeadersMap].delete(name)
  20985. }
  20986. // https://fetch.spec.whatwg.org/#concept-header-list-get
  20987. get (name) {
  20988. const value = this[kHeadersMap].get(name.toLowerCase())
  20989. // 1. If list does not contain name, then return null.
  20990. // 2. Return the values of all headers in list whose name
  20991. // is a byte-case-insensitive match for name,
  20992. // separated from each other by 0x2C 0x20, in order.
  20993. return value === undefined ? null : value.value
  20994. }
  20995. * [Symbol.iterator] () {
  20996. // use the lowercased name
  20997. for (const [name, { value }] of this[kHeadersMap]) {
  20998. yield [name, value]
  20999. }
  21000. }
  21001. get entries () {
  21002. const headers = {}
  21003. if (this[kHeadersMap].size) {
  21004. for (const { name, value } of this[kHeadersMap].values()) {
  21005. headers[name] = value
  21006. }
  21007. }
  21008. return headers
  21009. }
  21010. }
  21011. // https://fetch.spec.whatwg.org/#headers-class
  21012. class Headers {
  21013. constructor (init = undefined) {
  21014. if (init === kConstruct) {
  21015. return
  21016. }
  21017. this[kHeadersList] = new HeadersList()
  21018. // The new Headers(init) constructor steps are:
  21019. // 1. Set this’s guard to "none".
  21020. this[kGuard] = 'none'
  21021. // 2. If init is given, then fill this with init.
  21022. if (init !== undefined) {
  21023. init = webidl.converters.HeadersInit(init)
  21024. fill(this, init)
  21025. }
  21026. }
  21027. // https://fetch.spec.whatwg.org/#dom-headers-append
  21028. append (name, value) {
  21029. webidl.brandCheck(this, Headers)
  21030. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21031. name = webidl.converters.ByteString(name)
  21032. value = webidl.converters.ByteString(value)
  21033. return appendHeader(this, name, value)
  21034. }
  21035. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21036. delete (name) {
  21037. webidl.brandCheck(this, Headers)
  21038. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21039. name = webidl.converters.ByteString(name)
  21040. // 1. If name is not a header name, then throw a TypeError.
  21041. if (!isValidHeaderName(name)) {
  21042. throw webidl.errors.invalidArgument({
  21043. prefix: 'Headers.delete',
  21044. value: name,
  21045. type: 'header name'
  21046. })
  21047. }
  21048. // 2. If this’s guard is "immutable", then throw a TypeError.
  21049. // 3. Otherwise, if this’s guard is "request" and name is a
  21050. // forbidden header name, return.
  21051. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21052. // is not a no-CORS-safelisted request-header name, and
  21053. // name is not a privileged no-CORS request-header name,
  21054. // return.
  21055. // 5. Otherwise, if this’s guard is "response" and name is
  21056. // a forbidden response-header name, return.
  21057. // Note: undici does not implement forbidden header names
  21058. if (this[kGuard] === 'immutable') {
  21059. throw new TypeError('immutable')
  21060. } else if (this[kGuard] === 'request-no-cors') {
  21061. // TODO
  21062. }
  21063. // 6. If this’s header list does not contain name, then
  21064. // return.
  21065. if (!this[kHeadersList].contains(name)) {
  21066. return
  21067. }
  21068. // 7. Delete name from this’s header list.
  21069. // 8. If this’s guard is "request-no-cors", then remove
  21070. // privileged no-CORS request headers from this.
  21071. this[kHeadersList].delete(name)
  21072. }
  21073. // https://fetch.spec.whatwg.org/#dom-headers-get
  21074. get (name) {
  21075. webidl.brandCheck(this, Headers)
  21076. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21077. name = webidl.converters.ByteString(name)
  21078. // 1. If name is not a header name, then throw a TypeError.
  21079. if (!isValidHeaderName(name)) {
  21080. throw webidl.errors.invalidArgument({
  21081. prefix: 'Headers.get',
  21082. value: name,
  21083. type: 'header name'
  21084. })
  21085. }
  21086. // 2. Return the result of getting name from this’s header
  21087. // list.
  21088. return this[kHeadersList].get(name)
  21089. }
  21090. // https://fetch.spec.whatwg.org/#dom-headers-has
  21091. has (name) {
  21092. webidl.brandCheck(this, Headers)
  21093. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21094. name = webidl.converters.ByteString(name)
  21095. // 1. If name is not a header name, then throw a TypeError.
  21096. if (!isValidHeaderName(name)) {
  21097. throw webidl.errors.invalidArgument({
  21098. prefix: 'Headers.has',
  21099. value: name,
  21100. type: 'header name'
  21101. })
  21102. }
  21103. // 2. Return true if this’s header list contains name;
  21104. // otherwise false.
  21105. return this[kHeadersList].contains(name)
  21106. }
  21107. // https://fetch.spec.whatwg.org/#dom-headers-set
  21108. set (name, value) {
  21109. webidl.brandCheck(this, Headers)
  21110. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21111. name = webidl.converters.ByteString(name)
  21112. value = webidl.converters.ByteString(value)
  21113. // 1. Normalize value.
  21114. value = headerValueNormalize(value)
  21115. // 2. If name is not a header name or value is not a
  21116. // header value, then throw a TypeError.
  21117. if (!isValidHeaderName(name)) {
  21118. throw webidl.errors.invalidArgument({
  21119. prefix: 'Headers.set',
  21120. value: name,
  21121. type: 'header name'
  21122. })
  21123. } else if (!isValidHeaderValue(value)) {
  21124. throw webidl.errors.invalidArgument({
  21125. prefix: 'Headers.set',
  21126. value,
  21127. type: 'header value'
  21128. })
  21129. }
  21130. // 3. If this’s guard is "immutable", then throw a TypeError.
  21131. // 4. Otherwise, if this’s guard is "request" and name is a
  21132. // forbidden header name, return.
  21133. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21134. // name/value is not a no-CORS-safelisted request-header,
  21135. // return.
  21136. // 6. Otherwise, if this’s guard is "response" and name is a
  21137. // forbidden response-header name, return.
  21138. // Note: undici does not implement forbidden header names
  21139. if (this[kGuard] === 'immutable') {
  21140. throw new TypeError('immutable')
  21141. } else if (this[kGuard] === 'request-no-cors') {
  21142. // TODO
  21143. }
  21144. // 7. Set (name, value) in this’s header list.
  21145. // 8. If this’s guard is "request-no-cors", then remove
  21146. // privileged no-CORS request headers from this
  21147. this[kHeadersList].set(name, value)
  21148. }
  21149. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21150. getSetCookie () {
  21151. webidl.brandCheck(this, Headers)
  21152. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21153. // 2. Return the values of all headers in this’s header list whose name is
  21154. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21155. const list = this[kHeadersList].cookies
  21156. if (list) {
  21157. return [...list]
  21158. }
  21159. return []
  21160. }
  21161. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21162. get [kHeadersSortedMap] () {
  21163. if (this[kHeadersList][kHeadersSortedMap]) {
  21164. return this[kHeadersList][kHeadersSortedMap]
  21165. }
  21166. // 1. Let headers be an empty list of headers with the key being the name
  21167. // and value the value.
  21168. const headers = []
  21169. // 2. Let names be the result of convert header names to a sorted-lowercase
  21170. // set with all the names of the headers in list.
  21171. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21172. const cookies = this[kHeadersList].cookies
  21173. // 3. For each name of names:
  21174. for (let i = 0; i < names.length; ++i) {
  21175. const [name, value] = names[i]
  21176. // 1. If name is `set-cookie`, then:
  21177. if (name === 'set-cookie') {
  21178. // 1. Let values be a list of all values of headers in list whose name
  21179. // is a byte-case-insensitive match for name, in order.
  21180. // 2. For each value of values:
  21181. // 1. Append (name, value) to headers.
  21182. for (let j = 0; j < cookies.length; ++j) {
  21183. headers.push([name, cookies[j]])
  21184. }
  21185. } else {
  21186. // 2. Otherwise:
  21187. // 1. Let value be the result of getting name from list.
  21188. // 2. Assert: value is non-null.
  21189. assert(value !== null)
  21190. // 3. Append (name, value) to headers.
  21191. headers.push([name, value])
  21192. }
  21193. }
  21194. this[kHeadersList][kHeadersSortedMap] = headers
  21195. // 4. Return headers.
  21196. return headers
  21197. }
  21198. keys () {
  21199. webidl.brandCheck(this, Headers)
  21200. if (this[kGuard] === 'immutable') {
  21201. const value = this[kHeadersSortedMap]
  21202. return makeIterator(() => value, 'Headers',
  21203. 'key')
  21204. }
  21205. return makeIterator(
  21206. () => [...this[kHeadersSortedMap].values()],
  21207. 'Headers',
  21208. 'key'
  21209. )
  21210. }
  21211. values () {
  21212. webidl.brandCheck(this, Headers)
  21213. if (this[kGuard] === 'immutable') {
  21214. const value = this[kHeadersSortedMap]
  21215. return makeIterator(() => value, 'Headers',
  21216. 'value')
  21217. }
  21218. return makeIterator(
  21219. () => [...this[kHeadersSortedMap].values()],
  21220. 'Headers',
  21221. 'value'
  21222. )
  21223. }
  21224. entries () {
  21225. webidl.brandCheck(this, Headers)
  21226. if (this[kGuard] === 'immutable') {
  21227. const value = this[kHeadersSortedMap]
  21228. return makeIterator(() => value, 'Headers',
  21229. 'key+value')
  21230. }
  21231. return makeIterator(
  21232. () => [...this[kHeadersSortedMap].values()],
  21233. 'Headers',
  21234. 'key+value'
  21235. )
  21236. }
  21237. /**
  21238. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21239. * @param {unknown} thisArg
  21240. */
  21241. forEach (callbackFn, thisArg = globalThis) {
  21242. webidl.brandCheck(this, Headers)
  21243. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21244. if (typeof callbackFn !== 'function') {
  21245. throw new TypeError(
  21246. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21247. )
  21248. }
  21249. for (const [key, value] of this) {
  21250. callbackFn.apply(thisArg, [value, key, this])
  21251. }
  21252. }
  21253. [Symbol.for('nodejs.util.inspect.custom')] () {
  21254. webidl.brandCheck(this, Headers)
  21255. return this[kHeadersList]
  21256. }
  21257. }
  21258. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21259. Object.defineProperties(Headers.prototype, {
  21260. append: kEnumerableProperty,
  21261. delete: kEnumerableProperty,
  21262. get: kEnumerableProperty,
  21263. has: kEnumerableProperty,
  21264. set: kEnumerableProperty,
  21265. getSetCookie: kEnumerableProperty,
  21266. keys: kEnumerableProperty,
  21267. values: kEnumerableProperty,
  21268. entries: kEnumerableProperty,
  21269. forEach: kEnumerableProperty,
  21270. [Symbol.iterator]: { enumerable: false },
  21271. [Symbol.toStringTag]: {
  21272. value: 'Headers',
  21273. configurable: true
  21274. }
  21275. })
  21276. webidl.converters.HeadersInit = function (V) {
  21277. if (webidl.util.Type(V) === 'Object') {
  21278. if (V[Symbol.iterator]) {
  21279. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21280. }
  21281. return webidl.converters['record<ByteString, ByteString>'](V)
  21282. }
  21283. throw webidl.errors.conversionFailed({
  21284. prefix: 'Headers constructor',
  21285. argument: 'Argument 1',
  21286. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21287. })
  21288. }
  21289. module.exports = {
  21290. fill,
  21291. Headers,
  21292. HeadersList
  21293. }
  21294. /***/ }),
  21295. /***/ 4881:
  21296. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21297. "use strict";
  21298. // https://github.com/Ethan-Arrowood/undici-fetch
  21299. const {
  21300. Response,
  21301. makeNetworkError,
  21302. makeAppropriateNetworkError,
  21303. filterResponse,
  21304. makeResponse
  21305. } = __nccwpck_require__(7823)
  21306. const { Headers } = __nccwpck_require__(554)
  21307. const { Request, makeRequest } = __nccwpck_require__(8359)
  21308. const zlib = __nccwpck_require__(9796)
  21309. const {
  21310. bytesMatch,
  21311. makePolicyContainer,
  21312. clonePolicyContainer,
  21313. requestBadPort,
  21314. TAOCheck,
  21315. appendRequestOriginHeader,
  21316. responseLocationURL,
  21317. requestCurrentURL,
  21318. setRequestReferrerPolicyOnRedirect,
  21319. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21320. createOpaqueTimingInfo,
  21321. appendFetchMetadata,
  21322. corsCheck,
  21323. crossOriginResourcePolicyCheck,
  21324. determineRequestsReferrer,
  21325. coarsenedSharedCurrentTime,
  21326. createDeferredPromise,
  21327. isBlobLike,
  21328. sameOrigin,
  21329. isCancelled,
  21330. isAborted,
  21331. isErrorLike,
  21332. fullyReadBody,
  21333. readableStreamClose,
  21334. isomorphicEncode,
  21335. urlIsLocal,
  21336. urlIsHttpHttpsScheme,
  21337. urlHasHttpsScheme
  21338. } = __nccwpck_require__(2538)
  21339. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21340. const assert = __nccwpck_require__(9491)
  21341. const { safelyExtractBody } = __nccwpck_require__(9990)
  21342. const {
  21343. redirectStatusSet,
  21344. nullBodyStatus,
  21345. safeMethodsSet,
  21346. requestBodyHeader,
  21347. subresourceSet,
  21348. DOMException
  21349. } = __nccwpck_require__(1037)
  21350. const { kHeadersList } = __nccwpck_require__(2785)
  21351. const EE = __nccwpck_require__(2361)
  21352. const { Readable, pipeline } = __nccwpck_require__(2781)
  21353. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21354. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21355. const { TransformStream } = __nccwpck_require__(5356)
  21356. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21357. const { webidl } = __nccwpck_require__(1744)
  21358. const { STATUS_CODES } = __nccwpck_require__(3685)
  21359. const GET_OR_HEAD = ['GET', 'HEAD']
  21360. /** @type {import('buffer').resolveObjectURL} */
  21361. let resolveObjectURL
  21362. let ReadableStream = globalThis.ReadableStream
  21363. class Fetch extends EE {
  21364. constructor (dispatcher) {
  21365. super()
  21366. this.dispatcher = dispatcher
  21367. this.connection = null
  21368. this.dump = false
  21369. this.state = 'ongoing'
  21370. // 2 terminated listeners get added per request,
  21371. // but only 1 gets removed. If there are 20 redirects,
  21372. // 21 listeners will be added.
  21373. // See https://github.com/nodejs/undici/issues/1711
  21374. // TODO (fix): Find and fix root cause for leaked listener.
  21375. this.setMaxListeners(21)
  21376. }
  21377. terminate (reason) {
  21378. if (this.state !== 'ongoing') {
  21379. return
  21380. }
  21381. this.state = 'terminated'
  21382. this.connection?.destroy(reason)
  21383. this.emit('terminated', reason)
  21384. }
  21385. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21386. abort (error) {
  21387. if (this.state !== 'ongoing') {
  21388. return
  21389. }
  21390. // 1. Set controller’s state to "aborted".
  21391. this.state = 'aborted'
  21392. // 2. Let fallbackError be an "AbortError" DOMException.
  21393. // 3. Set error to fallbackError if it is not given.
  21394. if (!error) {
  21395. error = new DOMException('The operation was aborted.', 'AbortError')
  21396. }
  21397. // 4. Let serializedError be StructuredSerialize(error).
  21398. // If that threw an exception, catch it, and let
  21399. // serializedError be StructuredSerialize(fallbackError).
  21400. // 5. Set controller’s serialized abort reason to serializedError.
  21401. this.serializedAbortReason = error
  21402. this.connection?.destroy(error)
  21403. this.emit('terminated', error)
  21404. }
  21405. }
  21406. // https://fetch.spec.whatwg.org/#fetch-method
  21407. function fetch (input, init = {}) {
  21408. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21409. // 1. Let p be a new promise.
  21410. const p = createDeferredPromise()
  21411. // 2. Let requestObject be the result of invoking the initial value of
  21412. // Request as constructor with input and init as arguments. If this throws
  21413. // an exception, reject p with it and return p.
  21414. let requestObject
  21415. try {
  21416. requestObject = new Request(input, init)
  21417. } catch (e) {
  21418. p.reject(e)
  21419. return p.promise
  21420. }
  21421. // 3. Let request be requestObject’s request.
  21422. const request = requestObject[kState]
  21423. // 4. If requestObject’s signal’s aborted flag is set, then:
  21424. if (requestObject.signal.aborted) {
  21425. // 1. Abort the fetch() call with p, request, null, and
  21426. // requestObject’s signal’s abort reason.
  21427. abortFetch(p, request, null, requestObject.signal.reason)
  21428. // 2. Return p.
  21429. return p.promise
  21430. }
  21431. // 5. Let globalObject be request’s client’s global object.
  21432. const globalObject = request.client.globalObject
  21433. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21434. // request’s service-workers mode to "none".
  21435. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21436. request.serviceWorkers = 'none'
  21437. }
  21438. // 7. Let responseObject be null.
  21439. let responseObject = null
  21440. // 8. Let relevantRealm be this’s relevant Realm.
  21441. const relevantRealm = null
  21442. // 9. Let locallyAborted be false.
  21443. let locallyAborted = false
  21444. // 10. Let controller be null.
  21445. let controller = null
  21446. // 11. Add the following abort steps to requestObject’s signal:
  21447. addAbortListener(
  21448. requestObject.signal,
  21449. () => {
  21450. // 1. Set locallyAborted to true.
  21451. locallyAborted = true
  21452. // 2. Assert: controller is non-null.
  21453. assert(controller != null)
  21454. // 3. Abort controller with requestObject’s signal’s abort reason.
  21455. controller.abort(requestObject.signal.reason)
  21456. // 4. Abort the fetch() call with p, request, responseObject,
  21457. // and requestObject’s signal’s abort reason.
  21458. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21459. }
  21460. )
  21461. // 12. Let handleFetchDone given response response be to finalize and
  21462. // report timing with response, globalObject, and "fetch".
  21463. const handleFetchDone = (response) =>
  21464. finalizeAndReportTiming(response, 'fetch')
  21465. // 13. Set controller to the result of calling fetch given request,
  21466. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21467. // given response being these substeps:
  21468. const processResponse = (response) => {
  21469. // 1. If locallyAborted is true, terminate these substeps.
  21470. if (locallyAborted) {
  21471. return Promise.resolve()
  21472. }
  21473. // 2. If response’s aborted flag is set, then:
  21474. if (response.aborted) {
  21475. // 1. Let deserializedError be the result of deserialize a serialized
  21476. // abort reason given controller’s serialized abort reason and
  21477. // relevantRealm.
  21478. // 2. Abort the fetch() call with p, request, responseObject, and
  21479. // deserializedError.
  21480. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21481. return Promise.resolve()
  21482. }
  21483. // 3. If response is a network error, then reject p with a TypeError
  21484. // and terminate these substeps.
  21485. if (response.type === 'error') {
  21486. p.reject(
  21487. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21488. )
  21489. return Promise.resolve()
  21490. }
  21491. // 4. Set responseObject to the result of creating a Response object,
  21492. // given response, "immutable", and relevantRealm.
  21493. responseObject = new Response()
  21494. responseObject[kState] = response
  21495. responseObject[kRealm] = relevantRealm
  21496. responseObject[kHeaders][kHeadersList] = response.headersList
  21497. responseObject[kHeaders][kGuard] = 'immutable'
  21498. responseObject[kHeaders][kRealm] = relevantRealm
  21499. // 5. Resolve p with responseObject.
  21500. p.resolve(responseObject)
  21501. }
  21502. controller = fetching({
  21503. request,
  21504. processResponseEndOfBody: handleFetchDone,
  21505. processResponse,
  21506. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21507. })
  21508. // 14. Return p.
  21509. return p.promise
  21510. }
  21511. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21512. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21513. // 1. If response is an aborted network error, then return.
  21514. if (response.type === 'error' && response.aborted) {
  21515. return
  21516. }
  21517. // 2. If response’s URL list is null or empty, then return.
  21518. if (!response.urlList?.length) {
  21519. return
  21520. }
  21521. // 3. Let originalURL be response’s URL list[0].
  21522. const originalURL = response.urlList[0]
  21523. // 4. Let timingInfo be response’s timing info.
  21524. let timingInfo = response.timingInfo
  21525. // 5. Let cacheState be response’s cache state.
  21526. let cacheState = response.cacheState
  21527. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21528. if (!urlIsHttpHttpsScheme(originalURL)) {
  21529. return
  21530. }
  21531. // 7. If timingInfo is null, then return.
  21532. if (timingInfo === null) {
  21533. return
  21534. }
  21535. // 8. If response’s timing allow passed flag is not set, then:
  21536. if (!response.timingAllowPassed) {
  21537. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21538. timingInfo = createOpaqueTimingInfo({
  21539. startTime: timingInfo.startTime
  21540. })
  21541. // 2. Set cacheState to the empty string.
  21542. cacheState = ''
  21543. }
  21544. // 9. Set timingInfo’s end time to the coarsened shared current time
  21545. // given global’s relevant settings object’s cross-origin isolated
  21546. // capability.
  21547. // TODO: given global’s relevant settings object’s cross-origin isolated
  21548. // capability?
  21549. timingInfo.endTime = coarsenedSharedCurrentTime()
  21550. // 10. Set response’s timing info to timingInfo.
  21551. response.timingInfo = timingInfo
  21552. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21553. // global, and cacheState.
  21554. markResourceTiming(
  21555. timingInfo,
  21556. originalURL,
  21557. initiatorType,
  21558. globalThis,
  21559. cacheState
  21560. )
  21561. }
  21562. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21563. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21564. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21565. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21566. }
  21567. }
  21568. // https://fetch.spec.whatwg.org/#abort-fetch
  21569. function abortFetch (p, request, responseObject, error) {
  21570. // Note: AbortSignal.reason was added in node v17.2.0
  21571. // which would give us an undefined error to reject with.
  21572. // Remove this once node v16 is no longer supported.
  21573. if (!error) {
  21574. error = new DOMException('The operation was aborted.', 'AbortError')
  21575. }
  21576. // 1. Reject promise with error.
  21577. p.reject(error)
  21578. // 2. If request’s body is not null and is readable, then cancel request’s
  21579. // body with error.
  21580. if (request.body != null && isReadable(request.body?.stream)) {
  21581. request.body.stream.cancel(error).catch((err) => {
  21582. if (err.code === 'ERR_INVALID_STATE') {
  21583. // Node bug?
  21584. return
  21585. }
  21586. throw err
  21587. })
  21588. }
  21589. // 3. If responseObject is null, then return.
  21590. if (responseObject == null) {
  21591. return
  21592. }
  21593. // 4. Let response be responseObject’s response.
  21594. const response = responseObject[kState]
  21595. // 5. If response’s body is not null and is readable, then error response’s
  21596. // body with error.
  21597. if (response.body != null && isReadable(response.body?.stream)) {
  21598. response.body.stream.cancel(error).catch((err) => {
  21599. if (err.code === 'ERR_INVALID_STATE') {
  21600. // Node bug?
  21601. return
  21602. }
  21603. throw err
  21604. })
  21605. }
  21606. }
  21607. // https://fetch.spec.whatwg.org/#fetching
  21608. function fetching ({
  21609. request,
  21610. processRequestBodyChunkLength,
  21611. processRequestEndOfBody,
  21612. processResponse,
  21613. processResponseEndOfBody,
  21614. processResponseConsumeBody,
  21615. useParallelQueue = false,
  21616. dispatcher // undici
  21617. }) {
  21618. // 1. Let taskDestination be null.
  21619. let taskDestination = null
  21620. // 2. Let crossOriginIsolatedCapability be false.
  21621. let crossOriginIsolatedCapability = false
  21622. // 3. If request’s client is non-null, then:
  21623. if (request.client != null) {
  21624. // 1. Set taskDestination to request’s client’s global object.
  21625. taskDestination = request.client.globalObject
  21626. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21627. // isolated capability.
  21628. crossOriginIsolatedCapability =
  21629. request.client.crossOriginIsolatedCapability
  21630. }
  21631. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21632. // starting a new parallel queue.
  21633. // TODO
  21634. // 5. Let timingInfo be a new fetch timing info whose start time and
  21635. // post-redirect start time are the coarsened shared current time given
  21636. // crossOriginIsolatedCapability.
  21637. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21638. const timingInfo = createOpaqueTimingInfo({
  21639. startTime: currenTime
  21640. })
  21641. // 6. Let fetchParams be a new fetch params whose
  21642. // request is request,
  21643. // timing info is timingInfo,
  21644. // process request body chunk length is processRequestBodyChunkLength,
  21645. // process request end-of-body is processRequestEndOfBody,
  21646. // process response is processResponse,
  21647. // process response consume body is processResponseConsumeBody,
  21648. // process response end-of-body is processResponseEndOfBody,
  21649. // task destination is taskDestination,
  21650. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21651. const fetchParams = {
  21652. controller: new Fetch(dispatcher),
  21653. request,
  21654. timingInfo,
  21655. processRequestBodyChunkLength,
  21656. processRequestEndOfBody,
  21657. processResponse,
  21658. processResponseConsumeBody,
  21659. processResponseEndOfBody,
  21660. taskDestination,
  21661. crossOriginIsolatedCapability
  21662. }
  21663. // 7. If request’s body is a byte sequence, then set request’s body to
  21664. // request’s body as a body.
  21665. // NOTE: Since fetching is only called from fetch, body should already be
  21666. // extracted.
  21667. assert(!request.body || request.body.stream)
  21668. // 8. If request’s window is "client", then set request’s window to request’s
  21669. // client, if request’s client’s global object is a Window object; otherwise
  21670. // "no-window".
  21671. if (request.window === 'client') {
  21672. // TODO: What if request.client is null?
  21673. request.window =
  21674. request.client?.globalObject?.constructor?.name === 'Window'
  21675. ? request.client
  21676. : 'no-window'
  21677. }
  21678. // 9. If request’s origin is "client", then set request’s origin to request’s
  21679. // client’s origin.
  21680. if (request.origin === 'client') {
  21681. // TODO: What if request.client is null?
  21682. request.origin = request.client?.origin
  21683. }
  21684. // 10. If all of the following conditions are true:
  21685. // TODO
  21686. // 11. If request’s policy container is "client", then:
  21687. if (request.policyContainer === 'client') {
  21688. // 1. If request’s client is non-null, then set request’s policy
  21689. // container to a clone of request’s client’s policy container. [HTML]
  21690. if (request.client != null) {
  21691. request.policyContainer = clonePolicyContainer(
  21692. request.client.policyContainer
  21693. )
  21694. } else {
  21695. // 2. Otherwise, set request’s policy container to a new policy
  21696. // container.
  21697. request.policyContainer = makePolicyContainer()
  21698. }
  21699. }
  21700. // 12. If request’s header list does not contain `Accept`, then:
  21701. if (!request.headersList.contains('accept')) {
  21702. // 1. Let value be `*/*`.
  21703. const value = '*/*'
  21704. // 2. A user agent should set value to the first matching statement, if
  21705. // any, switching on request’s destination:
  21706. // "document"
  21707. // "frame"
  21708. // "iframe"
  21709. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21710. // "image"
  21711. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21712. // "style"
  21713. // `text/css,*/*;q=0.1`
  21714. // TODO
  21715. // 3. Append `Accept`/value to request’s header list.
  21716. request.headersList.append('accept', value)
  21717. }
  21718. // 13. If request’s header list does not contain `Accept-Language`, then
  21719. // user agents should append `Accept-Language`/an appropriate value to
  21720. // request’s header list.
  21721. if (!request.headersList.contains('accept-language')) {
  21722. request.headersList.append('accept-language', '*')
  21723. }
  21724. // 14. If request’s priority is null, then use request’s initiator and
  21725. // destination appropriately in setting request’s priority to a
  21726. // user-agent-defined object.
  21727. if (request.priority === null) {
  21728. // TODO
  21729. }
  21730. // 15. If request is a subresource request, then:
  21731. if (subresourceSet.has(request.destination)) {
  21732. // TODO
  21733. }
  21734. // 16. Run main fetch given fetchParams.
  21735. mainFetch(fetchParams)
  21736. .catch(err => {
  21737. fetchParams.controller.terminate(err)
  21738. })
  21739. // 17. Return fetchParam's controller
  21740. return fetchParams.controller
  21741. }
  21742. // https://fetch.spec.whatwg.org/#concept-main-fetch
  21743. async function mainFetch (fetchParams, recursive = false) {
  21744. // 1. Let request be fetchParams’s request.
  21745. const request = fetchParams.request
  21746. // 2. Let response be null.
  21747. let response = null
  21748. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  21749. // not local, then set response to a network error.
  21750. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  21751. response = makeNetworkError('local URLs only')
  21752. }
  21753. // 4. Run report Content Security Policy violations for request.
  21754. // TODO
  21755. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  21756. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  21757. // 6. If should request be blocked due to a bad port, should fetching request
  21758. // be blocked as mixed content, or should request be blocked by Content
  21759. // Security Policy returns blocked, then set response to a network error.
  21760. if (requestBadPort(request) === 'blocked') {
  21761. response = makeNetworkError('bad port')
  21762. }
  21763. // TODO: should fetching request be blocked as mixed content?
  21764. // TODO: should request be blocked by Content Security Policy?
  21765. // 7. If request’s referrer policy is the empty string, then set request’s
  21766. // referrer policy to request’s policy container’s referrer policy.
  21767. if (request.referrerPolicy === '') {
  21768. request.referrerPolicy = request.policyContainer.referrerPolicy
  21769. }
  21770. // 8. If request’s referrer is not "no-referrer", then set request’s
  21771. // referrer to the result of invoking determine request’s referrer.
  21772. if (request.referrer !== 'no-referrer') {
  21773. request.referrer = determineRequestsReferrer(request)
  21774. }
  21775. // 9. Set request’s current URL’s scheme to "https" if all of the following
  21776. // conditions are true:
  21777. // - request’s current URL’s scheme is "http"
  21778. // - request’s current URL’s host is a domain
  21779. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  21780. // Matching results in either a superdomain match with an asserted
  21781. // includeSubDomains directive or a congruent match (with or without an
  21782. // asserted includeSubDomains directive). [HSTS]
  21783. // TODO
  21784. // 10. If recursive is false, then run the remaining steps in parallel.
  21785. // TODO
  21786. // 11. If response is null, then set response to the result of running
  21787. // the steps corresponding to the first matching statement:
  21788. if (response === null) {
  21789. response = await (async () => {
  21790. const currentURL = requestCurrentURL(request)
  21791. if (
  21792. // - request’s current URL’s origin is same origin with request’s origin,
  21793. // and request’s response tainting is "basic"
  21794. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  21795. // request’s current URL’s scheme is "data"
  21796. (currentURL.protocol === 'data:') ||
  21797. // - request’s mode is "navigate" or "websocket"
  21798. (request.mode === 'navigate' || request.mode === 'websocket')
  21799. ) {
  21800. // 1. Set request’s response tainting to "basic".
  21801. request.responseTainting = 'basic'
  21802. // 2. Return the result of running scheme fetch given fetchParams.
  21803. return await schemeFetch(fetchParams)
  21804. }
  21805. // request’s mode is "same-origin"
  21806. if (request.mode === 'same-origin') {
  21807. // 1. Return a network error.
  21808. return makeNetworkError('request mode cannot be "same-origin"')
  21809. }
  21810. // request’s mode is "no-cors"
  21811. if (request.mode === 'no-cors') {
  21812. // 1. If request’s redirect mode is not "follow", then return a network
  21813. // error.
  21814. if (request.redirect !== 'follow') {
  21815. return makeNetworkError(
  21816. 'redirect mode cannot be "follow" for "no-cors" request'
  21817. )
  21818. }
  21819. // 2. Set request’s response tainting to "opaque".
  21820. request.responseTainting = 'opaque'
  21821. // 3. Return the result of running scheme fetch given fetchParams.
  21822. return await schemeFetch(fetchParams)
  21823. }
  21824. // request’s current URL’s scheme is not an HTTP(S) scheme
  21825. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  21826. // Return a network error.
  21827. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  21828. }
  21829. // - request’s use-CORS-preflight flag is set
  21830. // - request’s unsafe-request flag is set and either request’s method is
  21831. // not a CORS-safelisted method or CORS-unsafe request-header names with
  21832. // request’s header list is not empty
  21833. // 1. Set request’s response tainting to "cors".
  21834. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  21835. // given fetchParams and true.
  21836. // 3. If corsWithPreflightResponse is a network error, then clear cache
  21837. // entries using request.
  21838. // 4. Return corsWithPreflightResponse.
  21839. // TODO
  21840. // Otherwise
  21841. // 1. Set request’s response tainting to "cors".
  21842. request.responseTainting = 'cors'
  21843. // 2. Return the result of running HTTP fetch given fetchParams.
  21844. return await httpFetch(fetchParams)
  21845. })()
  21846. }
  21847. // 12. If recursive is true, then return response.
  21848. if (recursive) {
  21849. return response
  21850. }
  21851. // 13. If response is not a network error and response is not a filtered
  21852. // response, then:
  21853. if (response.status !== 0 && !response.internalResponse) {
  21854. // If request’s response tainting is "cors", then:
  21855. if (request.responseTainting === 'cors') {
  21856. // 1. Let headerNames be the result of extracting header list values
  21857. // given `Access-Control-Expose-Headers` and response’s header list.
  21858. // TODO
  21859. // 2. If request’s credentials mode is not "include" and headerNames
  21860. // contains `*`, then set response’s CORS-exposed header-name list to
  21861. // all unique header names in response’s header list.
  21862. // TODO
  21863. // 3. Otherwise, if headerNames is not null or failure, then set
  21864. // response’s CORS-exposed header-name list to headerNames.
  21865. // TODO
  21866. }
  21867. // Set response to the following filtered response with response as its
  21868. // internal response, depending on request’s response tainting:
  21869. if (request.responseTainting === 'basic') {
  21870. response = filterResponse(response, 'basic')
  21871. } else if (request.responseTainting === 'cors') {
  21872. response = filterResponse(response, 'cors')
  21873. } else if (request.responseTainting === 'opaque') {
  21874. response = filterResponse(response, 'opaque')
  21875. } else {
  21876. assert(false)
  21877. }
  21878. }
  21879. // 14. Let internalResponse be response, if response is a network error,
  21880. // and response’s internal response otherwise.
  21881. let internalResponse =
  21882. response.status === 0 ? response : response.internalResponse
  21883. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  21884. // request’s URL list.
  21885. if (internalResponse.urlList.length === 0) {
  21886. internalResponse.urlList.push(...request.urlList)
  21887. }
  21888. // 16. If request’s timing allow failed flag is unset, then set
  21889. // internalResponse’s timing allow passed flag.
  21890. if (!request.timingAllowFailed) {
  21891. response.timingAllowPassed = true
  21892. }
  21893. // 17. If response is not a network error and any of the following returns
  21894. // blocked
  21895. // - should internalResponse to request be blocked as mixed content
  21896. // - should internalResponse to request be blocked by Content Security Policy
  21897. // - should internalResponse to request be blocked due to its MIME type
  21898. // - should internalResponse to request be blocked due to nosniff
  21899. // TODO
  21900. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  21901. // internalResponse’s range-requested flag is set, and request’s header
  21902. // list does not contain `Range`, then set response and internalResponse
  21903. // to a network error.
  21904. if (
  21905. response.type === 'opaque' &&
  21906. internalResponse.status === 206 &&
  21907. internalResponse.rangeRequested &&
  21908. !request.headers.contains('range')
  21909. ) {
  21910. response = internalResponse = makeNetworkError()
  21911. }
  21912. // 19. If response is not a network error and either request’s method is
  21913. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  21914. // set internalResponse’s body to null and disregard any enqueuing toward
  21915. // it (if any).
  21916. if (
  21917. response.status !== 0 &&
  21918. (request.method === 'HEAD' ||
  21919. request.method === 'CONNECT' ||
  21920. nullBodyStatus.includes(internalResponse.status))
  21921. ) {
  21922. internalResponse.body = null
  21923. fetchParams.controller.dump = true
  21924. }
  21925. // 20. If request’s integrity metadata is not the empty string, then:
  21926. if (request.integrity) {
  21927. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  21928. // and a network error.
  21929. const processBodyError = (reason) =>
  21930. fetchFinale(fetchParams, makeNetworkError(reason))
  21931. // 2. If request’s response tainting is "opaque", or response’s body is null,
  21932. // then run processBodyError and abort these steps.
  21933. if (request.responseTainting === 'opaque' || response.body == null) {
  21934. processBodyError(response.error)
  21935. return
  21936. }
  21937. // 3. Let processBody given bytes be these steps:
  21938. const processBody = (bytes) => {
  21939. // 1. If bytes do not match request’s integrity metadata,
  21940. // then run processBodyError and abort these steps. [SRI]
  21941. if (!bytesMatch(bytes, request.integrity)) {
  21942. processBodyError('integrity mismatch')
  21943. return
  21944. }
  21945. // 2. Set response’s body to bytes as a body.
  21946. response.body = safelyExtractBody(bytes)[0]
  21947. // 3. Run fetch finale given fetchParams and response.
  21948. fetchFinale(fetchParams, response)
  21949. }
  21950. // 4. Fully read response’s body given processBody and processBodyError.
  21951. await fullyReadBody(response.body, processBody, processBodyError)
  21952. } else {
  21953. // 21. Otherwise, run fetch finale given fetchParams and response.
  21954. fetchFinale(fetchParams, response)
  21955. }
  21956. }
  21957. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  21958. // given a fetch params fetchParams
  21959. function schemeFetch (fetchParams) {
  21960. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  21961. // cancelled state, we do not want this condition to trigger *unless* there have been
  21962. // no redirects. See https://github.com/nodejs/undici/issues/1776
  21963. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  21964. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  21965. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  21966. }
  21967. // 2. Let request be fetchParams’s request.
  21968. const { request } = fetchParams
  21969. const { protocol: scheme } = requestCurrentURL(request)
  21970. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  21971. switch (scheme) {
  21972. case 'about:': {
  21973. // If request’s current URL’s path is the string "blank", then return a new response
  21974. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  21975. // and body is the empty byte sequence as a body.
  21976. // Otherwise, return a network error.
  21977. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  21978. }
  21979. case 'blob:': {
  21980. if (!resolveObjectURL) {
  21981. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  21982. }
  21983. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  21984. const blobURLEntry = requestCurrentURL(request)
  21985. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  21986. // Buffer.resolveObjectURL does not ignore URL queries.
  21987. if (blobURLEntry.search.length !== 0) {
  21988. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  21989. }
  21990. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  21991. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  21992. // object is not a Blob object, then return a network error.
  21993. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  21994. return Promise.resolve(makeNetworkError('invalid method'))
  21995. }
  21996. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  21997. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  21998. // 4. Let body be bodyWithType’s body.
  21999. const body = bodyWithType[0]
  22000. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22001. const length = isomorphicEncode(`${body.length}`)
  22002. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22003. const type = bodyWithType[1] ?? ''
  22004. // 7. Return a new response whose status message is `OK`, header list is
  22005. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22006. const response = makeResponse({
  22007. statusText: 'OK',
  22008. headersList: [
  22009. ['content-length', { name: 'Content-Length', value: length }],
  22010. ['content-type', { name: 'Content-Type', value: type }]
  22011. ]
  22012. })
  22013. response.body = body
  22014. return Promise.resolve(response)
  22015. }
  22016. case 'data:': {
  22017. // 1. Let dataURLStruct be the result of running the
  22018. // data: URL processor on request’s current URL.
  22019. const currentURL = requestCurrentURL(request)
  22020. const dataURLStruct = dataURLProcessor(currentURL)
  22021. // 2. If dataURLStruct is failure, then return a
  22022. // network error.
  22023. if (dataURLStruct === 'failure') {
  22024. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22025. }
  22026. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22027. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22028. // 4. Return a response whose status message is `OK`,
  22029. // header list is « (`Content-Type`, mimeType) »,
  22030. // and body is dataURLStruct’s body as a body.
  22031. return Promise.resolve(makeResponse({
  22032. statusText: 'OK',
  22033. headersList: [
  22034. ['content-type', { name: 'Content-Type', value: mimeType }]
  22035. ],
  22036. body: safelyExtractBody(dataURLStruct.body)[0]
  22037. }))
  22038. }
  22039. case 'file:': {
  22040. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22041. // When in doubt, return a network error.
  22042. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22043. }
  22044. case 'http:':
  22045. case 'https:': {
  22046. // Return the result of running HTTP fetch given fetchParams.
  22047. return httpFetch(fetchParams)
  22048. .catch((err) => makeNetworkError(err))
  22049. }
  22050. default: {
  22051. return Promise.resolve(makeNetworkError('unknown scheme'))
  22052. }
  22053. }
  22054. }
  22055. // https://fetch.spec.whatwg.org/#finalize-response
  22056. function finalizeResponse (fetchParams, response) {
  22057. // 1. Set fetchParams’s request’s done flag.
  22058. fetchParams.request.done = true
  22059. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22060. // task to run fetchParams’s process response done given response, with
  22061. // fetchParams’s task destination.
  22062. if (fetchParams.processResponseDone != null) {
  22063. queueMicrotask(() => fetchParams.processResponseDone(response))
  22064. }
  22065. }
  22066. // https://fetch.spec.whatwg.org/#fetch-finale
  22067. function fetchFinale (fetchParams, response) {
  22068. // 1. If response is a network error, then:
  22069. if (response.type === 'error') {
  22070. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22071. response.urlList = [fetchParams.request.urlList[0]]
  22072. // 2. Set response’s timing info to the result of creating an opaque timing
  22073. // info for fetchParams’s timing info.
  22074. response.timingInfo = createOpaqueTimingInfo({
  22075. startTime: fetchParams.timingInfo.startTime
  22076. })
  22077. }
  22078. // 2. Let processResponseEndOfBody be the following steps:
  22079. const processResponseEndOfBody = () => {
  22080. // 1. Set fetchParams’s request’s done flag.
  22081. fetchParams.request.done = true
  22082. // If fetchParams’s process response end-of-body is not null,
  22083. // then queue a fetch task to run fetchParams’s process response
  22084. // end-of-body given response with fetchParams’s task destination.
  22085. if (fetchParams.processResponseEndOfBody != null) {
  22086. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22087. }
  22088. }
  22089. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22090. // to run fetchParams’s process response given response, with fetchParams’s
  22091. // task destination.
  22092. if (fetchParams.processResponse != null) {
  22093. queueMicrotask(() => fetchParams.processResponse(response))
  22094. }
  22095. // 4. If response’s body is null, then run processResponseEndOfBody.
  22096. if (response.body == null) {
  22097. processResponseEndOfBody()
  22098. } else {
  22099. // 5. Otherwise:
  22100. // 1. Let transformStream be a new a TransformStream.
  22101. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22102. // enqueues chunk in transformStream.
  22103. const identityTransformAlgorithm = (chunk, controller) => {
  22104. controller.enqueue(chunk)
  22105. }
  22106. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22107. // and flushAlgorithm set to processResponseEndOfBody.
  22108. const transformStream = new TransformStream({
  22109. start () {},
  22110. transform: identityTransformAlgorithm,
  22111. flush: processResponseEndOfBody
  22112. }, {
  22113. size () {
  22114. return 1
  22115. }
  22116. }, {
  22117. size () {
  22118. return 1
  22119. }
  22120. })
  22121. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22122. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22123. }
  22124. // 6. If fetchParams’s process response consume body is non-null, then:
  22125. if (fetchParams.processResponseConsumeBody != null) {
  22126. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22127. // process response consume body given response and nullOrBytes.
  22128. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22129. // 2. Let processBodyError be this step: run fetchParams’s process
  22130. // response consume body given response and failure.
  22131. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22132. // 3. If response’s body is null, then queue a fetch task to run processBody
  22133. // given null, with fetchParams’s task destination.
  22134. if (response.body == null) {
  22135. queueMicrotask(() => processBody(null))
  22136. } else {
  22137. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22138. // and fetchParams’s task destination.
  22139. return fullyReadBody(response.body, processBody, processBodyError)
  22140. }
  22141. return Promise.resolve()
  22142. }
  22143. }
  22144. // https://fetch.spec.whatwg.org/#http-fetch
  22145. async function httpFetch (fetchParams) {
  22146. // 1. Let request be fetchParams’s request.
  22147. const request = fetchParams.request
  22148. // 2. Let response be null.
  22149. let response = null
  22150. // 3. Let actualResponse be null.
  22151. let actualResponse = null
  22152. // 4. Let timingInfo be fetchParams’s timing info.
  22153. const timingInfo = fetchParams.timingInfo
  22154. // 5. If request’s service-workers mode is "all", then:
  22155. if (request.serviceWorkers === 'all') {
  22156. // TODO
  22157. }
  22158. // 6. If response is null, then:
  22159. if (response === null) {
  22160. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22161. // TODO
  22162. // 2. If request’s redirect mode is "follow", then set request’s
  22163. // service-workers mode to "none".
  22164. if (request.redirect === 'follow') {
  22165. request.serviceWorkers = 'none'
  22166. }
  22167. // 3. Set response and actualResponse to the result of running
  22168. // HTTP-network-or-cache fetch given fetchParams.
  22169. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22170. // 4. If request’s response tainting is "cors" and a CORS check
  22171. // for request and response returns failure, then return a network error.
  22172. if (
  22173. request.responseTainting === 'cors' &&
  22174. corsCheck(request, response) === 'failure'
  22175. ) {
  22176. return makeNetworkError('cors failure')
  22177. }
  22178. // 5. If the TAO check for request and response returns failure, then set
  22179. // request’s timing allow failed flag.
  22180. if (TAOCheck(request, response) === 'failure') {
  22181. request.timingAllowFailed = true
  22182. }
  22183. }
  22184. // 7. If either request’s response tainting or response’s type
  22185. // is "opaque", and the cross-origin resource policy check with
  22186. // request’s origin, request’s client, request’s destination,
  22187. // and actualResponse returns blocked, then return a network error.
  22188. if (
  22189. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22190. crossOriginResourcePolicyCheck(
  22191. request.origin,
  22192. request.client,
  22193. request.destination,
  22194. actualResponse
  22195. ) === 'blocked'
  22196. ) {
  22197. return makeNetworkError('blocked')
  22198. }
  22199. // 8. If actualResponse’s status is a redirect status, then:
  22200. if (redirectStatusSet.has(actualResponse.status)) {
  22201. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22202. // and the connection uses HTTP/2, then user agents may, and are even
  22203. // encouraged to, transmit an RST_STREAM frame.
  22204. // See, https://github.com/whatwg/fetch/issues/1288
  22205. if (request.redirect !== 'manual') {
  22206. fetchParams.controller.connection.destroy()
  22207. }
  22208. // 2. Switch on request’s redirect mode:
  22209. if (request.redirect === 'error') {
  22210. // Set response to a network error.
  22211. response = makeNetworkError('unexpected redirect')
  22212. } else if (request.redirect === 'manual') {
  22213. // Set response to an opaque-redirect filtered response whose internal
  22214. // response is actualResponse.
  22215. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22216. // but that doesn't make sense server side.
  22217. // See https://github.com/nodejs/undici/issues/1193.
  22218. response = actualResponse
  22219. } else if (request.redirect === 'follow') {
  22220. // Set response to the result of running HTTP-redirect fetch given
  22221. // fetchParams and response.
  22222. response = await httpRedirectFetch(fetchParams, response)
  22223. } else {
  22224. assert(false)
  22225. }
  22226. }
  22227. // 9. Set response’s timing info to timingInfo.
  22228. response.timingInfo = timingInfo
  22229. // 10. Return response.
  22230. return response
  22231. }
  22232. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22233. function httpRedirectFetch (fetchParams, response) {
  22234. // 1. Let request be fetchParams’s request.
  22235. const request = fetchParams.request
  22236. // 2. Let actualResponse be response, if response is not a filtered response,
  22237. // and response’s internal response otherwise.
  22238. const actualResponse = response.internalResponse
  22239. ? response.internalResponse
  22240. : response
  22241. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22242. // URL’s fragment.
  22243. let locationURL
  22244. try {
  22245. locationURL = responseLocationURL(
  22246. actualResponse,
  22247. requestCurrentURL(request).hash
  22248. )
  22249. // 4. If locationURL is null, then return response.
  22250. if (locationURL == null) {
  22251. return response
  22252. }
  22253. } catch (err) {
  22254. // 5. If locationURL is failure, then return a network error.
  22255. return Promise.resolve(makeNetworkError(err))
  22256. }
  22257. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22258. // error.
  22259. if (!urlIsHttpHttpsScheme(locationURL)) {
  22260. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22261. }
  22262. // 7. If request’s redirect count is 20, then return a network error.
  22263. if (request.redirectCount === 20) {
  22264. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22265. }
  22266. // 8. Increase request’s redirect count by 1.
  22267. request.redirectCount += 1
  22268. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22269. // request’s origin is not same origin with locationURL’s origin, then return
  22270. // a network error.
  22271. if (
  22272. request.mode === 'cors' &&
  22273. (locationURL.username || locationURL.password) &&
  22274. !sameOrigin(request, locationURL)
  22275. ) {
  22276. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22277. }
  22278. // 10. If request’s response tainting is "cors" and locationURL includes
  22279. // credentials, then return a network error.
  22280. if (
  22281. request.responseTainting === 'cors' &&
  22282. (locationURL.username || locationURL.password)
  22283. ) {
  22284. return Promise.resolve(makeNetworkError(
  22285. 'URL cannot contain credentials for request mode "cors"'
  22286. ))
  22287. }
  22288. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22289. // and request’s body’s source is null, then return a network error.
  22290. if (
  22291. actualResponse.status !== 303 &&
  22292. request.body != null &&
  22293. request.body.source == null
  22294. ) {
  22295. return Promise.resolve(makeNetworkError())
  22296. }
  22297. // 12. If one of the following is true
  22298. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22299. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22300. if (
  22301. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22302. (actualResponse.status === 303 &&
  22303. !GET_OR_HEAD.includes(request.method))
  22304. ) {
  22305. // then:
  22306. // 1. Set request’s method to `GET` and request’s body to null.
  22307. request.method = 'GET'
  22308. request.body = null
  22309. // 2. For each headerName of request-body-header name, delete headerName from
  22310. // request’s header list.
  22311. for (const headerName of requestBodyHeader) {
  22312. request.headersList.delete(headerName)
  22313. }
  22314. }
  22315. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22316. // origin, then for each headerName of CORS non-wildcard request-header name,
  22317. // delete headerName from request’s header list.
  22318. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22319. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22320. request.headersList.delete('authorization')
  22321. // https://fetch.spec.whatwg.org/#authentication-entries
  22322. request.headersList.delete('proxy-authorization', true)
  22323. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22324. request.headersList.delete('cookie')
  22325. request.headersList.delete('host')
  22326. }
  22327. // 14. If request’s body is non-null, then set request’s body to the first return
  22328. // value of safely extracting request’s body’s source.
  22329. if (request.body != null) {
  22330. assert(request.body.source != null)
  22331. request.body = safelyExtractBody(request.body.source)[0]
  22332. }
  22333. // 15. Let timingInfo be fetchParams’s timing info.
  22334. const timingInfo = fetchParams.timingInfo
  22335. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22336. // coarsened shared current time given fetchParams’s cross-origin isolated
  22337. // capability.
  22338. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22339. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22340. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22341. // redirect start time to timingInfo’s start time.
  22342. if (timingInfo.redirectStartTime === 0) {
  22343. timingInfo.redirectStartTime = timingInfo.startTime
  22344. }
  22345. // 18. Append locationURL to request’s URL list.
  22346. request.urlList.push(locationURL)
  22347. // 19. Invoke set request’s referrer policy on redirect on request and
  22348. // actualResponse.
  22349. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22350. // 20. Return the result of running main fetch given fetchParams and true.
  22351. return mainFetch(fetchParams, true)
  22352. }
  22353. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22354. async function httpNetworkOrCacheFetch (
  22355. fetchParams,
  22356. isAuthenticationFetch = false,
  22357. isNewConnectionFetch = false
  22358. ) {
  22359. // 1. Let request be fetchParams’s request.
  22360. const request = fetchParams.request
  22361. // 2. Let httpFetchParams be null.
  22362. let httpFetchParams = null
  22363. // 3. Let httpRequest be null.
  22364. let httpRequest = null
  22365. // 4. Let response be null.
  22366. let response = null
  22367. // 5. Let storedResponse be null.
  22368. // TODO: cache
  22369. // 6. Let httpCache be null.
  22370. const httpCache = null
  22371. // 7. Let the revalidatingFlag be unset.
  22372. const revalidatingFlag = false
  22373. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22374. // 1. If request’s window is "no-window" and request’s redirect mode is
  22375. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22376. // request.
  22377. if (request.window === 'no-window' && request.redirect === 'error') {
  22378. httpFetchParams = fetchParams
  22379. httpRequest = request
  22380. } else {
  22381. // Otherwise:
  22382. // 1. Set httpRequest to a clone of request.
  22383. httpRequest = makeRequest(request)
  22384. // 2. Set httpFetchParams to a copy of fetchParams.
  22385. httpFetchParams = { ...fetchParams }
  22386. // 3. Set httpFetchParams’s request to httpRequest.
  22387. httpFetchParams.request = httpRequest
  22388. }
  22389. // 3. Let includeCredentials be true if one of
  22390. const includeCredentials =
  22391. request.credentials === 'include' ||
  22392. (request.credentials === 'same-origin' &&
  22393. request.responseTainting === 'basic')
  22394. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22395. // body is non-null; otherwise null.
  22396. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22397. // 5. Let contentLengthHeaderValue be null.
  22398. let contentLengthHeaderValue = null
  22399. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22400. // `PUT`, then set contentLengthHeaderValue to `0`.
  22401. if (
  22402. httpRequest.body == null &&
  22403. ['POST', 'PUT'].includes(httpRequest.method)
  22404. ) {
  22405. contentLengthHeaderValue = '0'
  22406. }
  22407. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22408. // contentLength, serialized and isomorphic encoded.
  22409. if (contentLength != null) {
  22410. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22411. }
  22412. // 8. If contentLengthHeaderValue is non-null, then append
  22413. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22414. // list.
  22415. if (contentLengthHeaderValue != null) {
  22416. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22417. }
  22418. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22419. // contentLengthHeaderValue) to httpRequest’s header list.
  22420. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22421. // then:
  22422. if (contentLength != null && httpRequest.keepalive) {
  22423. // NOTE: keepalive is a noop outside of browser context.
  22424. }
  22425. // 11. If httpRequest’s referrer is a URL, then append
  22426. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22427. // to httpRequest’s header list.
  22428. if (httpRequest.referrer instanceof URL) {
  22429. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22430. }
  22431. // 12. Append a request `Origin` header for httpRequest.
  22432. appendRequestOriginHeader(httpRequest)
  22433. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22434. appendFetchMetadata(httpRequest)
  22435. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22436. // user agents should append `User-Agent`/default `User-Agent` value to
  22437. // httpRequest’s header list.
  22438. if (!httpRequest.headersList.contains('user-agent')) {
  22439. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22440. }
  22441. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22442. // list contains `If-Modified-Since`, `If-None-Match`,
  22443. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22444. // httpRequest’s cache mode to "no-store".
  22445. if (
  22446. httpRequest.cache === 'default' &&
  22447. (httpRequest.headersList.contains('if-modified-since') ||
  22448. httpRequest.headersList.contains('if-none-match') ||
  22449. httpRequest.headersList.contains('if-unmodified-since') ||
  22450. httpRequest.headersList.contains('if-match') ||
  22451. httpRequest.headersList.contains('if-range'))
  22452. ) {
  22453. httpRequest.cache = 'no-store'
  22454. }
  22455. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22456. // no-cache cache-control header modification flag is unset, and
  22457. // httpRequest’s header list does not contain `Cache-Control`, then append
  22458. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22459. if (
  22460. httpRequest.cache === 'no-cache' &&
  22461. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22462. !httpRequest.headersList.contains('cache-control')
  22463. ) {
  22464. httpRequest.headersList.append('cache-control', 'max-age=0')
  22465. }
  22466. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22467. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22468. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22469. // `Pragma`/`no-cache` to httpRequest’s header list.
  22470. if (!httpRequest.headersList.contains('pragma')) {
  22471. httpRequest.headersList.append('pragma', 'no-cache')
  22472. }
  22473. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22474. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22475. if (!httpRequest.headersList.contains('cache-control')) {
  22476. httpRequest.headersList.append('cache-control', 'no-cache')
  22477. }
  22478. }
  22479. // 18. If httpRequest’s header list contains `Range`, then append
  22480. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22481. if (httpRequest.headersList.contains('range')) {
  22482. httpRequest.headersList.append('accept-encoding', 'identity')
  22483. }
  22484. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22485. // header if httpRequest’s header list contains that header’s name.
  22486. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22487. if (!httpRequest.headersList.contains('accept-encoding')) {
  22488. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22489. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22490. } else {
  22491. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22492. }
  22493. }
  22494. httpRequest.headersList.delete('host')
  22495. // 20. If includeCredentials is true, then:
  22496. if (includeCredentials) {
  22497. // 1. If the user agent is not configured to block cookies for httpRequest
  22498. // (see section 7 of [COOKIES]), then:
  22499. // TODO: credentials
  22500. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22501. // TODO: credentials
  22502. }
  22503. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22504. // TODO: proxy-authentication
  22505. // 22. Set httpCache to the result of determining the HTTP cache
  22506. // partition, given httpRequest.
  22507. // TODO: cache
  22508. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22509. // "no-store".
  22510. if (httpCache == null) {
  22511. httpRequest.cache = 'no-store'
  22512. }
  22513. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22514. // then:
  22515. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22516. // TODO: cache
  22517. }
  22518. // 9. If aborted, then return the appropriate network error for fetchParams.
  22519. // TODO
  22520. // 10. If response is null, then:
  22521. if (response == null) {
  22522. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22523. // network error.
  22524. if (httpRequest.mode === 'only-if-cached') {
  22525. return makeNetworkError('only if cached')
  22526. }
  22527. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22528. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22529. const forwardResponse = await httpNetworkFetch(
  22530. httpFetchParams,
  22531. includeCredentials,
  22532. isNewConnectionFetch
  22533. )
  22534. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22535. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22536. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22537. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22538. if (
  22539. !safeMethodsSet.has(httpRequest.method) &&
  22540. forwardResponse.status >= 200 &&
  22541. forwardResponse.status <= 399
  22542. ) {
  22543. // TODO: cache
  22544. }
  22545. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22546. // then:
  22547. if (revalidatingFlag && forwardResponse.status === 304) {
  22548. // TODO: cache
  22549. }
  22550. // 5. If response is null, then:
  22551. if (response == null) {
  22552. // 1. Set response to forwardResponse.
  22553. response = forwardResponse
  22554. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22555. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22556. // TODO: cache
  22557. }
  22558. }
  22559. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22560. response.urlList = [...httpRequest.urlList]
  22561. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22562. // range-requested flag.
  22563. if (httpRequest.headersList.contains('range')) {
  22564. response.rangeRequested = true
  22565. }
  22566. // 13. Set response’s request-includes-credentials to includeCredentials.
  22567. response.requestIncludesCredentials = includeCredentials
  22568. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22569. // "cors", includeCredentials is true, and request’s window is an environment
  22570. // settings object, then:
  22571. // TODO
  22572. // 15. If response’s status is 407, then:
  22573. if (response.status === 407) {
  22574. // 1. If request’s window is "no-window", then return a network error.
  22575. if (request.window === 'no-window') {
  22576. return makeNetworkError()
  22577. }
  22578. // 2. ???
  22579. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22580. if (isCancelled(fetchParams)) {
  22581. return makeAppropriateNetworkError(fetchParams)
  22582. }
  22583. // 4. Prompt the end user as appropriate in request’s window and store
  22584. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22585. // TODO: Invoke some kind of callback?
  22586. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22587. // fetchParams.
  22588. // TODO
  22589. return makeNetworkError('proxy authentication required')
  22590. }
  22591. // 16. If all of the following are true
  22592. if (
  22593. // response’s status is 421
  22594. response.status === 421 &&
  22595. // isNewConnectionFetch is false
  22596. !isNewConnectionFetch &&
  22597. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22598. (request.body == null || request.body.source != null)
  22599. ) {
  22600. // then:
  22601. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22602. if (isCancelled(fetchParams)) {
  22603. return makeAppropriateNetworkError(fetchParams)
  22604. }
  22605. // 2. Set response to the result of running HTTP-network-or-cache
  22606. // fetch given fetchParams, isAuthenticationFetch, and true.
  22607. // TODO (spec): The spec doesn't specify this but we need to cancel
  22608. // the active response before we can start a new one.
  22609. // https://github.com/whatwg/fetch/issues/1293
  22610. fetchParams.controller.connection.destroy()
  22611. response = await httpNetworkOrCacheFetch(
  22612. fetchParams,
  22613. isAuthenticationFetch,
  22614. true
  22615. )
  22616. }
  22617. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22618. if (isAuthenticationFetch) {
  22619. // TODO
  22620. }
  22621. // 18. Return response.
  22622. return response
  22623. }
  22624. // https://fetch.spec.whatwg.org/#http-network-fetch
  22625. async function httpNetworkFetch (
  22626. fetchParams,
  22627. includeCredentials = false,
  22628. forceNewConnection = false
  22629. ) {
  22630. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22631. fetchParams.controller.connection = {
  22632. abort: null,
  22633. destroyed: false,
  22634. destroy (err) {
  22635. if (!this.destroyed) {
  22636. this.destroyed = true
  22637. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22638. }
  22639. }
  22640. }
  22641. // 1. Let request be fetchParams’s request.
  22642. const request = fetchParams.request
  22643. // 2. Let response be null.
  22644. let response = null
  22645. // 3. Let timingInfo be fetchParams’s timing info.
  22646. const timingInfo = fetchParams.timingInfo
  22647. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22648. // given request.
  22649. // TODO: cache
  22650. const httpCache = null
  22651. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22652. if (httpCache == null) {
  22653. request.cache = 'no-store'
  22654. }
  22655. // 6. Let networkPartitionKey be the result of determining the network
  22656. // partition key given request.
  22657. // TODO
  22658. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22659. // "no".
  22660. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22661. // 8. Switch on request’s mode:
  22662. if (request.mode === 'websocket') {
  22663. // Let connection be the result of obtaining a WebSocket connection,
  22664. // given request’s current URL.
  22665. // TODO
  22666. } else {
  22667. // Let connection be the result of obtaining a connection, given
  22668. // networkPartitionKey, request’s current URL’s origin,
  22669. // includeCredentials, and forceNewConnection.
  22670. // TODO
  22671. }
  22672. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22673. // 1. If connection is failure, then return a network error.
  22674. // 2. Set timingInfo’s final connection timing info to the result of
  22675. // calling clamp and coarsen connection timing info with connection’s
  22676. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22677. // cross-origin isolated capability.
  22678. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22679. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22680. // `chunked`) to request’s header list.
  22681. // 4. Set timingInfo’s final network-request start time to the coarsened
  22682. // shared current time given fetchParams’s cross-origin isolated
  22683. // capability.
  22684. // 5. Set response to the result of making an HTTP request over connection
  22685. // using request with the following caveats:
  22686. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22687. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22688. // - If request’s body is non-null, and request’s body’s source is null,
  22689. // then the user agent may have a buffer of up to 64 kibibytes and store
  22690. // a part of request’s body in that buffer. If the user agent reads from
  22691. // request’s body beyond that buffer’s size and the user agent needs to
  22692. // resend request, then instead return a network error.
  22693. // - Set timingInfo’s final network-response start time to the coarsened
  22694. // shared current time given fetchParams’s cross-origin isolated capability,
  22695. // immediately after the user agent’s HTTP parser receives the first byte
  22696. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22697. // line for HTTP/1.x).
  22698. // - Wait until all the headers are transmitted.
  22699. // - Any responses whose status is in the range 100 to 199, inclusive,
  22700. // and is not 101, are to be ignored, except for the purposes of setting
  22701. // timingInfo’s final network-response start time above.
  22702. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22703. // response is transferred via HTTP/1.0 or older, then return a network
  22704. // error.
  22705. // - If the HTTP request results in a TLS client certificate dialog, then:
  22706. // 1. If request’s window is an environment settings object, make the
  22707. // dialog available in request’s window.
  22708. // 2. Otherwise, return a network error.
  22709. // To transmit request’s body body, run these steps:
  22710. let requestBody = null
  22711. // 1. If body is null and fetchParams’s process request end-of-body is
  22712. // non-null, then queue a fetch task given fetchParams’s process request
  22713. // end-of-body and fetchParams’s task destination.
  22714. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22715. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22716. } else if (request.body != null) {
  22717. // 2. Otherwise, if body is non-null:
  22718. // 1. Let processBodyChunk given bytes be these steps:
  22719. const processBodyChunk = async function * (bytes) {
  22720. // 1. If the ongoing fetch is terminated, then abort these steps.
  22721. if (isCancelled(fetchParams)) {
  22722. return
  22723. }
  22724. // 2. Run this step in parallel: transmit bytes.
  22725. yield bytes
  22726. // 3. If fetchParams’s process request body is non-null, then run
  22727. // fetchParams’s process request body given bytes’s length.
  22728. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  22729. }
  22730. // 2. Let processEndOfBody be these steps:
  22731. const processEndOfBody = () => {
  22732. // 1. If fetchParams is canceled, then abort these steps.
  22733. if (isCancelled(fetchParams)) {
  22734. return
  22735. }
  22736. // 2. If fetchParams’s process request end-of-body is non-null,
  22737. // then run fetchParams’s process request end-of-body.
  22738. if (fetchParams.processRequestEndOfBody) {
  22739. fetchParams.processRequestEndOfBody()
  22740. }
  22741. }
  22742. // 3. Let processBodyError given e be these steps:
  22743. const processBodyError = (e) => {
  22744. // 1. If fetchParams is canceled, then abort these steps.
  22745. if (isCancelled(fetchParams)) {
  22746. return
  22747. }
  22748. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  22749. if (e.name === 'AbortError') {
  22750. fetchParams.controller.abort()
  22751. } else {
  22752. fetchParams.controller.terminate(e)
  22753. }
  22754. }
  22755. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  22756. // processBodyError, and fetchParams’s task destination.
  22757. requestBody = (async function * () {
  22758. try {
  22759. for await (const bytes of request.body.stream) {
  22760. yield * processBodyChunk(bytes)
  22761. }
  22762. processEndOfBody()
  22763. } catch (err) {
  22764. processBodyError(err)
  22765. }
  22766. })()
  22767. }
  22768. try {
  22769. // socket is only provided for websockets
  22770. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  22771. if (socket) {
  22772. response = makeResponse({ status, statusText, headersList, socket })
  22773. } else {
  22774. const iterator = body[Symbol.asyncIterator]()
  22775. fetchParams.controller.next = () => iterator.next()
  22776. response = makeResponse({ status, statusText, headersList })
  22777. }
  22778. } catch (err) {
  22779. // 10. If aborted, then:
  22780. if (err.name === 'AbortError') {
  22781. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22782. fetchParams.controller.connection.destroy()
  22783. // 2. Return the appropriate network error for fetchParams.
  22784. return makeAppropriateNetworkError(fetchParams, err)
  22785. }
  22786. return makeNetworkError(err)
  22787. }
  22788. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  22789. // if it is suspended.
  22790. const pullAlgorithm = () => {
  22791. fetchParams.controller.resume()
  22792. }
  22793. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  22794. // controller with reason, given reason.
  22795. const cancelAlgorithm = (reason) => {
  22796. fetchParams.controller.abort(reason)
  22797. }
  22798. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  22799. // the user agent.
  22800. // TODO
  22801. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  22802. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  22803. // TODO
  22804. // 15. Let stream be a new ReadableStream.
  22805. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  22806. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  22807. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  22808. if (!ReadableStream) {
  22809. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  22810. }
  22811. const stream = new ReadableStream(
  22812. {
  22813. async start (controller) {
  22814. fetchParams.controller.controller = controller
  22815. },
  22816. async pull (controller) {
  22817. await pullAlgorithm(controller)
  22818. },
  22819. async cancel (reason) {
  22820. await cancelAlgorithm(reason)
  22821. }
  22822. },
  22823. {
  22824. highWaterMark: 0,
  22825. size () {
  22826. return 1
  22827. }
  22828. }
  22829. )
  22830. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  22831. // 1. Set response’s body to a new body whose stream is stream.
  22832. response.body = { stream }
  22833. // 2. If response is not a network error and request’s cache mode is
  22834. // not "no-store", then update response in httpCache for request.
  22835. // TODO
  22836. // 3. If includeCredentials is true and the user agent is not configured
  22837. // to block cookies for request (see section 7 of [COOKIES]), then run the
  22838. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  22839. // the value of each header whose name is a byte-case-insensitive match for
  22840. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  22841. // TODO
  22842. // 18. If aborted, then:
  22843. // TODO
  22844. // 19. Run these steps in parallel:
  22845. // 1. Run these steps, but abort when fetchParams is canceled:
  22846. fetchParams.controller.on('terminated', onAborted)
  22847. fetchParams.controller.resume = async () => {
  22848. // 1. While true
  22849. while (true) {
  22850. // 1-3. See onData...
  22851. // 4. Set bytes to the result of handling content codings given
  22852. // codings and bytes.
  22853. let bytes
  22854. let isFailure
  22855. try {
  22856. const { done, value } = await fetchParams.controller.next()
  22857. if (isAborted(fetchParams)) {
  22858. break
  22859. }
  22860. bytes = done ? undefined : value
  22861. } catch (err) {
  22862. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  22863. // zlib doesn't like empty streams.
  22864. bytes = undefined
  22865. } else {
  22866. bytes = err
  22867. // err may be propagated from the result of calling readablestream.cancel,
  22868. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  22869. isFailure = true
  22870. }
  22871. }
  22872. if (bytes === undefined) {
  22873. // 2. Otherwise, if the bytes transmission for response’s message
  22874. // body is done normally and stream is readable, then close
  22875. // stream, finalize response for fetchParams and response, and
  22876. // abort these in-parallel steps.
  22877. readableStreamClose(fetchParams.controller.controller)
  22878. finalizeResponse(fetchParams, response)
  22879. return
  22880. }
  22881. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  22882. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  22883. // 6. If bytes is failure, then terminate fetchParams’s controller.
  22884. if (isFailure) {
  22885. fetchParams.controller.terminate(bytes)
  22886. return
  22887. }
  22888. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  22889. // into stream.
  22890. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  22891. // 8. If stream is errored, then terminate the ongoing fetch.
  22892. if (isErrored(stream)) {
  22893. fetchParams.controller.terminate()
  22894. return
  22895. }
  22896. // 9. If stream doesn’t need more data ask the user agent to suspend
  22897. // the ongoing fetch.
  22898. if (!fetchParams.controller.controller.desiredSize) {
  22899. return
  22900. }
  22901. }
  22902. }
  22903. // 2. If aborted, then:
  22904. function onAborted (reason) {
  22905. // 2. If fetchParams is aborted, then:
  22906. if (isAborted(fetchParams)) {
  22907. // 1. Set response’s aborted flag.
  22908. response.aborted = true
  22909. // 2. If stream is readable, then error stream with the result of
  22910. // deserialize a serialized abort reason given fetchParams’s
  22911. // controller’s serialized abort reason and an
  22912. // implementation-defined realm.
  22913. if (isReadable(stream)) {
  22914. fetchParams.controller.controller.error(
  22915. fetchParams.controller.serializedAbortReason
  22916. )
  22917. }
  22918. } else {
  22919. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  22920. if (isReadable(stream)) {
  22921. fetchParams.controller.controller.error(new TypeError('terminated', {
  22922. cause: isErrorLike(reason) ? reason : undefined
  22923. }))
  22924. }
  22925. }
  22926. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22927. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  22928. fetchParams.controller.connection.destroy()
  22929. }
  22930. // 20. Return response.
  22931. return response
  22932. async function dispatch ({ body }) {
  22933. const url = requestCurrentURL(request)
  22934. /** @type {import('../..').Agent} */
  22935. const agent = fetchParams.controller.dispatcher
  22936. return new Promise((resolve, reject) => agent.dispatch(
  22937. {
  22938. path: url.pathname + url.search,
  22939. origin: url.origin,
  22940. method: request.method,
  22941. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  22942. headers: request.headersList.entries,
  22943. maxRedirections: 0,
  22944. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  22945. },
  22946. {
  22947. body: null,
  22948. abort: null,
  22949. onConnect (abort) {
  22950. // TODO (fix): Do we need connection here?
  22951. const { connection } = fetchParams.controller
  22952. if (connection.destroyed) {
  22953. abort(new DOMException('The operation was aborted.', 'AbortError'))
  22954. } else {
  22955. fetchParams.controller.on('terminated', abort)
  22956. this.abort = connection.abort = abort
  22957. }
  22958. },
  22959. onHeaders (status, headersList, resume, statusText) {
  22960. if (status < 200) {
  22961. return
  22962. }
  22963. let codings = []
  22964. let location = ''
  22965. const headers = new Headers()
  22966. // For H2, the headers are a plain JS object
  22967. // We distinguish between them and iterate accordingly
  22968. if (Array.isArray(headersList)) {
  22969. for (let n = 0; n < headersList.length; n += 2) {
  22970. const key = headersList[n + 0].toString('latin1')
  22971. const val = headersList[n + 1].toString('latin1')
  22972. if (key.toLowerCase() === 'content-encoding') {
  22973. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22974. // "All content-coding values are case-insensitive..."
  22975. codings = val.toLowerCase().split(',').map((x) => x.trim())
  22976. } else if (key.toLowerCase() === 'location') {
  22977. location = val
  22978. }
  22979. headers[kHeadersList].append(key, val)
  22980. }
  22981. } else {
  22982. const keys = Object.keys(headersList)
  22983. for (const key of keys) {
  22984. const val = headersList[key]
  22985. if (key.toLowerCase() === 'content-encoding') {
  22986. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22987. // "All content-coding values are case-insensitive..."
  22988. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  22989. } else if (key.toLowerCase() === 'location') {
  22990. location = val
  22991. }
  22992. headers[kHeadersList].append(key, val)
  22993. }
  22994. }
  22995. this.body = new Readable({ read: resume })
  22996. const decoders = []
  22997. const willFollow = request.redirect === 'follow' &&
  22998. location &&
  22999. redirectStatusSet.has(status)
  23000. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23001. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23002. for (const coding of codings) {
  23003. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23004. if (coding === 'x-gzip' || coding === 'gzip') {
  23005. decoders.push(zlib.createGunzip({
  23006. // Be less strict when decoding compressed responses, since sometimes
  23007. // servers send slightly invalid responses that are still accepted
  23008. // by common browsers.
  23009. // Always using Z_SYNC_FLUSH is what cURL does.
  23010. flush: zlib.constants.Z_SYNC_FLUSH,
  23011. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23012. }))
  23013. } else if (coding === 'deflate') {
  23014. decoders.push(zlib.createInflate())
  23015. } else if (coding === 'br') {
  23016. decoders.push(zlib.createBrotliDecompress())
  23017. } else {
  23018. decoders.length = 0
  23019. break
  23020. }
  23021. }
  23022. }
  23023. resolve({
  23024. status,
  23025. statusText,
  23026. headersList: headers[kHeadersList],
  23027. body: decoders.length
  23028. ? pipeline(this.body, ...decoders, () => { })
  23029. : this.body.on('error', () => {})
  23030. })
  23031. return true
  23032. },
  23033. onData (chunk) {
  23034. if (fetchParams.controller.dump) {
  23035. return
  23036. }
  23037. // 1. If one or more bytes have been transmitted from response’s
  23038. // message body, then:
  23039. // 1. Let bytes be the transmitted bytes.
  23040. const bytes = chunk
  23041. // 2. Let codings be the result of extracting header list values
  23042. // given `Content-Encoding` and response’s header list.
  23043. // See pullAlgorithm.
  23044. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23045. timingInfo.encodedBodySize += bytes.byteLength
  23046. // 4. See pullAlgorithm...
  23047. return this.body.push(bytes)
  23048. },
  23049. onComplete () {
  23050. if (this.abort) {
  23051. fetchParams.controller.off('terminated', this.abort)
  23052. }
  23053. fetchParams.controller.ended = true
  23054. this.body.push(null)
  23055. },
  23056. onError (error) {
  23057. if (this.abort) {
  23058. fetchParams.controller.off('terminated', this.abort)
  23059. }
  23060. this.body?.destroy(error)
  23061. fetchParams.controller.terminate(error)
  23062. reject(error)
  23063. },
  23064. onUpgrade (status, headersList, socket) {
  23065. if (status !== 101) {
  23066. return
  23067. }
  23068. const headers = new Headers()
  23069. for (let n = 0; n < headersList.length; n += 2) {
  23070. const key = headersList[n + 0].toString('latin1')
  23071. const val = headersList[n + 1].toString('latin1')
  23072. headers[kHeadersList].append(key, val)
  23073. }
  23074. resolve({
  23075. status,
  23076. statusText: STATUS_CODES[status],
  23077. headersList: headers[kHeadersList],
  23078. socket
  23079. })
  23080. return true
  23081. }
  23082. }
  23083. ))
  23084. }
  23085. }
  23086. module.exports = {
  23087. fetch,
  23088. Fetch,
  23089. fetching,
  23090. finalizeAndReportTiming
  23091. }
  23092. /***/ }),
  23093. /***/ 8359:
  23094. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23095. "use strict";
  23096. /* globals AbortController */
  23097. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23098. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23099. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23100. const util = __nccwpck_require__(3983)
  23101. const {
  23102. isValidHTTPToken,
  23103. sameOrigin,
  23104. normalizeMethod,
  23105. makePolicyContainer,
  23106. normalizeMethodRecord
  23107. } = __nccwpck_require__(2538)
  23108. const {
  23109. forbiddenMethodsSet,
  23110. corsSafeListedMethodsSet,
  23111. referrerPolicy,
  23112. requestRedirect,
  23113. requestMode,
  23114. requestCredentials,
  23115. requestCache,
  23116. requestDuplex
  23117. } = __nccwpck_require__(1037)
  23118. const { kEnumerableProperty } = util
  23119. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23120. const { webidl } = __nccwpck_require__(1744)
  23121. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23122. const { URLSerializer } = __nccwpck_require__(685)
  23123. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23124. const assert = __nccwpck_require__(9491)
  23125. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23126. let TransformStream = globalThis.TransformStream
  23127. const kAbortController = Symbol('abortController')
  23128. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23129. signal.removeEventListener('abort', abort)
  23130. })
  23131. // https://fetch.spec.whatwg.org/#request-class
  23132. class Request {
  23133. // https://fetch.spec.whatwg.org/#dom-request
  23134. constructor (input, init = {}) {
  23135. if (input === kConstruct) {
  23136. return
  23137. }
  23138. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23139. input = webidl.converters.RequestInfo(input)
  23140. init = webidl.converters.RequestInit(init)
  23141. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23142. this[kRealm] = {
  23143. settingsObject: {
  23144. baseUrl: getGlobalOrigin(),
  23145. get origin () {
  23146. return this.baseUrl?.origin
  23147. },
  23148. policyContainer: makePolicyContainer()
  23149. }
  23150. }
  23151. // 1. Let request be null.
  23152. let request = null
  23153. // 2. Let fallbackMode be null.
  23154. let fallbackMode = null
  23155. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23156. const baseUrl = this[kRealm].settingsObject.baseUrl
  23157. // 4. Let signal be null.
  23158. let signal = null
  23159. // 5. If input is a string, then:
  23160. if (typeof input === 'string') {
  23161. // 1. Let parsedURL be the result of parsing input with baseURL.
  23162. // 2. If parsedURL is failure, then throw a TypeError.
  23163. let parsedURL
  23164. try {
  23165. parsedURL = new URL(input, baseUrl)
  23166. } catch (err) {
  23167. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23168. }
  23169. // 3. If parsedURL includes credentials, then throw a TypeError.
  23170. if (parsedURL.username || parsedURL.password) {
  23171. throw new TypeError(
  23172. 'Request cannot be constructed from a URL that includes credentials: ' +
  23173. input
  23174. )
  23175. }
  23176. // 4. Set request to a new request whose URL is parsedURL.
  23177. request = makeRequest({ urlList: [parsedURL] })
  23178. // 5. Set fallbackMode to "cors".
  23179. fallbackMode = 'cors'
  23180. } else {
  23181. // 6. Otherwise:
  23182. // 7. Assert: input is a Request object.
  23183. assert(input instanceof Request)
  23184. // 8. Set request to input’s request.
  23185. request = input[kState]
  23186. // 9. Set signal to input’s signal.
  23187. signal = input[kSignal]
  23188. }
  23189. // 7. Let origin be this’s relevant settings object’s origin.
  23190. const origin = this[kRealm].settingsObject.origin
  23191. // 8. Let window be "client".
  23192. let window = 'client'
  23193. // 9. If request’s window is an environment settings object and its origin
  23194. // is same origin with origin, then set window to request’s window.
  23195. if (
  23196. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23197. sameOrigin(request.window, origin)
  23198. ) {
  23199. window = request.window
  23200. }
  23201. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23202. if (init.window != null) {
  23203. throw new TypeError(`'window' option '${window}' must be null`)
  23204. }
  23205. // 11. If init["window"] exists, then set window to "no-window".
  23206. if ('window' in init) {
  23207. window = 'no-window'
  23208. }
  23209. // 12. Set request to a new request with the following properties:
  23210. request = makeRequest({
  23211. // URL request’s URL.
  23212. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23213. // method request’s method.
  23214. method: request.method,
  23215. // header list A copy of request’s header list.
  23216. // undici implementation note: headersList is cloned in makeRequest
  23217. headersList: request.headersList,
  23218. // unsafe-request flag Set.
  23219. unsafeRequest: request.unsafeRequest,
  23220. // client This’s relevant settings object.
  23221. client: this[kRealm].settingsObject,
  23222. // window window.
  23223. window,
  23224. // priority request’s priority.
  23225. priority: request.priority,
  23226. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23227. // being handled by a service worker. In this scenario a request can have an origin that is different
  23228. // from the current client.
  23229. origin: request.origin,
  23230. // referrer request’s referrer.
  23231. referrer: request.referrer,
  23232. // referrer policy request’s referrer policy.
  23233. referrerPolicy: request.referrerPolicy,
  23234. // mode request’s mode.
  23235. mode: request.mode,
  23236. // credentials mode request’s credentials mode.
  23237. credentials: request.credentials,
  23238. // cache mode request’s cache mode.
  23239. cache: request.cache,
  23240. // redirect mode request’s redirect mode.
  23241. redirect: request.redirect,
  23242. // integrity metadata request’s integrity metadata.
  23243. integrity: request.integrity,
  23244. // keepalive request’s keepalive.
  23245. keepalive: request.keepalive,
  23246. // reload-navigation flag request’s reload-navigation flag.
  23247. reloadNavigation: request.reloadNavigation,
  23248. // history-navigation flag request’s history-navigation flag.
  23249. historyNavigation: request.historyNavigation,
  23250. // URL list A clone of request’s URL list.
  23251. urlList: [...request.urlList]
  23252. })
  23253. const initHasKey = Object.keys(init).length !== 0
  23254. // 13. If init is not empty, then:
  23255. if (initHasKey) {
  23256. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23257. if (request.mode === 'navigate') {
  23258. request.mode = 'same-origin'
  23259. }
  23260. // 2. Unset request’s reload-navigation flag.
  23261. request.reloadNavigation = false
  23262. // 3. Unset request’s history-navigation flag.
  23263. request.historyNavigation = false
  23264. // 4. Set request’s origin to "client".
  23265. request.origin = 'client'
  23266. // 5. Set request’s referrer to "client"
  23267. request.referrer = 'client'
  23268. // 6. Set request’s referrer policy to the empty string.
  23269. request.referrerPolicy = ''
  23270. // 7. Set request’s URL to request’s current URL.
  23271. request.url = request.urlList[request.urlList.length - 1]
  23272. // 8. Set request’s URL list to « request’s URL ».
  23273. request.urlList = [request.url]
  23274. }
  23275. // 14. If init["referrer"] exists, then:
  23276. if (init.referrer !== undefined) {
  23277. // 1. Let referrer be init["referrer"].
  23278. const referrer = init.referrer
  23279. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23280. if (referrer === '') {
  23281. request.referrer = 'no-referrer'
  23282. } else {
  23283. // 1. Let parsedReferrer be the result of parsing referrer with
  23284. // baseURL.
  23285. // 2. If parsedReferrer is failure, then throw a TypeError.
  23286. let parsedReferrer
  23287. try {
  23288. parsedReferrer = new URL(referrer, baseUrl)
  23289. } catch (err) {
  23290. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23291. }
  23292. // 3. If one of the following is true
  23293. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23294. // - parsedReferrer’s origin is not same origin with origin
  23295. // then set request’s referrer to "client".
  23296. if (
  23297. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23298. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23299. ) {
  23300. request.referrer = 'client'
  23301. } else {
  23302. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23303. request.referrer = parsedReferrer
  23304. }
  23305. }
  23306. }
  23307. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23308. // to it.
  23309. if (init.referrerPolicy !== undefined) {
  23310. request.referrerPolicy = init.referrerPolicy
  23311. }
  23312. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23313. let mode
  23314. if (init.mode !== undefined) {
  23315. mode = init.mode
  23316. } else {
  23317. mode = fallbackMode
  23318. }
  23319. // 17. If mode is "navigate", then throw a TypeError.
  23320. if (mode === 'navigate') {
  23321. throw webidl.errors.exception({
  23322. header: 'Request constructor',
  23323. message: 'invalid request mode navigate.'
  23324. })
  23325. }
  23326. // 18. If mode is non-null, set request’s mode to mode.
  23327. if (mode != null) {
  23328. request.mode = mode
  23329. }
  23330. // 19. If init["credentials"] exists, then set request’s credentials mode
  23331. // to it.
  23332. if (init.credentials !== undefined) {
  23333. request.credentials = init.credentials
  23334. }
  23335. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23336. if (init.cache !== undefined) {
  23337. request.cache = init.cache
  23338. }
  23339. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23340. // not "same-origin", then throw a TypeError.
  23341. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23342. throw new TypeError(
  23343. "'only-if-cached' can be set only with 'same-origin' mode"
  23344. )
  23345. }
  23346. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23347. if (init.redirect !== undefined) {
  23348. request.redirect = init.redirect
  23349. }
  23350. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23351. if (init.integrity != null) {
  23352. request.integrity = String(init.integrity)
  23353. }
  23354. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23355. if (init.keepalive !== undefined) {
  23356. request.keepalive = Boolean(init.keepalive)
  23357. }
  23358. // 25. If init["method"] exists, then:
  23359. if (init.method !== undefined) {
  23360. // 1. Let method be init["method"].
  23361. let method = init.method
  23362. // 2. If method is not a method or method is a forbidden method, then
  23363. // throw a TypeError.
  23364. if (!isValidHTTPToken(method)) {
  23365. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23366. }
  23367. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23368. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23369. }
  23370. // 3. Normalize method.
  23371. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23372. // 4. Set request’s method to method.
  23373. request.method = method
  23374. }
  23375. // 26. If init["signal"] exists, then set signal to it.
  23376. if (init.signal !== undefined) {
  23377. signal = init.signal
  23378. }
  23379. // 27. Set this’s request to request.
  23380. this[kState] = request
  23381. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23382. // Realm.
  23383. // TODO: could this be simplified with AbortSignal.any
  23384. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23385. const ac = new AbortController()
  23386. this[kSignal] = ac.signal
  23387. this[kSignal][kRealm] = this[kRealm]
  23388. // 29. If signal is not null, then make this’s signal follow signal.
  23389. if (signal != null) {
  23390. if (
  23391. !signal ||
  23392. typeof signal.aborted !== 'boolean' ||
  23393. typeof signal.addEventListener !== 'function'
  23394. ) {
  23395. throw new TypeError(
  23396. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23397. )
  23398. }
  23399. if (signal.aborted) {
  23400. ac.abort(signal.reason)
  23401. } else {
  23402. // Keep a strong ref to ac while request object
  23403. // is alive. This is needed to prevent AbortController
  23404. // from being prematurely garbage collected.
  23405. // See, https://github.com/nodejs/undici/issues/1926.
  23406. this[kAbortController] = ac
  23407. const acRef = new WeakRef(ac)
  23408. const abort = function () {
  23409. const ac = acRef.deref()
  23410. if (ac !== undefined) {
  23411. ac.abort(this.reason)
  23412. }
  23413. }
  23414. // Third-party AbortControllers may not work with these.
  23415. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23416. try {
  23417. // If the max amount of listeners is equal to the default, increase it
  23418. // This is only available in node >= v19.9.0
  23419. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23420. setMaxListeners(100, signal)
  23421. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23422. setMaxListeners(100, signal)
  23423. }
  23424. } catch {}
  23425. util.addAbortListener(signal, abort)
  23426. requestFinalizer.register(ac, { signal, abort })
  23427. }
  23428. }
  23429. // 30. Set this’s headers to a new Headers object with this’s relevant
  23430. // Realm, whose header list is request’s header list and guard is
  23431. // "request".
  23432. this[kHeaders] = new Headers(kConstruct)
  23433. this[kHeaders][kHeadersList] = request.headersList
  23434. this[kHeaders][kGuard] = 'request'
  23435. this[kHeaders][kRealm] = this[kRealm]
  23436. // 31. If this’s request’s mode is "no-cors", then:
  23437. if (mode === 'no-cors') {
  23438. // 1. If this’s request’s method is not a CORS-safelisted method,
  23439. // then throw a TypeError.
  23440. if (!corsSafeListedMethodsSet.has(request.method)) {
  23441. throw new TypeError(
  23442. `'${request.method} is unsupported in no-cors mode.`
  23443. )
  23444. }
  23445. // 2. Set this’s headers’s guard to "request-no-cors".
  23446. this[kHeaders][kGuard] = 'request-no-cors'
  23447. }
  23448. // 32. If init is not empty, then:
  23449. if (initHasKey) {
  23450. /** @type {HeadersList} */
  23451. const headersList = this[kHeaders][kHeadersList]
  23452. // 1. Let headers be a copy of this’s headers and its associated header
  23453. // list.
  23454. // 2. If init["headers"] exists, then set headers to init["headers"].
  23455. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23456. // 3. Empty this’s headers’s header list.
  23457. headersList.clear()
  23458. // 4. If headers is a Headers object, then for each header in its header
  23459. // list, append header’s name/header’s value to this’s headers.
  23460. if (headers instanceof HeadersList) {
  23461. for (const [key, val] of headers) {
  23462. headersList.append(key, val)
  23463. }
  23464. // Note: Copy the `set-cookie` meta-data.
  23465. headersList.cookies = headers.cookies
  23466. } else {
  23467. // 5. Otherwise, fill this’s headers with headers.
  23468. fillHeaders(this[kHeaders], headers)
  23469. }
  23470. }
  23471. // 33. Let inputBody be input’s request’s body if input is a Request
  23472. // object; otherwise null.
  23473. const inputBody = input instanceof Request ? input[kState].body : null
  23474. // 34. If either init["body"] exists and is non-null or inputBody is
  23475. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23476. // TypeError.
  23477. if (
  23478. (init.body != null || inputBody != null) &&
  23479. (request.method === 'GET' || request.method === 'HEAD')
  23480. ) {
  23481. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23482. }
  23483. // 35. Let initBody be null.
  23484. let initBody = null
  23485. // 36. If init["body"] exists and is non-null, then:
  23486. if (init.body != null) {
  23487. // 1. Let Content-Type be null.
  23488. // 2. Set initBody and Content-Type to the result of extracting
  23489. // init["body"], with keepalive set to request’s keepalive.
  23490. const [extractedBody, contentType] = extractBody(
  23491. init.body,
  23492. request.keepalive
  23493. )
  23494. initBody = extractedBody
  23495. // 3, If Content-Type is non-null and this’s headers’s header list does
  23496. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23497. // this’s headers.
  23498. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23499. this[kHeaders].append('content-type', contentType)
  23500. }
  23501. }
  23502. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23503. // inputBody.
  23504. const inputOrInitBody = initBody ?? inputBody
  23505. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23506. // null, then:
  23507. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23508. // 1. If initBody is non-null and init["duplex"] does not exist,
  23509. // then throw a TypeError.
  23510. if (initBody != null && init.duplex == null) {
  23511. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23512. }
  23513. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23514. // then throw a TypeError.
  23515. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23516. throw new TypeError(
  23517. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23518. )
  23519. }
  23520. // 3. Set this’s request’s use-CORS-preflight flag.
  23521. request.useCORSPreflightFlag = true
  23522. }
  23523. // 39. Let finalBody be inputOrInitBody.
  23524. let finalBody = inputOrInitBody
  23525. // 40. If initBody is null and inputBody is non-null, then:
  23526. if (initBody == null && inputBody != null) {
  23527. // 1. If input is unusable, then throw a TypeError.
  23528. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23529. throw new TypeError(
  23530. 'Cannot construct a Request with a Request object that has already been used.'
  23531. )
  23532. }
  23533. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23534. if (!TransformStream) {
  23535. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23536. }
  23537. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23538. const identityTransform = new TransformStream()
  23539. inputBody.stream.pipeThrough(identityTransform)
  23540. finalBody = {
  23541. source: inputBody.source,
  23542. length: inputBody.length,
  23543. stream: identityTransform.readable
  23544. }
  23545. }
  23546. // 41. Set this’s request’s body to finalBody.
  23547. this[kState].body = finalBody
  23548. }
  23549. // Returns request’s HTTP method, which is "GET" by default.
  23550. get method () {
  23551. webidl.brandCheck(this, Request)
  23552. // The method getter steps are to return this’s request’s method.
  23553. return this[kState].method
  23554. }
  23555. // Returns the URL of request as a string.
  23556. get url () {
  23557. webidl.brandCheck(this, Request)
  23558. // The url getter steps are to return this’s request’s URL, serialized.
  23559. return URLSerializer(this[kState].url)
  23560. }
  23561. // Returns a Headers object consisting of the headers associated with request.
  23562. // Note that headers added in the network layer by the user agent will not
  23563. // be accounted for in this object, e.g., the "Host" header.
  23564. get headers () {
  23565. webidl.brandCheck(this, Request)
  23566. // The headers getter steps are to return this’s headers.
  23567. return this[kHeaders]
  23568. }
  23569. // Returns the kind of resource requested by request, e.g., "document"
  23570. // or "script".
  23571. get destination () {
  23572. webidl.brandCheck(this, Request)
  23573. // The destination getter are to return this’s request’s destination.
  23574. return this[kState].destination
  23575. }
  23576. // Returns the referrer of request. Its value can be a same-origin URL if
  23577. // explicitly set in init, the empty string to indicate no referrer, and
  23578. // "about:client" when defaulting to the global’s default. This is used
  23579. // during fetching to determine the value of the `Referer` header of the
  23580. // request being made.
  23581. get referrer () {
  23582. webidl.brandCheck(this, Request)
  23583. // 1. If this’s request’s referrer is "no-referrer", then return the
  23584. // empty string.
  23585. if (this[kState].referrer === 'no-referrer') {
  23586. return ''
  23587. }
  23588. // 2. If this’s request’s referrer is "client", then return
  23589. // "about:client".
  23590. if (this[kState].referrer === 'client') {
  23591. return 'about:client'
  23592. }
  23593. // Return this’s request’s referrer, serialized.
  23594. return this[kState].referrer.toString()
  23595. }
  23596. // Returns the referrer policy associated with request.
  23597. // This is used during fetching to compute the value of the request’s
  23598. // referrer.
  23599. get referrerPolicy () {
  23600. webidl.brandCheck(this, Request)
  23601. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23602. return this[kState].referrerPolicy
  23603. }
  23604. // Returns the mode associated with request, which is a string indicating
  23605. // whether the request will use CORS, or will be restricted to same-origin
  23606. // URLs.
  23607. get mode () {
  23608. webidl.brandCheck(this, Request)
  23609. // The mode getter steps are to return this’s request’s mode.
  23610. return this[kState].mode
  23611. }
  23612. // Returns the credentials mode associated with request,
  23613. // which is a string indicating whether credentials will be sent with the
  23614. // request always, never, or only when sent to a same-origin URL.
  23615. get credentials () {
  23616. // The credentials getter steps are to return this’s request’s credentials mode.
  23617. return this[kState].credentials
  23618. }
  23619. // Returns the cache mode associated with request,
  23620. // which is a string indicating how the request will
  23621. // interact with the browser’s cache when fetching.
  23622. get cache () {
  23623. webidl.brandCheck(this, Request)
  23624. // The cache getter steps are to return this’s request’s cache mode.
  23625. return this[kState].cache
  23626. }
  23627. // Returns the redirect mode associated with request,
  23628. // which is a string indicating how redirects for the
  23629. // request will be handled during fetching. A request
  23630. // will follow redirects by default.
  23631. get redirect () {
  23632. webidl.brandCheck(this, Request)
  23633. // The redirect getter steps are to return this’s request’s redirect mode.
  23634. return this[kState].redirect
  23635. }
  23636. // Returns request’s subresource integrity metadata, which is a
  23637. // cryptographic hash of the resource being fetched. Its value
  23638. // consists of multiple hashes separated by whitespace. [SRI]
  23639. get integrity () {
  23640. webidl.brandCheck(this, Request)
  23641. // The integrity getter steps are to return this’s request’s integrity
  23642. // metadata.
  23643. return this[kState].integrity
  23644. }
  23645. // Returns a boolean indicating whether or not request can outlive the
  23646. // global in which it was created.
  23647. get keepalive () {
  23648. webidl.brandCheck(this, Request)
  23649. // The keepalive getter steps are to return this’s request’s keepalive.
  23650. return this[kState].keepalive
  23651. }
  23652. // Returns a boolean indicating whether or not request is for a reload
  23653. // navigation.
  23654. get isReloadNavigation () {
  23655. webidl.brandCheck(this, Request)
  23656. // The isReloadNavigation getter steps are to return true if this’s
  23657. // request’s reload-navigation flag is set; otherwise false.
  23658. return this[kState].reloadNavigation
  23659. }
  23660. // Returns a boolean indicating whether or not request is for a history
  23661. // navigation (a.k.a. back-foward navigation).
  23662. get isHistoryNavigation () {
  23663. webidl.brandCheck(this, Request)
  23664. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23665. // history-navigation flag is set; otherwise false.
  23666. return this[kState].historyNavigation
  23667. }
  23668. // Returns the signal associated with request, which is an AbortSignal
  23669. // object indicating whether or not request has been aborted, and its
  23670. // abort event handler.
  23671. get signal () {
  23672. webidl.brandCheck(this, Request)
  23673. // The signal getter steps are to return this’s signal.
  23674. return this[kSignal]
  23675. }
  23676. get body () {
  23677. webidl.brandCheck(this, Request)
  23678. return this[kState].body ? this[kState].body.stream : null
  23679. }
  23680. get bodyUsed () {
  23681. webidl.brandCheck(this, Request)
  23682. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23683. }
  23684. get duplex () {
  23685. webidl.brandCheck(this, Request)
  23686. return 'half'
  23687. }
  23688. // Returns a clone of request.
  23689. clone () {
  23690. webidl.brandCheck(this, Request)
  23691. // 1. If this is unusable, then throw a TypeError.
  23692. if (this.bodyUsed || this.body?.locked) {
  23693. throw new TypeError('unusable')
  23694. }
  23695. // 2. Let clonedRequest be the result of cloning this’s request.
  23696. const clonedRequest = cloneRequest(this[kState])
  23697. // 3. Let clonedRequestObject be the result of creating a Request object,
  23698. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23699. const clonedRequestObject = new Request(kConstruct)
  23700. clonedRequestObject[kState] = clonedRequest
  23701. clonedRequestObject[kRealm] = this[kRealm]
  23702. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23703. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23704. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23705. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23706. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23707. const ac = new AbortController()
  23708. if (this.signal.aborted) {
  23709. ac.abort(this.signal.reason)
  23710. } else {
  23711. util.addAbortListener(
  23712. this.signal,
  23713. () => {
  23714. ac.abort(this.signal.reason)
  23715. }
  23716. )
  23717. }
  23718. clonedRequestObject[kSignal] = ac.signal
  23719. // 4. Return clonedRequestObject.
  23720. return clonedRequestObject
  23721. }
  23722. }
  23723. mixinBody(Request)
  23724. function makeRequest (init) {
  23725. // https://fetch.spec.whatwg.org/#requests
  23726. const request = {
  23727. method: 'GET',
  23728. localURLsOnly: false,
  23729. unsafeRequest: false,
  23730. body: null,
  23731. client: null,
  23732. reservedClient: null,
  23733. replacesClientId: '',
  23734. window: 'client',
  23735. keepalive: false,
  23736. serviceWorkers: 'all',
  23737. initiator: '',
  23738. destination: '',
  23739. priority: null,
  23740. origin: 'client',
  23741. policyContainer: 'client',
  23742. referrer: 'client',
  23743. referrerPolicy: '',
  23744. mode: 'no-cors',
  23745. useCORSPreflightFlag: false,
  23746. credentials: 'same-origin',
  23747. useCredentials: false,
  23748. cache: 'default',
  23749. redirect: 'follow',
  23750. integrity: '',
  23751. cryptoGraphicsNonceMetadata: '',
  23752. parserMetadata: '',
  23753. reloadNavigation: false,
  23754. historyNavigation: false,
  23755. userActivation: false,
  23756. taintedOrigin: false,
  23757. redirectCount: 0,
  23758. responseTainting: 'basic',
  23759. preventNoCacheCacheControlHeaderModification: false,
  23760. done: false,
  23761. timingAllowFailed: false,
  23762. ...init,
  23763. headersList: init.headersList
  23764. ? new HeadersList(init.headersList)
  23765. : new HeadersList()
  23766. }
  23767. request.url = request.urlList[0]
  23768. return request
  23769. }
  23770. // https://fetch.spec.whatwg.org/#concept-request-clone
  23771. function cloneRequest (request) {
  23772. // To clone a request request, run these steps:
  23773. // 1. Let newRequest be a copy of request, except for its body.
  23774. const newRequest = makeRequest({ ...request, body: null })
  23775. // 2. If request’s body is non-null, set newRequest’s body to the
  23776. // result of cloning request’s body.
  23777. if (request.body != null) {
  23778. newRequest.body = cloneBody(request.body)
  23779. }
  23780. // 3. Return newRequest.
  23781. return newRequest
  23782. }
  23783. Object.defineProperties(Request.prototype, {
  23784. method: kEnumerableProperty,
  23785. url: kEnumerableProperty,
  23786. headers: kEnumerableProperty,
  23787. redirect: kEnumerableProperty,
  23788. clone: kEnumerableProperty,
  23789. signal: kEnumerableProperty,
  23790. duplex: kEnumerableProperty,
  23791. destination: kEnumerableProperty,
  23792. body: kEnumerableProperty,
  23793. bodyUsed: kEnumerableProperty,
  23794. isHistoryNavigation: kEnumerableProperty,
  23795. isReloadNavigation: kEnumerableProperty,
  23796. keepalive: kEnumerableProperty,
  23797. integrity: kEnumerableProperty,
  23798. cache: kEnumerableProperty,
  23799. credentials: kEnumerableProperty,
  23800. attribute: kEnumerableProperty,
  23801. referrerPolicy: kEnumerableProperty,
  23802. referrer: kEnumerableProperty,
  23803. mode: kEnumerableProperty,
  23804. [Symbol.toStringTag]: {
  23805. value: 'Request',
  23806. configurable: true
  23807. }
  23808. })
  23809. webidl.converters.Request = webidl.interfaceConverter(
  23810. Request
  23811. )
  23812. // https://fetch.spec.whatwg.org/#requestinfo
  23813. webidl.converters.RequestInfo = function (V) {
  23814. if (typeof V === 'string') {
  23815. return webidl.converters.USVString(V)
  23816. }
  23817. if (V instanceof Request) {
  23818. return webidl.converters.Request(V)
  23819. }
  23820. return webidl.converters.USVString(V)
  23821. }
  23822. webidl.converters.AbortSignal = webidl.interfaceConverter(
  23823. AbortSignal
  23824. )
  23825. // https://fetch.spec.whatwg.org/#requestinit
  23826. webidl.converters.RequestInit = webidl.dictionaryConverter([
  23827. {
  23828. key: 'method',
  23829. converter: webidl.converters.ByteString
  23830. },
  23831. {
  23832. key: 'headers',
  23833. converter: webidl.converters.HeadersInit
  23834. },
  23835. {
  23836. key: 'body',
  23837. converter: webidl.nullableConverter(
  23838. webidl.converters.BodyInit
  23839. )
  23840. },
  23841. {
  23842. key: 'referrer',
  23843. converter: webidl.converters.USVString
  23844. },
  23845. {
  23846. key: 'referrerPolicy',
  23847. converter: webidl.converters.DOMString,
  23848. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  23849. allowedValues: referrerPolicy
  23850. },
  23851. {
  23852. key: 'mode',
  23853. converter: webidl.converters.DOMString,
  23854. // https://fetch.spec.whatwg.org/#concept-request-mode
  23855. allowedValues: requestMode
  23856. },
  23857. {
  23858. key: 'credentials',
  23859. converter: webidl.converters.DOMString,
  23860. // https://fetch.spec.whatwg.org/#requestcredentials
  23861. allowedValues: requestCredentials
  23862. },
  23863. {
  23864. key: 'cache',
  23865. converter: webidl.converters.DOMString,
  23866. // https://fetch.spec.whatwg.org/#requestcache
  23867. allowedValues: requestCache
  23868. },
  23869. {
  23870. key: 'redirect',
  23871. converter: webidl.converters.DOMString,
  23872. // https://fetch.spec.whatwg.org/#requestredirect
  23873. allowedValues: requestRedirect
  23874. },
  23875. {
  23876. key: 'integrity',
  23877. converter: webidl.converters.DOMString
  23878. },
  23879. {
  23880. key: 'keepalive',
  23881. converter: webidl.converters.boolean
  23882. },
  23883. {
  23884. key: 'signal',
  23885. converter: webidl.nullableConverter(
  23886. (signal) => webidl.converters.AbortSignal(
  23887. signal,
  23888. { strict: false }
  23889. )
  23890. )
  23891. },
  23892. {
  23893. key: 'window',
  23894. converter: webidl.converters.any
  23895. },
  23896. {
  23897. key: 'duplex',
  23898. converter: webidl.converters.DOMString,
  23899. allowedValues: requestDuplex
  23900. }
  23901. ])
  23902. module.exports = { Request, makeRequest }
  23903. /***/ }),
  23904. /***/ 7823:
  23905. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23906. "use strict";
  23907. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  23908. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  23909. const util = __nccwpck_require__(3983)
  23910. const { kEnumerableProperty } = util
  23911. const {
  23912. isValidReasonPhrase,
  23913. isCancelled,
  23914. isAborted,
  23915. isBlobLike,
  23916. serializeJavascriptValueToJSONString,
  23917. isErrorLike,
  23918. isomorphicEncode
  23919. } = __nccwpck_require__(2538)
  23920. const {
  23921. redirectStatusSet,
  23922. nullBodyStatus,
  23923. DOMException
  23924. } = __nccwpck_require__(1037)
  23925. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  23926. const { webidl } = __nccwpck_require__(1744)
  23927. const { FormData } = __nccwpck_require__(2015)
  23928. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23929. const { URLSerializer } = __nccwpck_require__(685)
  23930. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23931. const assert = __nccwpck_require__(9491)
  23932. const { types } = __nccwpck_require__(3837)
  23933. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  23934. const textEncoder = new TextEncoder('utf-8')
  23935. // https://fetch.spec.whatwg.org/#response-class
  23936. class Response {
  23937. // Creates network error Response.
  23938. static error () {
  23939. // TODO
  23940. const relevantRealm = { settingsObject: {} }
  23941. // The static error() method steps are to return the result of creating a
  23942. // Response object, given a new network error, "immutable", and this’s
  23943. // relevant Realm.
  23944. const responseObject = new Response()
  23945. responseObject[kState] = makeNetworkError()
  23946. responseObject[kRealm] = relevantRealm
  23947. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  23948. responseObject[kHeaders][kGuard] = 'immutable'
  23949. responseObject[kHeaders][kRealm] = relevantRealm
  23950. return responseObject
  23951. }
  23952. // https://fetch.spec.whatwg.org/#dom-response-json
  23953. static json (data, init = {}) {
  23954. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  23955. if (init !== null) {
  23956. init = webidl.converters.ResponseInit(init)
  23957. }
  23958. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  23959. const bytes = textEncoder.encode(
  23960. serializeJavascriptValueToJSONString(data)
  23961. )
  23962. // 2. Let body be the result of extracting bytes.
  23963. const body = extractBody(bytes)
  23964. // 3. Let responseObject be the result of creating a Response object, given a new response,
  23965. // "response", and this’s relevant Realm.
  23966. const relevantRealm = { settingsObject: {} }
  23967. const responseObject = new Response()
  23968. responseObject[kRealm] = relevantRealm
  23969. responseObject[kHeaders][kGuard] = 'response'
  23970. responseObject[kHeaders][kRealm] = relevantRealm
  23971. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  23972. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  23973. // 5. Return responseObject.
  23974. return responseObject
  23975. }
  23976. // Creates a redirect Response that redirects to url with status status.
  23977. static redirect (url, status = 302) {
  23978. const relevantRealm = { settingsObject: {} }
  23979. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  23980. url = webidl.converters.USVString(url)
  23981. status = webidl.converters['unsigned short'](status)
  23982. // 1. Let parsedURL be the result of parsing url with current settings
  23983. // object’s API base URL.
  23984. // 2. If parsedURL is failure, then throw a TypeError.
  23985. // TODO: base-URL?
  23986. let parsedURL
  23987. try {
  23988. parsedURL = new URL(url, getGlobalOrigin())
  23989. } catch (err) {
  23990. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  23991. cause: err
  23992. })
  23993. }
  23994. // 3. If status is not a redirect status, then throw a RangeError.
  23995. if (!redirectStatusSet.has(status)) {
  23996. throw new RangeError('Invalid status code ' + status)
  23997. }
  23998. // 4. Let responseObject be the result of creating a Response object,
  23999. // given a new response, "immutable", and this’s relevant Realm.
  24000. const responseObject = new Response()
  24001. responseObject[kRealm] = relevantRealm
  24002. responseObject[kHeaders][kGuard] = 'immutable'
  24003. responseObject[kHeaders][kRealm] = relevantRealm
  24004. // 5. Set responseObject’s response’s status to status.
  24005. responseObject[kState].status = status
  24006. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24007. const value = isomorphicEncode(URLSerializer(parsedURL))
  24008. // 7. Append `Location`/value to responseObject’s response’s header list.
  24009. responseObject[kState].headersList.append('location', value)
  24010. // 8. Return responseObject.
  24011. return responseObject
  24012. }
  24013. // https://fetch.spec.whatwg.org/#dom-response
  24014. constructor (body = null, init = {}) {
  24015. if (body !== null) {
  24016. body = webidl.converters.BodyInit(body)
  24017. }
  24018. init = webidl.converters.ResponseInit(init)
  24019. // TODO
  24020. this[kRealm] = { settingsObject: {} }
  24021. // 1. Set this’s response to a new response.
  24022. this[kState] = makeResponse({})
  24023. // 2. Set this’s headers to a new Headers object with this’s relevant
  24024. // Realm, whose header list is this’s response’s header list and guard
  24025. // is "response".
  24026. this[kHeaders] = new Headers(kConstruct)
  24027. this[kHeaders][kGuard] = 'response'
  24028. this[kHeaders][kHeadersList] = this[kState].headersList
  24029. this[kHeaders][kRealm] = this[kRealm]
  24030. // 3. Let bodyWithType be null.
  24031. let bodyWithType = null
  24032. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24033. if (body != null) {
  24034. const [extractedBody, type] = extractBody(body)
  24035. bodyWithType = { body: extractedBody, type }
  24036. }
  24037. // 5. Perform initialize a response given this, init, and bodyWithType.
  24038. initializeResponse(this, init, bodyWithType)
  24039. }
  24040. // Returns response’s type, e.g., "cors".
  24041. get type () {
  24042. webidl.brandCheck(this, Response)
  24043. // The type getter steps are to return this’s response’s type.
  24044. return this[kState].type
  24045. }
  24046. // Returns response’s URL, if it has one; otherwise the empty string.
  24047. get url () {
  24048. webidl.brandCheck(this, Response)
  24049. const urlList = this[kState].urlList
  24050. // The url getter steps are to return the empty string if this’s
  24051. // response’s URL is null; otherwise this’s response’s URL,
  24052. // serialized with exclude fragment set to true.
  24053. const url = urlList[urlList.length - 1] ?? null
  24054. if (url === null) {
  24055. return ''
  24056. }
  24057. return URLSerializer(url, true)
  24058. }
  24059. // Returns whether response was obtained through a redirect.
  24060. get redirected () {
  24061. webidl.brandCheck(this, Response)
  24062. // The redirected getter steps are to return true if this’s response’s URL
  24063. // list has more than one item; otherwise false.
  24064. return this[kState].urlList.length > 1
  24065. }
  24066. // Returns response’s status.
  24067. get status () {
  24068. webidl.brandCheck(this, Response)
  24069. // The status getter steps are to return this’s response’s status.
  24070. return this[kState].status
  24071. }
  24072. // Returns whether response’s status is an ok status.
  24073. get ok () {
  24074. webidl.brandCheck(this, Response)
  24075. // The ok getter steps are to return true if this’s response’s status is an
  24076. // ok status; otherwise false.
  24077. return this[kState].status >= 200 && this[kState].status <= 299
  24078. }
  24079. // Returns response’s status message.
  24080. get statusText () {
  24081. webidl.brandCheck(this, Response)
  24082. // The statusText getter steps are to return this’s response’s status
  24083. // message.
  24084. return this[kState].statusText
  24085. }
  24086. // Returns response’s headers as Headers.
  24087. get headers () {
  24088. webidl.brandCheck(this, Response)
  24089. // The headers getter steps are to return this’s headers.
  24090. return this[kHeaders]
  24091. }
  24092. get body () {
  24093. webidl.brandCheck(this, Response)
  24094. return this[kState].body ? this[kState].body.stream : null
  24095. }
  24096. get bodyUsed () {
  24097. webidl.brandCheck(this, Response)
  24098. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24099. }
  24100. // Returns a clone of response.
  24101. clone () {
  24102. webidl.brandCheck(this, Response)
  24103. // 1. If this is unusable, then throw a TypeError.
  24104. if (this.bodyUsed || (this.body && this.body.locked)) {
  24105. throw webidl.errors.exception({
  24106. header: 'Response.clone',
  24107. message: 'Body has already been consumed.'
  24108. })
  24109. }
  24110. // 2. Let clonedResponse be the result of cloning this’s response.
  24111. const clonedResponse = cloneResponse(this[kState])
  24112. // 3. Return the result of creating a Response object, given
  24113. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24114. const clonedResponseObject = new Response()
  24115. clonedResponseObject[kState] = clonedResponse
  24116. clonedResponseObject[kRealm] = this[kRealm]
  24117. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24118. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24119. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24120. return clonedResponseObject
  24121. }
  24122. }
  24123. mixinBody(Response)
  24124. Object.defineProperties(Response.prototype, {
  24125. type: kEnumerableProperty,
  24126. url: kEnumerableProperty,
  24127. status: kEnumerableProperty,
  24128. ok: kEnumerableProperty,
  24129. redirected: kEnumerableProperty,
  24130. statusText: kEnumerableProperty,
  24131. headers: kEnumerableProperty,
  24132. clone: kEnumerableProperty,
  24133. body: kEnumerableProperty,
  24134. bodyUsed: kEnumerableProperty,
  24135. [Symbol.toStringTag]: {
  24136. value: 'Response',
  24137. configurable: true
  24138. }
  24139. })
  24140. Object.defineProperties(Response, {
  24141. json: kEnumerableProperty,
  24142. redirect: kEnumerableProperty,
  24143. error: kEnumerableProperty
  24144. })
  24145. // https://fetch.spec.whatwg.org/#concept-response-clone
  24146. function cloneResponse (response) {
  24147. // To clone a response response, run these steps:
  24148. // 1. If response is a filtered response, then return a new identical
  24149. // filtered response whose internal response is a clone of response’s
  24150. // internal response.
  24151. if (response.internalResponse) {
  24152. return filterResponse(
  24153. cloneResponse(response.internalResponse),
  24154. response.type
  24155. )
  24156. }
  24157. // 2. Let newResponse be a copy of response, except for its body.
  24158. const newResponse = makeResponse({ ...response, body: null })
  24159. // 3. If response’s body is non-null, then set newResponse’s body to the
  24160. // result of cloning response’s body.
  24161. if (response.body != null) {
  24162. newResponse.body = cloneBody(response.body)
  24163. }
  24164. // 4. Return newResponse.
  24165. return newResponse
  24166. }
  24167. function makeResponse (init) {
  24168. return {
  24169. aborted: false,
  24170. rangeRequested: false,
  24171. timingAllowPassed: false,
  24172. requestIncludesCredentials: false,
  24173. type: 'default',
  24174. status: 200,
  24175. timingInfo: null,
  24176. cacheState: '',
  24177. statusText: '',
  24178. ...init,
  24179. headersList: init.headersList
  24180. ? new HeadersList(init.headersList)
  24181. : new HeadersList(),
  24182. urlList: init.urlList ? [...init.urlList] : []
  24183. }
  24184. }
  24185. function makeNetworkError (reason) {
  24186. const isError = isErrorLike(reason)
  24187. return makeResponse({
  24188. type: 'error',
  24189. status: 0,
  24190. error: isError
  24191. ? reason
  24192. : new Error(reason ? String(reason) : reason),
  24193. aborted: reason && reason.name === 'AbortError'
  24194. })
  24195. }
  24196. function makeFilteredResponse (response, state) {
  24197. state = {
  24198. internalResponse: response,
  24199. ...state
  24200. }
  24201. return new Proxy(response, {
  24202. get (target, p) {
  24203. return p in state ? state[p] : target[p]
  24204. },
  24205. set (target, p, value) {
  24206. assert(!(p in state))
  24207. target[p] = value
  24208. return true
  24209. }
  24210. })
  24211. }
  24212. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24213. function filterResponse (response, type) {
  24214. // Set response to the following filtered response with response as its
  24215. // internal response, depending on request’s response tainting:
  24216. if (type === 'basic') {
  24217. // A basic filtered response is a filtered response whose type is "basic"
  24218. // and header list excludes any headers in internal response’s header list
  24219. // whose name is a forbidden response-header name.
  24220. // Note: undici does not implement forbidden response-header names
  24221. return makeFilteredResponse(response, {
  24222. type: 'basic',
  24223. headersList: response.headersList
  24224. })
  24225. } else if (type === 'cors') {
  24226. // A CORS filtered response is a filtered response whose type is "cors"
  24227. // and header list excludes any headers in internal response’s header
  24228. // list whose name is not a CORS-safelisted response-header name, given
  24229. // internal response’s CORS-exposed header-name list.
  24230. // Note: undici does not implement CORS-safelisted response-header names
  24231. return makeFilteredResponse(response, {
  24232. type: 'cors',
  24233. headersList: response.headersList
  24234. })
  24235. } else if (type === 'opaque') {
  24236. // An opaque filtered response is a filtered response whose type is
  24237. // "opaque", URL list is the empty list, status is 0, status message
  24238. // is the empty byte sequence, header list is empty, and body is null.
  24239. return makeFilteredResponse(response, {
  24240. type: 'opaque',
  24241. urlList: Object.freeze([]),
  24242. status: 0,
  24243. statusText: '',
  24244. body: null
  24245. })
  24246. } else if (type === 'opaqueredirect') {
  24247. // An opaque-redirect filtered response is a filtered response whose type
  24248. // is "opaqueredirect", status is 0, status message is the empty byte
  24249. // sequence, header list is empty, and body is null.
  24250. return makeFilteredResponse(response, {
  24251. type: 'opaqueredirect',
  24252. status: 0,
  24253. statusText: '',
  24254. headersList: [],
  24255. body: null
  24256. })
  24257. } else {
  24258. assert(false)
  24259. }
  24260. }
  24261. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24262. function makeAppropriateNetworkError (fetchParams, err = null) {
  24263. // 1. Assert: fetchParams is canceled.
  24264. assert(isCancelled(fetchParams))
  24265. // 2. Return an aborted network error if fetchParams is aborted;
  24266. // otherwise return a network error.
  24267. return isAborted(fetchParams)
  24268. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24269. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24270. }
  24271. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24272. function initializeResponse (response, init, body) {
  24273. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24274. // throw a RangeError.
  24275. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24276. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24277. }
  24278. // 2. If init["statusText"] does not match the reason-phrase token production,
  24279. // then throw a TypeError.
  24280. if ('statusText' in init && init.statusText != null) {
  24281. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24282. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24283. if (!isValidReasonPhrase(String(init.statusText))) {
  24284. throw new TypeError('Invalid statusText')
  24285. }
  24286. }
  24287. // 3. Set response’s response’s status to init["status"].
  24288. if ('status' in init && init.status != null) {
  24289. response[kState].status = init.status
  24290. }
  24291. // 4. Set response’s response’s status message to init["statusText"].
  24292. if ('statusText' in init && init.statusText != null) {
  24293. response[kState].statusText = init.statusText
  24294. }
  24295. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24296. if ('headers' in init && init.headers != null) {
  24297. fill(response[kHeaders], init.headers)
  24298. }
  24299. // 6. If body was given, then:
  24300. if (body) {
  24301. // 1. If response's status is a null body status, then throw a TypeError.
  24302. if (nullBodyStatus.includes(response.status)) {
  24303. throw webidl.errors.exception({
  24304. header: 'Response constructor',
  24305. message: 'Invalid response status code ' + response.status
  24306. })
  24307. }
  24308. // 2. Set response's body to body's body.
  24309. response[kState].body = body.body
  24310. // 3. If body's type is non-null and response's header list does not contain
  24311. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24312. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24313. response[kState].headersList.append('content-type', body.type)
  24314. }
  24315. }
  24316. }
  24317. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24318. ReadableStream
  24319. )
  24320. webidl.converters.FormData = webidl.interfaceConverter(
  24321. FormData
  24322. )
  24323. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24324. URLSearchParams
  24325. )
  24326. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24327. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24328. if (typeof V === 'string') {
  24329. return webidl.converters.USVString(V)
  24330. }
  24331. if (isBlobLike(V)) {
  24332. return webidl.converters.Blob(V, { strict: false })
  24333. }
  24334. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24335. return webidl.converters.BufferSource(V)
  24336. }
  24337. if (util.isFormDataLike(V)) {
  24338. return webidl.converters.FormData(V, { strict: false })
  24339. }
  24340. if (V instanceof URLSearchParams) {
  24341. return webidl.converters.URLSearchParams(V)
  24342. }
  24343. return webidl.converters.DOMString(V)
  24344. }
  24345. // https://fetch.spec.whatwg.org/#bodyinit
  24346. webidl.converters.BodyInit = function (V) {
  24347. if (V instanceof ReadableStream) {
  24348. return webidl.converters.ReadableStream(V)
  24349. }
  24350. // Note: the spec doesn't include async iterables,
  24351. // this is an undici extension.
  24352. if (V?.[Symbol.asyncIterator]) {
  24353. return V
  24354. }
  24355. return webidl.converters.XMLHttpRequestBodyInit(V)
  24356. }
  24357. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24358. {
  24359. key: 'status',
  24360. converter: webidl.converters['unsigned short'],
  24361. defaultValue: 200
  24362. },
  24363. {
  24364. key: 'statusText',
  24365. converter: webidl.converters.ByteString,
  24366. defaultValue: ''
  24367. },
  24368. {
  24369. key: 'headers',
  24370. converter: webidl.converters.HeadersInit
  24371. }
  24372. ])
  24373. module.exports = {
  24374. makeNetworkError,
  24375. makeResponse,
  24376. makeAppropriateNetworkError,
  24377. filterResponse,
  24378. Response,
  24379. cloneResponse
  24380. }
  24381. /***/ }),
  24382. /***/ 5861:
  24383. /***/ ((module) => {
  24384. "use strict";
  24385. module.exports = {
  24386. kUrl: Symbol('url'),
  24387. kHeaders: Symbol('headers'),
  24388. kSignal: Symbol('signal'),
  24389. kState: Symbol('state'),
  24390. kGuard: Symbol('guard'),
  24391. kRealm: Symbol('realm')
  24392. }
  24393. /***/ }),
  24394. /***/ 2538:
  24395. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24396. "use strict";
  24397. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24398. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24399. const { performance } = __nccwpck_require__(4074)
  24400. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24401. const assert = __nccwpck_require__(9491)
  24402. const { isUint8Array } = __nccwpck_require__(9830)
  24403. let supportedHashes = []
  24404. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24405. /** @type {import('crypto')|undefined} */
  24406. let crypto
  24407. try {
  24408. crypto = __nccwpck_require__(6113)
  24409. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24410. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24411. /* c8 ignore next 3 */
  24412. } catch {
  24413. }
  24414. function responseURL (response) {
  24415. // https://fetch.spec.whatwg.org/#responses
  24416. // A response has an associated URL. It is a pointer to the last URL
  24417. // in response’s URL list and null if response’s URL list is empty.
  24418. const urlList = response.urlList
  24419. const length = urlList.length
  24420. return length === 0 ? null : urlList[length - 1].toString()
  24421. }
  24422. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24423. function responseLocationURL (response, requestFragment) {
  24424. // 1. If response’s status is not a redirect status, then return null.
  24425. if (!redirectStatusSet.has(response.status)) {
  24426. return null
  24427. }
  24428. // 2. Let location be the result of extracting header list values given
  24429. // `Location` and response’s header list.
  24430. let location = response.headersList.get('location')
  24431. // 3. If location is a header value, then set location to the result of
  24432. // parsing location with response’s URL.
  24433. if (location !== null && isValidHeaderValue(location)) {
  24434. location = new URL(location, responseURL(response))
  24435. }
  24436. // 4. If location is a URL whose fragment is null, then set location’s
  24437. // fragment to requestFragment.
  24438. if (location && !location.hash) {
  24439. location.hash = requestFragment
  24440. }
  24441. // 5. Return location.
  24442. return location
  24443. }
  24444. /** @returns {URL} */
  24445. function requestCurrentURL (request) {
  24446. return request.urlList[request.urlList.length - 1]
  24447. }
  24448. function requestBadPort (request) {
  24449. // 1. Let url be request’s current URL.
  24450. const url = requestCurrentURL(request)
  24451. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24452. // then return blocked.
  24453. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24454. return 'blocked'
  24455. }
  24456. // 3. Return allowed.
  24457. return 'allowed'
  24458. }
  24459. function isErrorLike (object) {
  24460. return object instanceof Error || (
  24461. object?.constructor?.name === 'Error' ||
  24462. object?.constructor?.name === 'DOMException'
  24463. )
  24464. }
  24465. // Check whether |statusText| is a ByteString and
  24466. // matches the Reason-Phrase token production.
  24467. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24468. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24469. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24470. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24471. function isValidReasonPhrase (statusText) {
  24472. for (let i = 0; i < statusText.length; ++i) {
  24473. const c = statusText.charCodeAt(i)
  24474. if (
  24475. !(
  24476. (
  24477. c === 0x09 || // HTAB
  24478. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24479. (c >= 0x80 && c <= 0xff)
  24480. ) // obs-text
  24481. )
  24482. ) {
  24483. return false
  24484. }
  24485. }
  24486. return true
  24487. }
  24488. /**
  24489. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24490. * @param {number} c
  24491. */
  24492. function isTokenCharCode (c) {
  24493. switch (c) {
  24494. case 0x22:
  24495. case 0x28:
  24496. case 0x29:
  24497. case 0x2c:
  24498. case 0x2f:
  24499. case 0x3a:
  24500. case 0x3b:
  24501. case 0x3c:
  24502. case 0x3d:
  24503. case 0x3e:
  24504. case 0x3f:
  24505. case 0x40:
  24506. case 0x5b:
  24507. case 0x5c:
  24508. case 0x5d:
  24509. case 0x7b:
  24510. case 0x7d:
  24511. // DQUOTE and "(),/:;<=>?@[\]{}"
  24512. return false
  24513. default:
  24514. // VCHAR %x21-7E
  24515. return c >= 0x21 && c <= 0x7e
  24516. }
  24517. }
  24518. /**
  24519. * @param {string} characters
  24520. */
  24521. function isValidHTTPToken (characters) {
  24522. if (characters.length === 0) {
  24523. return false
  24524. }
  24525. for (let i = 0; i < characters.length; ++i) {
  24526. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24527. return false
  24528. }
  24529. }
  24530. return true
  24531. }
  24532. /**
  24533. * @see https://fetch.spec.whatwg.org/#header-name
  24534. * @param {string} potentialValue
  24535. */
  24536. function isValidHeaderName (potentialValue) {
  24537. return isValidHTTPToken(potentialValue)
  24538. }
  24539. /**
  24540. * @see https://fetch.spec.whatwg.org/#header-value
  24541. * @param {string} potentialValue
  24542. */
  24543. function isValidHeaderValue (potentialValue) {
  24544. // - Has no leading or trailing HTTP tab or space bytes.
  24545. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24546. if (
  24547. potentialValue.startsWith('\t') ||
  24548. potentialValue.startsWith(' ') ||
  24549. potentialValue.endsWith('\t') ||
  24550. potentialValue.endsWith(' ')
  24551. ) {
  24552. return false
  24553. }
  24554. if (
  24555. potentialValue.includes('\0') ||
  24556. potentialValue.includes('\r') ||
  24557. potentialValue.includes('\n')
  24558. ) {
  24559. return false
  24560. }
  24561. return true
  24562. }
  24563. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24564. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24565. // Given a request request and a response actualResponse, this algorithm
  24566. // updates request’s referrer policy according to the Referrer-Policy
  24567. // header (if any) in actualResponse.
  24568. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24569. // from a Referrer-Policy header on actualResponse.
  24570. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24571. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24572. const { headersList } = actualResponse
  24573. // 2. Let policy be the empty string.
  24574. // 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.
  24575. // 4. Return policy.
  24576. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24577. // Note: As the referrer-policy can contain multiple policies
  24578. // separated by comma, we need to loop through all of them
  24579. // and pick the first valid one.
  24580. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24581. let policy = ''
  24582. if (policyHeader.length > 0) {
  24583. // The right-most policy takes precedence.
  24584. // The left-most policy is the fallback.
  24585. for (let i = policyHeader.length; i !== 0; i--) {
  24586. const token = policyHeader[i - 1].trim()
  24587. if (referrerPolicyTokens.has(token)) {
  24588. policy = token
  24589. break
  24590. }
  24591. }
  24592. }
  24593. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24594. if (policy !== '') {
  24595. request.referrerPolicy = policy
  24596. }
  24597. }
  24598. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24599. function crossOriginResourcePolicyCheck () {
  24600. // TODO
  24601. return 'allowed'
  24602. }
  24603. // https://fetch.spec.whatwg.org/#concept-cors-check
  24604. function corsCheck () {
  24605. // TODO
  24606. return 'success'
  24607. }
  24608. // https://fetch.spec.whatwg.org/#concept-tao-check
  24609. function TAOCheck () {
  24610. // TODO
  24611. return 'success'
  24612. }
  24613. function appendFetchMetadata (httpRequest) {
  24614. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24615. // TODO
  24616. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24617. // 1. Assert: r’s url is a potentially trustworthy URL.
  24618. // TODO
  24619. // 2. Let header be a Structured Header whose value is a token.
  24620. let header = null
  24621. // 3. Set header’s value to r’s mode.
  24622. header = httpRequest.mode
  24623. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24624. httpRequest.headersList.set('sec-fetch-mode', header)
  24625. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24626. // TODO
  24627. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24628. // TODO
  24629. }
  24630. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24631. function appendRequestOriginHeader (request) {
  24632. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24633. let serializedOrigin = request.origin
  24634. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24635. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24636. if (serializedOrigin) {
  24637. request.headersList.append('origin', serializedOrigin)
  24638. }
  24639. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24640. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24641. // 1. Switch on request’s referrer policy:
  24642. switch (request.referrerPolicy) {
  24643. case 'no-referrer':
  24644. // Set serializedOrigin to `null`.
  24645. serializedOrigin = null
  24646. break
  24647. case 'no-referrer-when-downgrade':
  24648. case 'strict-origin':
  24649. case 'strict-origin-when-cross-origin':
  24650. // 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`.
  24651. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24652. serializedOrigin = null
  24653. }
  24654. break
  24655. case 'same-origin':
  24656. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24657. if (!sameOrigin(request, requestCurrentURL(request))) {
  24658. serializedOrigin = null
  24659. }
  24660. break
  24661. default:
  24662. // Do nothing.
  24663. }
  24664. if (serializedOrigin) {
  24665. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24666. request.headersList.append('origin', serializedOrigin)
  24667. }
  24668. }
  24669. }
  24670. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24671. // TODO
  24672. return performance.now()
  24673. }
  24674. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24675. function createOpaqueTimingInfo (timingInfo) {
  24676. return {
  24677. startTime: timingInfo.startTime ?? 0,
  24678. redirectStartTime: 0,
  24679. redirectEndTime: 0,
  24680. postRedirectStartTime: timingInfo.startTime ?? 0,
  24681. finalServiceWorkerStartTime: 0,
  24682. finalNetworkResponseStartTime: 0,
  24683. finalNetworkRequestStartTime: 0,
  24684. endTime: 0,
  24685. encodedBodySize: 0,
  24686. decodedBodySize: 0,
  24687. finalConnectionTimingInfo: null
  24688. }
  24689. }
  24690. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24691. function makePolicyContainer () {
  24692. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24693. return {
  24694. referrerPolicy: 'strict-origin-when-cross-origin'
  24695. }
  24696. }
  24697. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24698. function clonePolicyContainer (policyContainer) {
  24699. return {
  24700. referrerPolicy: policyContainer.referrerPolicy
  24701. }
  24702. }
  24703. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24704. function determineRequestsReferrer (request) {
  24705. // 1. Let policy be request's referrer policy.
  24706. const policy = request.referrerPolicy
  24707. // Note: policy cannot (shouldn't) be null or an empty string.
  24708. assert(policy)
  24709. // 2. Let environment be request’s client.
  24710. let referrerSource = null
  24711. // 3. Switch on request’s referrer:
  24712. if (request.referrer === 'client') {
  24713. // Note: node isn't a browser and doesn't implement document/iframes,
  24714. // so we bypass this step and replace it with our own.
  24715. const globalOrigin = getGlobalOrigin()
  24716. if (!globalOrigin || globalOrigin.origin === 'null') {
  24717. return 'no-referrer'
  24718. }
  24719. // note: we need to clone it as it's mutated
  24720. referrerSource = new URL(globalOrigin)
  24721. } else if (request.referrer instanceof URL) {
  24722. // Let referrerSource be request’s referrer.
  24723. referrerSource = request.referrer
  24724. }
  24725. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24726. // use as a referrer.
  24727. let referrerURL = stripURLForReferrer(referrerSource)
  24728. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  24729. // a referrer, with the origin-only flag set to true.
  24730. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  24731. // 6. If the result of serializing referrerURL is a string whose length is
  24732. // greater than 4096, set referrerURL to referrerOrigin.
  24733. if (referrerURL.toString().length > 4096) {
  24734. referrerURL = referrerOrigin
  24735. }
  24736. const areSameOrigin = sameOrigin(request, referrerURL)
  24737. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  24738. !isURLPotentiallyTrustworthy(request.url)
  24739. // 8. Execute the switch statements corresponding to the value of policy:
  24740. switch (policy) {
  24741. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  24742. case 'unsafe-url': return referrerURL
  24743. case 'same-origin':
  24744. return areSameOrigin ? referrerOrigin : 'no-referrer'
  24745. case 'origin-when-cross-origin':
  24746. return areSameOrigin ? referrerURL : referrerOrigin
  24747. case 'strict-origin-when-cross-origin': {
  24748. const currentURL = requestCurrentURL(request)
  24749. // 1. If the origin of referrerURL and the origin of request’s current
  24750. // URL are the same, then return referrerURL.
  24751. if (sameOrigin(referrerURL, currentURL)) {
  24752. return referrerURL
  24753. }
  24754. // 2. If referrerURL is a potentially trustworthy URL and request’s
  24755. // current URL is not a potentially trustworthy URL, then return no
  24756. // referrer.
  24757. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  24758. return 'no-referrer'
  24759. }
  24760. // 3. Return referrerOrigin.
  24761. return referrerOrigin
  24762. }
  24763. case 'strict-origin': // eslint-disable-line
  24764. /**
  24765. * 1. If referrerURL is a potentially trustworthy URL and
  24766. * request’s current URL is not a potentially trustworthy URL,
  24767. * then return no referrer.
  24768. * 2. Return referrerOrigin
  24769. */
  24770. case 'no-referrer-when-downgrade': // eslint-disable-line
  24771. /**
  24772. * 1. If referrerURL is a potentially trustworthy URL and
  24773. * request’s current URL is not a potentially trustworthy URL,
  24774. * then return no referrer.
  24775. * 2. Return referrerOrigin
  24776. */
  24777. default: // eslint-disable-line
  24778. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  24779. }
  24780. }
  24781. /**
  24782. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  24783. * @param {URL} url
  24784. * @param {boolean|undefined} originOnly
  24785. */
  24786. function stripURLForReferrer (url, originOnly) {
  24787. // 1. Assert: url is a URL.
  24788. assert(url instanceof URL)
  24789. // 2. If url’s scheme is a local scheme, then return no referrer.
  24790. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  24791. return 'no-referrer'
  24792. }
  24793. // 3. Set url’s username to the empty string.
  24794. url.username = ''
  24795. // 4. Set url’s password to the empty string.
  24796. url.password = ''
  24797. // 5. Set url’s fragment to null.
  24798. url.hash = ''
  24799. // 6. If the origin-only flag is true, then:
  24800. if (originOnly) {
  24801. // 1. Set url’s path to « the empty string ».
  24802. url.pathname = ''
  24803. // 2. Set url’s query to null.
  24804. url.search = ''
  24805. }
  24806. // 7. Return url.
  24807. return url
  24808. }
  24809. function isURLPotentiallyTrustworthy (url) {
  24810. if (!(url instanceof URL)) {
  24811. return false
  24812. }
  24813. // If child of about, return true
  24814. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  24815. return true
  24816. }
  24817. // If scheme is data, return true
  24818. if (url.protocol === 'data:') return true
  24819. // If file, return true
  24820. if (url.protocol === 'file:') return true
  24821. return isOriginPotentiallyTrustworthy(url.origin)
  24822. function isOriginPotentiallyTrustworthy (origin) {
  24823. // If origin is explicitly null, return false
  24824. if (origin == null || origin === 'null') return false
  24825. const originAsURL = new URL(origin)
  24826. // If secure, return true
  24827. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  24828. return true
  24829. }
  24830. // If localhost or variants, return true
  24831. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  24832. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  24833. (originAsURL.hostname.endsWith('.localhost'))) {
  24834. return true
  24835. }
  24836. // If any other, return false
  24837. return false
  24838. }
  24839. }
  24840. /**
  24841. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  24842. * @param {Uint8Array} bytes
  24843. * @param {string} metadataList
  24844. */
  24845. function bytesMatch (bytes, metadataList) {
  24846. // If node is not built with OpenSSL support, we cannot check
  24847. // a request's integrity, so allow it by default (the spec will
  24848. // allow requests if an invalid hash is given, as precedence).
  24849. /* istanbul ignore if: only if node is built with --without-ssl */
  24850. if (crypto === undefined) {
  24851. return true
  24852. }
  24853. // 1. Let parsedMetadata be the result of parsing metadataList.
  24854. const parsedMetadata = parseMetadata(metadataList)
  24855. // 2. If parsedMetadata is no metadata, return true.
  24856. if (parsedMetadata === 'no metadata') {
  24857. return true
  24858. }
  24859. // 3. If response is not eligible for integrity validation, return false.
  24860. // TODO
  24861. // 4. If parsedMetadata is the empty set, return true.
  24862. if (parsedMetadata.length === 0) {
  24863. return true
  24864. }
  24865. // 5. Let metadata be the result of getting the strongest
  24866. // metadata from parsedMetadata.
  24867. const strongest = getStrongestMetadata(parsedMetadata)
  24868. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  24869. // 6. For each item in metadata:
  24870. for (const item of metadata) {
  24871. // 1. Let algorithm be the alg component of item.
  24872. const algorithm = item.algo
  24873. // 2. Let expectedValue be the val component of item.
  24874. const expectedValue = item.hash
  24875. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  24876. // "be liberal with padding". This is annoying, and it's not even in the spec.
  24877. // 3. Let actualValue be the result of applying algorithm to bytes.
  24878. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  24879. if (actualValue[actualValue.length - 1] === '=') {
  24880. if (actualValue[actualValue.length - 2] === '=') {
  24881. actualValue = actualValue.slice(0, -2)
  24882. } else {
  24883. actualValue = actualValue.slice(0, -1)
  24884. }
  24885. }
  24886. // 4. If actualValue is a case-sensitive match for expectedValue,
  24887. // return true.
  24888. if (compareBase64Mixed(actualValue, expectedValue)) {
  24889. return true
  24890. }
  24891. }
  24892. // 7. Return false.
  24893. return false
  24894. }
  24895. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  24896. // https://www.w3.org/TR/CSP2/#source-list-syntax
  24897. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  24898. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  24899. /**
  24900. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  24901. * @param {string} metadata
  24902. */
  24903. function parseMetadata (metadata) {
  24904. // 1. Let result be the empty set.
  24905. /** @type {{ algo: string, hash: string }[]} */
  24906. const result = []
  24907. // 2. Let empty be equal to true.
  24908. let empty = true
  24909. // 3. For each token returned by splitting metadata on spaces:
  24910. for (const token of metadata.split(' ')) {
  24911. // 1. Set empty to false.
  24912. empty = false
  24913. // 2. Parse token as a hash-with-options.
  24914. const parsedToken = parseHashWithOptions.exec(token)
  24915. // 3. If token does not parse, continue to the next token.
  24916. if (
  24917. parsedToken === null ||
  24918. parsedToken.groups === undefined ||
  24919. parsedToken.groups.algo === undefined
  24920. ) {
  24921. // Note: Chromium blocks the request at this point, but Firefox
  24922. // gives a warning that an invalid integrity was given. The
  24923. // correct behavior is to ignore these, and subsequently not
  24924. // check the integrity of the resource.
  24925. continue
  24926. }
  24927. // 4. Let algorithm be the hash-algo component of token.
  24928. const algorithm = parsedToken.groups.algo.toLowerCase()
  24929. // 5. If algorithm is a hash function recognized by the user
  24930. // agent, add the parsed token to result.
  24931. if (supportedHashes.includes(algorithm)) {
  24932. result.push(parsedToken.groups)
  24933. }
  24934. }
  24935. // 4. Return no metadata if empty is true, otherwise return result.
  24936. if (empty === true) {
  24937. return 'no metadata'
  24938. }
  24939. return result
  24940. }
  24941. /**
  24942. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  24943. */
  24944. function getStrongestMetadata (metadataList) {
  24945. // Let algorithm be the algo component of the first item in metadataList.
  24946. // Can be sha256
  24947. let algorithm = metadataList[0].algo
  24948. // If the algorithm is sha512, then it is the strongest
  24949. // and we can return immediately
  24950. if (algorithm[3] === '5') {
  24951. return algorithm
  24952. }
  24953. for (let i = 1; i < metadataList.length; ++i) {
  24954. const metadata = metadataList[i]
  24955. // If the algorithm is sha512, then it is the strongest
  24956. // and we can break the loop immediately
  24957. if (metadata.algo[3] === '5') {
  24958. algorithm = 'sha512'
  24959. break
  24960. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  24961. } else if (algorithm[3] === '3') {
  24962. continue
  24963. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  24964. // the strongest
  24965. } else if (metadata.algo[3] === '3') {
  24966. algorithm = 'sha384'
  24967. }
  24968. }
  24969. return algorithm
  24970. }
  24971. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  24972. if (metadataList.length === 1) {
  24973. return metadataList
  24974. }
  24975. let pos = 0
  24976. for (let i = 0; i < metadataList.length; ++i) {
  24977. if (metadataList[i].algo === algorithm) {
  24978. metadataList[pos++] = metadataList[i]
  24979. }
  24980. }
  24981. metadataList.length = pos
  24982. return metadataList
  24983. }
  24984. /**
  24985. * Compares two base64 strings, allowing for base64url
  24986. * in the second string.
  24987. *
  24988. * @param {string} actualValue always base64
  24989. * @param {string} expectedValue base64 or base64url
  24990. * @returns {boolean}
  24991. */
  24992. function compareBase64Mixed (actualValue, expectedValue) {
  24993. if (actualValue.length !== expectedValue.length) {
  24994. return false
  24995. }
  24996. for (let i = 0; i < actualValue.length; ++i) {
  24997. if (actualValue[i] !== expectedValue[i]) {
  24998. if (
  24999. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25000. (actualValue[i] === '/' && expectedValue[i] === '_')
  25001. ) {
  25002. continue
  25003. }
  25004. return false
  25005. }
  25006. }
  25007. return true
  25008. }
  25009. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25010. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25011. // TODO
  25012. }
  25013. /**
  25014. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25015. * @param {URL} A
  25016. * @param {URL} B
  25017. */
  25018. function sameOrigin (A, B) {
  25019. // 1. If A and B are the same opaque origin, then return true.
  25020. if (A.origin === B.origin && A.origin === 'null') {
  25021. return true
  25022. }
  25023. // 2. If A and B are both tuple origins and their schemes,
  25024. // hosts, and port are identical, then return true.
  25025. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25026. return true
  25027. }
  25028. // 3. Return false.
  25029. return false
  25030. }
  25031. function createDeferredPromise () {
  25032. let res
  25033. let rej
  25034. const promise = new Promise((resolve, reject) => {
  25035. res = resolve
  25036. rej = reject
  25037. })
  25038. return { promise, resolve: res, reject: rej }
  25039. }
  25040. function isAborted (fetchParams) {
  25041. return fetchParams.controller.state === 'aborted'
  25042. }
  25043. function isCancelled (fetchParams) {
  25044. return fetchParams.controller.state === 'aborted' ||
  25045. fetchParams.controller.state === 'terminated'
  25046. }
  25047. const normalizeMethodRecord = {
  25048. delete: 'DELETE',
  25049. DELETE: 'DELETE',
  25050. get: 'GET',
  25051. GET: 'GET',
  25052. head: 'HEAD',
  25053. HEAD: 'HEAD',
  25054. options: 'OPTIONS',
  25055. OPTIONS: 'OPTIONS',
  25056. post: 'POST',
  25057. POST: 'POST',
  25058. put: 'PUT',
  25059. PUT: 'PUT'
  25060. }
  25061. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25062. Object.setPrototypeOf(normalizeMethodRecord, null)
  25063. /**
  25064. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25065. * @param {string} method
  25066. */
  25067. function normalizeMethod (method) {
  25068. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25069. }
  25070. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25071. function serializeJavascriptValueToJSONString (value) {
  25072. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25073. const result = JSON.stringify(value)
  25074. // 2. If result is undefined, then throw a TypeError.
  25075. if (result === undefined) {
  25076. throw new TypeError('Value is not JSON serializable')
  25077. }
  25078. // 3. Assert: result is a string.
  25079. assert(typeof result === 'string')
  25080. // 4. Return result.
  25081. return result
  25082. }
  25083. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25084. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25085. /**
  25086. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25087. * @param {() => unknown[]} iterator
  25088. * @param {string} name name of the instance
  25089. * @param {'key'|'value'|'key+value'} kind
  25090. */
  25091. function makeIterator (iterator, name, kind) {
  25092. const object = {
  25093. index: 0,
  25094. kind,
  25095. target: iterator
  25096. }
  25097. const i = {
  25098. next () {
  25099. // 1. Let interface be the interface for which the iterator prototype object exists.
  25100. // 2. Let thisValue be the this value.
  25101. // 3. Let object be ? ToObject(thisValue).
  25102. // 4. If object is a platform object, then perform a security
  25103. // check, passing:
  25104. // 5. If object is not a default iterator object for interface,
  25105. // then throw a TypeError.
  25106. if (Object.getPrototypeOf(this) !== i) {
  25107. throw new TypeError(
  25108. `'next' called on an object that does not implement interface ${name} Iterator.`
  25109. )
  25110. }
  25111. // 6. Let index be object’s index.
  25112. // 7. Let kind be object’s kind.
  25113. // 8. Let values be object’s target's value pairs to iterate over.
  25114. const { index, kind, target } = object
  25115. const values = target()
  25116. // 9. Let len be the length of values.
  25117. const len = values.length
  25118. // 10. If index is greater than or equal to len, then return
  25119. // CreateIterResultObject(undefined, true).
  25120. if (index >= len) {
  25121. return { value: undefined, done: true }
  25122. }
  25123. // 11. Let pair be the entry in values at index index.
  25124. const pair = values[index]
  25125. // 12. Set object’s index to index + 1.
  25126. object.index = index + 1
  25127. // 13. Return the iterator result for pair and kind.
  25128. return iteratorResult(pair, kind)
  25129. },
  25130. // The class string of an iterator prototype object for a given interface is the
  25131. // result of concatenating the identifier of the interface and the string " Iterator".
  25132. [Symbol.toStringTag]: `${name} Iterator`
  25133. }
  25134. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25135. Object.setPrototypeOf(i, esIteratorPrototype)
  25136. // esIteratorPrototype needs to be the prototype of i
  25137. // which is the prototype of an empty object. Yes, it's confusing.
  25138. return Object.setPrototypeOf({}, i)
  25139. }
  25140. // https://webidl.spec.whatwg.org/#iterator-result
  25141. function iteratorResult (pair, kind) {
  25142. let result
  25143. // 1. Let result be a value determined by the value of kind:
  25144. switch (kind) {
  25145. case 'key': {
  25146. // 1. Let idlKey be pair’s key.
  25147. // 2. Let key be the result of converting idlKey to an
  25148. // ECMAScript value.
  25149. // 3. result is key.
  25150. result = pair[0]
  25151. break
  25152. }
  25153. case 'value': {
  25154. // 1. Let idlValue be pair’s value.
  25155. // 2. Let value be the result of converting idlValue to
  25156. // an ECMAScript value.
  25157. // 3. result is value.
  25158. result = pair[1]
  25159. break
  25160. }
  25161. case 'key+value': {
  25162. // 1. Let idlKey be pair’s key.
  25163. // 2. Let idlValue be pair’s value.
  25164. // 3. Let key be the result of converting idlKey to an
  25165. // ECMAScript value.
  25166. // 4. Let value be the result of converting idlValue to
  25167. // an ECMAScript value.
  25168. // 5. Let array be ! ArrayCreate(2).
  25169. // 6. Call ! CreateDataProperty(array, "0", key).
  25170. // 7. Call ! CreateDataProperty(array, "1", value).
  25171. // 8. result is array.
  25172. result = pair
  25173. break
  25174. }
  25175. }
  25176. // 2. Return CreateIterResultObject(result, false).
  25177. return { value: result, done: false }
  25178. }
  25179. /**
  25180. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25181. */
  25182. async function fullyReadBody (body, processBody, processBodyError) {
  25183. // 1. If taskDestination is null, then set taskDestination to
  25184. // the result of starting a new parallel queue.
  25185. // 2. Let successSteps given a byte sequence bytes be to queue a
  25186. // fetch task to run processBody given bytes, with taskDestination.
  25187. const successSteps = processBody
  25188. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25189. // with taskDestination.
  25190. const errorSteps = processBodyError
  25191. // 4. Let reader be the result of getting a reader for body’s stream.
  25192. // If that threw an exception, then run errorSteps with that
  25193. // exception and return.
  25194. let reader
  25195. try {
  25196. reader = body.stream.getReader()
  25197. } catch (e) {
  25198. errorSteps(e)
  25199. return
  25200. }
  25201. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25202. try {
  25203. const result = await readAllBytes(reader)
  25204. successSteps(result)
  25205. } catch (e) {
  25206. errorSteps(e)
  25207. }
  25208. }
  25209. /** @type {ReadableStream} */
  25210. let ReadableStream = globalThis.ReadableStream
  25211. function isReadableStreamLike (stream) {
  25212. if (!ReadableStream) {
  25213. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25214. }
  25215. return stream instanceof ReadableStream || (
  25216. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25217. typeof stream.tee === 'function'
  25218. )
  25219. }
  25220. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25221. /**
  25222. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25223. * @param {number[]|Uint8Array} input
  25224. */
  25225. function isomorphicDecode (input) {
  25226. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25227. // length is equal to input’s length and whose code points have the same values
  25228. // as the values of input’s bytes, in the same order.
  25229. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25230. return String.fromCharCode(...input)
  25231. }
  25232. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25233. }
  25234. /**
  25235. * @param {ReadableStreamController<Uint8Array>} controller
  25236. */
  25237. function readableStreamClose (controller) {
  25238. try {
  25239. controller.close()
  25240. } catch (err) {
  25241. // TODO: add comment explaining why this error occurs.
  25242. if (!err.message.includes('Controller is already closed')) {
  25243. throw err
  25244. }
  25245. }
  25246. }
  25247. /**
  25248. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25249. * @param {string} input
  25250. */
  25251. function isomorphicEncode (input) {
  25252. // 1. Assert: input contains no code points greater than U+00FF.
  25253. for (let i = 0; i < input.length; i++) {
  25254. assert(input.charCodeAt(i) <= 0xFF)
  25255. }
  25256. // 2. Return a byte sequence whose length is equal to input’s code
  25257. // point length and whose bytes have the same values as the
  25258. // values of input’s code points, in the same order
  25259. return input
  25260. }
  25261. /**
  25262. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25263. * @see https://streams.spec.whatwg.org/#read-loop
  25264. * @param {ReadableStreamDefaultReader} reader
  25265. */
  25266. async function readAllBytes (reader) {
  25267. const bytes = []
  25268. let byteLength = 0
  25269. while (true) {
  25270. const { done, value: chunk } = await reader.read()
  25271. if (done) {
  25272. // 1. Call successSteps with bytes.
  25273. return Buffer.concat(bytes, byteLength)
  25274. }
  25275. // 1. If chunk is not a Uint8Array object, call failureSteps
  25276. // with a TypeError and abort these steps.
  25277. if (!isUint8Array(chunk)) {
  25278. throw new TypeError('Received non-Uint8Array chunk')
  25279. }
  25280. // 2. Append the bytes represented by chunk to bytes.
  25281. bytes.push(chunk)
  25282. byteLength += chunk.length
  25283. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25284. }
  25285. }
  25286. /**
  25287. * @see https://fetch.spec.whatwg.org/#is-local
  25288. * @param {URL} url
  25289. */
  25290. function urlIsLocal (url) {
  25291. assert('protocol' in url) // ensure it's a url object
  25292. const protocol = url.protocol
  25293. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25294. }
  25295. /**
  25296. * @param {string|URL} url
  25297. */
  25298. function urlHasHttpsScheme (url) {
  25299. if (typeof url === 'string') {
  25300. return url.startsWith('https:')
  25301. }
  25302. return url.protocol === 'https:'
  25303. }
  25304. /**
  25305. * @see https://fetch.spec.whatwg.org/#http-scheme
  25306. * @param {URL} url
  25307. */
  25308. function urlIsHttpHttpsScheme (url) {
  25309. assert('protocol' in url) // ensure it's a url object
  25310. const protocol = url.protocol
  25311. return protocol === 'http:' || protocol === 'https:'
  25312. }
  25313. /**
  25314. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25315. */
  25316. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25317. module.exports = {
  25318. isAborted,
  25319. isCancelled,
  25320. createDeferredPromise,
  25321. ReadableStreamFrom,
  25322. toUSVString,
  25323. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25324. coarsenedSharedCurrentTime,
  25325. determineRequestsReferrer,
  25326. makePolicyContainer,
  25327. clonePolicyContainer,
  25328. appendFetchMetadata,
  25329. appendRequestOriginHeader,
  25330. TAOCheck,
  25331. corsCheck,
  25332. crossOriginResourcePolicyCheck,
  25333. createOpaqueTimingInfo,
  25334. setRequestReferrerPolicyOnRedirect,
  25335. isValidHTTPToken,
  25336. requestBadPort,
  25337. requestCurrentURL,
  25338. responseURL,
  25339. responseLocationURL,
  25340. isBlobLike,
  25341. isURLPotentiallyTrustworthy,
  25342. isValidReasonPhrase,
  25343. sameOrigin,
  25344. normalizeMethod,
  25345. serializeJavascriptValueToJSONString,
  25346. makeIterator,
  25347. isValidHeaderName,
  25348. isValidHeaderValue,
  25349. hasOwn,
  25350. isErrorLike,
  25351. fullyReadBody,
  25352. bytesMatch,
  25353. isReadableStreamLike,
  25354. readableStreamClose,
  25355. isomorphicEncode,
  25356. isomorphicDecode,
  25357. urlIsLocal,
  25358. urlHasHttpsScheme,
  25359. urlIsHttpHttpsScheme,
  25360. readAllBytes,
  25361. normalizeMethodRecord,
  25362. parseMetadata
  25363. }
  25364. /***/ }),
  25365. /***/ 1744:
  25366. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25367. "use strict";
  25368. const { types } = __nccwpck_require__(3837)
  25369. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25370. /** @type {import('../../types/webidl').Webidl} */
  25371. const webidl = {}
  25372. webidl.converters = {}
  25373. webidl.util = {}
  25374. webidl.errors = {}
  25375. webidl.errors.exception = function (message) {
  25376. return new TypeError(`${message.header}: ${message.message}`)
  25377. }
  25378. webidl.errors.conversionFailed = function (context) {
  25379. const plural = context.types.length === 1 ? '' : ' one of'
  25380. const message =
  25381. `${context.argument} could not be converted to` +
  25382. `${plural}: ${context.types.join(', ')}.`
  25383. return webidl.errors.exception({
  25384. header: context.prefix,
  25385. message
  25386. })
  25387. }
  25388. webidl.errors.invalidArgument = function (context) {
  25389. return webidl.errors.exception({
  25390. header: context.prefix,
  25391. message: `"${context.value}" is an invalid ${context.type}.`
  25392. })
  25393. }
  25394. // https://webidl.spec.whatwg.org/#implements
  25395. webidl.brandCheck = function (V, I, opts = undefined) {
  25396. if (opts?.strict !== false && !(V instanceof I)) {
  25397. throw new TypeError('Illegal invocation')
  25398. } else {
  25399. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25400. }
  25401. }
  25402. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25403. if (length < min) {
  25404. throw webidl.errors.exception({
  25405. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25406. `but${length ? ' only' : ''} ${length} found.`,
  25407. ...ctx
  25408. })
  25409. }
  25410. }
  25411. webidl.illegalConstructor = function () {
  25412. throw webidl.errors.exception({
  25413. header: 'TypeError',
  25414. message: 'Illegal constructor'
  25415. })
  25416. }
  25417. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25418. webidl.util.Type = function (V) {
  25419. switch (typeof V) {
  25420. case 'undefined': return 'Undefined'
  25421. case 'boolean': return 'Boolean'
  25422. case 'string': return 'String'
  25423. case 'symbol': return 'Symbol'
  25424. case 'number': return 'Number'
  25425. case 'bigint': return 'BigInt'
  25426. case 'function':
  25427. case 'object': {
  25428. if (V === null) {
  25429. return 'Null'
  25430. }
  25431. return 'Object'
  25432. }
  25433. }
  25434. }
  25435. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25436. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25437. let upperBound
  25438. let lowerBound
  25439. // 1. If bitLength is 64, then:
  25440. if (bitLength === 64) {
  25441. // 1. Let upperBound be 2^53 − 1.
  25442. upperBound = Math.pow(2, 53) - 1
  25443. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25444. if (signedness === 'unsigned') {
  25445. lowerBound = 0
  25446. } else {
  25447. // 3. Otherwise let lowerBound be −2^53 + 1.
  25448. lowerBound = Math.pow(-2, 53) + 1
  25449. }
  25450. } else if (signedness === 'unsigned') {
  25451. // 2. Otherwise, if signedness is "unsigned", then:
  25452. // 1. Let lowerBound be 0.
  25453. lowerBound = 0
  25454. // 2. Let upperBound be 2^bitLength − 1.
  25455. upperBound = Math.pow(2, bitLength) - 1
  25456. } else {
  25457. // 3. Otherwise:
  25458. // 1. Let lowerBound be -2^bitLength − 1.
  25459. lowerBound = Math.pow(-2, bitLength) - 1
  25460. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25461. upperBound = Math.pow(2, bitLength - 1) - 1
  25462. }
  25463. // 4. Let x be ? ToNumber(V).
  25464. let x = Number(V)
  25465. // 5. If x is −0, then set x to +0.
  25466. if (x === 0) {
  25467. x = 0
  25468. }
  25469. // 6. If the conversion is to an IDL type associated
  25470. // with the [EnforceRange] extended attribute, then:
  25471. if (opts.enforceRange === true) {
  25472. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25473. if (
  25474. Number.isNaN(x) ||
  25475. x === Number.POSITIVE_INFINITY ||
  25476. x === Number.NEGATIVE_INFINITY
  25477. ) {
  25478. throw webidl.errors.exception({
  25479. header: 'Integer conversion',
  25480. message: `Could not convert ${V} to an integer.`
  25481. })
  25482. }
  25483. // 2. Set x to IntegerPart(x).
  25484. x = webidl.util.IntegerPart(x)
  25485. // 3. If x < lowerBound or x > upperBound, then
  25486. // throw a TypeError.
  25487. if (x < lowerBound || x > upperBound) {
  25488. throw webidl.errors.exception({
  25489. header: 'Integer conversion',
  25490. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25491. })
  25492. }
  25493. // 4. Return x.
  25494. return x
  25495. }
  25496. // 7. If x is not NaN and the conversion is to an IDL
  25497. // type associated with the [Clamp] extended
  25498. // attribute, then:
  25499. if (!Number.isNaN(x) && opts.clamp === true) {
  25500. // 1. Set x to min(max(x, lowerBound), upperBound).
  25501. x = Math.min(Math.max(x, lowerBound), upperBound)
  25502. // 2. Round x to the nearest integer, choosing the
  25503. // even integer if it lies halfway between two,
  25504. // and choosing +0 rather than −0.
  25505. if (Math.floor(x) % 2 === 0) {
  25506. x = Math.floor(x)
  25507. } else {
  25508. x = Math.ceil(x)
  25509. }
  25510. // 3. Return x.
  25511. return x
  25512. }
  25513. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25514. if (
  25515. Number.isNaN(x) ||
  25516. (x === 0 && Object.is(0, x)) ||
  25517. x === Number.POSITIVE_INFINITY ||
  25518. x === Number.NEGATIVE_INFINITY
  25519. ) {
  25520. return 0
  25521. }
  25522. // 9. Set x to IntegerPart(x).
  25523. x = webidl.util.IntegerPart(x)
  25524. // 10. Set x to x modulo 2^bitLength.
  25525. x = x % Math.pow(2, bitLength)
  25526. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25527. // then return x − 2^bitLength.
  25528. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25529. return x - Math.pow(2, bitLength)
  25530. }
  25531. // 12. Otherwise, return x.
  25532. return x
  25533. }
  25534. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25535. webidl.util.IntegerPart = function (n) {
  25536. // 1. Let r be floor(abs(n)).
  25537. const r = Math.floor(Math.abs(n))
  25538. // 2. If n < 0, then return -1 × r.
  25539. if (n < 0) {
  25540. return -1 * r
  25541. }
  25542. // 3. Otherwise, return r.
  25543. return r
  25544. }
  25545. // https://webidl.spec.whatwg.org/#es-sequence
  25546. webidl.sequenceConverter = function (converter) {
  25547. return (V) => {
  25548. // 1. If Type(V) is not Object, throw a TypeError.
  25549. if (webidl.util.Type(V) !== 'Object') {
  25550. throw webidl.errors.exception({
  25551. header: 'Sequence',
  25552. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25553. })
  25554. }
  25555. // 2. Let method be ? GetMethod(V, @@iterator).
  25556. /** @type {Generator} */
  25557. const method = V?.[Symbol.iterator]?.()
  25558. const seq = []
  25559. // 3. If method is undefined, throw a TypeError.
  25560. if (
  25561. method === undefined ||
  25562. typeof method.next !== 'function'
  25563. ) {
  25564. throw webidl.errors.exception({
  25565. header: 'Sequence',
  25566. message: 'Object is not an iterator.'
  25567. })
  25568. }
  25569. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25570. while (true) {
  25571. const { done, value } = method.next()
  25572. if (done) {
  25573. break
  25574. }
  25575. seq.push(converter(value))
  25576. }
  25577. return seq
  25578. }
  25579. }
  25580. // https://webidl.spec.whatwg.org/#es-to-record
  25581. webidl.recordConverter = function (keyConverter, valueConverter) {
  25582. return (O) => {
  25583. // 1. If Type(O) is not Object, throw a TypeError.
  25584. if (webidl.util.Type(O) !== 'Object') {
  25585. throw webidl.errors.exception({
  25586. header: 'Record',
  25587. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25588. })
  25589. }
  25590. // 2. Let result be a new empty instance of record<K, V>.
  25591. const result = {}
  25592. if (!types.isProxy(O)) {
  25593. // Object.keys only returns enumerable properties
  25594. const keys = Object.keys(O)
  25595. for (const key of keys) {
  25596. // 1. Let typedKey be key converted to an IDL value of type K.
  25597. const typedKey = keyConverter(key)
  25598. // 2. Let value be ? Get(O, key).
  25599. // 3. Let typedValue be value converted to an IDL value of type V.
  25600. const typedValue = valueConverter(O[key])
  25601. // 4. Set result[typedKey] to typedValue.
  25602. result[typedKey] = typedValue
  25603. }
  25604. // 5. Return result.
  25605. return result
  25606. }
  25607. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25608. const keys = Reflect.ownKeys(O)
  25609. // 4. For each key of keys.
  25610. for (const key of keys) {
  25611. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25612. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25613. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25614. if (desc?.enumerable) {
  25615. // 1. Let typedKey be key converted to an IDL value of type K.
  25616. const typedKey = keyConverter(key)
  25617. // 2. Let value be ? Get(O, key).
  25618. // 3. Let typedValue be value converted to an IDL value of type V.
  25619. const typedValue = valueConverter(O[key])
  25620. // 4. Set result[typedKey] to typedValue.
  25621. result[typedKey] = typedValue
  25622. }
  25623. }
  25624. // 5. Return result.
  25625. return result
  25626. }
  25627. }
  25628. webidl.interfaceConverter = function (i) {
  25629. return (V, opts = {}) => {
  25630. if (opts.strict !== false && !(V instanceof i)) {
  25631. throw webidl.errors.exception({
  25632. header: i.name,
  25633. message: `Expected ${V} to be an instance of ${i.name}.`
  25634. })
  25635. }
  25636. return V
  25637. }
  25638. }
  25639. webidl.dictionaryConverter = function (converters) {
  25640. return (dictionary) => {
  25641. const type = webidl.util.Type(dictionary)
  25642. const dict = {}
  25643. if (type === 'Null' || type === 'Undefined') {
  25644. return dict
  25645. } else if (type !== 'Object') {
  25646. throw webidl.errors.exception({
  25647. header: 'Dictionary',
  25648. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25649. })
  25650. }
  25651. for (const options of converters) {
  25652. const { key, defaultValue, required, converter } = options
  25653. if (required === true) {
  25654. if (!hasOwn(dictionary, key)) {
  25655. throw webidl.errors.exception({
  25656. header: 'Dictionary',
  25657. message: `Missing required key "${key}".`
  25658. })
  25659. }
  25660. }
  25661. let value = dictionary[key]
  25662. const hasDefault = hasOwn(options, 'defaultValue')
  25663. // Only use defaultValue if value is undefined and
  25664. // a defaultValue options was provided.
  25665. if (hasDefault && value !== null) {
  25666. value = value ?? defaultValue
  25667. }
  25668. // A key can be optional and have no default value.
  25669. // When this happens, do not perform a conversion,
  25670. // and do not assign the key a value.
  25671. if (required || hasDefault || value !== undefined) {
  25672. value = converter(value)
  25673. if (
  25674. options.allowedValues &&
  25675. !options.allowedValues.includes(value)
  25676. ) {
  25677. throw webidl.errors.exception({
  25678. header: 'Dictionary',
  25679. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25680. })
  25681. }
  25682. dict[key] = value
  25683. }
  25684. }
  25685. return dict
  25686. }
  25687. }
  25688. webidl.nullableConverter = function (converter) {
  25689. return (V) => {
  25690. if (V === null) {
  25691. return V
  25692. }
  25693. return converter(V)
  25694. }
  25695. }
  25696. // https://webidl.spec.whatwg.org/#es-DOMString
  25697. webidl.converters.DOMString = function (V, opts = {}) {
  25698. // 1. If V is null and the conversion is to an IDL type
  25699. // associated with the [LegacyNullToEmptyString]
  25700. // extended attribute, then return the DOMString value
  25701. // that represents the empty string.
  25702. if (V === null && opts.legacyNullToEmptyString) {
  25703. return ''
  25704. }
  25705. // 2. Let x be ? ToString(V).
  25706. if (typeof V === 'symbol') {
  25707. throw new TypeError('Could not convert argument of type symbol to string.')
  25708. }
  25709. // 3. Return the IDL DOMString value that represents the
  25710. // same sequence of code units as the one the
  25711. // ECMAScript String value x represents.
  25712. return String(V)
  25713. }
  25714. // https://webidl.spec.whatwg.org/#es-ByteString
  25715. webidl.converters.ByteString = function (V) {
  25716. // 1. Let x be ? ToString(V).
  25717. // Note: DOMString converter perform ? ToString(V)
  25718. const x = webidl.converters.DOMString(V)
  25719. // 2. If the value of any element of x is greater than
  25720. // 255, then throw a TypeError.
  25721. for (let index = 0; index < x.length; index++) {
  25722. if (x.charCodeAt(index) > 255) {
  25723. throw new TypeError(
  25724. 'Cannot convert argument to a ByteString because the character at ' +
  25725. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25726. )
  25727. }
  25728. }
  25729. // 3. Return an IDL ByteString value whose length is the
  25730. // length of x, and where the value of each element is
  25731. // the value of the corresponding element of x.
  25732. return x
  25733. }
  25734. // https://webidl.spec.whatwg.org/#es-USVString
  25735. webidl.converters.USVString = toUSVString
  25736. // https://webidl.spec.whatwg.org/#es-boolean
  25737. webidl.converters.boolean = function (V) {
  25738. // 1. Let x be the result of computing ToBoolean(V).
  25739. const x = Boolean(V)
  25740. // 2. Return the IDL boolean value that is the one that represents
  25741. // the same truth value as the ECMAScript Boolean value x.
  25742. return x
  25743. }
  25744. // https://webidl.spec.whatwg.org/#es-any
  25745. webidl.converters.any = function (V) {
  25746. return V
  25747. }
  25748. // https://webidl.spec.whatwg.org/#es-long-long
  25749. webidl.converters['long long'] = function (V) {
  25750. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  25751. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  25752. // 2. Return the IDL long long value that represents
  25753. // the same numeric value as x.
  25754. return x
  25755. }
  25756. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  25757. webidl.converters['unsigned long long'] = function (V) {
  25758. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  25759. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  25760. // 2. Return the IDL unsigned long long value that
  25761. // represents the same numeric value as x.
  25762. return x
  25763. }
  25764. // https://webidl.spec.whatwg.org/#es-unsigned-long
  25765. webidl.converters['unsigned long'] = function (V) {
  25766. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  25767. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  25768. // 2. Return the IDL unsigned long value that
  25769. // represents the same numeric value as x.
  25770. return x
  25771. }
  25772. // https://webidl.spec.whatwg.org/#es-unsigned-short
  25773. webidl.converters['unsigned short'] = function (V, opts) {
  25774. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  25775. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  25776. // 2. Return the IDL unsigned short value that represents
  25777. // the same numeric value as x.
  25778. return x
  25779. }
  25780. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  25781. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  25782. // 1. If Type(V) is not Object, or V does not have an
  25783. // [[ArrayBufferData]] internal slot, then throw a
  25784. // TypeError.
  25785. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  25786. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  25787. if (
  25788. webidl.util.Type(V) !== 'Object' ||
  25789. !types.isAnyArrayBuffer(V)
  25790. ) {
  25791. throw webidl.errors.conversionFailed({
  25792. prefix: `${V}`,
  25793. argument: `${V}`,
  25794. types: ['ArrayBuffer']
  25795. })
  25796. }
  25797. // 2. If the conversion is not to an IDL type associated
  25798. // with the [AllowShared] extended attribute, and
  25799. // IsSharedArrayBuffer(V) is true, then throw a
  25800. // TypeError.
  25801. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  25802. throw webidl.errors.exception({
  25803. header: 'ArrayBuffer',
  25804. message: 'SharedArrayBuffer is not allowed.'
  25805. })
  25806. }
  25807. // 3. If the conversion is not to an IDL type associated
  25808. // with the [AllowResizable] extended attribute, and
  25809. // IsResizableArrayBuffer(V) is true, then throw a
  25810. // TypeError.
  25811. // Note: resizable ArrayBuffers are currently a proposal.
  25812. // 4. Return the IDL ArrayBuffer value that is a
  25813. // reference to the same object as V.
  25814. return V
  25815. }
  25816. webidl.converters.TypedArray = function (V, T, opts = {}) {
  25817. // 1. Let T be the IDL type V is being converted to.
  25818. // 2. If Type(V) is not Object, or V does not have a
  25819. // [[TypedArrayName]] internal slot with a value
  25820. // equal to T’s name, then throw a TypeError.
  25821. if (
  25822. webidl.util.Type(V) !== 'Object' ||
  25823. !types.isTypedArray(V) ||
  25824. V.constructor.name !== T.name
  25825. ) {
  25826. throw webidl.errors.conversionFailed({
  25827. prefix: `${T.name}`,
  25828. argument: `${V}`,
  25829. types: [T.name]
  25830. })
  25831. }
  25832. // 3. If the conversion is not to an IDL type associated
  25833. // with the [AllowShared] extended attribute, and
  25834. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25835. // true, then throw a TypeError.
  25836. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25837. throw webidl.errors.exception({
  25838. header: 'ArrayBuffer',
  25839. message: 'SharedArrayBuffer is not allowed.'
  25840. })
  25841. }
  25842. // 4. If the conversion is not to an IDL type associated
  25843. // with the [AllowResizable] extended attribute, and
  25844. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25845. // true, then throw a TypeError.
  25846. // Note: resizable array buffers are currently a proposal
  25847. // 5. Return the IDL value of type T that is a reference
  25848. // to the same object as V.
  25849. return V
  25850. }
  25851. webidl.converters.DataView = function (V, opts = {}) {
  25852. // 1. If Type(V) is not Object, or V does not have a
  25853. // [[DataView]] internal slot, then throw a TypeError.
  25854. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  25855. throw webidl.errors.exception({
  25856. header: 'DataView',
  25857. message: 'Object is not a DataView.'
  25858. })
  25859. }
  25860. // 2. If the conversion is not to an IDL type associated
  25861. // with the [AllowShared] extended attribute, and
  25862. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  25863. // then throw a TypeError.
  25864. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25865. throw webidl.errors.exception({
  25866. header: 'ArrayBuffer',
  25867. message: 'SharedArrayBuffer is not allowed.'
  25868. })
  25869. }
  25870. // 3. If the conversion is not to an IDL type associated
  25871. // with the [AllowResizable] extended attribute, and
  25872. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25873. // true, then throw a TypeError.
  25874. // Note: resizable ArrayBuffers are currently a proposal
  25875. // 4. Return the IDL DataView value that is a reference
  25876. // to the same object as V.
  25877. return V
  25878. }
  25879. // https://webidl.spec.whatwg.org/#BufferSource
  25880. webidl.converters.BufferSource = function (V, opts = {}) {
  25881. if (types.isAnyArrayBuffer(V)) {
  25882. return webidl.converters.ArrayBuffer(V, opts)
  25883. }
  25884. if (types.isTypedArray(V)) {
  25885. return webidl.converters.TypedArray(V, V.constructor)
  25886. }
  25887. if (types.isDataView(V)) {
  25888. return webidl.converters.DataView(V, opts)
  25889. }
  25890. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  25891. }
  25892. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  25893. webidl.converters.ByteString
  25894. )
  25895. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  25896. webidl.converters['sequence<ByteString>']
  25897. )
  25898. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  25899. webidl.converters.ByteString,
  25900. webidl.converters.ByteString
  25901. )
  25902. module.exports = {
  25903. webidl
  25904. }
  25905. /***/ }),
  25906. /***/ 4854:
  25907. /***/ ((module) => {
  25908. "use strict";
  25909. /**
  25910. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  25911. * @param {string|undefined} label
  25912. */
  25913. function getEncoding (label) {
  25914. if (!label) {
  25915. return 'failure'
  25916. }
  25917. // 1. Remove any leading and trailing ASCII whitespace from label.
  25918. // 2. If label is an ASCII case-insensitive match for any of the
  25919. // labels listed in the table below, then return the
  25920. // corresponding encoding; otherwise return failure.
  25921. switch (label.trim().toLowerCase()) {
  25922. case 'unicode-1-1-utf-8':
  25923. case 'unicode11utf8':
  25924. case 'unicode20utf8':
  25925. case 'utf-8':
  25926. case 'utf8':
  25927. case 'x-unicode20utf8':
  25928. return 'UTF-8'
  25929. case '866':
  25930. case 'cp866':
  25931. case 'csibm866':
  25932. case 'ibm866':
  25933. return 'IBM866'
  25934. case 'csisolatin2':
  25935. case 'iso-8859-2':
  25936. case 'iso-ir-101':
  25937. case 'iso8859-2':
  25938. case 'iso88592':
  25939. case 'iso_8859-2':
  25940. case 'iso_8859-2:1987':
  25941. case 'l2':
  25942. case 'latin2':
  25943. return 'ISO-8859-2'
  25944. case 'csisolatin3':
  25945. case 'iso-8859-3':
  25946. case 'iso-ir-109':
  25947. case 'iso8859-3':
  25948. case 'iso88593':
  25949. case 'iso_8859-3':
  25950. case 'iso_8859-3:1988':
  25951. case 'l3':
  25952. case 'latin3':
  25953. return 'ISO-8859-3'
  25954. case 'csisolatin4':
  25955. case 'iso-8859-4':
  25956. case 'iso-ir-110':
  25957. case 'iso8859-4':
  25958. case 'iso88594':
  25959. case 'iso_8859-4':
  25960. case 'iso_8859-4:1988':
  25961. case 'l4':
  25962. case 'latin4':
  25963. return 'ISO-8859-4'
  25964. case 'csisolatincyrillic':
  25965. case 'cyrillic':
  25966. case 'iso-8859-5':
  25967. case 'iso-ir-144':
  25968. case 'iso8859-5':
  25969. case 'iso88595':
  25970. case 'iso_8859-5':
  25971. case 'iso_8859-5:1988':
  25972. return 'ISO-8859-5'
  25973. case 'arabic':
  25974. case 'asmo-708':
  25975. case 'csiso88596e':
  25976. case 'csiso88596i':
  25977. case 'csisolatinarabic':
  25978. case 'ecma-114':
  25979. case 'iso-8859-6':
  25980. case 'iso-8859-6-e':
  25981. case 'iso-8859-6-i':
  25982. case 'iso-ir-127':
  25983. case 'iso8859-6':
  25984. case 'iso88596':
  25985. case 'iso_8859-6':
  25986. case 'iso_8859-6:1987':
  25987. return 'ISO-8859-6'
  25988. case 'csisolatingreek':
  25989. case 'ecma-118':
  25990. case 'elot_928':
  25991. case 'greek':
  25992. case 'greek8':
  25993. case 'iso-8859-7':
  25994. case 'iso-ir-126':
  25995. case 'iso8859-7':
  25996. case 'iso88597':
  25997. case 'iso_8859-7':
  25998. case 'iso_8859-7:1987':
  25999. case 'sun_eu_greek':
  26000. return 'ISO-8859-7'
  26001. case 'csiso88598e':
  26002. case 'csisolatinhebrew':
  26003. case 'hebrew':
  26004. case 'iso-8859-8':
  26005. case 'iso-8859-8-e':
  26006. case 'iso-ir-138':
  26007. case 'iso8859-8':
  26008. case 'iso88598':
  26009. case 'iso_8859-8':
  26010. case 'iso_8859-8:1988':
  26011. case 'visual':
  26012. return 'ISO-8859-8'
  26013. case 'csiso88598i':
  26014. case 'iso-8859-8-i':
  26015. case 'logical':
  26016. return 'ISO-8859-8-I'
  26017. case 'csisolatin6':
  26018. case 'iso-8859-10':
  26019. case 'iso-ir-157':
  26020. case 'iso8859-10':
  26021. case 'iso885910':
  26022. case 'l6':
  26023. case 'latin6':
  26024. return 'ISO-8859-10'
  26025. case 'iso-8859-13':
  26026. case 'iso8859-13':
  26027. case 'iso885913':
  26028. return 'ISO-8859-13'
  26029. case 'iso-8859-14':
  26030. case 'iso8859-14':
  26031. case 'iso885914':
  26032. return 'ISO-8859-14'
  26033. case 'csisolatin9':
  26034. case 'iso-8859-15':
  26035. case 'iso8859-15':
  26036. case 'iso885915':
  26037. case 'iso_8859-15':
  26038. case 'l9':
  26039. return 'ISO-8859-15'
  26040. case 'iso-8859-16':
  26041. return 'ISO-8859-16'
  26042. case 'cskoi8r':
  26043. case 'koi':
  26044. case 'koi8':
  26045. case 'koi8-r':
  26046. case 'koi8_r':
  26047. return 'KOI8-R'
  26048. case 'koi8-ru':
  26049. case 'koi8-u':
  26050. return 'KOI8-U'
  26051. case 'csmacintosh':
  26052. case 'mac':
  26053. case 'macintosh':
  26054. case 'x-mac-roman':
  26055. return 'macintosh'
  26056. case 'iso-8859-11':
  26057. case 'iso8859-11':
  26058. case 'iso885911':
  26059. case 'tis-620':
  26060. case 'windows-874':
  26061. return 'windows-874'
  26062. case 'cp1250':
  26063. case 'windows-1250':
  26064. case 'x-cp1250':
  26065. return 'windows-1250'
  26066. case 'cp1251':
  26067. case 'windows-1251':
  26068. case 'x-cp1251':
  26069. return 'windows-1251'
  26070. case 'ansi_x3.4-1968':
  26071. case 'ascii':
  26072. case 'cp1252':
  26073. case 'cp819':
  26074. case 'csisolatin1':
  26075. case 'ibm819':
  26076. case 'iso-8859-1':
  26077. case 'iso-ir-100':
  26078. case 'iso8859-1':
  26079. case 'iso88591':
  26080. case 'iso_8859-1':
  26081. case 'iso_8859-1:1987':
  26082. case 'l1':
  26083. case 'latin1':
  26084. case 'us-ascii':
  26085. case 'windows-1252':
  26086. case 'x-cp1252':
  26087. return 'windows-1252'
  26088. case 'cp1253':
  26089. case 'windows-1253':
  26090. case 'x-cp1253':
  26091. return 'windows-1253'
  26092. case 'cp1254':
  26093. case 'csisolatin5':
  26094. case 'iso-8859-9':
  26095. case 'iso-ir-148':
  26096. case 'iso8859-9':
  26097. case 'iso88599':
  26098. case 'iso_8859-9':
  26099. case 'iso_8859-9:1989':
  26100. case 'l5':
  26101. case 'latin5':
  26102. case 'windows-1254':
  26103. case 'x-cp1254':
  26104. return 'windows-1254'
  26105. case 'cp1255':
  26106. case 'windows-1255':
  26107. case 'x-cp1255':
  26108. return 'windows-1255'
  26109. case 'cp1256':
  26110. case 'windows-1256':
  26111. case 'x-cp1256':
  26112. return 'windows-1256'
  26113. case 'cp1257':
  26114. case 'windows-1257':
  26115. case 'x-cp1257':
  26116. return 'windows-1257'
  26117. case 'cp1258':
  26118. case 'windows-1258':
  26119. case 'x-cp1258':
  26120. return 'windows-1258'
  26121. case 'x-mac-cyrillic':
  26122. case 'x-mac-ukrainian':
  26123. return 'x-mac-cyrillic'
  26124. case 'chinese':
  26125. case 'csgb2312':
  26126. case 'csiso58gb231280':
  26127. case 'gb2312':
  26128. case 'gb_2312':
  26129. case 'gb_2312-80':
  26130. case 'gbk':
  26131. case 'iso-ir-58':
  26132. case 'x-gbk':
  26133. return 'GBK'
  26134. case 'gb18030':
  26135. return 'gb18030'
  26136. case 'big5':
  26137. case 'big5-hkscs':
  26138. case 'cn-big5':
  26139. case 'csbig5':
  26140. case 'x-x-big5':
  26141. return 'Big5'
  26142. case 'cseucpkdfmtjapanese':
  26143. case 'euc-jp':
  26144. case 'x-euc-jp':
  26145. return 'EUC-JP'
  26146. case 'csiso2022jp':
  26147. case 'iso-2022-jp':
  26148. return 'ISO-2022-JP'
  26149. case 'csshiftjis':
  26150. case 'ms932':
  26151. case 'ms_kanji':
  26152. case 'shift-jis':
  26153. case 'shift_jis':
  26154. case 'sjis':
  26155. case 'windows-31j':
  26156. case 'x-sjis':
  26157. return 'Shift_JIS'
  26158. case 'cseuckr':
  26159. case 'csksc56011987':
  26160. case 'euc-kr':
  26161. case 'iso-ir-149':
  26162. case 'korean':
  26163. case 'ks_c_5601-1987':
  26164. case 'ks_c_5601-1989':
  26165. case 'ksc5601':
  26166. case 'ksc_5601':
  26167. case 'windows-949':
  26168. return 'EUC-KR'
  26169. case 'csiso2022kr':
  26170. case 'hz-gb-2312':
  26171. case 'iso-2022-cn':
  26172. case 'iso-2022-cn-ext':
  26173. case 'iso-2022-kr':
  26174. case 'replacement':
  26175. return 'replacement'
  26176. case 'unicodefffe':
  26177. case 'utf-16be':
  26178. return 'UTF-16BE'
  26179. case 'csunicode':
  26180. case 'iso-10646-ucs-2':
  26181. case 'ucs-2':
  26182. case 'unicode':
  26183. case 'unicodefeff':
  26184. case 'utf-16':
  26185. case 'utf-16le':
  26186. return 'UTF-16LE'
  26187. case 'x-user-defined':
  26188. return 'x-user-defined'
  26189. default: return 'failure'
  26190. }
  26191. }
  26192. module.exports = {
  26193. getEncoding
  26194. }
  26195. /***/ }),
  26196. /***/ 1446:
  26197. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26198. "use strict";
  26199. const {
  26200. staticPropertyDescriptors,
  26201. readOperation,
  26202. fireAProgressEvent
  26203. } = __nccwpck_require__(7530)
  26204. const {
  26205. kState,
  26206. kError,
  26207. kResult,
  26208. kEvents,
  26209. kAborted
  26210. } = __nccwpck_require__(9054)
  26211. const { webidl } = __nccwpck_require__(1744)
  26212. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26213. class FileReader extends EventTarget {
  26214. constructor () {
  26215. super()
  26216. this[kState] = 'empty'
  26217. this[kResult] = null
  26218. this[kError] = null
  26219. this[kEvents] = {
  26220. loadend: null,
  26221. error: null,
  26222. abort: null,
  26223. load: null,
  26224. progress: null,
  26225. loadstart: null
  26226. }
  26227. }
  26228. /**
  26229. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26230. * @param {import('buffer').Blob} blob
  26231. */
  26232. readAsArrayBuffer (blob) {
  26233. webidl.brandCheck(this, FileReader)
  26234. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26235. blob = webidl.converters.Blob(blob, { strict: false })
  26236. // The readAsArrayBuffer(blob) method, when invoked,
  26237. // must initiate a read operation for blob with ArrayBuffer.
  26238. readOperation(this, blob, 'ArrayBuffer')
  26239. }
  26240. /**
  26241. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26242. * @param {import('buffer').Blob} blob
  26243. */
  26244. readAsBinaryString (blob) {
  26245. webidl.brandCheck(this, FileReader)
  26246. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26247. blob = webidl.converters.Blob(blob, { strict: false })
  26248. // The readAsBinaryString(blob) method, when invoked,
  26249. // must initiate a read operation for blob with BinaryString.
  26250. readOperation(this, blob, 'BinaryString')
  26251. }
  26252. /**
  26253. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26254. * @param {import('buffer').Blob} blob
  26255. * @param {string?} encoding
  26256. */
  26257. readAsText (blob, encoding = undefined) {
  26258. webidl.brandCheck(this, FileReader)
  26259. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26260. blob = webidl.converters.Blob(blob, { strict: false })
  26261. if (encoding !== undefined) {
  26262. encoding = webidl.converters.DOMString(encoding)
  26263. }
  26264. // The readAsText(blob, encoding) method, when invoked,
  26265. // must initiate a read operation for blob with Text and encoding.
  26266. readOperation(this, blob, 'Text', encoding)
  26267. }
  26268. /**
  26269. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26270. * @param {import('buffer').Blob} blob
  26271. */
  26272. readAsDataURL (blob) {
  26273. webidl.brandCheck(this, FileReader)
  26274. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26275. blob = webidl.converters.Blob(blob, { strict: false })
  26276. // The readAsDataURL(blob) method, when invoked, must
  26277. // initiate a read operation for blob with DataURL.
  26278. readOperation(this, blob, 'DataURL')
  26279. }
  26280. /**
  26281. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26282. */
  26283. abort () {
  26284. // 1. If this's state is "empty" or if this's state is
  26285. // "done" set this's result to null and terminate
  26286. // this algorithm.
  26287. if (this[kState] === 'empty' || this[kState] === 'done') {
  26288. this[kResult] = null
  26289. return
  26290. }
  26291. // 2. If this's state is "loading" set this's state to
  26292. // "done" and set this's result to null.
  26293. if (this[kState] === 'loading') {
  26294. this[kState] = 'done'
  26295. this[kResult] = null
  26296. }
  26297. // 3. If there are any tasks from this on the file reading
  26298. // task source in an affiliated task queue, then remove
  26299. // those tasks from that task queue.
  26300. this[kAborted] = true
  26301. // 4. Terminate the algorithm for the read method being processed.
  26302. // TODO
  26303. // 5. Fire a progress event called abort at this.
  26304. fireAProgressEvent('abort', this)
  26305. // 6. If this's state is not "loading", fire a progress
  26306. // event called loadend at this.
  26307. if (this[kState] !== 'loading') {
  26308. fireAProgressEvent('loadend', this)
  26309. }
  26310. }
  26311. /**
  26312. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26313. */
  26314. get readyState () {
  26315. webidl.brandCheck(this, FileReader)
  26316. switch (this[kState]) {
  26317. case 'empty': return this.EMPTY
  26318. case 'loading': return this.LOADING
  26319. case 'done': return this.DONE
  26320. }
  26321. }
  26322. /**
  26323. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26324. */
  26325. get result () {
  26326. webidl.brandCheck(this, FileReader)
  26327. // The result attribute’s getter, when invoked, must return
  26328. // this's result.
  26329. return this[kResult]
  26330. }
  26331. /**
  26332. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26333. */
  26334. get error () {
  26335. webidl.brandCheck(this, FileReader)
  26336. // The error attribute’s getter, when invoked, must return
  26337. // this's error.
  26338. return this[kError]
  26339. }
  26340. get onloadend () {
  26341. webidl.brandCheck(this, FileReader)
  26342. return this[kEvents].loadend
  26343. }
  26344. set onloadend (fn) {
  26345. webidl.brandCheck(this, FileReader)
  26346. if (this[kEvents].loadend) {
  26347. this.removeEventListener('loadend', this[kEvents].loadend)
  26348. }
  26349. if (typeof fn === 'function') {
  26350. this[kEvents].loadend = fn
  26351. this.addEventListener('loadend', fn)
  26352. } else {
  26353. this[kEvents].loadend = null
  26354. }
  26355. }
  26356. get onerror () {
  26357. webidl.brandCheck(this, FileReader)
  26358. return this[kEvents].error
  26359. }
  26360. set onerror (fn) {
  26361. webidl.brandCheck(this, FileReader)
  26362. if (this[kEvents].error) {
  26363. this.removeEventListener('error', this[kEvents].error)
  26364. }
  26365. if (typeof fn === 'function') {
  26366. this[kEvents].error = fn
  26367. this.addEventListener('error', fn)
  26368. } else {
  26369. this[kEvents].error = null
  26370. }
  26371. }
  26372. get onloadstart () {
  26373. webidl.brandCheck(this, FileReader)
  26374. return this[kEvents].loadstart
  26375. }
  26376. set onloadstart (fn) {
  26377. webidl.brandCheck(this, FileReader)
  26378. if (this[kEvents].loadstart) {
  26379. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26380. }
  26381. if (typeof fn === 'function') {
  26382. this[kEvents].loadstart = fn
  26383. this.addEventListener('loadstart', fn)
  26384. } else {
  26385. this[kEvents].loadstart = null
  26386. }
  26387. }
  26388. get onprogress () {
  26389. webidl.brandCheck(this, FileReader)
  26390. return this[kEvents].progress
  26391. }
  26392. set onprogress (fn) {
  26393. webidl.brandCheck(this, FileReader)
  26394. if (this[kEvents].progress) {
  26395. this.removeEventListener('progress', this[kEvents].progress)
  26396. }
  26397. if (typeof fn === 'function') {
  26398. this[kEvents].progress = fn
  26399. this.addEventListener('progress', fn)
  26400. } else {
  26401. this[kEvents].progress = null
  26402. }
  26403. }
  26404. get onload () {
  26405. webidl.brandCheck(this, FileReader)
  26406. return this[kEvents].load
  26407. }
  26408. set onload (fn) {
  26409. webidl.brandCheck(this, FileReader)
  26410. if (this[kEvents].load) {
  26411. this.removeEventListener('load', this[kEvents].load)
  26412. }
  26413. if (typeof fn === 'function') {
  26414. this[kEvents].load = fn
  26415. this.addEventListener('load', fn)
  26416. } else {
  26417. this[kEvents].load = null
  26418. }
  26419. }
  26420. get onabort () {
  26421. webidl.brandCheck(this, FileReader)
  26422. return this[kEvents].abort
  26423. }
  26424. set onabort (fn) {
  26425. webidl.brandCheck(this, FileReader)
  26426. if (this[kEvents].abort) {
  26427. this.removeEventListener('abort', this[kEvents].abort)
  26428. }
  26429. if (typeof fn === 'function') {
  26430. this[kEvents].abort = fn
  26431. this.addEventListener('abort', fn)
  26432. } else {
  26433. this[kEvents].abort = null
  26434. }
  26435. }
  26436. }
  26437. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26438. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26439. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26440. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26441. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26442. FileReader.DONE = FileReader.prototype.DONE = 2
  26443. Object.defineProperties(FileReader.prototype, {
  26444. EMPTY: staticPropertyDescriptors,
  26445. LOADING: staticPropertyDescriptors,
  26446. DONE: staticPropertyDescriptors,
  26447. readAsArrayBuffer: kEnumerableProperty,
  26448. readAsBinaryString: kEnumerableProperty,
  26449. readAsText: kEnumerableProperty,
  26450. readAsDataURL: kEnumerableProperty,
  26451. abort: kEnumerableProperty,
  26452. readyState: kEnumerableProperty,
  26453. result: kEnumerableProperty,
  26454. error: kEnumerableProperty,
  26455. onloadstart: kEnumerableProperty,
  26456. onprogress: kEnumerableProperty,
  26457. onload: kEnumerableProperty,
  26458. onabort: kEnumerableProperty,
  26459. onerror: kEnumerableProperty,
  26460. onloadend: kEnumerableProperty,
  26461. [Symbol.toStringTag]: {
  26462. value: 'FileReader',
  26463. writable: false,
  26464. enumerable: false,
  26465. configurable: true
  26466. }
  26467. })
  26468. Object.defineProperties(FileReader, {
  26469. EMPTY: staticPropertyDescriptors,
  26470. LOADING: staticPropertyDescriptors,
  26471. DONE: staticPropertyDescriptors
  26472. })
  26473. module.exports = {
  26474. FileReader
  26475. }
  26476. /***/ }),
  26477. /***/ 5504:
  26478. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26479. "use strict";
  26480. const { webidl } = __nccwpck_require__(1744)
  26481. const kState = Symbol('ProgressEvent state')
  26482. /**
  26483. * @see https://xhr.spec.whatwg.org/#progressevent
  26484. */
  26485. class ProgressEvent extends Event {
  26486. constructor (type, eventInitDict = {}) {
  26487. type = webidl.converters.DOMString(type)
  26488. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26489. super(type, eventInitDict)
  26490. this[kState] = {
  26491. lengthComputable: eventInitDict.lengthComputable,
  26492. loaded: eventInitDict.loaded,
  26493. total: eventInitDict.total
  26494. }
  26495. }
  26496. get lengthComputable () {
  26497. webidl.brandCheck(this, ProgressEvent)
  26498. return this[kState].lengthComputable
  26499. }
  26500. get loaded () {
  26501. webidl.brandCheck(this, ProgressEvent)
  26502. return this[kState].loaded
  26503. }
  26504. get total () {
  26505. webidl.brandCheck(this, ProgressEvent)
  26506. return this[kState].total
  26507. }
  26508. }
  26509. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26510. {
  26511. key: 'lengthComputable',
  26512. converter: webidl.converters.boolean,
  26513. defaultValue: false
  26514. },
  26515. {
  26516. key: 'loaded',
  26517. converter: webidl.converters['unsigned long long'],
  26518. defaultValue: 0
  26519. },
  26520. {
  26521. key: 'total',
  26522. converter: webidl.converters['unsigned long long'],
  26523. defaultValue: 0
  26524. },
  26525. {
  26526. key: 'bubbles',
  26527. converter: webidl.converters.boolean,
  26528. defaultValue: false
  26529. },
  26530. {
  26531. key: 'cancelable',
  26532. converter: webidl.converters.boolean,
  26533. defaultValue: false
  26534. },
  26535. {
  26536. key: 'composed',
  26537. converter: webidl.converters.boolean,
  26538. defaultValue: false
  26539. }
  26540. ])
  26541. module.exports = {
  26542. ProgressEvent
  26543. }
  26544. /***/ }),
  26545. /***/ 9054:
  26546. /***/ ((module) => {
  26547. "use strict";
  26548. module.exports = {
  26549. kState: Symbol('FileReader state'),
  26550. kResult: Symbol('FileReader result'),
  26551. kError: Symbol('FileReader error'),
  26552. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26553. kEvents: Symbol('FileReader events'),
  26554. kAborted: Symbol('FileReader aborted')
  26555. }
  26556. /***/ }),
  26557. /***/ 7530:
  26558. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26559. "use strict";
  26560. const {
  26561. kState,
  26562. kError,
  26563. kResult,
  26564. kAborted,
  26565. kLastProgressEventFired
  26566. } = __nccwpck_require__(9054)
  26567. const { ProgressEvent } = __nccwpck_require__(5504)
  26568. const { getEncoding } = __nccwpck_require__(4854)
  26569. const { DOMException } = __nccwpck_require__(1037)
  26570. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26571. const { types } = __nccwpck_require__(3837)
  26572. const { StringDecoder } = __nccwpck_require__(1576)
  26573. const { btoa } = __nccwpck_require__(4300)
  26574. /** @type {PropertyDescriptor} */
  26575. const staticPropertyDescriptors = {
  26576. enumerable: true,
  26577. writable: false,
  26578. configurable: false
  26579. }
  26580. /**
  26581. * @see https://w3c.github.io/FileAPI/#readOperation
  26582. * @param {import('./filereader').FileReader} fr
  26583. * @param {import('buffer').Blob} blob
  26584. * @param {string} type
  26585. * @param {string?} encodingName
  26586. */
  26587. function readOperation (fr, blob, type, encodingName) {
  26588. // 1. If fr’s state is "loading", throw an InvalidStateError
  26589. // DOMException.
  26590. if (fr[kState] === 'loading') {
  26591. throw new DOMException('Invalid state', 'InvalidStateError')
  26592. }
  26593. // 2. Set fr’s state to "loading".
  26594. fr[kState] = 'loading'
  26595. // 3. Set fr’s result to null.
  26596. fr[kResult] = null
  26597. // 4. Set fr’s error to null.
  26598. fr[kError] = null
  26599. // 5. Let stream be the result of calling get stream on blob.
  26600. /** @type {import('stream/web').ReadableStream} */
  26601. const stream = blob.stream()
  26602. // 6. Let reader be the result of getting a reader from stream.
  26603. const reader = stream.getReader()
  26604. // 7. Let bytes be an empty byte sequence.
  26605. /** @type {Uint8Array[]} */
  26606. const bytes = []
  26607. // 8. Let chunkPromise be the result of reading a chunk from
  26608. // stream with reader.
  26609. let chunkPromise = reader.read()
  26610. // 9. Let isFirstChunk be true.
  26611. let isFirstChunk = true
  26612. // 10. In parallel, while true:
  26613. // Note: "In parallel" just means non-blocking
  26614. // Note 2: readOperation itself cannot be async as double
  26615. // reading the body would then reject the promise, instead
  26616. // of throwing an error.
  26617. ;(async () => {
  26618. while (!fr[kAborted]) {
  26619. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26620. try {
  26621. const { done, value } = await chunkPromise
  26622. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26623. // true, queue a task to fire a progress event called
  26624. // loadstart at fr.
  26625. if (isFirstChunk && !fr[kAborted]) {
  26626. queueMicrotask(() => {
  26627. fireAProgressEvent('loadstart', fr)
  26628. })
  26629. }
  26630. // 3. Set isFirstChunk to false.
  26631. isFirstChunk = false
  26632. // 4. If chunkPromise is fulfilled with an object whose
  26633. // done property is false and whose value property is
  26634. // a Uint8Array object, run these steps:
  26635. if (!done && types.isUint8Array(value)) {
  26636. // 1. Let bs be the byte sequence represented by the
  26637. // Uint8Array object.
  26638. // 2. Append bs to bytes.
  26639. bytes.push(value)
  26640. // 3. If roughly 50ms have passed since these steps
  26641. // were last invoked, queue a task to fire a
  26642. // progress event called progress at fr.
  26643. if (
  26644. (
  26645. fr[kLastProgressEventFired] === undefined ||
  26646. Date.now() - fr[kLastProgressEventFired] >= 50
  26647. ) &&
  26648. !fr[kAborted]
  26649. ) {
  26650. fr[kLastProgressEventFired] = Date.now()
  26651. queueMicrotask(() => {
  26652. fireAProgressEvent('progress', fr)
  26653. })
  26654. }
  26655. // 4. Set chunkPromise to the result of reading a
  26656. // chunk from stream with reader.
  26657. chunkPromise = reader.read()
  26658. } else if (done) {
  26659. // 5. Otherwise, if chunkPromise is fulfilled with an
  26660. // object whose done property is true, queue a task
  26661. // to run the following steps and abort this algorithm:
  26662. queueMicrotask(() => {
  26663. // 1. Set fr’s state to "done".
  26664. fr[kState] = 'done'
  26665. // 2. Let result be the result of package data given
  26666. // bytes, type, blob’s type, and encodingName.
  26667. try {
  26668. const result = packageData(bytes, type, blob.type, encodingName)
  26669. // 4. Else:
  26670. if (fr[kAborted]) {
  26671. return
  26672. }
  26673. // 1. Set fr’s result to result.
  26674. fr[kResult] = result
  26675. // 2. Fire a progress event called load at the fr.
  26676. fireAProgressEvent('load', fr)
  26677. } catch (error) {
  26678. // 3. If package data threw an exception error:
  26679. // 1. Set fr’s error to error.
  26680. fr[kError] = error
  26681. // 2. Fire a progress event called error at fr.
  26682. fireAProgressEvent('error', fr)
  26683. }
  26684. // 5. If fr’s state is not "loading", fire a progress
  26685. // event called loadend at the fr.
  26686. if (fr[kState] !== 'loading') {
  26687. fireAProgressEvent('loadend', fr)
  26688. }
  26689. })
  26690. break
  26691. }
  26692. } catch (error) {
  26693. if (fr[kAborted]) {
  26694. return
  26695. }
  26696. // 6. Otherwise, if chunkPromise is rejected with an
  26697. // error error, queue a task to run the following
  26698. // steps and abort this algorithm:
  26699. queueMicrotask(() => {
  26700. // 1. Set fr’s state to "done".
  26701. fr[kState] = 'done'
  26702. // 2. Set fr’s error to error.
  26703. fr[kError] = error
  26704. // 3. Fire a progress event called error at fr.
  26705. fireAProgressEvent('error', fr)
  26706. // 4. If fr’s state is not "loading", fire a progress
  26707. // event called loadend at fr.
  26708. if (fr[kState] !== 'loading') {
  26709. fireAProgressEvent('loadend', fr)
  26710. }
  26711. })
  26712. break
  26713. }
  26714. }
  26715. })()
  26716. }
  26717. /**
  26718. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26719. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26720. * @param {string} e The name of the event
  26721. * @param {import('./filereader').FileReader} reader
  26722. */
  26723. function fireAProgressEvent (e, reader) {
  26724. // The progress event e does not bubble. e.bubbles must be false
  26725. // The progress event e is NOT cancelable. e.cancelable must be false
  26726. const event = new ProgressEvent(e, {
  26727. bubbles: false,
  26728. cancelable: false
  26729. })
  26730. reader.dispatchEvent(event)
  26731. }
  26732. /**
  26733. * @see https://w3c.github.io/FileAPI/#blob-package-data
  26734. * @param {Uint8Array[]} bytes
  26735. * @param {string} type
  26736. * @param {string?} mimeType
  26737. * @param {string?} encodingName
  26738. */
  26739. function packageData (bytes, type, mimeType, encodingName) {
  26740. // 1. A Blob has an associated package data algorithm, given
  26741. // bytes, a type, a optional mimeType, and a optional
  26742. // encodingName, which switches on type and runs the
  26743. // associated steps:
  26744. switch (type) {
  26745. case 'DataURL': {
  26746. // 1. Return bytes as a DataURL [RFC2397] subject to
  26747. // the considerations below:
  26748. // * Use mimeType as part of the Data URL if it is
  26749. // available in keeping with the Data URL
  26750. // specification [RFC2397].
  26751. // * If mimeType is not available return a Data URL
  26752. // without a media-type. [RFC2397].
  26753. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  26754. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  26755. // mediatype := [ type "/" subtype ] *( ";" parameter )
  26756. // data := *urlchar
  26757. // parameter := attribute "=" value
  26758. let dataURL = 'data:'
  26759. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  26760. if (parsed !== 'failure') {
  26761. dataURL += serializeAMimeType(parsed)
  26762. }
  26763. dataURL += ';base64,'
  26764. const decoder = new StringDecoder('latin1')
  26765. for (const chunk of bytes) {
  26766. dataURL += btoa(decoder.write(chunk))
  26767. }
  26768. dataURL += btoa(decoder.end())
  26769. return dataURL
  26770. }
  26771. case 'Text': {
  26772. // 1. Let encoding be failure
  26773. let encoding = 'failure'
  26774. // 2. If the encodingName is present, set encoding to the
  26775. // result of getting an encoding from encodingName.
  26776. if (encodingName) {
  26777. encoding = getEncoding(encodingName)
  26778. }
  26779. // 3. If encoding is failure, and mimeType is present:
  26780. if (encoding === 'failure' && mimeType) {
  26781. // 1. Let type be the result of parse a MIME type
  26782. // given mimeType.
  26783. const type = parseMIMEType(mimeType)
  26784. // 2. If type is not failure, set encoding to the result
  26785. // of getting an encoding from type’s parameters["charset"].
  26786. if (type !== 'failure') {
  26787. encoding = getEncoding(type.parameters.get('charset'))
  26788. }
  26789. }
  26790. // 4. If encoding is failure, then set encoding to UTF-8.
  26791. if (encoding === 'failure') {
  26792. encoding = 'UTF-8'
  26793. }
  26794. // 5. Decode bytes using fallback encoding encoding, and
  26795. // return the result.
  26796. return decode(bytes, encoding)
  26797. }
  26798. case 'ArrayBuffer': {
  26799. // Return a new ArrayBuffer whose contents are bytes.
  26800. const sequence = combineByteSequences(bytes)
  26801. return sequence.buffer
  26802. }
  26803. case 'BinaryString': {
  26804. // Return bytes as a binary string, in which every byte
  26805. // is represented by a code unit of equal value [0..255].
  26806. let binaryString = ''
  26807. const decoder = new StringDecoder('latin1')
  26808. for (const chunk of bytes) {
  26809. binaryString += decoder.write(chunk)
  26810. }
  26811. binaryString += decoder.end()
  26812. return binaryString
  26813. }
  26814. }
  26815. }
  26816. /**
  26817. * @see https://encoding.spec.whatwg.org/#decode
  26818. * @param {Uint8Array[]} ioQueue
  26819. * @param {string} encoding
  26820. */
  26821. function decode (ioQueue, encoding) {
  26822. const bytes = combineByteSequences(ioQueue)
  26823. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  26824. const BOMEncoding = BOMSniffing(bytes)
  26825. let slice = 0
  26826. // 2. If BOMEncoding is non-null:
  26827. if (BOMEncoding !== null) {
  26828. // 1. Set encoding to BOMEncoding.
  26829. encoding = BOMEncoding
  26830. // 2. Read three bytes from ioQueue, if BOMEncoding is
  26831. // UTF-8; otherwise read two bytes.
  26832. // (Do nothing with those bytes.)
  26833. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  26834. }
  26835. // 3. Process a queue with an instance of encoding’s
  26836. // decoder, ioQueue, output, and "replacement".
  26837. // 4. Return output.
  26838. const sliced = bytes.slice(slice)
  26839. return new TextDecoder(encoding).decode(sliced)
  26840. }
  26841. /**
  26842. * @see https://encoding.spec.whatwg.org/#bom-sniff
  26843. * @param {Uint8Array} ioQueue
  26844. */
  26845. function BOMSniffing (ioQueue) {
  26846. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  26847. // converted to a byte sequence.
  26848. const [a, b, c] = ioQueue
  26849. // 2. For each of the rows in the table below, starting with
  26850. // the first one and going down, if BOM starts with the
  26851. // bytes given in the first column, then return the
  26852. // encoding given in the cell in the second column of that
  26853. // row. Otherwise, return null.
  26854. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  26855. return 'UTF-8'
  26856. } else if (a === 0xFE && b === 0xFF) {
  26857. return 'UTF-16BE'
  26858. } else if (a === 0xFF && b === 0xFE) {
  26859. return 'UTF-16LE'
  26860. }
  26861. return null
  26862. }
  26863. /**
  26864. * @param {Uint8Array[]} sequences
  26865. */
  26866. function combineByteSequences (sequences) {
  26867. const size = sequences.reduce((a, b) => {
  26868. return a + b.byteLength
  26869. }, 0)
  26870. let offset = 0
  26871. return sequences.reduce((a, b) => {
  26872. a.set(b, offset)
  26873. offset += b.byteLength
  26874. return a
  26875. }, new Uint8Array(size))
  26876. }
  26877. module.exports = {
  26878. staticPropertyDescriptors,
  26879. readOperation,
  26880. fireAProgressEvent
  26881. }
  26882. /***/ }),
  26883. /***/ 1892:
  26884. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26885. "use strict";
  26886. // We include a version number for the Dispatcher API. In case of breaking changes,
  26887. // this version number must be increased to avoid conflicts.
  26888. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  26889. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26890. const Agent = __nccwpck_require__(7890)
  26891. if (getGlobalDispatcher() === undefined) {
  26892. setGlobalDispatcher(new Agent())
  26893. }
  26894. function setGlobalDispatcher (agent) {
  26895. if (!agent || typeof agent.dispatch !== 'function') {
  26896. throw new InvalidArgumentError('Argument agent must implement Agent')
  26897. }
  26898. Object.defineProperty(globalThis, globalDispatcher, {
  26899. value: agent,
  26900. writable: true,
  26901. enumerable: false,
  26902. configurable: false
  26903. })
  26904. }
  26905. function getGlobalDispatcher () {
  26906. return globalThis[globalDispatcher]
  26907. }
  26908. module.exports = {
  26909. setGlobalDispatcher,
  26910. getGlobalDispatcher
  26911. }
  26912. /***/ }),
  26913. /***/ 6930:
  26914. /***/ ((module) => {
  26915. "use strict";
  26916. module.exports = class DecoratorHandler {
  26917. constructor (handler) {
  26918. this.handler = handler
  26919. }
  26920. onConnect (...args) {
  26921. return this.handler.onConnect(...args)
  26922. }
  26923. onError (...args) {
  26924. return this.handler.onError(...args)
  26925. }
  26926. onUpgrade (...args) {
  26927. return this.handler.onUpgrade(...args)
  26928. }
  26929. onHeaders (...args) {
  26930. return this.handler.onHeaders(...args)
  26931. }
  26932. onData (...args) {
  26933. return this.handler.onData(...args)
  26934. }
  26935. onComplete (...args) {
  26936. return this.handler.onComplete(...args)
  26937. }
  26938. onBodySent (...args) {
  26939. return this.handler.onBodySent(...args)
  26940. }
  26941. }
  26942. /***/ }),
  26943. /***/ 2860:
  26944. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26945. "use strict";
  26946. const util = __nccwpck_require__(3983)
  26947. const { kBodyUsed } = __nccwpck_require__(2785)
  26948. const assert = __nccwpck_require__(9491)
  26949. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26950. const EE = __nccwpck_require__(2361)
  26951. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  26952. const kBody = Symbol('body')
  26953. class BodyAsyncIterable {
  26954. constructor (body) {
  26955. this[kBody] = body
  26956. this[kBodyUsed] = false
  26957. }
  26958. async * [Symbol.asyncIterator] () {
  26959. assert(!this[kBodyUsed], 'disturbed')
  26960. this[kBodyUsed] = true
  26961. yield * this[kBody]
  26962. }
  26963. }
  26964. class RedirectHandler {
  26965. constructor (dispatch, maxRedirections, opts, handler) {
  26966. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  26967. throw new InvalidArgumentError('maxRedirections must be a positive number')
  26968. }
  26969. util.validateHandler(handler, opts.method, opts.upgrade)
  26970. this.dispatch = dispatch
  26971. this.location = null
  26972. this.abort = null
  26973. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  26974. this.maxRedirections = maxRedirections
  26975. this.handler = handler
  26976. this.history = []
  26977. if (util.isStream(this.opts.body)) {
  26978. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  26979. // so that it can be dispatched again?
  26980. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  26981. if (util.bodyLength(this.opts.body) === 0) {
  26982. this.opts.body
  26983. .on('data', function () {
  26984. assert(false)
  26985. })
  26986. }
  26987. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  26988. this.opts.body[kBodyUsed] = false
  26989. EE.prototype.on.call(this.opts.body, 'data', function () {
  26990. this[kBodyUsed] = true
  26991. })
  26992. }
  26993. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  26994. // TODO (fix): We can't access ReadableStream internal state
  26995. // to determine whether or not it has been disturbed. This is just
  26996. // a workaround.
  26997. this.opts.body = new BodyAsyncIterable(this.opts.body)
  26998. } else if (
  26999. this.opts.body &&
  27000. typeof this.opts.body !== 'string' &&
  27001. !ArrayBuffer.isView(this.opts.body) &&
  27002. util.isIterable(this.opts.body)
  27003. ) {
  27004. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27005. // or through some other flag?
  27006. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27007. }
  27008. }
  27009. onConnect (abort) {
  27010. this.abort = abort
  27011. this.handler.onConnect(abort, { history: this.history })
  27012. }
  27013. onUpgrade (statusCode, headers, socket) {
  27014. this.handler.onUpgrade(statusCode, headers, socket)
  27015. }
  27016. onError (error) {
  27017. this.handler.onError(error)
  27018. }
  27019. onHeaders (statusCode, headers, resume, statusText) {
  27020. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27021. ? null
  27022. : parseLocation(statusCode, headers)
  27023. if (this.opts.origin) {
  27024. this.history.push(new URL(this.opts.path, this.opts.origin))
  27025. }
  27026. if (!this.location) {
  27027. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27028. }
  27029. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27030. const path = search ? `${pathname}${search}` : pathname
  27031. // Remove headers referring to the original URL.
  27032. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27033. // https://tools.ietf.org/html/rfc7231#section-6.4
  27034. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27035. this.opts.path = path
  27036. this.opts.origin = origin
  27037. this.opts.maxRedirections = 0
  27038. this.opts.query = null
  27039. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27040. // In case of HTTP 303, always replace method to be either HEAD or GET
  27041. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27042. this.opts.method = 'GET'
  27043. this.opts.body = null
  27044. }
  27045. }
  27046. onData (chunk) {
  27047. if (this.location) {
  27048. /*
  27049. https://tools.ietf.org/html/rfc7231#section-6.4
  27050. TLDR: undici always ignores 3xx response bodies.
  27051. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27052. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27053. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27054. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27055. the Location response header, so the body can be ignored safely.
  27056. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27057. response header AND a response body with the other possible location to follow.
  27058. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27059. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27060. */
  27061. } else {
  27062. return this.handler.onData(chunk)
  27063. }
  27064. }
  27065. onComplete (trailers) {
  27066. if (this.location) {
  27067. /*
  27068. https://tools.ietf.org/html/rfc7231#section-6.4
  27069. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27070. and neither are useful if present.
  27071. See comment on onData method above for more detailed informations.
  27072. */
  27073. this.location = null
  27074. this.abort = null
  27075. this.dispatch(this.opts, this)
  27076. } else {
  27077. this.handler.onComplete(trailers)
  27078. }
  27079. }
  27080. onBodySent (chunk) {
  27081. if (this.handler.onBodySent) {
  27082. this.handler.onBodySent(chunk)
  27083. }
  27084. }
  27085. }
  27086. function parseLocation (statusCode, headers) {
  27087. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27088. return null
  27089. }
  27090. for (let i = 0; i < headers.length; i += 2) {
  27091. if (headers[i].toString().toLowerCase() === 'location') {
  27092. return headers[i + 1]
  27093. }
  27094. }
  27095. }
  27096. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27097. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27098. if (header.length === 4) {
  27099. return util.headerNameToString(header) === 'host'
  27100. }
  27101. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27102. return true
  27103. }
  27104. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27105. const name = util.headerNameToString(header)
  27106. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27107. }
  27108. return false
  27109. }
  27110. // https://tools.ietf.org/html/rfc7231#section-6.4
  27111. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27112. const ret = []
  27113. if (Array.isArray(headers)) {
  27114. for (let i = 0; i < headers.length; i += 2) {
  27115. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27116. ret.push(headers[i], headers[i + 1])
  27117. }
  27118. }
  27119. } else if (headers && typeof headers === 'object') {
  27120. for (const key of Object.keys(headers)) {
  27121. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27122. ret.push(key, headers[key])
  27123. }
  27124. }
  27125. } else {
  27126. assert(headers == null, 'headers must be an object or an array')
  27127. }
  27128. return ret
  27129. }
  27130. module.exports = RedirectHandler
  27131. /***/ }),
  27132. /***/ 2286:
  27133. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27134. const assert = __nccwpck_require__(9491)
  27135. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27136. const { RequestRetryError } = __nccwpck_require__(8045)
  27137. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27138. function calculateRetryAfterHeader (retryAfter) {
  27139. const current = Date.now()
  27140. const diff = new Date(retryAfter).getTime() - current
  27141. return diff
  27142. }
  27143. class RetryHandler {
  27144. constructor (opts, handlers) {
  27145. const { retryOptions, ...dispatchOpts } = opts
  27146. const {
  27147. // Retry scoped
  27148. retry: retryFn,
  27149. maxRetries,
  27150. maxTimeout,
  27151. minTimeout,
  27152. timeoutFactor,
  27153. // Response scoped
  27154. methods,
  27155. errorCodes,
  27156. retryAfter,
  27157. statusCodes
  27158. } = retryOptions ?? {}
  27159. this.dispatch = handlers.dispatch
  27160. this.handler = handlers.handler
  27161. this.opts = dispatchOpts
  27162. this.abort = null
  27163. this.aborted = false
  27164. this.retryOpts = {
  27165. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27166. retryAfter: retryAfter ?? true,
  27167. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27168. timeout: minTimeout ?? 500, // .5s
  27169. timeoutFactor: timeoutFactor ?? 2,
  27170. maxRetries: maxRetries ?? 5,
  27171. // What errors we should retry
  27172. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27173. // Indicates which errors to retry
  27174. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27175. // List of errors to retry
  27176. errorCodes: errorCodes ?? [
  27177. 'ECONNRESET',
  27178. 'ECONNREFUSED',
  27179. 'ENOTFOUND',
  27180. 'ENETDOWN',
  27181. 'ENETUNREACH',
  27182. 'EHOSTDOWN',
  27183. 'EHOSTUNREACH',
  27184. 'EPIPE'
  27185. ]
  27186. }
  27187. this.retryCount = 0
  27188. this.start = 0
  27189. this.end = null
  27190. this.etag = null
  27191. this.resume = null
  27192. // Handle possible onConnect duplication
  27193. this.handler.onConnect(reason => {
  27194. this.aborted = true
  27195. if (this.abort) {
  27196. this.abort(reason)
  27197. } else {
  27198. this.reason = reason
  27199. }
  27200. })
  27201. }
  27202. onRequestSent () {
  27203. if (this.handler.onRequestSent) {
  27204. this.handler.onRequestSent()
  27205. }
  27206. }
  27207. onUpgrade (statusCode, headers, socket) {
  27208. if (this.handler.onUpgrade) {
  27209. this.handler.onUpgrade(statusCode, headers, socket)
  27210. }
  27211. }
  27212. onConnect (abort) {
  27213. if (this.aborted) {
  27214. abort(this.reason)
  27215. } else {
  27216. this.abort = abort
  27217. }
  27218. }
  27219. onBodySent (chunk) {
  27220. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27221. }
  27222. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27223. const { statusCode, code, headers } = err
  27224. const { method, retryOptions } = opts
  27225. const {
  27226. maxRetries,
  27227. timeout,
  27228. maxTimeout,
  27229. timeoutFactor,
  27230. statusCodes,
  27231. errorCodes,
  27232. methods
  27233. } = retryOptions
  27234. let { counter, currentTimeout } = state
  27235. currentTimeout =
  27236. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27237. // Any code that is not a Undici's originated and allowed to retry
  27238. if (
  27239. code &&
  27240. code !== 'UND_ERR_REQ_RETRY' &&
  27241. code !== 'UND_ERR_SOCKET' &&
  27242. !errorCodes.includes(code)
  27243. ) {
  27244. cb(err)
  27245. return
  27246. }
  27247. // If a set of method are provided and the current method is not in the list
  27248. if (Array.isArray(methods) && !methods.includes(method)) {
  27249. cb(err)
  27250. return
  27251. }
  27252. // If a set of status code are provided and the current status code is not in the list
  27253. if (
  27254. statusCode != null &&
  27255. Array.isArray(statusCodes) &&
  27256. !statusCodes.includes(statusCode)
  27257. ) {
  27258. cb(err)
  27259. return
  27260. }
  27261. // If we reached the max number of retries
  27262. if (counter > maxRetries) {
  27263. cb(err)
  27264. return
  27265. }
  27266. let retryAfterHeader = headers != null && headers['retry-after']
  27267. if (retryAfterHeader) {
  27268. retryAfterHeader = Number(retryAfterHeader)
  27269. retryAfterHeader = isNaN(retryAfterHeader)
  27270. ? calculateRetryAfterHeader(retryAfterHeader)
  27271. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27272. }
  27273. const retryTimeout =
  27274. retryAfterHeader > 0
  27275. ? Math.min(retryAfterHeader, maxTimeout)
  27276. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27277. state.currentTimeout = retryTimeout
  27278. setTimeout(() => cb(null), retryTimeout)
  27279. }
  27280. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27281. const headers = parseHeaders(rawHeaders)
  27282. this.retryCount += 1
  27283. if (statusCode >= 300) {
  27284. this.abort(
  27285. new RequestRetryError('Request failed', statusCode, {
  27286. headers,
  27287. count: this.retryCount
  27288. })
  27289. )
  27290. return false
  27291. }
  27292. // Checkpoint for resume from where we left it
  27293. if (this.resume != null) {
  27294. this.resume = null
  27295. if (statusCode !== 206) {
  27296. return true
  27297. }
  27298. const contentRange = parseRangeHeader(headers['content-range'])
  27299. // If no content range
  27300. if (!contentRange) {
  27301. this.abort(
  27302. new RequestRetryError('Content-Range mismatch', statusCode, {
  27303. headers,
  27304. count: this.retryCount
  27305. })
  27306. )
  27307. return false
  27308. }
  27309. // Let's start with a weak etag check
  27310. if (this.etag != null && this.etag !== headers.etag) {
  27311. this.abort(
  27312. new RequestRetryError('ETag mismatch', statusCode, {
  27313. headers,
  27314. count: this.retryCount
  27315. })
  27316. )
  27317. return false
  27318. }
  27319. const { start, size, end = size } = contentRange
  27320. assert(this.start === start, 'content-range mismatch')
  27321. assert(this.end == null || this.end === end, 'content-range mismatch')
  27322. this.resume = resume
  27323. return true
  27324. }
  27325. if (this.end == null) {
  27326. if (statusCode === 206) {
  27327. // First time we receive 206
  27328. const range = parseRangeHeader(headers['content-range'])
  27329. if (range == null) {
  27330. return this.handler.onHeaders(
  27331. statusCode,
  27332. rawHeaders,
  27333. resume,
  27334. statusMessage
  27335. )
  27336. }
  27337. const { start, size, end = size } = range
  27338. assert(
  27339. start != null && Number.isFinite(start) && this.start !== start,
  27340. 'content-range mismatch'
  27341. )
  27342. assert(Number.isFinite(start))
  27343. assert(
  27344. end != null && Number.isFinite(end) && this.end !== end,
  27345. 'invalid content-length'
  27346. )
  27347. this.start = start
  27348. this.end = end
  27349. }
  27350. // We make our best to checkpoint the body for further range headers
  27351. if (this.end == null) {
  27352. const contentLength = headers['content-length']
  27353. this.end = contentLength != null ? Number(contentLength) : null
  27354. }
  27355. assert(Number.isFinite(this.start))
  27356. assert(
  27357. this.end == null || Number.isFinite(this.end),
  27358. 'invalid content-length'
  27359. )
  27360. this.resume = resume
  27361. this.etag = headers.etag != null ? headers.etag : null
  27362. return this.handler.onHeaders(
  27363. statusCode,
  27364. rawHeaders,
  27365. resume,
  27366. statusMessage
  27367. )
  27368. }
  27369. const err = new RequestRetryError('Request failed', statusCode, {
  27370. headers,
  27371. count: this.retryCount
  27372. })
  27373. this.abort(err)
  27374. return false
  27375. }
  27376. onData (chunk) {
  27377. this.start += chunk.length
  27378. return this.handler.onData(chunk)
  27379. }
  27380. onComplete (rawTrailers) {
  27381. this.retryCount = 0
  27382. return this.handler.onComplete(rawTrailers)
  27383. }
  27384. onError (err) {
  27385. if (this.aborted || isDisturbed(this.opts.body)) {
  27386. return this.handler.onError(err)
  27387. }
  27388. this.retryOpts.retry(
  27389. err,
  27390. {
  27391. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27392. opts: { retryOptions: this.retryOpts, ...this.opts }
  27393. },
  27394. onRetry.bind(this)
  27395. )
  27396. function onRetry (err) {
  27397. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27398. return this.handler.onError(err)
  27399. }
  27400. if (this.start !== 0) {
  27401. this.opts = {
  27402. ...this.opts,
  27403. headers: {
  27404. ...this.opts.headers,
  27405. range: `bytes=${this.start}-${this.end ?? ''}`
  27406. }
  27407. }
  27408. }
  27409. try {
  27410. this.dispatch(this.opts, this)
  27411. } catch (err) {
  27412. this.handler.onError(err)
  27413. }
  27414. }
  27415. }
  27416. }
  27417. module.exports = RetryHandler
  27418. /***/ }),
  27419. /***/ 8861:
  27420. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27421. "use strict";
  27422. const RedirectHandler = __nccwpck_require__(2860)
  27423. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27424. return (dispatch) => {
  27425. return function Intercept (opts, handler) {
  27426. const { maxRedirections = defaultMaxRedirections } = opts
  27427. if (!maxRedirections) {
  27428. return dispatch(opts, handler)
  27429. }
  27430. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27431. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27432. return dispatch(opts, redirectHandler)
  27433. }
  27434. }
  27435. }
  27436. module.exports = createRedirectInterceptor
  27437. /***/ }),
  27438. /***/ 953:
  27439. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27440. "use strict";
  27441. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27442. 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;
  27443. const utils_1 = __nccwpck_require__(1891);
  27444. // C headers
  27445. var ERROR;
  27446. (function (ERROR) {
  27447. ERROR[ERROR["OK"] = 0] = "OK";
  27448. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27449. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27450. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27451. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27452. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27453. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27454. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27455. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27456. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27457. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27458. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27459. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27460. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27461. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27462. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27463. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27464. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27465. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27466. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27467. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27468. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27469. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27470. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27471. ERROR[ERROR["USER"] = 24] = "USER";
  27472. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27473. var TYPE;
  27474. (function (TYPE) {
  27475. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27476. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27477. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27478. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27479. var FLAGS;
  27480. (function (FLAGS) {
  27481. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27482. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27483. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27484. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27485. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27486. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27487. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27488. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27489. // 1 << 8 is unused
  27490. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27491. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27492. var LENIENT_FLAGS;
  27493. (function (LENIENT_FLAGS) {
  27494. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27495. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27496. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27497. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27498. var METHODS;
  27499. (function (METHODS) {
  27500. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27501. METHODS[METHODS["GET"] = 1] = "GET";
  27502. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27503. METHODS[METHODS["POST"] = 3] = "POST";
  27504. METHODS[METHODS["PUT"] = 4] = "PUT";
  27505. /* pathological */
  27506. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27507. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27508. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27509. /* WebDAV */
  27510. METHODS[METHODS["COPY"] = 8] = "COPY";
  27511. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27512. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27513. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27514. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27515. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27516. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27517. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27518. METHODS[METHODS["BIND"] = 16] = "BIND";
  27519. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27520. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27521. METHODS[METHODS["ACL"] = 19] = "ACL";
  27522. /* subversion */
  27523. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27524. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27525. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27526. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27527. /* upnp */
  27528. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27529. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27530. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27531. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27532. /* RFC-5789 */
  27533. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27534. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27535. /* CalDAV */
  27536. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27537. /* RFC-2068, section 19.6.1.2 */
  27538. METHODS[METHODS["LINK"] = 31] = "LINK";
  27539. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27540. /* icecast */
  27541. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27542. /* RFC-7540, section 11.6 */
  27543. METHODS[METHODS["PRI"] = 34] = "PRI";
  27544. /* RFC-2326 RTSP */
  27545. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27546. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27547. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27548. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27549. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27550. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27551. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27552. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27553. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27554. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27555. /* RAOP */
  27556. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27557. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27558. exports.METHODS_HTTP = [
  27559. METHODS.DELETE,
  27560. METHODS.GET,
  27561. METHODS.HEAD,
  27562. METHODS.POST,
  27563. METHODS.PUT,
  27564. METHODS.CONNECT,
  27565. METHODS.OPTIONS,
  27566. METHODS.TRACE,
  27567. METHODS.COPY,
  27568. METHODS.LOCK,
  27569. METHODS.MKCOL,
  27570. METHODS.MOVE,
  27571. METHODS.PROPFIND,
  27572. METHODS.PROPPATCH,
  27573. METHODS.SEARCH,
  27574. METHODS.UNLOCK,
  27575. METHODS.BIND,
  27576. METHODS.REBIND,
  27577. METHODS.UNBIND,
  27578. METHODS.ACL,
  27579. METHODS.REPORT,
  27580. METHODS.MKACTIVITY,
  27581. METHODS.CHECKOUT,
  27582. METHODS.MERGE,
  27583. METHODS['M-SEARCH'],
  27584. METHODS.NOTIFY,
  27585. METHODS.SUBSCRIBE,
  27586. METHODS.UNSUBSCRIBE,
  27587. METHODS.PATCH,
  27588. METHODS.PURGE,
  27589. METHODS.MKCALENDAR,
  27590. METHODS.LINK,
  27591. METHODS.UNLINK,
  27592. METHODS.PRI,
  27593. // TODO(indutny): should we allow it with HTTP?
  27594. METHODS.SOURCE,
  27595. ];
  27596. exports.METHODS_ICE = [
  27597. METHODS.SOURCE,
  27598. ];
  27599. exports.METHODS_RTSP = [
  27600. METHODS.OPTIONS,
  27601. METHODS.DESCRIBE,
  27602. METHODS.ANNOUNCE,
  27603. METHODS.SETUP,
  27604. METHODS.PLAY,
  27605. METHODS.PAUSE,
  27606. METHODS.TEARDOWN,
  27607. METHODS.GET_PARAMETER,
  27608. METHODS.SET_PARAMETER,
  27609. METHODS.REDIRECT,
  27610. METHODS.RECORD,
  27611. METHODS.FLUSH,
  27612. // For AirPlay
  27613. METHODS.GET,
  27614. METHODS.POST,
  27615. ];
  27616. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27617. exports.H_METHOD_MAP = {};
  27618. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27619. if (/^H/.test(key)) {
  27620. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27621. }
  27622. });
  27623. var FINISH;
  27624. (function (FINISH) {
  27625. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27626. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27627. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27628. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27629. exports.ALPHA = [];
  27630. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27631. // Upper case
  27632. exports.ALPHA.push(String.fromCharCode(i));
  27633. // Lower case
  27634. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27635. }
  27636. exports.NUM_MAP = {
  27637. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27638. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27639. };
  27640. exports.HEX_MAP = {
  27641. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27642. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27643. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27644. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27645. };
  27646. exports.NUM = [
  27647. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27648. ];
  27649. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27650. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27651. exports.USERINFO_CHARS = exports.ALPHANUM
  27652. .concat(exports.MARK)
  27653. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27654. // TODO(indutny): use RFC
  27655. exports.STRICT_URL_CHAR = [
  27656. '!', '"', '$', '%', '&', '\'',
  27657. '(', ')', '*', '+', ',', '-', '.', '/',
  27658. ':', ';', '<', '=', '>',
  27659. '@', '[', '\\', ']', '^', '_',
  27660. '`',
  27661. '{', '|', '}', '~',
  27662. ].concat(exports.ALPHANUM);
  27663. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27664. .concat(['\t', '\f']);
  27665. // All characters with 0x80 bit set to 1
  27666. for (let i = 0x80; i <= 0xff; i++) {
  27667. exports.URL_CHAR.push(i);
  27668. }
  27669. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27670. /* Tokens as defined by rfc 2616. Also lowercases them.
  27671. * token = 1*<any CHAR except CTLs or separators>
  27672. * separators = "(" | ")" | "<" | ">" | "@"
  27673. * | "," | ";" | ":" | "\" | <">
  27674. * | "/" | "[" | "]" | "?" | "="
  27675. * | "{" | "}" | SP | HT
  27676. */
  27677. exports.STRICT_TOKEN = [
  27678. '!', '#', '$', '%', '&', '\'',
  27679. '*', '+', '-', '.',
  27680. '^', '_', '`',
  27681. '|', '~',
  27682. ].concat(exports.ALPHANUM);
  27683. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27684. /*
  27685. * Verify that a char is a valid visible (printable) US-ASCII
  27686. * character or %x80-FF
  27687. */
  27688. exports.HEADER_CHARS = ['\t'];
  27689. for (let i = 32; i <= 255; i++) {
  27690. if (i !== 127) {
  27691. exports.HEADER_CHARS.push(i);
  27692. }
  27693. }
  27694. // ',' = \x44
  27695. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27696. exports.MAJOR = exports.NUM_MAP;
  27697. exports.MINOR = exports.MAJOR;
  27698. var HEADER_STATE;
  27699. (function (HEADER_STATE) {
  27700. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27701. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27702. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27703. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27704. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27705. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27706. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27707. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27708. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27709. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27710. exports.SPECIAL_HEADERS = {
  27711. 'connection': HEADER_STATE.CONNECTION,
  27712. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27713. 'proxy-connection': HEADER_STATE.CONNECTION,
  27714. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27715. 'upgrade': HEADER_STATE.UPGRADE,
  27716. };
  27717. //# sourceMappingURL=constants.js.map
  27718. /***/ }),
  27719. /***/ 1145:
  27720. /***/ ((module) => {
  27721. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVn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AJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8Bo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IREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIRAMtQMLAkAgASIQIAJHDQBBKyEQDLUDCwJAIBAtAAAiAUE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p4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8L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AAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHt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pAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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iASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAA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CyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgI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SSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  27726. /***/ }),
  27727. /***/ 1891:
  27728. /***/ ((__unused_webpack_module, exports) => {
  27729. "use strict";
  27730. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27731. exports.enumToMap = void 0;
  27732. function enumToMap(obj) {
  27733. const res = {};
  27734. Object.keys(obj).forEach((key) => {
  27735. const value = obj[key];
  27736. if (typeof value === 'number') {
  27737. res[key] = value;
  27738. }
  27739. });
  27740. return res;
  27741. }
  27742. exports.enumToMap = enumToMap;
  27743. //# sourceMappingURL=utils.js.map
  27744. /***/ }),
  27745. /***/ 6771:
  27746. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27747. "use strict";
  27748. const { kClients } = __nccwpck_require__(2785)
  27749. const Agent = __nccwpck_require__(7890)
  27750. const {
  27751. kAgent,
  27752. kMockAgentSet,
  27753. kMockAgentGet,
  27754. kDispatches,
  27755. kIsMockActive,
  27756. kNetConnect,
  27757. kGetNetConnect,
  27758. kOptions,
  27759. kFactory
  27760. } = __nccwpck_require__(4347)
  27761. const MockClient = __nccwpck_require__(8687)
  27762. const MockPool = __nccwpck_require__(6193)
  27763. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  27764. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  27765. const Dispatcher = __nccwpck_require__(412)
  27766. const Pluralizer = __nccwpck_require__(8891)
  27767. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  27768. class FakeWeakRef {
  27769. constructor (value) {
  27770. this.value = value
  27771. }
  27772. deref () {
  27773. return this.value
  27774. }
  27775. }
  27776. class MockAgent extends Dispatcher {
  27777. constructor (opts) {
  27778. super(opts)
  27779. this[kNetConnect] = true
  27780. this[kIsMockActive] = true
  27781. // Instantiate Agent and encapsulate
  27782. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  27783. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27784. }
  27785. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  27786. this[kAgent] = agent
  27787. this[kClients] = agent[kClients]
  27788. this[kOptions] = buildMockOptions(opts)
  27789. }
  27790. get (origin) {
  27791. let dispatcher = this[kMockAgentGet](origin)
  27792. if (!dispatcher) {
  27793. dispatcher = this[kFactory](origin)
  27794. this[kMockAgentSet](origin, dispatcher)
  27795. }
  27796. return dispatcher
  27797. }
  27798. dispatch (opts, handler) {
  27799. // Call MockAgent.get to perform additional setup before dispatching as normal
  27800. this.get(opts.origin)
  27801. return this[kAgent].dispatch(opts, handler)
  27802. }
  27803. async close () {
  27804. await this[kAgent].close()
  27805. this[kClients].clear()
  27806. }
  27807. deactivate () {
  27808. this[kIsMockActive] = false
  27809. }
  27810. activate () {
  27811. this[kIsMockActive] = true
  27812. }
  27813. enableNetConnect (matcher) {
  27814. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  27815. if (Array.isArray(this[kNetConnect])) {
  27816. this[kNetConnect].push(matcher)
  27817. } else {
  27818. this[kNetConnect] = [matcher]
  27819. }
  27820. } else if (typeof matcher === 'undefined') {
  27821. this[kNetConnect] = true
  27822. } else {
  27823. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  27824. }
  27825. }
  27826. disableNetConnect () {
  27827. this[kNetConnect] = false
  27828. }
  27829. // This is required to bypass issues caused by using global symbols - see:
  27830. // https://github.com/nodejs/undici/issues/1447
  27831. get isMockActive () {
  27832. return this[kIsMockActive]
  27833. }
  27834. [kMockAgentSet] (origin, dispatcher) {
  27835. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  27836. }
  27837. [kFactory] (origin) {
  27838. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  27839. return this[kOptions] && this[kOptions].connections === 1
  27840. ? new MockClient(origin, mockOptions)
  27841. : new MockPool(origin, mockOptions)
  27842. }
  27843. [kMockAgentGet] (origin) {
  27844. // First check if we can immediately find it
  27845. const ref = this[kClients].get(origin)
  27846. if (ref) {
  27847. return ref.deref()
  27848. }
  27849. // If the origin is not a string create a dummy parent pool and return to user
  27850. if (typeof origin !== 'string') {
  27851. const dispatcher = this[kFactory]('http://localhost:9999')
  27852. this[kMockAgentSet](origin, dispatcher)
  27853. return dispatcher
  27854. }
  27855. // If we match, create a pool and assign the same dispatches
  27856. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  27857. const nonExplicitDispatcher = nonExplicitRef.deref()
  27858. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  27859. const dispatcher = this[kFactory](origin)
  27860. this[kMockAgentSet](origin, dispatcher)
  27861. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  27862. return dispatcher
  27863. }
  27864. }
  27865. }
  27866. [kGetNetConnect] () {
  27867. return this[kNetConnect]
  27868. }
  27869. pendingInterceptors () {
  27870. const mockAgentClients = this[kClients]
  27871. return Array.from(mockAgentClients.entries())
  27872. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  27873. .filter(({ pending }) => pending)
  27874. }
  27875. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  27876. const pending = this.pendingInterceptors()
  27877. if (pending.length === 0) {
  27878. return
  27879. }
  27880. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  27881. throw new UndiciError(`
  27882. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  27883. ${pendingInterceptorsFormatter.format(pending)}
  27884. `.trim())
  27885. }
  27886. }
  27887. module.exports = MockAgent
  27888. /***/ }),
  27889. /***/ 8687:
  27890. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27891. "use strict";
  27892. const { promisify } = __nccwpck_require__(3837)
  27893. const Client = __nccwpck_require__(3598)
  27894. const { buildMockDispatch } = __nccwpck_require__(9323)
  27895. const {
  27896. kDispatches,
  27897. kMockAgent,
  27898. kClose,
  27899. kOriginalClose,
  27900. kOrigin,
  27901. kOriginalDispatch,
  27902. kConnected
  27903. } = __nccwpck_require__(4347)
  27904. const { MockInterceptor } = __nccwpck_require__(410)
  27905. const Symbols = __nccwpck_require__(2785)
  27906. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27907. /**
  27908. * MockClient provides an API that extends the Client to influence the mockDispatches.
  27909. */
  27910. class MockClient extends Client {
  27911. constructor (origin, opts) {
  27912. super(origin, opts)
  27913. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  27914. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27915. }
  27916. this[kMockAgent] = opts.agent
  27917. this[kOrigin] = origin
  27918. this[kDispatches] = []
  27919. this[kConnected] = 1
  27920. this[kOriginalDispatch] = this.dispatch
  27921. this[kOriginalClose] = this.close.bind(this)
  27922. this.dispatch = buildMockDispatch.call(this)
  27923. this.close = this[kClose]
  27924. }
  27925. get [Symbols.kConnected] () {
  27926. return this[kConnected]
  27927. }
  27928. /**
  27929. * Sets up the base interceptor for mocking replies from undici.
  27930. */
  27931. intercept (opts) {
  27932. return new MockInterceptor(opts, this[kDispatches])
  27933. }
  27934. async [kClose] () {
  27935. await promisify(this[kOriginalClose])()
  27936. this[kConnected] = 0
  27937. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  27938. }
  27939. }
  27940. module.exports = MockClient
  27941. /***/ }),
  27942. /***/ 888:
  27943. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27944. "use strict";
  27945. const { UndiciError } = __nccwpck_require__(8045)
  27946. class MockNotMatchedError extends UndiciError {
  27947. constructor (message) {
  27948. super(message)
  27949. Error.captureStackTrace(this, MockNotMatchedError)
  27950. this.name = 'MockNotMatchedError'
  27951. this.message = message || 'The request does not match any registered mock dispatches'
  27952. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  27953. }
  27954. }
  27955. module.exports = {
  27956. MockNotMatchedError
  27957. }
  27958. /***/ }),
  27959. /***/ 410:
  27960. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27961. "use strict";
  27962. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  27963. const {
  27964. kDispatches,
  27965. kDispatchKey,
  27966. kDefaultHeaders,
  27967. kDefaultTrailers,
  27968. kContentLength,
  27969. kMockDispatch
  27970. } = __nccwpck_require__(4347)
  27971. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27972. const { buildURL } = __nccwpck_require__(3983)
  27973. /**
  27974. * Defines the scope API for an interceptor reply
  27975. */
  27976. class MockScope {
  27977. constructor (mockDispatch) {
  27978. this[kMockDispatch] = mockDispatch
  27979. }
  27980. /**
  27981. * Delay a reply by a set amount in ms.
  27982. */
  27983. delay (waitInMs) {
  27984. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  27985. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  27986. }
  27987. this[kMockDispatch].delay = waitInMs
  27988. return this
  27989. }
  27990. /**
  27991. * For a defined reply, never mark as consumed.
  27992. */
  27993. persist () {
  27994. this[kMockDispatch].persist = true
  27995. return this
  27996. }
  27997. /**
  27998. * Allow one to define a reply for a set amount of matching requests.
  27999. */
  28000. times (repeatTimes) {
  28001. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28002. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28003. }
  28004. this[kMockDispatch].times = repeatTimes
  28005. return this
  28006. }
  28007. }
  28008. /**
  28009. * Defines an interceptor for a Mock
  28010. */
  28011. class MockInterceptor {
  28012. constructor (opts, mockDispatches) {
  28013. if (typeof opts !== 'object') {
  28014. throw new InvalidArgumentError('opts must be an object')
  28015. }
  28016. if (typeof opts.path === 'undefined') {
  28017. throw new InvalidArgumentError('opts.path must be defined')
  28018. }
  28019. if (typeof opts.method === 'undefined') {
  28020. opts.method = 'GET'
  28021. }
  28022. // See https://github.com/nodejs/undici/issues/1245
  28023. // As per RFC 3986, clients are not supposed to send URI
  28024. // fragments to servers when they retrieve a document,
  28025. if (typeof opts.path === 'string') {
  28026. if (opts.query) {
  28027. opts.path = buildURL(opts.path, opts.query)
  28028. } else {
  28029. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28030. const parsedURL = new URL(opts.path, 'data://')
  28031. opts.path = parsedURL.pathname + parsedURL.search
  28032. }
  28033. }
  28034. if (typeof opts.method === 'string') {
  28035. opts.method = opts.method.toUpperCase()
  28036. }
  28037. this[kDispatchKey] = buildKey(opts)
  28038. this[kDispatches] = mockDispatches
  28039. this[kDefaultHeaders] = {}
  28040. this[kDefaultTrailers] = {}
  28041. this[kContentLength] = false
  28042. }
  28043. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28044. const responseData = getResponseData(data)
  28045. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28046. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28047. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28048. return { statusCode, data, headers, trailers }
  28049. }
  28050. validateReplyParameters (statusCode, data, responseOptions) {
  28051. if (typeof statusCode === 'undefined') {
  28052. throw new InvalidArgumentError('statusCode must be defined')
  28053. }
  28054. if (typeof data === 'undefined') {
  28055. throw new InvalidArgumentError('data must be defined')
  28056. }
  28057. if (typeof responseOptions !== 'object') {
  28058. throw new InvalidArgumentError('responseOptions must be an object')
  28059. }
  28060. }
  28061. /**
  28062. * Mock an undici request with a defined reply.
  28063. */
  28064. reply (replyData) {
  28065. // Values of reply aren't available right now as they
  28066. // can only be available when the reply callback is invoked.
  28067. if (typeof replyData === 'function') {
  28068. // We'll first wrap the provided callback in another function,
  28069. // this function will properly resolve the data from the callback
  28070. // when invoked.
  28071. const wrappedDefaultsCallback = (opts) => {
  28072. // Our reply options callback contains the parameter for statusCode, data and options.
  28073. const resolvedData = replyData(opts)
  28074. // Check if it is in the right format
  28075. if (typeof resolvedData !== 'object') {
  28076. throw new InvalidArgumentError('reply options callback must return an object')
  28077. }
  28078. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28079. this.validateReplyParameters(statusCode, data, responseOptions)
  28080. // Since the values can be obtained immediately we return them
  28081. // from this higher order function that will be resolved later.
  28082. return {
  28083. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28084. }
  28085. }
  28086. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28087. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28088. return new MockScope(newMockDispatch)
  28089. }
  28090. // We can have either one or three parameters, if we get here,
  28091. // we should have 1-3 parameters. So we spread the arguments of
  28092. // this function to obtain the parameters, since replyData will always
  28093. // just be the statusCode.
  28094. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28095. this.validateReplyParameters(statusCode, data, responseOptions)
  28096. // Send in-already provided data like usual
  28097. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28098. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28099. return new MockScope(newMockDispatch)
  28100. }
  28101. /**
  28102. * Mock an undici request with a defined error.
  28103. */
  28104. replyWithError (error) {
  28105. if (typeof error === 'undefined') {
  28106. throw new InvalidArgumentError('error must be defined')
  28107. }
  28108. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28109. return new MockScope(newMockDispatch)
  28110. }
  28111. /**
  28112. * Set default reply headers on the interceptor for subsequent replies
  28113. */
  28114. defaultReplyHeaders (headers) {
  28115. if (typeof headers === 'undefined') {
  28116. throw new InvalidArgumentError('headers must be defined')
  28117. }
  28118. this[kDefaultHeaders] = headers
  28119. return this
  28120. }
  28121. /**
  28122. * Set default reply trailers on the interceptor for subsequent replies
  28123. */
  28124. defaultReplyTrailers (trailers) {
  28125. if (typeof trailers === 'undefined') {
  28126. throw new InvalidArgumentError('trailers must be defined')
  28127. }
  28128. this[kDefaultTrailers] = trailers
  28129. return this
  28130. }
  28131. /**
  28132. * Set reply content length header for replies on the interceptor
  28133. */
  28134. replyContentLength () {
  28135. this[kContentLength] = true
  28136. return this
  28137. }
  28138. }
  28139. module.exports.MockInterceptor = MockInterceptor
  28140. module.exports.MockScope = MockScope
  28141. /***/ }),
  28142. /***/ 6193:
  28143. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28144. "use strict";
  28145. const { promisify } = __nccwpck_require__(3837)
  28146. const Pool = __nccwpck_require__(4634)
  28147. const { buildMockDispatch } = __nccwpck_require__(9323)
  28148. const {
  28149. kDispatches,
  28150. kMockAgent,
  28151. kClose,
  28152. kOriginalClose,
  28153. kOrigin,
  28154. kOriginalDispatch,
  28155. kConnected
  28156. } = __nccwpck_require__(4347)
  28157. const { MockInterceptor } = __nccwpck_require__(410)
  28158. const Symbols = __nccwpck_require__(2785)
  28159. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28160. /**
  28161. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28162. */
  28163. class MockPool extends Pool {
  28164. constructor (origin, opts) {
  28165. super(origin, opts)
  28166. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28167. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28168. }
  28169. this[kMockAgent] = opts.agent
  28170. this[kOrigin] = origin
  28171. this[kDispatches] = []
  28172. this[kConnected] = 1
  28173. this[kOriginalDispatch] = this.dispatch
  28174. this[kOriginalClose] = this.close.bind(this)
  28175. this.dispatch = buildMockDispatch.call(this)
  28176. this.close = this[kClose]
  28177. }
  28178. get [Symbols.kConnected] () {
  28179. return this[kConnected]
  28180. }
  28181. /**
  28182. * Sets up the base interceptor for mocking replies from undici.
  28183. */
  28184. intercept (opts) {
  28185. return new MockInterceptor(opts, this[kDispatches])
  28186. }
  28187. async [kClose] () {
  28188. await promisify(this[kOriginalClose])()
  28189. this[kConnected] = 0
  28190. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28191. }
  28192. }
  28193. module.exports = MockPool
  28194. /***/ }),
  28195. /***/ 4347:
  28196. /***/ ((module) => {
  28197. "use strict";
  28198. module.exports = {
  28199. kAgent: Symbol('agent'),
  28200. kOptions: Symbol('options'),
  28201. kFactory: Symbol('factory'),
  28202. kDispatches: Symbol('dispatches'),
  28203. kDispatchKey: Symbol('dispatch key'),
  28204. kDefaultHeaders: Symbol('default headers'),
  28205. kDefaultTrailers: Symbol('default trailers'),
  28206. kContentLength: Symbol('content length'),
  28207. kMockAgent: Symbol('mock agent'),
  28208. kMockAgentSet: Symbol('mock agent set'),
  28209. kMockAgentGet: Symbol('mock agent get'),
  28210. kMockDispatch: Symbol('mock dispatch'),
  28211. kClose: Symbol('close'),
  28212. kOriginalClose: Symbol('original agent close'),
  28213. kOrigin: Symbol('origin'),
  28214. kIsMockActive: Symbol('is mock active'),
  28215. kNetConnect: Symbol('net connect'),
  28216. kGetNetConnect: Symbol('get net connect'),
  28217. kConnected: Symbol('connected')
  28218. }
  28219. /***/ }),
  28220. /***/ 9323:
  28221. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28222. "use strict";
  28223. const { MockNotMatchedError } = __nccwpck_require__(888)
  28224. const {
  28225. kDispatches,
  28226. kMockAgent,
  28227. kOriginalDispatch,
  28228. kOrigin,
  28229. kGetNetConnect
  28230. } = __nccwpck_require__(4347)
  28231. const { buildURL, nop } = __nccwpck_require__(3983)
  28232. const { STATUS_CODES } = __nccwpck_require__(3685)
  28233. const {
  28234. types: {
  28235. isPromise
  28236. }
  28237. } = __nccwpck_require__(3837)
  28238. function matchValue (match, value) {
  28239. if (typeof match === 'string') {
  28240. return match === value
  28241. }
  28242. if (match instanceof RegExp) {
  28243. return match.test(value)
  28244. }
  28245. if (typeof match === 'function') {
  28246. return match(value) === true
  28247. }
  28248. return false
  28249. }
  28250. function lowerCaseEntries (headers) {
  28251. return Object.fromEntries(
  28252. Object.entries(headers).map(([headerName, headerValue]) => {
  28253. return [headerName.toLocaleLowerCase(), headerValue]
  28254. })
  28255. )
  28256. }
  28257. /**
  28258. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28259. * @param {string} key
  28260. */
  28261. function getHeaderByName (headers, key) {
  28262. if (Array.isArray(headers)) {
  28263. for (let i = 0; i < headers.length; i += 2) {
  28264. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28265. return headers[i + 1]
  28266. }
  28267. }
  28268. return undefined
  28269. } else if (typeof headers.get === 'function') {
  28270. return headers.get(key)
  28271. } else {
  28272. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28273. }
  28274. }
  28275. /** @param {string[]} headers */
  28276. function buildHeadersFromArray (headers) { // fetch HeadersList
  28277. const clone = headers.slice()
  28278. const entries = []
  28279. for (let index = 0; index < clone.length; index += 2) {
  28280. entries.push([clone[index], clone[index + 1]])
  28281. }
  28282. return Object.fromEntries(entries)
  28283. }
  28284. function matchHeaders (mockDispatch, headers) {
  28285. if (typeof mockDispatch.headers === 'function') {
  28286. if (Array.isArray(headers)) { // fetch HeadersList
  28287. headers = buildHeadersFromArray(headers)
  28288. }
  28289. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28290. }
  28291. if (typeof mockDispatch.headers === 'undefined') {
  28292. return true
  28293. }
  28294. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28295. return false
  28296. }
  28297. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28298. const headerValue = getHeaderByName(headers, matchHeaderName)
  28299. if (!matchValue(matchHeaderValue, headerValue)) {
  28300. return false
  28301. }
  28302. }
  28303. return true
  28304. }
  28305. function safeUrl (path) {
  28306. if (typeof path !== 'string') {
  28307. return path
  28308. }
  28309. const pathSegments = path.split('?')
  28310. if (pathSegments.length !== 2) {
  28311. return path
  28312. }
  28313. const qp = new URLSearchParams(pathSegments.pop())
  28314. qp.sort()
  28315. return [...pathSegments, qp.toString()].join('?')
  28316. }
  28317. function matchKey (mockDispatch, { path, method, body, headers }) {
  28318. const pathMatch = matchValue(mockDispatch.path, path)
  28319. const methodMatch = matchValue(mockDispatch.method, method)
  28320. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28321. const headersMatch = matchHeaders(mockDispatch, headers)
  28322. return pathMatch && methodMatch && bodyMatch && headersMatch
  28323. }
  28324. function getResponseData (data) {
  28325. if (Buffer.isBuffer(data)) {
  28326. return data
  28327. } else if (typeof data === 'object') {
  28328. return JSON.stringify(data)
  28329. } else {
  28330. return data.toString()
  28331. }
  28332. }
  28333. function getMockDispatch (mockDispatches, key) {
  28334. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28335. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28336. // Match path
  28337. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28338. if (matchedMockDispatches.length === 0) {
  28339. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28340. }
  28341. // Match method
  28342. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28343. if (matchedMockDispatches.length === 0) {
  28344. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28345. }
  28346. // Match body
  28347. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28348. if (matchedMockDispatches.length === 0) {
  28349. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28350. }
  28351. // Match headers
  28352. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28353. if (matchedMockDispatches.length === 0) {
  28354. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28355. }
  28356. return matchedMockDispatches[0]
  28357. }
  28358. function addMockDispatch (mockDispatches, key, data) {
  28359. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28360. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28361. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28362. mockDispatches.push(newMockDispatch)
  28363. return newMockDispatch
  28364. }
  28365. function deleteMockDispatch (mockDispatches, key) {
  28366. const index = mockDispatches.findIndex(dispatch => {
  28367. if (!dispatch.consumed) {
  28368. return false
  28369. }
  28370. return matchKey(dispatch, key)
  28371. })
  28372. if (index !== -1) {
  28373. mockDispatches.splice(index, 1)
  28374. }
  28375. }
  28376. function buildKey (opts) {
  28377. const { path, method, body, headers, query } = opts
  28378. return {
  28379. path,
  28380. method,
  28381. body,
  28382. headers,
  28383. query
  28384. }
  28385. }
  28386. function generateKeyValues (data) {
  28387. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28388. ...keyValuePairs,
  28389. Buffer.from(`${key}`),
  28390. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28391. ], [])
  28392. }
  28393. /**
  28394. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28395. * @param {number} statusCode
  28396. */
  28397. function getStatusText (statusCode) {
  28398. return STATUS_CODES[statusCode] || 'unknown'
  28399. }
  28400. async function getResponse (body) {
  28401. const buffers = []
  28402. for await (const data of body) {
  28403. buffers.push(data)
  28404. }
  28405. return Buffer.concat(buffers).toString('utf8')
  28406. }
  28407. /**
  28408. * Mock dispatch function used to simulate undici dispatches
  28409. */
  28410. function mockDispatch (opts, handler) {
  28411. // Get mock dispatch from built key
  28412. const key = buildKey(opts)
  28413. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28414. mockDispatch.timesInvoked++
  28415. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28416. if (mockDispatch.data.callback) {
  28417. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28418. }
  28419. // Parse mockDispatch data
  28420. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28421. const { timesInvoked, times } = mockDispatch
  28422. // If it's used up and not persistent, mark as consumed
  28423. mockDispatch.consumed = !persist && timesInvoked >= times
  28424. mockDispatch.pending = timesInvoked < times
  28425. // If specified, trigger dispatch error
  28426. if (error !== null) {
  28427. deleteMockDispatch(this[kDispatches], key)
  28428. handler.onError(error)
  28429. return true
  28430. }
  28431. // Handle the request with a delay if necessary
  28432. if (typeof delay === 'number' && delay > 0) {
  28433. setTimeout(() => {
  28434. handleReply(this[kDispatches])
  28435. }, delay)
  28436. } else {
  28437. handleReply(this[kDispatches])
  28438. }
  28439. function handleReply (mockDispatches, _data = data) {
  28440. // fetch's HeadersList is a 1D string array
  28441. const optsHeaders = Array.isArray(opts.headers)
  28442. ? buildHeadersFromArray(opts.headers)
  28443. : opts.headers
  28444. const body = typeof _data === 'function'
  28445. ? _data({ ...opts, headers: optsHeaders })
  28446. : _data
  28447. // util.types.isPromise is likely needed for jest.
  28448. if (isPromise(body)) {
  28449. // If handleReply is asynchronous, throwing an error
  28450. // in the callback will reject the promise, rather than
  28451. // synchronously throw the error, which breaks some tests.
  28452. // Rather, we wait for the callback to resolve if it is a
  28453. // promise, and then re-run handleReply with the new body.
  28454. body.then((newData) => handleReply(mockDispatches, newData))
  28455. return
  28456. }
  28457. const responseData = getResponseData(body)
  28458. const responseHeaders = generateKeyValues(headers)
  28459. const responseTrailers = generateKeyValues(trailers)
  28460. handler.abort = nop
  28461. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28462. handler.onData(Buffer.from(responseData))
  28463. handler.onComplete(responseTrailers)
  28464. deleteMockDispatch(mockDispatches, key)
  28465. }
  28466. function resume () {}
  28467. return true
  28468. }
  28469. function buildMockDispatch () {
  28470. const agent = this[kMockAgent]
  28471. const origin = this[kOrigin]
  28472. const originalDispatch = this[kOriginalDispatch]
  28473. return function dispatch (opts, handler) {
  28474. if (agent.isMockActive) {
  28475. try {
  28476. mockDispatch.call(this, opts, handler)
  28477. } catch (error) {
  28478. if (error instanceof MockNotMatchedError) {
  28479. const netConnect = agent[kGetNetConnect]()
  28480. if (netConnect === false) {
  28481. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28482. }
  28483. if (checkNetConnect(netConnect, origin)) {
  28484. originalDispatch.call(this, opts, handler)
  28485. } else {
  28486. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28487. }
  28488. } else {
  28489. throw error
  28490. }
  28491. }
  28492. } else {
  28493. originalDispatch.call(this, opts, handler)
  28494. }
  28495. }
  28496. }
  28497. function checkNetConnect (netConnect, origin) {
  28498. const url = new URL(origin)
  28499. if (netConnect === true) {
  28500. return true
  28501. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28502. return true
  28503. }
  28504. return false
  28505. }
  28506. function buildMockOptions (opts) {
  28507. if (opts) {
  28508. const { agent, ...mockOptions } = opts
  28509. return mockOptions
  28510. }
  28511. }
  28512. module.exports = {
  28513. getResponseData,
  28514. getMockDispatch,
  28515. addMockDispatch,
  28516. deleteMockDispatch,
  28517. buildKey,
  28518. generateKeyValues,
  28519. matchValue,
  28520. getResponse,
  28521. getStatusText,
  28522. mockDispatch,
  28523. buildMockDispatch,
  28524. checkNetConnect,
  28525. buildMockOptions,
  28526. getHeaderByName
  28527. }
  28528. /***/ }),
  28529. /***/ 6823:
  28530. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28531. "use strict";
  28532. const { Transform } = __nccwpck_require__(2781)
  28533. const { Console } = __nccwpck_require__(6206)
  28534. /**
  28535. * Gets the output of `console.table(…)` as a string.
  28536. */
  28537. module.exports = class PendingInterceptorsFormatter {
  28538. constructor ({ disableColors } = {}) {
  28539. this.transform = new Transform({
  28540. transform (chunk, _enc, cb) {
  28541. cb(null, chunk)
  28542. }
  28543. })
  28544. this.logger = new Console({
  28545. stdout: this.transform,
  28546. inspectOptions: {
  28547. colors: !disableColors && !process.env.CI
  28548. }
  28549. })
  28550. }
  28551. format (pendingInterceptors) {
  28552. const withPrettyHeaders = pendingInterceptors.map(
  28553. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28554. Method: method,
  28555. Origin: origin,
  28556. Path: path,
  28557. 'Status code': statusCode,
  28558. Persistent: persist ? '✅' : '❌',
  28559. Invocations: timesInvoked,
  28560. Remaining: persist ? Infinity : times - timesInvoked
  28561. }))
  28562. this.logger.table(withPrettyHeaders)
  28563. return this.transform.read().toString()
  28564. }
  28565. }
  28566. /***/ }),
  28567. /***/ 8891:
  28568. /***/ ((module) => {
  28569. "use strict";
  28570. const singulars = {
  28571. pronoun: 'it',
  28572. is: 'is',
  28573. was: 'was',
  28574. this: 'this'
  28575. }
  28576. const plurals = {
  28577. pronoun: 'they',
  28578. is: 'are',
  28579. was: 'were',
  28580. this: 'these'
  28581. }
  28582. module.exports = class Pluralizer {
  28583. constructor (singular, plural) {
  28584. this.singular = singular
  28585. this.plural = plural
  28586. }
  28587. pluralize (count) {
  28588. const one = count === 1
  28589. const keys = one ? singulars : plurals
  28590. const noun = one ? this.singular : this.plural
  28591. return { ...keys, count, noun }
  28592. }
  28593. }
  28594. /***/ }),
  28595. /***/ 8266:
  28596. /***/ ((module) => {
  28597. "use strict";
  28598. /* eslint-disable */
  28599. // Extracted from node/lib/internal/fixed_queue.js
  28600. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28601. const kSize = 2048;
  28602. const kMask = kSize - 1;
  28603. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28604. // circular buffers. It looks something like this:
  28605. //
  28606. // head tail
  28607. // | |
  28608. // v v
  28609. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28610. // | [null] | \----- | next | \------- | next |
  28611. // +-----------+ +-----------+ +-----------+
  28612. // | item | <-- bottom | item | <-- bottom | [empty] |
  28613. // | item | | item | | [empty] |
  28614. // | item | | item | | [empty] |
  28615. // | item | | item | | [empty] |
  28616. // | item | | item | bottom --> | item |
  28617. // | item | | item | | item |
  28618. // | ... | | ... | | ... |
  28619. // | item | | item | | item |
  28620. // | item | | item | | item |
  28621. // | [empty] | <-- top | item | | item |
  28622. // | [empty] | | item | | item |
  28623. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28624. // +-----------+ +-----------+ +-----------+
  28625. //
  28626. // Or, if there is only one circular buffer, it looks something
  28627. // like either of these:
  28628. //
  28629. // head tail head tail
  28630. // | | | |
  28631. // v v v v
  28632. // +-----------+ +-----------+
  28633. // | [null] | | [null] |
  28634. // +-----------+ +-----------+
  28635. // | [empty] | | item |
  28636. // | [empty] | | item |
  28637. // | item | <-- bottom top --> | [empty] |
  28638. // | item | | [empty] |
  28639. // | [empty] | <-- top bottom --> | item |
  28640. // | [empty] | | item |
  28641. // +-----------+ +-----------+
  28642. //
  28643. // Adding a value means moving `top` forward by one, removing means
  28644. // moving `bottom` forward by one. After reaching the end, the queue
  28645. // wraps around.
  28646. //
  28647. // When `top === bottom` the current queue is empty and when
  28648. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28649. // but allows much quicker checks.
  28650. class FixedCircularBuffer {
  28651. constructor() {
  28652. this.bottom = 0;
  28653. this.top = 0;
  28654. this.list = new Array(kSize);
  28655. this.next = null;
  28656. }
  28657. isEmpty() {
  28658. return this.top === this.bottom;
  28659. }
  28660. isFull() {
  28661. return ((this.top + 1) & kMask) === this.bottom;
  28662. }
  28663. push(data) {
  28664. this.list[this.top] = data;
  28665. this.top = (this.top + 1) & kMask;
  28666. }
  28667. shift() {
  28668. const nextItem = this.list[this.bottom];
  28669. if (nextItem === undefined)
  28670. return null;
  28671. this.list[this.bottom] = undefined;
  28672. this.bottom = (this.bottom + 1) & kMask;
  28673. return nextItem;
  28674. }
  28675. }
  28676. module.exports = class FixedQueue {
  28677. constructor() {
  28678. this.head = this.tail = new FixedCircularBuffer();
  28679. }
  28680. isEmpty() {
  28681. return this.head.isEmpty();
  28682. }
  28683. push(data) {
  28684. if (this.head.isFull()) {
  28685. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28686. // and sets it as the new main queue.
  28687. this.head = this.head.next = new FixedCircularBuffer();
  28688. }
  28689. this.head.push(data);
  28690. }
  28691. shift() {
  28692. const tail = this.tail;
  28693. const next = tail.shift();
  28694. if (tail.isEmpty() && tail.next !== null) {
  28695. // If there is another queue, it forms the new tail.
  28696. this.tail = tail.next;
  28697. }
  28698. return next;
  28699. }
  28700. };
  28701. /***/ }),
  28702. /***/ 3198:
  28703. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28704. "use strict";
  28705. const DispatcherBase = __nccwpck_require__(4839)
  28706. const FixedQueue = __nccwpck_require__(8266)
  28707. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28708. const PoolStats = __nccwpck_require__(9689)
  28709. const kClients = Symbol('clients')
  28710. const kNeedDrain = Symbol('needDrain')
  28711. const kQueue = Symbol('queue')
  28712. const kClosedResolve = Symbol('closed resolve')
  28713. const kOnDrain = Symbol('onDrain')
  28714. const kOnConnect = Symbol('onConnect')
  28715. const kOnDisconnect = Symbol('onDisconnect')
  28716. const kOnConnectionError = Symbol('onConnectionError')
  28717. const kGetDispatcher = Symbol('get dispatcher')
  28718. const kAddClient = Symbol('add client')
  28719. const kRemoveClient = Symbol('remove client')
  28720. const kStats = Symbol('stats')
  28721. class PoolBase extends DispatcherBase {
  28722. constructor () {
  28723. super()
  28724. this[kQueue] = new FixedQueue()
  28725. this[kClients] = []
  28726. this[kQueued] = 0
  28727. const pool = this
  28728. this[kOnDrain] = function onDrain (origin, targets) {
  28729. const queue = pool[kQueue]
  28730. let needDrain = false
  28731. while (!needDrain) {
  28732. const item = queue.shift()
  28733. if (!item) {
  28734. break
  28735. }
  28736. pool[kQueued]--
  28737. needDrain = !this.dispatch(item.opts, item.handler)
  28738. }
  28739. this[kNeedDrain] = needDrain
  28740. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  28741. pool[kNeedDrain] = false
  28742. pool.emit('drain', origin, [pool, ...targets])
  28743. }
  28744. if (pool[kClosedResolve] && queue.isEmpty()) {
  28745. Promise
  28746. .all(pool[kClients].map(c => c.close()))
  28747. .then(pool[kClosedResolve])
  28748. }
  28749. }
  28750. this[kOnConnect] = (origin, targets) => {
  28751. pool.emit('connect', origin, [pool, ...targets])
  28752. }
  28753. this[kOnDisconnect] = (origin, targets, err) => {
  28754. pool.emit('disconnect', origin, [pool, ...targets], err)
  28755. }
  28756. this[kOnConnectionError] = (origin, targets, err) => {
  28757. pool.emit('connectionError', origin, [pool, ...targets], err)
  28758. }
  28759. this[kStats] = new PoolStats(this)
  28760. }
  28761. get [kBusy] () {
  28762. return this[kNeedDrain]
  28763. }
  28764. get [kConnected] () {
  28765. return this[kClients].filter(client => client[kConnected]).length
  28766. }
  28767. get [kFree] () {
  28768. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  28769. }
  28770. get [kPending] () {
  28771. let ret = this[kQueued]
  28772. for (const { [kPending]: pending } of this[kClients]) {
  28773. ret += pending
  28774. }
  28775. return ret
  28776. }
  28777. get [kRunning] () {
  28778. let ret = 0
  28779. for (const { [kRunning]: running } of this[kClients]) {
  28780. ret += running
  28781. }
  28782. return ret
  28783. }
  28784. get [kSize] () {
  28785. let ret = this[kQueued]
  28786. for (const { [kSize]: size } of this[kClients]) {
  28787. ret += size
  28788. }
  28789. return ret
  28790. }
  28791. get stats () {
  28792. return this[kStats]
  28793. }
  28794. async [kClose] () {
  28795. if (this[kQueue].isEmpty()) {
  28796. return Promise.all(this[kClients].map(c => c.close()))
  28797. } else {
  28798. return new Promise((resolve) => {
  28799. this[kClosedResolve] = resolve
  28800. })
  28801. }
  28802. }
  28803. async [kDestroy] (err) {
  28804. while (true) {
  28805. const item = this[kQueue].shift()
  28806. if (!item) {
  28807. break
  28808. }
  28809. item.handler.onError(err)
  28810. }
  28811. return Promise.all(this[kClients].map(c => c.destroy(err)))
  28812. }
  28813. [kDispatch] (opts, handler) {
  28814. const dispatcher = this[kGetDispatcher]()
  28815. if (!dispatcher) {
  28816. this[kNeedDrain] = true
  28817. this[kQueue].push({ opts, handler })
  28818. this[kQueued]++
  28819. } else if (!dispatcher.dispatch(opts, handler)) {
  28820. dispatcher[kNeedDrain] = true
  28821. this[kNeedDrain] = !this[kGetDispatcher]()
  28822. }
  28823. return !this[kNeedDrain]
  28824. }
  28825. [kAddClient] (client) {
  28826. client
  28827. .on('drain', this[kOnDrain])
  28828. .on('connect', this[kOnConnect])
  28829. .on('disconnect', this[kOnDisconnect])
  28830. .on('connectionError', this[kOnConnectionError])
  28831. this[kClients].push(client)
  28832. if (this[kNeedDrain]) {
  28833. process.nextTick(() => {
  28834. if (this[kNeedDrain]) {
  28835. this[kOnDrain](client[kUrl], [this, client])
  28836. }
  28837. })
  28838. }
  28839. return this
  28840. }
  28841. [kRemoveClient] (client) {
  28842. client.close(() => {
  28843. const idx = this[kClients].indexOf(client)
  28844. if (idx !== -1) {
  28845. this[kClients].splice(idx, 1)
  28846. }
  28847. })
  28848. this[kNeedDrain] = this[kClients].some(dispatcher => (
  28849. !dispatcher[kNeedDrain] &&
  28850. dispatcher.closed !== true &&
  28851. dispatcher.destroyed !== true
  28852. ))
  28853. }
  28854. }
  28855. module.exports = {
  28856. PoolBase,
  28857. kClients,
  28858. kNeedDrain,
  28859. kAddClient,
  28860. kRemoveClient,
  28861. kGetDispatcher
  28862. }
  28863. /***/ }),
  28864. /***/ 9689:
  28865. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28866. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  28867. const kPool = Symbol('pool')
  28868. class PoolStats {
  28869. constructor (pool) {
  28870. this[kPool] = pool
  28871. }
  28872. get connected () {
  28873. return this[kPool][kConnected]
  28874. }
  28875. get free () {
  28876. return this[kPool][kFree]
  28877. }
  28878. get pending () {
  28879. return this[kPool][kPending]
  28880. }
  28881. get queued () {
  28882. return this[kPool][kQueued]
  28883. }
  28884. get running () {
  28885. return this[kPool][kRunning]
  28886. }
  28887. get size () {
  28888. return this[kPool][kSize]
  28889. }
  28890. }
  28891. module.exports = PoolStats
  28892. /***/ }),
  28893. /***/ 4634:
  28894. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28895. "use strict";
  28896. const {
  28897. PoolBase,
  28898. kClients,
  28899. kNeedDrain,
  28900. kAddClient,
  28901. kGetDispatcher
  28902. } = __nccwpck_require__(3198)
  28903. const Client = __nccwpck_require__(3598)
  28904. const {
  28905. InvalidArgumentError
  28906. } = __nccwpck_require__(8045)
  28907. const util = __nccwpck_require__(3983)
  28908. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  28909. const buildConnector = __nccwpck_require__(2067)
  28910. const kOptions = Symbol('options')
  28911. const kConnections = Symbol('connections')
  28912. const kFactory = Symbol('factory')
  28913. function defaultFactory (origin, opts) {
  28914. return new Client(origin, opts)
  28915. }
  28916. class Pool extends PoolBase {
  28917. constructor (origin, {
  28918. connections,
  28919. factory = defaultFactory,
  28920. connect,
  28921. connectTimeout,
  28922. tls,
  28923. maxCachedSessions,
  28924. socketPath,
  28925. autoSelectFamily,
  28926. autoSelectFamilyAttemptTimeout,
  28927. allowH2,
  28928. ...options
  28929. } = {}) {
  28930. super()
  28931. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  28932. throw new InvalidArgumentError('invalid connections')
  28933. }
  28934. if (typeof factory !== 'function') {
  28935. throw new InvalidArgumentError('factory must be a function.')
  28936. }
  28937. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  28938. throw new InvalidArgumentError('connect must be a function or an object')
  28939. }
  28940. if (typeof connect !== 'function') {
  28941. connect = buildConnector({
  28942. ...tls,
  28943. maxCachedSessions,
  28944. allowH2,
  28945. socketPath,
  28946. timeout: connectTimeout,
  28947. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  28948. ...connect
  28949. })
  28950. }
  28951. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  28952. ? options.interceptors.Pool
  28953. : []
  28954. this[kConnections] = connections || null
  28955. this[kUrl] = util.parseOrigin(origin)
  28956. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  28957. this[kOptions].interceptors = options.interceptors
  28958. ? { ...options.interceptors }
  28959. : undefined
  28960. this[kFactory] = factory
  28961. }
  28962. [kGetDispatcher] () {
  28963. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  28964. if (dispatcher) {
  28965. return dispatcher
  28966. }
  28967. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  28968. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  28969. this[kAddClient](dispatcher)
  28970. }
  28971. return dispatcher
  28972. }
  28973. }
  28974. module.exports = Pool
  28975. /***/ }),
  28976. /***/ 7858:
  28977. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28978. "use strict";
  28979. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  28980. const { URL } = __nccwpck_require__(7310)
  28981. const Agent = __nccwpck_require__(7890)
  28982. const Pool = __nccwpck_require__(4634)
  28983. const DispatcherBase = __nccwpck_require__(4839)
  28984. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  28985. const buildConnector = __nccwpck_require__(2067)
  28986. const kAgent = Symbol('proxy agent')
  28987. const kClient = Symbol('proxy client')
  28988. const kProxyHeaders = Symbol('proxy headers')
  28989. const kRequestTls = Symbol('request tls settings')
  28990. const kProxyTls = Symbol('proxy tls settings')
  28991. const kConnectEndpoint = Symbol('connect endpoint function')
  28992. function defaultProtocolPort (protocol) {
  28993. return protocol === 'https:' ? 443 : 80
  28994. }
  28995. function buildProxyOptions (opts) {
  28996. if (typeof opts === 'string') {
  28997. opts = { uri: opts }
  28998. }
  28999. if (!opts || !opts.uri) {
  29000. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29001. }
  29002. return {
  29003. uri: opts.uri,
  29004. protocol: opts.protocol || 'https'
  29005. }
  29006. }
  29007. function defaultFactory (origin, opts) {
  29008. return new Pool(origin, opts)
  29009. }
  29010. class ProxyAgent extends DispatcherBase {
  29011. constructor (opts) {
  29012. super(opts)
  29013. this[kProxy] = buildProxyOptions(opts)
  29014. this[kAgent] = new Agent(opts)
  29015. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29016. ? opts.interceptors.ProxyAgent
  29017. : []
  29018. if (typeof opts === 'string') {
  29019. opts = { uri: opts }
  29020. }
  29021. if (!opts || !opts.uri) {
  29022. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29023. }
  29024. const { clientFactory = defaultFactory } = opts
  29025. if (typeof clientFactory !== 'function') {
  29026. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29027. }
  29028. this[kRequestTls] = opts.requestTls
  29029. this[kProxyTls] = opts.proxyTls
  29030. this[kProxyHeaders] = opts.headers || {}
  29031. const resolvedUrl = new URL(opts.uri)
  29032. const { origin, port, host, username, password } = resolvedUrl
  29033. if (opts.auth && opts.token) {
  29034. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29035. } else if (opts.auth) {
  29036. /* @deprecated in favour of opts.token */
  29037. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29038. } else if (opts.token) {
  29039. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29040. } else if (username && password) {
  29041. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29042. }
  29043. const connect = buildConnector({ ...opts.proxyTls })
  29044. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29045. this[kClient] = clientFactory(resolvedUrl, { connect })
  29046. this[kAgent] = new Agent({
  29047. ...opts,
  29048. connect: async (opts, callback) => {
  29049. let requestedHost = opts.host
  29050. if (!opts.port) {
  29051. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29052. }
  29053. try {
  29054. const { socket, statusCode } = await this[kClient].connect({
  29055. origin,
  29056. port,
  29057. path: requestedHost,
  29058. signal: opts.signal,
  29059. headers: {
  29060. ...this[kProxyHeaders],
  29061. host
  29062. }
  29063. })
  29064. if (statusCode !== 200) {
  29065. socket.on('error', () => {}).destroy()
  29066. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29067. }
  29068. if (opts.protocol !== 'https:') {
  29069. callback(null, socket)
  29070. return
  29071. }
  29072. let servername
  29073. if (this[kRequestTls]) {
  29074. servername = this[kRequestTls].servername
  29075. } else {
  29076. servername = opts.servername
  29077. }
  29078. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29079. } catch (err) {
  29080. callback(err)
  29081. }
  29082. }
  29083. })
  29084. }
  29085. dispatch (opts, handler) {
  29086. const { host } = new URL(opts.origin)
  29087. const headers = buildHeaders(opts.headers)
  29088. throwIfProxyAuthIsSent(headers)
  29089. return this[kAgent].dispatch(
  29090. {
  29091. ...opts,
  29092. headers: {
  29093. ...headers,
  29094. host
  29095. }
  29096. },
  29097. handler
  29098. )
  29099. }
  29100. async [kClose] () {
  29101. await this[kAgent].close()
  29102. await this[kClient].close()
  29103. }
  29104. async [kDestroy] () {
  29105. await this[kAgent].destroy()
  29106. await this[kClient].destroy()
  29107. }
  29108. }
  29109. /**
  29110. * @param {string[] | Record<string, string>} headers
  29111. * @returns {Record<string, string>}
  29112. */
  29113. function buildHeaders (headers) {
  29114. // When using undici.fetch, the headers list is stored
  29115. // as an array.
  29116. if (Array.isArray(headers)) {
  29117. /** @type {Record<string, string>} */
  29118. const headersPair = {}
  29119. for (let i = 0; i < headers.length; i += 2) {
  29120. headersPair[headers[i]] = headers[i + 1]
  29121. }
  29122. return headersPair
  29123. }
  29124. return headers
  29125. }
  29126. /**
  29127. * @param {Record<string, string>} headers
  29128. *
  29129. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29130. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29131. * this check was created.
  29132. * It should be removed in the next major version for performance reasons
  29133. */
  29134. function throwIfProxyAuthIsSent (headers) {
  29135. const existProxyAuth = headers && Object.keys(headers)
  29136. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29137. if (existProxyAuth) {
  29138. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29139. }
  29140. }
  29141. module.exports = ProxyAgent
  29142. /***/ }),
  29143. /***/ 9459:
  29144. /***/ ((module) => {
  29145. "use strict";
  29146. let fastNow = Date.now()
  29147. let fastNowTimeout
  29148. const fastTimers = []
  29149. function onTimeout () {
  29150. fastNow = Date.now()
  29151. let len = fastTimers.length
  29152. let idx = 0
  29153. while (idx < len) {
  29154. const timer = fastTimers[idx]
  29155. if (timer.state === 0) {
  29156. timer.state = fastNow + timer.delay
  29157. } else if (timer.state > 0 && fastNow >= timer.state) {
  29158. timer.state = -1
  29159. timer.callback(timer.opaque)
  29160. }
  29161. if (timer.state === -1) {
  29162. timer.state = -2
  29163. if (idx !== len - 1) {
  29164. fastTimers[idx] = fastTimers.pop()
  29165. } else {
  29166. fastTimers.pop()
  29167. }
  29168. len -= 1
  29169. } else {
  29170. idx += 1
  29171. }
  29172. }
  29173. if (fastTimers.length > 0) {
  29174. refreshTimeout()
  29175. }
  29176. }
  29177. function refreshTimeout () {
  29178. if (fastNowTimeout && fastNowTimeout.refresh) {
  29179. fastNowTimeout.refresh()
  29180. } else {
  29181. clearTimeout(fastNowTimeout)
  29182. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29183. if (fastNowTimeout.unref) {
  29184. fastNowTimeout.unref()
  29185. }
  29186. }
  29187. }
  29188. class Timeout {
  29189. constructor (callback, delay, opaque) {
  29190. this.callback = callback
  29191. this.delay = delay
  29192. this.opaque = opaque
  29193. // -2 not in timer list
  29194. // -1 in timer list but inactive
  29195. // 0 in timer list waiting for time
  29196. // > 0 in timer list waiting for time to expire
  29197. this.state = -2
  29198. this.refresh()
  29199. }
  29200. refresh () {
  29201. if (this.state === -2) {
  29202. fastTimers.push(this)
  29203. if (!fastNowTimeout || fastTimers.length === 1) {
  29204. refreshTimeout()
  29205. }
  29206. }
  29207. this.state = 0
  29208. }
  29209. clear () {
  29210. this.state = -1
  29211. }
  29212. }
  29213. module.exports = {
  29214. setTimeout (callback, delay, opaque) {
  29215. return delay < 1e3
  29216. ? setTimeout(callback, delay, opaque)
  29217. : new Timeout(callback, delay, opaque)
  29218. },
  29219. clearTimeout (timeout) {
  29220. if (timeout instanceof Timeout) {
  29221. timeout.clear()
  29222. } else {
  29223. clearTimeout(timeout)
  29224. }
  29225. }
  29226. }
  29227. /***/ }),
  29228. /***/ 5354:
  29229. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29230. "use strict";
  29231. const diagnosticsChannel = __nccwpck_require__(7643)
  29232. const { uid, states } = __nccwpck_require__(9188)
  29233. const {
  29234. kReadyState,
  29235. kSentClose,
  29236. kByteParser,
  29237. kReceivedClose
  29238. } = __nccwpck_require__(7578)
  29239. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29240. const { CloseEvent } = __nccwpck_require__(2611)
  29241. const { makeRequest } = __nccwpck_require__(8359)
  29242. const { fetching } = __nccwpck_require__(4881)
  29243. const { Headers } = __nccwpck_require__(554)
  29244. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29245. const { kHeadersList } = __nccwpck_require__(2785)
  29246. const channels = {}
  29247. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29248. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29249. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29250. /** @type {import('crypto')} */
  29251. let crypto
  29252. try {
  29253. crypto = __nccwpck_require__(6113)
  29254. } catch {
  29255. }
  29256. /**
  29257. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29258. * @param {URL} url
  29259. * @param {string|string[]} protocols
  29260. * @param {import('./websocket').WebSocket} ws
  29261. * @param {(response: any) => void} onEstablish
  29262. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29263. */
  29264. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29265. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29266. // scheme is "ws", and to "https" otherwise.
  29267. const requestURL = url
  29268. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29269. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29270. // service-workers mode is "none", referrer is "no-referrer", mode is
  29271. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29272. // and redirect mode is "error".
  29273. const request = makeRequest({
  29274. urlList: [requestURL],
  29275. serviceWorkers: 'none',
  29276. referrer: 'no-referrer',
  29277. mode: 'websocket',
  29278. credentials: 'include',
  29279. cache: 'no-store',
  29280. redirect: 'error'
  29281. })
  29282. // Note: undici extension, allow setting custom headers.
  29283. if (options.headers) {
  29284. const headersList = new Headers(options.headers)[kHeadersList]
  29285. request.headersList = headersList
  29286. }
  29287. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29288. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29289. // Note: both of these are handled by undici currently.
  29290. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29291. // 5. Let keyValue be a nonce consisting of a randomly selected
  29292. // 16-byte value that has been forgiving-base64-encoded and
  29293. // isomorphic encoded.
  29294. const keyValue = crypto.randomBytes(16).toString('base64')
  29295. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29296. // header list.
  29297. request.headersList.append('sec-websocket-key', keyValue)
  29298. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29299. // header list.
  29300. request.headersList.append('sec-websocket-version', '13')
  29301. // 8. For each protocol in protocols, combine
  29302. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29303. // list.
  29304. for (const protocol of protocols) {
  29305. request.headersList.append('sec-websocket-protocol', protocol)
  29306. }
  29307. // 9. Let permessageDeflate be a user-agent defined
  29308. // "permessage-deflate" extension header value.
  29309. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29310. // TODO: enable once permessage-deflate is supported
  29311. const permessageDeflate = '' // 'permessage-deflate; 15'
  29312. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29313. // request’s header list.
  29314. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29315. // 11. Fetch request with useParallelQueue set to true, and
  29316. // processResponse given response being these steps:
  29317. const controller = fetching({
  29318. request,
  29319. useParallelQueue: true,
  29320. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29321. processResponse (response) {
  29322. // 1. If response is a network error or its status is not 101,
  29323. // fail the WebSocket connection.
  29324. if (response.type === 'error' || response.status !== 101) {
  29325. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29326. return
  29327. }
  29328. // 2. If protocols is not the empty list and extracting header
  29329. // list values given `Sec-WebSocket-Protocol` and response’s
  29330. // header list results in null, failure, or the empty byte
  29331. // sequence, then fail the WebSocket connection.
  29332. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29333. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29334. return
  29335. }
  29336. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29337. // of the last set of steps in section 4.1 of The WebSocket
  29338. // Protocol to validate response. This either results in fail
  29339. // the WebSocket connection or the WebSocket connection is
  29340. // established.
  29341. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29342. // header field contains a value that is not an ASCII case-
  29343. // insensitive match for the value "websocket", the client MUST
  29344. // _Fail the WebSocket Connection_.
  29345. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29346. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29347. return
  29348. }
  29349. // 3. If the response lacks a |Connection| header field or the
  29350. // |Connection| header field doesn't contain a token that is an
  29351. // ASCII case-insensitive match for the value "Upgrade", the client
  29352. // MUST _Fail the WebSocket Connection_.
  29353. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29354. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29355. return
  29356. }
  29357. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29358. // the |Sec-WebSocket-Accept| contains a value other than the
  29359. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29360. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29361. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29362. // trailing whitespace, the client MUST _Fail the WebSocket
  29363. // Connection_.
  29364. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29365. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29366. if (secWSAccept !== digest) {
  29367. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29368. return
  29369. }
  29370. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29371. // field and this header field indicates the use of an extension
  29372. // that was not present in the client's handshake (the server has
  29373. // indicated an extension not requested by the client), the client
  29374. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29375. // header field to determine which extensions are requested is
  29376. // discussed in Section 9.1.)
  29377. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29378. if (secExtension !== null && secExtension !== permessageDeflate) {
  29379. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29380. return
  29381. }
  29382. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29383. // and this header field indicates the use of a subprotocol that was
  29384. // not present in the client's handshake (the server has indicated a
  29385. // subprotocol not requested by the client), the client MUST _Fail
  29386. // the WebSocket Connection_.
  29387. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29388. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29389. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29390. return
  29391. }
  29392. response.socket.on('data', onSocketData)
  29393. response.socket.on('close', onSocketClose)
  29394. response.socket.on('error', onSocketError)
  29395. if (channels.open.hasSubscribers) {
  29396. channels.open.publish({
  29397. address: response.socket.address(),
  29398. protocol: secProtocol,
  29399. extensions: secExtension
  29400. })
  29401. }
  29402. onEstablish(response)
  29403. }
  29404. })
  29405. return controller
  29406. }
  29407. /**
  29408. * @param {Buffer} chunk
  29409. */
  29410. function onSocketData (chunk) {
  29411. if (!this.ws[kByteParser].write(chunk)) {
  29412. this.pause()
  29413. }
  29414. }
  29415. /**
  29416. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29417. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29418. */
  29419. function onSocketClose () {
  29420. const { ws } = this
  29421. // If the TCP connection was closed after the
  29422. // WebSocket closing handshake was completed, the WebSocket connection
  29423. // is said to have been closed _cleanly_.
  29424. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29425. let code = 1005
  29426. let reason = ''
  29427. const result = ws[kByteParser].closingInfo
  29428. if (result) {
  29429. code = result.code ?? 1005
  29430. reason = result.reason
  29431. } else if (!ws[kSentClose]) {
  29432. // If _The WebSocket
  29433. // Connection is Closed_ and no Close control frame was received by the
  29434. // endpoint (such as could occur if the underlying transport connection
  29435. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29436. // 1006.
  29437. code = 1006
  29438. }
  29439. // 1. Change the ready state to CLOSED (3).
  29440. ws[kReadyState] = states.CLOSED
  29441. // 2. If the user agent was required to fail the WebSocket
  29442. // connection, or if the WebSocket connection was closed
  29443. // after being flagged as full, fire an event named error
  29444. // at the WebSocket object.
  29445. // TODO
  29446. // 3. Fire an event named close at the WebSocket object,
  29447. // using CloseEvent, with the wasClean attribute
  29448. // initialized to true if the connection closed cleanly
  29449. // and false otherwise, the code attribute initialized to
  29450. // the WebSocket connection close code, and the reason
  29451. // attribute initialized to the result of applying UTF-8
  29452. // decode without BOM to the WebSocket connection close
  29453. // reason.
  29454. fireEvent('close', ws, CloseEvent, {
  29455. wasClean, code, reason
  29456. })
  29457. if (channels.close.hasSubscribers) {
  29458. channels.close.publish({
  29459. websocket: ws,
  29460. code,
  29461. reason
  29462. })
  29463. }
  29464. }
  29465. function onSocketError (error) {
  29466. const { ws } = this
  29467. ws[kReadyState] = states.CLOSING
  29468. if (channels.socketError.hasSubscribers) {
  29469. channels.socketError.publish(error)
  29470. }
  29471. this.destroy()
  29472. }
  29473. module.exports = {
  29474. establishWebSocketConnection
  29475. }
  29476. /***/ }),
  29477. /***/ 9188:
  29478. /***/ ((module) => {
  29479. "use strict";
  29480. // This is a Globally Unique Identifier unique used
  29481. // to validate that the endpoint accepts websocket
  29482. // connections.
  29483. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29484. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29485. /** @type {PropertyDescriptor} */
  29486. const staticPropertyDescriptors = {
  29487. enumerable: true,
  29488. writable: false,
  29489. configurable: false
  29490. }
  29491. const states = {
  29492. CONNECTING: 0,
  29493. OPEN: 1,
  29494. CLOSING: 2,
  29495. CLOSED: 3
  29496. }
  29497. const opcodes = {
  29498. CONTINUATION: 0x0,
  29499. TEXT: 0x1,
  29500. BINARY: 0x2,
  29501. CLOSE: 0x8,
  29502. PING: 0x9,
  29503. PONG: 0xA
  29504. }
  29505. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29506. const parserStates = {
  29507. INFO: 0,
  29508. PAYLOADLENGTH_16: 2,
  29509. PAYLOADLENGTH_64: 3,
  29510. READ_DATA: 4
  29511. }
  29512. const emptyBuffer = Buffer.allocUnsafe(0)
  29513. module.exports = {
  29514. uid,
  29515. staticPropertyDescriptors,
  29516. states,
  29517. opcodes,
  29518. maxUnsigned16Bit,
  29519. parserStates,
  29520. emptyBuffer
  29521. }
  29522. /***/ }),
  29523. /***/ 2611:
  29524. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29525. "use strict";
  29526. const { webidl } = __nccwpck_require__(1744)
  29527. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29528. const { MessagePort } = __nccwpck_require__(1267)
  29529. /**
  29530. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29531. */
  29532. class MessageEvent extends Event {
  29533. #eventInit
  29534. constructor (type, eventInitDict = {}) {
  29535. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29536. type = webidl.converters.DOMString(type)
  29537. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29538. super(type, eventInitDict)
  29539. this.#eventInit = eventInitDict
  29540. }
  29541. get data () {
  29542. webidl.brandCheck(this, MessageEvent)
  29543. return this.#eventInit.data
  29544. }
  29545. get origin () {
  29546. webidl.brandCheck(this, MessageEvent)
  29547. return this.#eventInit.origin
  29548. }
  29549. get lastEventId () {
  29550. webidl.brandCheck(this, MessageEvent)
  29551. return this.#eventInit.lastEventId
  29552. }
  29553. get source () {
  29554. webidl.brandCheck(this, MessageEvent)
  29555. return this.#eventInit.source
  29556. }
  29557. get ports () {
  29558. webidl.brandCheck(this, MessageEvent)
  29559. if (!Object.isFrozen(this.#eventInit.ports)) {
  29560. Object.freeze(this.#eventInit.ports)
  29561. }
  29562. return this.#eventInit.ports
  29563. }
  29564. initMessageEvent (
  29565. type,
  29566. bubbles = false,
  29567. cancelable = false,
  29568. data = null,
  29569. origin = '',
  29570. lastEventId = '',
  29571. source = null,
  29572. ports = []
  29573. ) {
  29574. webidl.brandCheck(this, MessageEvent)
  29575. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29576. return new MessageEvent(type, {
  29577. bubbles, cancelable, data, origin, lastEventId, source, ports
  29578. })
  29579. }
  29580. }
  29581. /**
  29582. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29583. */
  29584. class CloseEvent extends Event {
  29585. #eventInit
  29586. constructor (type, eventInitDict = {}) {
  29587. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29588. type = webidl.converters.DOMString(type)
  29589. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29590. super(type, eventInitDict)
  29591. this.#eventInit = eventInitDict
  29592. }
  29593. get wasClean () {
  29594. webidl.brandCheck(this, CloseEvent)
  29595. return this.#eventInit.wasClean
  29596. }
  29597. get code () {
  29598. webidl.brandCheck(this, CloseEvent)
  29599. return this.#eventInit.code
  29600. }
  29601. get reason () {
  29602. webidl.brandCheck(this, CloseEvent)
  29603. return this.#eventInit.reason
  29604. }
  29605. }
  29606. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29607. class ErrorEvent extends Event {
  29608. #eventInit
  29609. constructor (type, eventInitDict) {
  29610. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29611. super(type, eventInitDict)
  29612. type = webidl.converters.DOMString(type)
  29613. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29614. this.#eventInit = eventInitDict
  29615. }
  29616. get message () {
  29617. webidl.brandCheck(this, ErrorEvent)
  29618. return this.#eventInit.message
  29619. }
  29620. get filename () {
  29621. webidl.brandCheck(this, ErrorEvent)
  29622. return this.#eventInit.filename
  29623. }
  29624. get lineno () {
  29625. webidl.brandCheck(this, ErrorEvent)
  29626. return this.#eventInit.lineno
  29627. }
  29628. get colno () {
  29629. webidl.brandCheck(this, ErrorEvent)
  29630. return this.#eventInit.colno
  29631. }
  29632. get error () {
  29633. webidl.brandCheck(this, ErrorEvent)
  29634. return this.#eventInit.error
  29635. }
  29636. }
  29637. Object.defineProperties(MessageEvent.prototype, {
  29638. [Symbol.toStringTag]: {
  29639. value: 'MessageEvent',
  29640. configurable: true
  29641. },
  29642. data: kEnumerableProperty,
  29643. origin: kEnumerableProperty,
  29644. lastEventId: kEnumerableProperty,
  29645. source: kEnumerableProperty,
  29646. ports: kEnumerableProperty,
  29647. initMessageEvent: kEnumerableProperty
  29648. })
  29649. Object.defineProperties(CloseEvent.prototype, {
  29650. [Symbol.toStringTag]: {
  29651. value: 'CloseEvent',
  29652. configurable: true
  29653. },
  29654. reason: kEnumerableProperty,
  29655. code: kEnumerableProperty,
  29656. wasClean: kEnumerableProperty
  29657. })
  29658. Object.defineProperties(ErrorEvent.prototype, {
  29659. [Symbol.toStringTag]: {
  29660. value: 'ErrorEvent',
  29661. configurable: true
  29662. },
  29663. message: kEnumerableProperty,
  29664. filename: kEnumerableProperty,
  29665. lineno: kEnumerableProperty,
  29666. colno: kEnumerableProperty,
  29667. error: kEnumerableProperty
  29668. })
  29669. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29670. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29671. webidl.converters.MessagePort
  29672. )
  29673. const eventInit = [
  29674. {
  29675. key: 'bubbles',
  29676. converter: webidl.converters.boolean,
  29677. defaultValue: false
  29678. },
  29679. {
  29680. key: 'cancelable',
  29681. converter: webidl.converters.boolean,
  29682. defaultValue: false
  29683. },
  29684. {
  29685. key: 'composed',
  29686. converter: webidl.converters.boolean,
  29687. defaultValue: false
  29688. }
  29689. ]
  29690. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29691. ...eventInit,
  29692. {
  29693. key: 'data',
  29694. converter: webidl.converters.any,
  29695. defaultValue: null
  29696. },
  29697. {
  29698. key: 'origin',
  29699. converter: webidl.converters.USVString,
  29700. defaultValue: ''
  29701. },
  29702. {
  29703. key: 'lastEventId',
  29704. converter: webidl.converters.DOMString,
  29705. defaultValue: ''
  29706. },
  29707. {
  29708. key: 'source',
  29709. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29710. // valid value for source is a MessagePort.
  29711. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29712. defaultValue: null
  29713. },
  29714. {
  29715. key: 'ports',
  29716. converter: webidl.converters['sequence<MessagePort>'],
  29717. get defaultValue () {
  29718. return []
  29719. }
  29720. }
  29721. ])
  29722. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  29723. ...eventInit,
  29724. {
  29725. key: 'wasClean',
  29726. converter: webidl.converters.boolean,
  29727. defaultValue: false
  29728. },
  29729. {
  29730. key: 'code',
  29731. converter: webidl.converters['unsigned short'],
  29732. defaultValue: 0
  29733. },
  29734. {
  29735. key: 'reason',
  29736. converter: webidl.converters.USVString,
  29737. defaultValue: ''
  29738. }
  29739. ])
  29740. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  29741. ...eventInit,
  29742. {
  29743. key: 'message',
  29744. converter: webidl.converters.DOMString,
  29745. defaultValue: ''
  29746. },
  29747. {
  29748. key: 'filename',
  29749. converter: webidl.converters.USVString,
  29750. defaultValue: ''
  29751. },
  29752. {
  29753. key: 'lineno',
  29754. converter: webidl.converters['unsigned long'],
  29755. defaultValue: 0
  29756. },
  29757. {
  29758. key: 'colno',
  29759. converter: webidl.converters['unsigned long'],
  29760. defaultValue: 0
  29761. },
  29762. {
  29763. key: 'error',
  29764. converter: webidl.converters.any
  29765. }
  29766. ])
  29767. module.exports = {
  29768. MessageEvent,
  29769. CloseEvent,
  29770. ErrorEvent
  29771. }
  29772. /***/ }),
  29773. /***/ 5444:
  29774. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29775. "use strict";
  29776. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  29777. /** @type {import('crypto')} */
  29778. let crypto
  29779. try {
  29780. crypto = __nccwpck_require__(6113)
  29781. } catch {
  29782. }
  29783. class WebsocketFrameSend {
  29784. /**
  29785. * @param {Buffer|undefined} data
  29786. */
  29787. constructor (data) {
  29788. this.frameData = data
  29789. this.maskKey = crypto.randomBytes(4)
  29790. }
  29791. createFrame (opcode) {
  29792. const bodyLength = this.frameData?.byteLength ?? 0
  29793. /** @type {number} */
  29794. let payloadLength = bodyLength // 0-125
  29795. let offset = 6
  29796. if (bodyLength > maxUnsigned16Bit) {
  29797. offset += 8 // payload length is next 8 bytes
  29798. payloadLength = 127
  29799. } else if (bodyLength > 125) {
  29800. offset += 2 // payload length is next 2 bytes
  29801. payloadLength = 126
  29802. }
  29803. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  29804. // Clear first 2 bytes, everything else is overwritten
  29805. buffer[0] = buffer[1] = 0
  29806. buffer[0] |= 0x80 // FIN
  29807. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  29808. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  29809. buffer[offset - 4] = this.maskKey[0]
  29810. buffer[offset - 3] = this.maskKey[1]
  29811. buffer[offset - 2] = this.maskKey[2]
  29812. buffer[offset - 1] = this.maskKey[3]
  29813. buffer[1] = payloadLength
  29814. if (payloadLength === 126) {
  29815. buffer.writeUInt16BE(bodyLength, 2)
  29816. } else if (payloadLength === 127) {
  29817. // Clear extended payload length
  29818. buffer[2] = buffer[3] = 0
  29819. buffer.writeUIntBE(bodyLength, 4, 6)
  29820. }
  29821. buffer[1] |= 0x80 // MASK
  29822. // mask body
  29823. for (let i = 0; i < bodyLength; i++) {
  29824. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  29825. }
  29826. return buffer
  29827. }
  29828. }
  29829. module.exports = {
  29830. WebsocketFrameSend
  29831. }
  29832. /***/ }),
  29833. /***/ 1688:
  29834. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29835. "use strict";
  29836. const { Writable } = __nccwpck_require__(2781)
  29837. const diagnosticsChannel = __nccwpck_require__(7643)
  29838. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  29839. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  29840. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  29841. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  29842. // This code was influenced by ws released under the MIT license.
  29843. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  29844. // Copyright (c) 2013 Arnout Kazemier and contributors
  29845. // Copyright (c) 2016 Luigi Pinca and contributors
  29846. const channels = {}
  29847. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  29848. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  29849. class ByteParser extends Writable {
  29850. #buffers = []
  29851. #byteOffset = 0
  29852. #state = parserStates.INFO
  29853. #info = {}
  29854. #fragments = []
  29855. constructor (ws) {
  29856. super()
  29857. this.ws = ws
  29858. }
  29859. /**
  29860. * @param {Buffer} chunk
  29861. * @param {() => void} callback
  29862. */
  29863. _write (chunk, _, callback) {
  29864. this.#buffers.push(chunk)
  29865. this.#byteOffset += chunk.length
  29866. this.run(callback)
  29867. }
  29868. /**
  29869. * Runs whenever a new chunk is received.
  29870. * Callback is called whenever there are no more chunks buffering,
  29871. * or not enough bytes are buffered to parse.
  29872. */
  29873. run (callback) {
  29874. while (true) {
  29875. if (this.#state === parserStates.INFO) {
  29876. // If there aren't enough bytes to parse the payload length, etc.
  29877. if (this.#byteOffset < 2) {
  29878. return callback()
  29879. }
  29880. const buffer = this.consume(2)
  29881. this.#info.fin = (buffer[0] & 0x80) !== 0
  29882. this.#info.opcode = buffer[0] & 0x0F
  29883. // If we receive a fragmented message, we use the type of the first
  29884. // frame to parse the full message as binary/text, when it's terminated
  29885. this.#info.originalOpcode ??= this.#info.opcode
  29886. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  29887. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  29888. // Only text and binary frames can be fragmented
  29889. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  29890. return
  29891. }
  29892. const payloadLength = buffer[1] & 0x7F
  29893. if (payloadLength <= 125) {
  29894. this.#info.payloadLength = payloadLength
  29895. this.#state = parserStates.READ_DATA
  29896. } else if (payloadLength === 126) {
  29897. this.#state = parserStates.PAYLOADLENGTH_16
  29898. } else if (payloadLength === 127) {
  29899. this.#state = parserStates.PAYLOADLENGTH_64
  29900. }
  29901. if (this.#info.fragmented && payloadLength > 125) {
  29902. // A fragmented frame can't be fragmented itself
  29903. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  29904. return
  29905. } else if (
  29906. (this.#info.opcode === opcodes.PING ||
  29907. this.#info.opcode === opcodes.PONG ||
  29908. this.#info.opcode === opcodes.CLOSE) &&
  29909. payloadLength > 125
  29910. ) {
  29911. // Control frames can have a payload length of 125 bytes MAX
  29912. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  29913. return
  29914. } else if (this.#info.opcode === opcodes.CLOSE) {
  29915. if (payloadLength === 1) {
  29916. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  29917. return
  29918. }
  29919. const body = this.consume(payloadLength)
  29920. this.#info.closeInfo = this.parseCloseBody(false, body)
  29921. if (!this.ws[kSentClose]) {
  29922. // If an endpoint receives a Close frame and did not previously send a
  29923. // Close frame, the endpoint MUST send a Close frame in response. (When
  29924. // sending a Close frame in response, the endpoint typically echos the
  29925. // status code it received.)
  29926. const body = Buffer.allocUnsafe(2)
  29927. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  29928. const closeFrame = new WebsocketFrameSend(body)
  29929. this.ws[kResponse].socket.write(
  29930. closeFrame.createFrame(opcodes.CLOSE),
  29931. (err) => {
  29932. if (!err) {
  29933. this.ws[kSentClose] = true
  29934. }
  29935. }
  29936. )
  29937. }
  29938. // Upon either sending or receiving a Close control frame, it is said
  29939. // that _The WebSocket Closing Handshake is Started_ and that the
  29940. // WebSocket connection is in the CLOSING state.
  29941. this.ws[kReadyState] = states.CLOSING
  29942. this.ws[kReceivedClose] = true
  29943. this.end()
  29944. return
  29945. } else if (this.#info.opcode === opcodes.PING) {
  29946. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  29947. // response, unless it already received a Close frame.
  29948. // A Pong frame sent in response to a Ping frame must have identical
  29949. // "Application data"
  29950. const body = this.consume(payloadLength)
  29951. if (!this.ws[kReceivedClose]) {
  29952. const frame = new WebsocketFrameSend(body)
  29953. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  29954. if (channels.ping.hasSubscribers) {
  29955. channels.ping.publish({
  29956. payload: body
  29957. })
  29958. }
  29959. }
  29960. this.#state = parserStates.INFO
  29961. if (this.#byteOffset > 0) {
  29962. continue
  29963. } else {
  29964. callback()
  29965. return
  29966. }
  29967. } else if (this.#info.opcode === opcodes.PONG) {
  29968. // A Pong frame MAY be sent unsolicited. This serves as a
  29969. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  29970. // not expected.
  29971. const body = this.consume(payloadLength)
  29972. if (channels.pong.hasSubscribers) {
  29973. channels.pong.publish({
  29974. payload: body
  29975. })
  29976. }
  29977. if (this.#byteOffset > 0) {
  29978. continue
  29979. } else {
  29980. callback()
  29981. return
  29982. }
  29983. }
  29984. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  29985. if (this.#byteOffset < 2) {
  29986. return callback()
  29987. }
  29988. const buffer = this.consume(2)
  29989. this.#info.payloadLength = buffer.readUInt16BE(0)
  29990. this.#state = parserStates.READ_DATA
  29991. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  29992. if (this.#byteOffset < 8) {
  29993. return callback()
  29994. }
  29995. const buffer = this.consume(8)
  29996. const upper = buffer.readUInt32BE(0)
  29997. // 2^31 is the maxinimum bytes an arraybuffer can contain
  29998. // on 32-bit systems. Although, on 64-bit systems, this is
  29999. // 2^53-1 bytes.
  30000. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30001. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30002. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30003. if (upper > 2 ** 31 - 1) {
  30004. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30005. return
  30006. }
  30007. const lower = buffer.readUInt32BE(4)
  30008. this.#info.payloadLength = (upper << 8) + lower
  30009. this.#state = parserStates.READ_DATA
  30010. } else if (this.#state === parserStates.READ_DATA) {
  30011. if (this.#byteOffset < this.#info.payloadLength) {
  30012. // If there is still more data in this chunk that needs to be read
  30013. return callback()
  30014. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30015. // If the server sent multiple frames in a single chunk
  30016. const body = this.consume(this.#info.payloadLength)
  30017. this.#fragments.push(body)
  30018. // If the frame is unfragmented, or a fragmented frame was terminated,
  30019. // a message was received
  30020. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30021. const fullMessage = Buffer.concat(this.#fragments)
  30022. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30023. this.#info = {}
  30024. this.#fragments.length = 0
  30025. }
  30026. this.#state = parserStates.INFO
  30027. }
  30028. }
  30029. if (this.#byteOffset > 0) {
  30030. continue
  30031. } else {
  30032. callback()
  30033. break
  30034. }
  30035. }
  30036. }
  30037. /**
  30038. * Take n bytes from the buffered Buffers
  30039. * @param {number} n
  30040. * @returns {Buffer|null}
  30041. */
  30042. consume (n) {
  30043. if (n > this.#byteOffset) {
  30044. return null
  30045. } else if (n === 0) {
  30046. return emptyBuffer
  30047. }
  30048. if (this.#buffers[0].length === n) {
  30049. this.#byteOffset -= this.#buffers[0].length
  30050. return this.#buffers.shift()
  30051. }
  30052. const buffer = Buffer.allocUnsafe(n)
  30053. let offset = 0
  30054. while (offset !== n) {
  30055. const next = this.#buffers[0]
  30056. const { length } = next
  30057. if (length + offset === n) {
  30058. buffer.set(this.#buffers.shift(), offset)
  30059. break
  30060. } else if (length + offset > n) {
  30061. buffer.set(next.subarray(0, n - offset), offset)
  30062. this.#buffers[0] = next.subarray(n - offset)
  30063. break
  30064. } else {
  30065. buffer.set(this.#buffers.shift(), offset)
  30066. offset += next.length
  30067. }
  30068. }
  30069. this.#byteOffset -= n
  30070. return buffer
  30071. }
  30072. parseCloseBody (onlyCode, data) {
  30073. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30074. /** @type {number|undefined} */
  30075. let code
  30076. if (data.length >= 2) {
  30077. // _The WebSocket Connection Close Code_ is
  30078. // defined as the status code (Section 7.4) contained in the first Close
  30079. // control frame received by the application
  30080. code = data.readUInt16BE(0)
  30081. }
  30082. if (onlyCode) {
  30083. if (!isValidStatusCode(code)) {
  30084. return null
  30085. }
  30086. return { code }
  30087. }
  30088. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30089. /** @type {Buffer} */
  30090. let reason = data.subarray(2)
  30091. // Remove BOM
  30092. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30093. reason = reason.subarray(3)
  30094. }
  30095. if (code !== undefined && !isValidStatusCode(code)) {
  30096. return null
  30097. }
  30098. try {
  30099. // TODO: optimize this
  30100. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30101. } catch {
  30102. return null
  30103. }
  30104. return { code, reason }
  30105. }
  30106. get closingInfo () {
  30107. return this.#info.closeInfo
  30108. }
  30109. }
  30110. module.exports = {
  30111. ByteParser
  30112. }
  30113. /***/ }),
  30114. /***/ 7578:
  30115. /***/ ((module) => {
  30116. "use strict";
  30117. module.exports = {
  30118. kWebSocketURL: Symbol('url'),
  30119. kReadyState: Symbol('ready state'),
  30120. kController: Symbol('controller'),
  30121. kResponse: Symbol('response'),
  30122. kBinaryType: Symbol('binary type'),
  30123. kSentClose: Symbol('sent close'),
  30124. kReceivedClose: Symbol('received close'),
  30125. kByteParser: Symbol('byte parser')
  30126. }
  30127. /***/ }),
  30128. /***/ 5515:
  30129. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30130. "use strict";
  30131. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30132. const { states, opcodes } = __nccwpck_require__(9188)
  30133. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30134. /* globals Blob */
  30135. /**
  30136. * @param {import('./websocket').WebSocket} ws
  30137. */
  30138. function isEstablished (ws) {
  30139. // If the server's response is validated as provided for above, it is
  30140. // said that _The WebSocket Connection is Established_ and that the
  30141. // WebSocket Connection is in the OPEN state.
  30142. return ws[kReadyState] === states.OPEN
  30143. }
  30144. /**
  30145. * @param {import('./websocket').WebSocket} ws
  30146. */
  30147. function isClosing (ws) {
  30148. // Upon either sending or receiving a Close control frame, it is said
  30149. // that _The WebSocket Closing Handshake is Started_ and that the
  30150. // WebSocket connection is in the CLOSING state.
  30151. return ws[kReadyState] === states.CLOSING
  30152. }
  30153. /**
  30154. * @param {import('./websocket').WebSocket} ws
  30155. */
  30156. function isClosed (ws) {
  30157. return ws[kReadyState] === states.CLOSED
  30158. }
  30159. /**
  30160. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30161. * @param {string} e
  30162. * @param {EventTarget} target
  30163. * @param {EventInit | undefined} eventInitDict
  30164. */
  30165. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30166. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30167. // 2. Let event be the result of creating an event given eventConstructor,
  30168. // in the relevant realm of target.
  30169. // 3. Initialize event’s type attribute to e.
  30170. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30171. // 4. Initialize any other IDL attributes of event as described in the
  30172. // invocation of this algorithm.
  30173. // 5. Return the result of dispatching event at target, with legacy target
  30174. // override flag set if set.
  30175. target.dispatchEvent(event)
  30176. }
  30177. /**
  30178. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30179. * @param {import('./websocket').WebSocket} ws
  30180. * @param {number} type Opcode
  30181. * @param {Buffer} data application data
  30182. */
  30183. function websocketMessageReceived (ws, type, data) {
  30184. // 1. If ready state is not OPEN (1), then return.
  30185. if (ws[kReadyState] !== states.OPEN) {
  30186. return
  30187. }
  30188. // 2. Let dataForEvent be determined by switching on type and binary type:
  30189. let dataForEvent
  30190. if (type === opcodes.TEXT) {
  30191. // -> type indicates that the data is Text
  30192. // a new DOMString containing data
  30193. try {
  30194. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30195. } catch {
  30196. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30197. return
  30198. }
  30199. } else if (type === opcodes.BINARY) {
  30200. if (ws[kBinaryType] === 'blob') {
  30201. // -> type indicates that the data is Binary and binary type is "blob"
  30202. // a new Blob object, created in the relevant Realm of the WebSocket
  30203. // object, that represents data as its raw data
  30204. dataForEvent = new Blob([data])
  30205. } else {
  30206. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30207. // a new ArrayBuffer object, created in the relevant Realm of the
  30208. // WebSocket object, whose contents are data
  30209. dataForEvent = new Uint8Array(data).buffer
  30210. }
  30211. }
  30212. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30213. // with the origin attribute initialized to the serialization of the WebSocket
  30214. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30215. fireEvent('message', ws, MessageEvent, {
  30216. origin: ws[kWebSocketURL].origin,
  30217. data: dataForEvent
  30218. })
  30219. }
  30220. /**
  30221. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30222. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30223. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30224. * @param {string} protocol
  30225. */
  30226. function isValidSubprotocol (protocol) {
  30227. // If present, this value indicates one
  30228. // or more comma-separated subprotocol the client wishes to speak,
  30229. // ordered by preference. The elements that comprise this value
  30230. // MUST be non-empty strings with characters in the range U+0021 to
  30231. // U+007E not including separator characters as defined in
  30232. // [RFC2616] and MUST all be unique strings.
  30233. if (protocol.length === 0) {
  30234. return false
  30235. }
  30236. for (const char of protocol) {
  30237. const code = char.charCodeAt(0)
  30238. if (
  30239. code < 0x21 ||
  30240. code > 0x7E ||
  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. char === '?' ||
  30255. char === '=' ||
  30256. char === '{' ||
  30257. char === '}' ||
  30258. code === 32 || // SP
  30259. code === 9 // HT
  30260. ) {
  30261. return false
  30262. }
  30263. }
  30264. return true
  30265. }
  30266. /**
  30267. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30268. * @param {number} code
  30269. */
  30270. function isValidStatusCode (code) {
  30271. if (code >= 1000 && code < 1015) {
  30272. return (
  30273. code !== 1004 && // reserved
  30274. code !== 1005 && // "MUST NOT be set as a status code"
  30275. code !== 1006 // "MUST NOT be set as a status code"
  30276. )
  30277. }
  30278. return code >= 3000 && code <= 4999
  30279. }
  30280. /**
  30281. * @param {import('./websocket').WebSocket} ws
  30282. * @param {string|undefined} reason
  30283. */
  30284. function failWebsocketConnection (ws, reason) {
  30285. const { [kController]: controller, [kResponse]: response } = ws
  30286. controller.abort()
  30287. if (response?.socket && !response.socket.destroyed) {
  30288. response.socket.destroy()
  30289. }
  30290. if (reason) {
  30291. fireEvent('error', ws, ErrorEvent, {
  30292. error: new Error(reason)
  30293. })
  30294. }
  30295. }
  30296. module.exports = {
  30297. isEstablished,
  30298. isClosing,
  30299. isClosed,
  30300. fireEvent,
  30301. isValidSubprotocol,
  30302. isValidStatusCode,
  30303. failWebsocketConnection,
  30304. websocketMessageReceived
  30305. }
  30306. /***/ }),
  30307. /***/ 4284:
  30308. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30309. "use strict";
  30310. const { webidl } = __nccwpck_require__(1744)
  30311. const { DOMException } = __nccwpck_require__(1037)
  30312. const { URLSerializer } = __nccwpck_require__(685)
  30313. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30314. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30315. const {
  30316. kWebSocketURL,
  30317. kReadyState,
  30318. kController,
  30319. kBinaryType,
  30320. kResponse,
  30321. kSentClose,
  30322. kByteParser
  30323. } = __nccwpck_require__(7578)
  30324. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30325. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30326. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30327. const { ByteParser } = __nccwpck_require__(1688)
  30328. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30329. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30330. const { types } = __nccwpck_require__(3837)
  30331. let experimentalWarned = false
  30332. // https://websockets.spec.whatwg.org/#interface-definition
  30333. class WebSocket extends EventTarget {
  30334. #events = {
  30335. open: null,
  30336. error: null,
  30337. close: null,
  30338. message: null
  30339. }
  30340. #bufferedAmount = 0
  30341. #protocol = ''
  30342. #extensions = ''
  30343. /**
  30344. * @param {string} url
  30345. * @param {string|string[]} protocols
  30346. */
  30347. constructor (url, protocols = []) {
  30348. super()
  30349. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30350. if (!experimentalWarned) {
  30351. experimentalWarned = true
  30352. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30353. code: 'UNDICI-WS'
  30354. })
  30355. }
  30356. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30357. url = webidl.converters.USVString(url)
  30358. protocols = options.protocols
  30359. // 1. Let baseURL be this's relevant settings object's API base URL.
  30360. const baseURL = getGlobalOrigin()
  30361. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30362. let urlRecord
  30363. try {
  30364. urlRecord = new URL(url, baseURL)
  30365. } catch (e) {
  30366. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30367. throw new DOMException(e, 'SyntaxError')
  30368. }
  30369. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30370. if (urlRecord.protocol === 'http:') {
  30371. urlRecord.protocol = 'ws:'
  30372. } else if (urlRecord.protocol === 'https:') {
  30373. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30374. urlRecord.protocol = 'wss:'
  30375. }
  30376. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30377. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30378. throw new DOMException(
  30379. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30380. 'SyntaxError'
  30381. )
  30382. }
  30383. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30384. // DOMException.
  30385. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30386. throw new DOMException('Got fragment', 'SyntaxError')
  30387. }
  30388. // 8. If protocols is a string, set protocols to a sequence consisting
  30389. // of just that string.
  30390. if (typeof protocols === 'string') {
  30391. protocols = [protocols]
  30392. }
  30393. // 9. If any of the values in protocols occur more than once or otherwise
  30394. // fail to match the requirements for elements that comprise the value
  30395. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30396. // protocol, then throw a "SyntaxError" DOMException.
  30397. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30398. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30399. }
  30400. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30401. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30402. }
  30403. // 10. Set this's url to urlRecord.
  30404. this[kWebSocketURL] = new URL(urlRecord.href)
  30405. // 11. Let client be this's relevant settings object.
  30406. // 12. Run this step in parallel:
  30407. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30408. // and client.
  30409. this[kController] = establishWebSocketConnection(
  30410. urlRecord,
  30411. protocols,
  30412. this,
  30413. (response) => this.#onConnectionEstablished(response),
  30414. options
  30415. )
  30416. // Each WebSocket object has an associated ready state, which is a
  30417. // number representing the state of the connection. Initially it must
  30418. // be CONNECTING (0).
  30419. this[kReadyState] = WebSocket.CONNECTING
  30420. // The extensions attribute must initially return the empty string.
  30421. // The protocol attribute must initially return the empty string.
  30422. // Each WebSocket object has an associated binary type, which is a
  30423. // BinaryType. Initially it must be "blob".
  30424. this[kBinaryType] = 'blob'
  30425. }
  30426. /**
  30427. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30428. * @param {number|undefined} code
  30429. * @param {string|undefined} reason
  30430. */
  30431. close (code = undefined, reason = undefined) {
  30432. webidl.brandCheck(this, WebSocket)
  30433. if (code !== undefined) {
  30434. code = webidl.converters['unsigned short'](code, { clamp: true })
  30435. }
  30436. if (reason !== undefined) {
  30437. reason = webidl.converters.USVString(reason)
  30438. }
  30439. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30440. // integer in the range 3000 to 4999, inclusive, throw an
  30441. // "InvalidAccessError" DOMException.
  30442. if (code !== undefined) {
  30443. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30444. throw new DOMException('invalid code', 'InvalidAccessError')
  30445. }
  30446. }
  30447. let reasonByteLength = 0
  30448. // 2. If reason is present, then run these substeps:
  30449. if (reason !== undefined) {
  30450. // 1. Let reasonBytes be the result of encoding reason.
  30451. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30452. // "SyntaxError" DOMException.
  30453. reasonByteLength = Buffer.byteLength(reason)
  30454. if (reasonByteLength > 123) {
  30455. throw new DOMException(
  30456. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30457. 'SyntaxError'
  30458. )
  30459. }
  30460. }
  30461. // 3. Run the first matching steps from the following list:
  30462. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30463. // If this's ready state is CLOSING (2) or CLOSED (3)
  30464. // Do nothing.
  30465. } else if (!isEstablished(this)) {
  30466. // If the WebSocket connection is not yet established
  30467. // Fail the WebSocket connection and set this's ready state
  30468. // to CLOSING (2).
  30469. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30470. this[kReadyState] = WebSocket.CLOSING
  30471. } else if (!isClosing(this)) {
  30472. // If the WebSocket closing handshake has not yet been started
  30473. // Start the WebSocket closing handshake and set this's ready
  30474. // state to CLOSING (2).
  30475. // - If neither code nor reason is present, the WebSocket Close
  30476. // message must not have a body.
  30477. // - If code is present, then the status code to use in the
  30478. // WebSocket Close message must be the integer given by code.
  30479. // - If reason is also present, then reasonBytes must be
  30480. // provided in the Close message after the status code.
  30481. const frame = new WebsocketFrameSend()
  30482. // If neither code nor reason is present, the WebSocket Close
  30483. // message must not have a body.
  30484. // If code is present, then the status code to use in the
  30485. // WebSocket Close message must be the integer given by code.
  30486. if (code !== undefined && reason === undefined) {
  30487. frame.frameData = Buffer.allocUnsafe(2)
  30488. frame.frameData.writeUInt16BE(code, 0)
  30489. } else if (code !== undefined && reason !== undefined) {
  30490. // If reason is also present, then reasonBytes must be
  30491. // provided in the Close message after the status code.
  30492. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30493. frame.frameData.writeUInt16BE(code, 0)
  30494. // the body MAY contain UTF-8-encoded data with value /reason/
  30495. frame.frameData.write(reason, 2, 'utf-8')
  30496. } else {
  30497. frame.frameData = emptyBuffer
  30498. }
  30499. /** @type {import('stream').Duplex} */
  30500. const socket = this[kResponse].socket
  30501. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30502. if (!err) {
  30503. this[kSentClose] = true
  30504. }
  30505. })
  30506. // Upon either sending or receiving a Close control frame, it is said
  30507. // that _The WebSocket Closing Handshake is Started_ and that the
  30508. // WebSocket connection is in the CLOSING state.
  30509. this[kReadyState] = states.CLOSING
  30510. } else {
  30511. // Otherwise
  30512. // Set this's ready state to CLOSING (2).
  30513. this[kReadyState] = WebSocket.CLOSING
  30514. }
  30515. }
  30516. /**
  30517. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30518. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30519. */
  30520. send (data) {
  30521. webidl.brandCheck(this, WebSocket)
  30522. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30523. data = webidl.converters.WebSocketSendData(data)
  30524. // 1. If this's ready state is CONNECTING, then throw an
  30525. // "InvalidStateError" DOMException.
  30526. if (this[kReadyState] === WebSocket.CONNECTING) {
  30527. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30528. }
  30529. // 2. Run the appropriate set of steps from the following list:
  30530. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30531. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30532. if (!isEstablished(this) || isClosing(this)) {
  30533. return
  30534. }
  30535. /** @type {import('stream').Duplex} */
  30536. const socket = this[kResponse].socket
  30537. // If data is a string
  30538. if (typeof data === 'string') {
  30539. // If the WebSocket connection is established and the WebSocket
  30540. // closing handshake has not yet started, then the user agent
  30541. // must send a WebSocket Message comprised of the data argument
  30542. // using a text frame opcode; if the data cannot be sent, e.g.
  30543. // because it would need to be buffered but the buffer is full,
  30544. // the user agent must flag the WebSocket as full and then close
  30545. // the WebSocket connection. Any invocation of this method with a
  30546. // string argument that does not throw an exception must increase
  30547. // the bufferedAmount attribute by the number of bytes needed to
  30548. // express the argument as UTF-8.
  30549. const value = Buffer.from(data)
  30550. const frame = new WebsocketFrameSend(value)
  30551. const buffer = frame.createFrame(opcodes.TEXT)
  30552. this.#bufferedAmount += value.byteLength
  30553. socket.write(buffer, () => {
  30554. this.#bufferedAmount -= value.byteLength
  30555. })
  30556. } else if (types.isArrayBuffer(data)) {
  30557. // If the WebSocket connection is established, and the WebSocket
  30558. // closing handshake has not yet started, then the user agent must
  30559. // send a WebSocket Message comprised of data using a binary frame
  30560. // opcode; if the data cannot be sent, e.g. because it would need
  30561. // to be buffered but the buffer is full, the user agent must flag
  30562. // the WebSocket as full and then close the WebSocket connection.
  30563. // The data to be sent is the data stored in the buffer described
  30564. // by the ArrayBuffer object. Any invocation of this method with an
  30565. // ArrayBuffer argument that does not throw an exception must
  30566. // increase the bufferedAmount attribute by the length of the
  30567. // ArrayBuffer in bytes.
  30568. const value = Buffer.from(data)
  30569. const frame = new WebsocketFrameSend(value)
  30570. const buffer = frame.createFrame(opcodes.BINARY)
  30571. this.#bufferedAmount += value.byteLength
  30572. socket.write(buffer, () => {
  30573. this.#bufferedAmount -= value.byteLength
  30574. })
  30575. } else if (ArrayBuffer.isView(data)) {
  30576. // If the WebSocket connection is established, and the WebSocket
  30577. // closing handshake has not yet started, then the user agent must
  30578. // send a WebSocket Message comprised of data using a binary frame
  30579. // opcode; if the data cannot be sent, e.g. because it would need to
  30580. // be buffered but the buffer is full, the user agent must flag the
  30581. // WebSocket as full and then close the WebSocket connection. The
  30582. // data to be sent is the data stored in the section of the buffer
  30583. // described by the ArrayBuffer object that data references. Any
  30584. // invocation of this method with this kind of argument that does
  30585. // not throw an exception must increase the bufferedAmount attribute
  30586. // by the length of data’s buffer in bytes.
  30587. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30588. const frame = new WebsocketFrameSend(ab)
  30589. const buffer = frame.createFrame(opcodes.BINARY)
  30590. this.#bufferedAmount += ab.byteLength
  30591. socket.write(buffer, () => {
  30592. this.#bufferedAmount -= ab.byteLength
  30593. })
  30594. } else if (isBlobLike(data)) {
  30595. // If the WebSocket connection is established, and the WebSocket
  30596. // closing handshake has not yet started, then the user agent must
  30597. // send a WebSocket Message comprised of data using a binary frame
  30598. // opcode; if the data cannot be sent, e.g. because it would need to
  30599. // be buffered but the buffer is full, the user agent must flag the
  30600. // WebSocket as full and then close the WebSocket connection. The data
  30601. // to be sent is the raw data represented by the Blob object. Any
  30602. // invocation of this method with a Blob argument that does not throw
  30603. // an exception must increase the bufferedAmount attribute by the size
  30604. // of the Blob object’s raw data, in bytes.
  30605. const frame = new WebsocketFrameSend()
  30606. data.arrayBuffer().then((ab) => {
  30607. const value = Buffer.from(ab)
  30608. frame.frameData = value
  30609. const buffer = frame.createFrame(opcodes.BINARY)
  30610. this.#bufferedAmount += value.byteLength
  30611. socket.write(buffer, () => {
  30612. this.#bufferedAmount -= value.byteLength
  30613. })
  30614. })
  30615. }
  30616. }
  30617. get readyState () {
  30618. webidl.brandCheck(this, WebSocket)
  30619. // The readyState getter steps are to return this's ready state.
  30620. return this[kReadyState]
  30621. }
  30622. get bufferedAmount () {
  30623. webidl.brandCheck(this, WebSocket)
  30624. return this.#bufferedAmount
  30625. }
  30626. get url () {
  30627. webidl.brandCheck(this, WebSocket)
  30628. // The url getter steps are to return this's url, serialized.
  30629. return URLSerializer(this[kWebSocketURL])
  30630. }
  30631. get extensions () {
  30632. webidl.brandCheck(this, WebSocket)
  30633. return this.#extensions
  30634. }
  30635. get protocol () {
  30636. webidl.brandCheck(this, WebSocket)
  30637. return this.#protocol
  30638. }
  30639. get onopen () {
  30640. webidl.brandCheck(this, WebSocket)
  30641. return this.#events.open
  30642. }
  30643. set onopen (fn) {
  30644. webidl.brandCheck(this, WebSocket)
  30645. if (this.#events.open) {
  30646. this.removeEventListener('open', this.#events.open)
  30647. }
  30648. if (typeof fn === 'function') {
  30649. this.#events.open = fn
  30650. this.addEventListener('open', fn)
  30651. } else {
  30652. this.#events.open = null
  30653. }
  30654. }
  30655. get onerror () {
  30656. webidl.brandCheck(this, WebSocket)
  30657. return this.#events.error
  30658. }
  30659. set onerror (fn) {
  30660. webidl.brandCheck(this, WebSocket)
  30661. if (this.#events.error) {
  30662. this.removeEventListener('error', this.#events.error)
  30663. }
  30664. if (typeof fn === 'function') {
  30665. this.#events.error = fn
  30666. this.addEventListener('error', fn)
  30667. } else {
  30668. this.#events.error = null
  30669. }
  30670. }
  30671. get onclose () {
  30672. webidl.brandCheck(this, WebSocket)
  30673. return this.#events.close
  30674. }
  30675. set onclose (fn) {
  30676. webidl.brandCheck(this, WebSocket)
  30677. if (this.#events.close) {
  30678. this.removeEventListener('close', this.#events.close)
  30679. }
  30680. if (typeof fn === 'function') {
  30681. this.#events.close = fn
  30682. this.addEventListener('close', fn)
  30683. } else {
  30684. this.#events.close = null
  30685. }
  30686. }
  30687. get onmessage () {
  30688. webidl.brandCheck(this, WebSocket)
  30689. return this.#events.message
  30690. }
  30691. set onmessage (fn) {
  30692. webidl.brandCheck(this, WebSocket)
  30693. if (this.#events.message) {
  30694. this.removeEventListener('message', this.#events.message)
  30695. }
  30696. if (typeof fn === 'function') {
  30697. this.#events.message = fn
  30698. this.addEventListener('message', fn)
  30699. } else {
  30700. this.#events.message = null
  30701. }
  30702. }
  30703. get binaryType () {
  30704. webidl.brandCheck(this, WebSocket)
  30705. return this[kBinaryType]
  30706. }
  30707. set binaryType (type) {
  30708. webidl.brandCheck(this, WebSocket)
  30709. if (type !== 'blob' && type !== 'arraybuffer') {
  30710. this[kBinaryType] = 'blob'
  30711. } else {
  30712. this[kBinaryType] = type
  30713. }
  30714. }
  30715. /**
  30716. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30717. */
  30718. #onConnectionEstablished (response) {
  30719. // processResponse is called when the "response’s header list has been received and initialized."
  30720. // once this happens, the connection is open
  30721. this[kResponse] = response
  30722. const parser = new ByteParser(this)
  30723. parser.on('drain', function onParserDrain () {
  30724. this.ws[kResponse].socket.resume()
  30725. })
  30726. response.socket.ws = this
  30727. this[kByteParser] = parser
  30728. // 1. Change the ready state to OPEN (1).
  30729. this[kReadyState] = states.OPEN
  30730. // 2. Change the extensions attribute’s value to the extensions in use, if
  30731. // it is not the null value.
  30732. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  30733. const extensions = response.headersList.get('sec-websocket-extensions')
  30734. if (extensions !== null) {
  30735. this.#extensions = extensions
  30736. }
  30737. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  30738. // it is not the null value.
  30739. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  30740. const protocol = response.headersList.get('sec-websocket-protocol')
  30741. if (protocol !== null) {
  30742. this.#protocol = protocol
  30743. }
  30744. // 4. Fire an event named open at the WebSocket object.
  30745. fireEvent('open', this)
  30746. }
  30747. }
  30748. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  30749. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  30750. // https://websockets.spec.whatwg.org/#dom-websocket-open
  30751. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  30752. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  30753. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  30754. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  30755. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  30756. Object.defineProperties(WebSocket.prototype, {
  30757. CONNECTING: staticPropertyDescriptors,
  30758. OPEN: staticPropertyDescriptors,
  30759. CLOSING: staticPropertyDescriptors,
  30760. CLOSED: staticPropertyDescriptors,
  30761. url: kEnumerableProperty,
  30762. readyState: kEnumerableProperty,
  30763. bufferedAmount: kEnumerableProperty,
  30764. onopen: kEnumerableProperty,
  30765. onerror: kEnumerableProperty,
  30766. onclose: kEnumerableProperty,
  30767. close: kEnumerableProperty,
  30768. onmessage: kEnumerableProperty,
  30769. binaryType: kEnumerableProperty,
  30770. send: kEnumerableProperty,
  30771. extensions: kEnumerableProperty,
  30772. protocol: kEnumerableProperty,
  30773. [Symbol.toStringTag]: {
  30774. value: 'WebSocket',
  30775. writable: false,
  30776. enumerable: false,
  30777. configurable: true
  30778. }
  30779. })
  30780. Object.defineProperties(WebSocket, {
  30781. CONNECTING: staticPropertyDescriptors,
  30782. OPEN: staticPropertyDescriptors,
  30783. CLOSING: staticPropertyDescriptors,
  30784. CLOSED: staticPropertyDescriptors
  30785. })
  30786. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  30787. webidl.converters.DOMString
  30788. )
  30789. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  30790. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  30791. return webidl.converters['sequence<DOMString>'](V)
  30792. }
  30793. return webidl.converters.DOMString(V)
  30794. }
  30795. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  30796. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  30797. {
  30798. key: 'protocols',
  30799. converter: webidl.converters['DOMString or sequence<DOMString>'],
  30800. get defaultValue () {
  30801. return []
  30802. }
  30803. },
  30804. {
  30805. key: 'dispatcher',
  30806. converter: (V) => V,
  30807. get defaultValue () {
  30808. return getGlobalDispatcher()
  30809. }
  30810. },
  30811. {
  30812. key: 'headers',
  30813. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  30814. }
  30815. ])
  30816. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  30817. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  30818. return webidl.converters.WebSocketInit(V)
  30819. }
  30820. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  30821. }
  30822. webidl.converters.WebSocketSendData = function (V) {
  30823. if (webidl.util.Type(V) === 'Object') {
  30824. if (isBlobLike(V)) {
  30825. return webidl.converters.Blob(V, { strict: false })
  30826. }
  30827. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  30828. return webidl.converters.BufferSource(V)
  30829. }
  30830. }
  30831. return webidl.converters.USVString(V)
  30832. }
  30833. module.exports = {
  30834. WebSocket
  30835. }
  30836. /***/ }),
  30837. /***/ 5030:
  30838. /***/ ((__unused_webpack_module, exports) => {
  30839. "use strict";
  30840. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30841. function getUserAgent() {
  30842. if (typeof navigator === "object" && "userAgent" in navigator) {
  30843. return navigator.userAgent;
  30844. }
  30845. if (typeof process === "object" && process.version !== undefined) {
  30846. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  30847. }
  30848. return "<environment undetectable>";
  30849. }
  30850. exports.getUserAgent = getUserAgent;
  30851. //# sourceMappingURL=index.js.map
  30852. /***/ }),
  30853. /***/ 5840:
  30854. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30855. "use strict";
  30856. Object.defineProperty(exports, "__esModule", ({
  30857. value: true
  30858. }));
  30859. Object.defineProperty(exports, "NIL", ({
  30860. enumerable: true,
  30861. get: function () {
  30862. return _nil.default;
  30863. }
  30864. }));
  30865. Object.defineProperty(exports, "parse", ({
  30866. enumerable: true,
  30867. get: function () {
  30868. return _parse.default;
  30869. }
  30870. }));
  30871. Object.defineProperty(exports, "stringify", ({
  30872. enumerable: true,
  30873. get: function () {
  30874. return _stringify.default;
  30875. }
  30876. }));
  30877. Object.defineProperty(exports, "v1", ({
  30878. enumerable: true,
  30879. get: function () {
  30880. return _v.default;
  30881. }
  30882. }));
  30883. Object.defineProperty(exports, "v3", ({
  30884. enumerable: true,
  30885. get: function () {
  30886. return _v2.default;
  30887. }
  30888. }));
  30889. Object.defineProperty(exports, "v4", ({
  30890. enumerable: true,
  30891. get: function () {
  30892. return _v3.default;
  30893. }
  30894. }));
  30895. Object.defineProperty(exports, "v5", ({
  30896. enumerable: true,
  30897. get: function () {
  30898. return _v4.default;
  30899. }
  30900. }));
  30901. Object.defineProperty(exports, "validate", ({
  30902. enumerable: true,
  30903. get: function () {
  30904. return _validate.default;
  30905. }
  30906. }));
  30907. Object.defineProperty(exports, "version", ({
  30908. enumerable: true,
  30909. get: function () {
  30910. return _version.default;
  30911. }
  30912. }));
  30913. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  30914. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  30915. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  30916. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  30917. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  30918. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  30919. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30920. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  30921. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  30922. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30923. /***/ }),
  30924. /***/ 4569:
  30925. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30926. "use strict";
  30927. Object.defineProperty(exports, "__esModule", ({
  30928. value: true
  30929. }));
  30930. exports["default"] = void 0;
  30931. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30932. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30933. function md5(bytes) {
  30934. if (Array.isArray(bytes)) {
  30935. bytes = Buffer.from(bytes);
  30936. } else if (typeof bytes === 'string') {
  30937. bytes = Buffer.from(bytes, 'utf8');
  30938. }
  30939. return _crypto.default.createHash('md5').update(bytes).digest();
  30940. }
  30941. var _default = md5;
  30942. exports["default"] = _default;
  30943. /***/ }),
  30944. /***/ 2054:
  30945. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30946. "use strict";
  30947. Object.defineProperty(exports, "__esModule", ({
  30948. value: true
  30949. }));
  30950. exports["default"] = void 0;
  30951. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30952. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30953. var _default = {
  30954. randomUUID: _crypto.default.randomUUID
  30955. };
  30956. exports["default"] = _default;
  30957. /***/ }),
  30958. /***/ 5332:
  30959. /***/ ((__unused_webpack_module, exports) => {
  30960. "use strict";
  30961. Object.defineProperty(exports, "__esModule", ({
  30962. value: true
  30963. }));
  30964. exports["default"] = void 0;
  30965. var _default = '00000000-0000-0000-0000-000000000000';
  30966. exports["default"] = _default;
  30967. /***/ }),
  30968. /***/ 2746:
  30969. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30970. "use strict";
  30971. Object.defineProperty(exports, "__esModule", ({
  30972. value: true
  30973. }));
  30974. exports["default"] = void 0;
  30975. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30976. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30977. function parse(uuid) {
  30978. if (!(0, _validate.default)(uuid)) {
  30979. throw TypeError('Invalid UUID');
  30980. }
  30981. let v;
  30982. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  30983. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  30984. arr[1] = v >>> 16 & 0xff;
  30985. arr[2] = v >>> 8 & 0xff;
  30986. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  30987. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  30988. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  30989. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  30990. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  30991. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  30992. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  30993. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  30994. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  30995. arr[11] = v / 0x100000000 & 0xff;
  30996. arr[12] = v >>> 24 & 0xff;
  30997. arr[13] = v >>> 16 & 0xff;
  30998. arr[14] = v >>> 8 & 0xff;
  30999. arr[15] = v & 0xff;
  31000. return arr;
  31001. }
  31002. var _default = parse;
  31003. exports["default"] = _default;
  31004. /***/ }),
  31005. /***/ 814:
  31006. /***/ ((__unused_webpack_module, exports) => {
  31007. "use strict";
  31008. Object.defineProperty(exports, "__esModule", ({
  31009. value: true
  31010. }));
  31011. exports["default"] = void 0;
  31012. 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;
  31013. exports["default"] = _default;
  31014. /***/ }),
  31015. /***/ 807:
  31016. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31017. "use strict";
  31018. Object.defineProperty(exports, "__esModule", ({
  31019. value: true
  31020. }));
  31021. exports["default"] = rng;
  31022. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31023. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31024. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31025. let poolPtr = rnds8Pool.length;
  31026. function rng() {
  31027. if (poolPtr > rnds8Pool.length - 16) {
  31028. _crypto.default.randomFillSync(rnds8Pool);
  31029. poolPtr = 0;
  31030. }
  31031. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31032. }
  31033. /***/ }),
  31034. /***/ 5274:
  31035. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31036. "use strict";
  31037. Object.defineProperty(exports, "__esModule", ({
  31038. value: true
  31039. }));
  31040. exports["default"] = void 0;
  31041. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31042. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31043. function sha1(bytes) {
  31044. if (Array.isArray(bytes)) {
  31045. bytes = Buffer.from(bytes);
  31046. } else if (typeof bytes === 'string') {
  31047. bytes = Buffer.from(bytes, 'utf8');
  31048. }
  31049. return _crypto.default.createHash('sha1').update(bytes).digest();
  31050. }
  31051. var _default = sha1;
  31052. exports["default"] = _default;
  31053. /***/ }),
  31054. /***/ 8950:
  31055. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31056. "use strict";
  31057. Object.defineProperty(exports, "__esModule", ({
  31058. value: true
  31059. }));
  31060. exports["default"] = void 0;
  31061. exports.unsafeStringify = unsafeStringify;
  31062. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31063. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31064. /**
  31065. * Convert array of 16 byte values to UUID string format of the form:
  31066. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31067. */
  31068. const byteToHex = [];
  31069. for (let i = 0; i < 256; ++i) {
  31070. byteToHex.push((i + 0x100).toString(16).slice(1));
  31071. }
  31072. function unsafeStringify(arr, offset = 0) {
  31073. // Note: Be careful editing this code! It's been tuned for performance
  31074. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31075. 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]];
  31076. }
  31077. function stringify(arr, offset = 0) {
  31078. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31079. // of the following:
  31080. // - One or more input array values don't map to a hex octet (leading to
  31081. // "undefined" in the uuid)
  31082. // - Invalid input values for the RFC `version` or `variant` fields
  31083. if (!(0, _validate.default)(uuid)) {
  31084. throw TypeError('Stringified UUID is invalid');
  31085. }
  31086. return uuid;
  31087. }
  31088. var _default = stringify;
  31089. exports["default"] = _default;
  31090. /***/ }),
  31091. /***/ 8628:
  31092. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31093. "use strict";
  31094. Object.defineProperty(exports, "__esModule", ({
  31095. value: true
  31096. }));
  31097. exports["default"] = void 0;
  31098. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31099. var _stringify = __nccwpck_require__(8950);
  31100. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31101. // **`v1()` - Generate time-based UUID**
  31102. //
  31103. // Inspired by https://github.com/LiosK/UUID.js
  31104. // and http://docs.python.org/library/uuid.html
  31105. let _nodeId;
  31106. let _clockseq; // Previous uuid creation time
  31107. let _lastMSecs = 0;
  31108. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31109. function v1(options, buf, offset) {
  31110. let i = buf && offset || 0;
  31111. const b = buf || new Array(16);
  31112. options = options || {};
  31113. let node = options.node || _nodeId;
  31114. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31115. // specified. We do this lazily to minimize issues related to insufficient
  31116. // system entropy. See #189
  31117. if (node == null || clockseq == null) {
  31118. const seedBytes = options.random || (options.rng || _rng.default)();
  31119. if (node == null) {
  31120. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31121. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31122. }
  31123. if (clockseq == null) {
  31124. // Per 4.2.2, randomize (14 bit) clockseq
  31125. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31126. }
  31127. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31128. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31129. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31130. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31131. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31132. // cycle to simulate higher resolution clock
  31133. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31134. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31135. if (dt < 0 && options.clockseq === undefined) {
  31136. clockseq = clockseq + 1 & 0x3fff;
  31137. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31138. // time interval
  31139. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31140. nsecs = 0;
  31141. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31142. if (nsecs >= 10000) {
  31143. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31144. }
  31145. _lastMSecs = msecs;
  31146. _lastNSecs = nsecs;
  31147. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31148. msecs += 12219292800000; // `time_low`
  31149. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31150. b[i++] = tl >>> 24 & 0xff;
  31151. b[i++] = tl >>> 16 & 0xff;
  31152. b[i++] = tl >>> 8 & 0xff;
  31153. b[i++] = tl & 0xff; // `time_mid`
  31154. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31155. b[i++] = tmh >>> 8 & 0xff;
  31156. b[i++] = tmh & 0xff; // `time_high_and_version`
  31157. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31158. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31159. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31160. b[i++] = clockseq & 0xff; // `node`
  31161. for (let n = 0; n < 6; ++n) {
  31162. b[i + n] = node[n];
  31163. }
  31164. return buf || (0, _stringify.unsafeStringify)(b);
  31165. }
  31166. var _default = v1;
  31167. exports["default"] = _default;
  31168. /***/ }),
  31169. /***/ 6409:
  31170. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31171. "use strict";
  31172. Object.defineProperty(exports, "__esModule", ({
  31173. value: true
  31174. }));
  31175. exports["default"] = void 0;
  31176. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31177. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31178. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31179. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31180. var _default = v3;
  31181. exports["default"] = _default;
  31182. /***/ }),
  31183. /***/ 5998:
  31184. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31185. "use strict";
  31186. Object.defineProperty(exports, "__esModule", ({
  31187. value: true
  31188. }));
  31189. exports.URL = exports.DNS = void 0;
  31190. exports["default"] = v35;
  31191. var _stringify = __nccwpck_require__(8950);
  31192. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31193. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31194. function stringToBytes(str) {
  31195. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31196. const bytes = [];
  31197. for (let i = 0; i < str.length; ++i) {
  31198. bytes.push(str.charCodeAt(i));
  31199. }
  31200. return bytes;
  31201. }
  31202. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31203. exports.DNS = DNS;
  31204. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31205. exports.URL = URL;
  31206. function v35(name, version, hashfunc) {
  31207. function generateUUID(value, namespace, buf, offset) {
  31208. var _namespace;
  31209. if (typeof value === 'string') {
  31210. value = stringToBytes(value);
  31211. }
  31212. if (typeof namespace === 'string') {
  31213. namespace = (0, _parse.default)(namespace);
  31214. }
  31215. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31216. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31217. } // Compute hash of namespace and value, Per 4.3
  31218. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31219. // hashfunc([...namespace, ... value])`
  31220. let bytes = new Uint8Array(16 + value.length);
  31221. bytes.set(namespace);
  31222. bytes.set(value, namespace.length);
  31223. bytes = hashfunc(bytes);
  31224. bytes[6] = bytes[6] & 0x0f | version;
  31225. bytes[8] = bytes[8] & 0x3f | 0x80;
  31226. if (buf) {
  31227. offset = offset || 0;
  31228. for (let i = 0; i < 16; ++i) {
  31229. buf[offset + i] = bytes[i];
  31230. }
  31231. return buf;
  31232. }
  31233. return (0, _stringify.unsafeStringify)(bytes);
  31234. } // Function#name is not settable on some platforms (#270)
  31235. try {
  31236. generateUUID.name = name; // eslint-disable-next-line no-empty
  31237. } catch (err) {} // For CommonJS default export support
  31238. generateUUID.DNS = DNS;
  31239. generateUUID.URL = URL;
  31240. return generateUUID;
  31241. }
  31242. /***/ }),
  31243. /***/ 5122:
  31244. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31245. "use strict";
  31246. Object.defineProperty(exports, "__esModule", ({
  31247. value: true
  31248. }));
  31249. exports["default"] = void 0;
  31250. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31251. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31252. var _stringify = __nccwpck_require__(8950);
  31253. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31254. function v4(options, buf, offset) {
  31255. if (_native.default.randomUUID && !buf && !options) {
  31256. return _native.default.randomUUID();
  31257. }
  31258. options = options || {};
  31259. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31260. rnds[6] = rnds[6] & 0x0f | 0x40;
  31261. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31262. if (buf) {
  31263. offset = offset || 0;
  31264. for (let i = 0; i < 16; ++i) {
  31265. buf[offset + i] = rnds[i];
  31266. }
  31267. return buf;
  31268. }
  31269. return (0, _stringify.unsafeStringify)(rnds);
  31270. }
  31271. var _default = v4;
  31272. exports["default"] = _default;
  31273. /***/ }),
  31274. /***/ 9120:
  31275. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31276. "use strict";
  31277. Object.defineProperty(exports, "__esModule", ({
  31278. value: true
  31279. }));
  31280. exports["default"] = void 0;
  31281. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31282. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31283. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31284. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31285. var _default = v5;
  31286. exports["default"] = _default;
  31287. /***/ }),
  31288. /***/ 6900:
  31289. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31290. "use strict";
  31291. Object.defineProperty(exports, "__esModule", ({
  31292. value: true
  31293. }));
  31294. exports["default"] = void 0;
  31295. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31296. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31297. function validate(uuid) {
  31298. return typeof uuid === 'string' && _regex.default.test(uuid);
  31299. }
  31300. var _default = validate;
  31301. exports["default"] = _default;
  31302. /***/ }),
  31303. /***/ 2414:
  31304. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31305. "use strict";
  31306. Object.defineProperty(exports, "__esModule", ({
  31307. value: true
  31308. }));
  31309. exports["default"] = void 0;
  31310. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31311. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31312. function version(uuid) {
  31313. if (!(0, _validate.default)(uuid)) {
  31314. throw TypeError('Invalid UUID');
  31315. }
  31316. return parseInt(uuid.slice(14, 15), 16);
  31317. }
  31318. var _default = version;
  31319. exports["default"] = _default;
  31320. /***/ }),
  31321. /***/ 2940:
  31322. /***/ ((module) => {
  31323. // Returns a wrapper function that returns a wrapped callback
  31324. // The wrapper function should do some stuff, and return a
  31325. // presumably different callback function.
  31326. // This makes sure that own properties are retained, so that
  31327. // decorations and such are not lost along the way.
  31328. module.exports = wrappy
  31329. function wrappy (fn, cb) {
  31330. if (fn && cb) return wrappy(fn)(cb)
  31331. if (typeof fn !== 'function')
  31332. throw new TypeError('need wrapper function')
  31333. Object.keys(fn).forEach(function (k) {
  31334. wrapper[k] = fn[k]
  31335. })
  31336. return wrapper
  31337. function wrapper() {
  31338. var args = new Array(arguments.length)
  31339. for (var i = 0; i < args.length; i++) {
  31340. args[i] = arguments[i]
  31341. }
  31342. var ret = fn.apply(this, args)
  31343. var cb = args[args.length-1]
  31344. if (typeof ret === 'function' && ret !== cb) {
  31345. Object.keys(cb).forEach(function (k) {
  31346. ret[k] = cb[k]
  31347. })
  31348. }
  31349. return ret
  31350. }
  31351. }
  31352. /***/ }),
  31353. /***/ 9491:
  31354. /***/ ((module) => {
  31355. "use strict";
  31356. module.exports = require("assert");
  31357. /***/ }),
  31358. /***/ 852:
  31359. /***/ ((module) => {
  31360. "use strict";
  31361. module.exports = require("async_hooks");
  31362. /***/ }),
  31363. /***/ 4300:
  31364. /***/ ((module) => {
  31365. "use strict";
  31366. module.exports = require("buffer");
  31367. /***/ }),
  31368. /***/ 2081:
  31369. /***/ ((module) => {
  31370. "use strict";
  31371. module.exports = require("child_process");
  31372. /***/ }),
  31373. /***/ 6206:
  31374. /***/ ((module) => {
  31375. "use strict";
  31376. module.exports = require("console");
  31377. /***/ }),
  31378. /***/ 6113:
  31379. /***/ ((module) => {
  31380. "use strict";
  31381. module.exports = require("crypto");
  31382. /***/ }),
  31383. /***/ 7643:
  31384. /***/ ((module) => {
  31385. "use strict";
  31386. module.exports = require("diagnostics_channel");
  31387. /***/ }),
  31388. /***/ 2361:
  31389. /***/ ((module) => {
  31390. "use strict";
  31391. module.exports = require("events");
  31392. /***/ }),
  31393. /***/ 7147:
  31394. /***/ ((module) => {
  31395. "use strict";
  31396. module.exports = require("fs");
  31397. /***/ }),
  31398. /***/ 3685:
  31399. /***/ ((module) => {
  31400. "use strict";
  31401. module.exports = require("http");
  31402. /***/ }),
  31403. /***/ 5158:
  31404. /***/ ((module) => {
  31405. "use strict";
  31406. module.exports = require("http2");
  31407. /***/ }),
  31408. /***/ 5687:
  31409. /***/ ((module) => {
  31410. "use strict";
  31411. module.exports = require("https");
  31412. /***/ }),
  31413. /***/ 1808:
  31414. /***/ ((module) => {
  31415. "use strict";
  31416. module.exports = require("net");
  31417. /***/ }),
  31418. /***/ 5673:
  31419. /***/ ((module) => {
  31420. "use strict";
  31421. module.exports = require("node:events");
  31422. /***/ }),
  31423. /***/ 4492:
  31424. /***/ ((module) => {
  31425. "use strict";
  31426. module.exports = require("node:stream");
  31427. /***/ }),
  31428. /***/ 7261:
  31429. /***/ ((module) => {
  31430. "use strict";
  31431. module.exports = require("node:util");
  31432. /***/ }),
  31433. /***/ 2037:
  31434. /***/ ((module) => {
  31435. "use strict";
  31436. module.exports = require("os");
  31437. /***/ }),
  31438. /***/ 1017:
  31439. /***/ ((module) => {
  31440. "use strict";
  31441. module.exports = require("path");
  31442. /***/ }),
  31443. /***/ 4074:
  31444. /***/ ((module) => {
  31445. "use strict";
  31446. module.exports = require("perf_hooks");
  31447. /***/ }),
  31448. /***/ 3477:
  31449. /***/ ((module) => {
  31450. "use strict";
  31451. module.exports = require("querystring");
  31452. /***/ }),
  31453. /***/ 2781:
  31454. /***/ ((module) => {
  31455. "use strict";
  31456. module.exports = require("stream");
  31457. /***/ }),
  31458. /***/ 5356:
  31459. /***/ ((module) => {
  31460. "use strict";
  31461. module.exports = require("stream/web");
  31462. /***/ }),
  31463. /***/ 1576:
  31464. /***/ ((module) => {
  31465. "use strict";
  31466. module.exports = require("string_decoder");
  31467. /***/ }),
  31468. /***/ 9512:
  31469. /***/ ((module) => {
  31470. "use strict";
  31471. module.exports = require("timers");
  31472. /***/ }),
  31473. /***/ 4404:
  31474. /***/ ((module) => {
  31475. "use strict";
  31476. module.exports = require("tls");
  31477. /***/ }),
  31478. /***/ 7310:
  31479. /***/ ((module) => {
  31480. "use strict";
  31481. module.exports = require("url");
  31482. /***/ }),
  31483. /***/ 3837:
  31484. /***/ ((module) => {
  31485. "use strict";
  31486. module.exports = require("util");
  31487. /***/ }),
  31488. /***/ 9830:
  31489. /***/ ((module) => {
  31490. "use strict";
  31491. module.exports = require("util/types");
  31492. /***/ }),
  31493. /***/ 1267:
  31494. /***/ ((module) => {
  31495. "use strict";
  31496. module.exports = require("worker_threads");
  31497. /***/ }),
  31498. /***/ 9796:
  31499. /***/ ((module) => {
  31500. "use strict";
  31501. module.exports = require("zlib");
  31502. /***/ }),
  31503. /***/ 2960:
  31504. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31505. "use strict";
  31506. const WritableStream = (__nccwpck_require__(4492).Writable)
  31507. const inherits = (__nccwpck_require__(7261).inherits)
  31508. const StreamSearch = __nccwpck_require__(1142)
  31509. const PartStream = __nccwpck_require__(1620)
  31510. const HeaderParser = __nccwpck_require__(2032)
  31511. const DASH = 45
  31512. const B_ONEDASH = Buffer.from('-')
  31513. const B_CRLF = Buffer.from('\r\n')
  31514. const EMPTY_FN = function () {}
  31515. function Dicer (cfg) {
  31516. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31517. WritableStream.call(this, cfg)
  31518. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31519. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31520. this._headerFirst = cfg.headerFirst
  31521. this._dashes = 0
  31522. this._parts = 0
  31523. this._finished = false
  31524. this._realFinish = false
  31525. this._isPreamble = true
  31526. this._justMatched = false
  31527. this._firstWrite = true
  31528. this._inHeader = true
  31529. this._part = undefined
  31530. this._cb = undefined
  31531. this._ignoreData = false
  31532. this._partOpts = { highWaterMark: cfg.partHwm }
  31533. this._pause = false
  31534. const self = this
  31535. this._hparser = new HeaderParser(cfg)
  31536. this._hparser.on('header', function (header) {
  31537. self._inHeader = false
  31538. self._part.emit('header', header)
  31539. })
  31540. }
  31541. inherits(Dicer, WritableStream)
  31542. Dicer.prototype.emit = function (ev) {
  31543. if (ev === 'finish' && !this._realFinish) {
  31544. if (!this._finished) {
  31545. const self = this
  31546. process.nextTick(function () {
  31547. self.emit('error', new Error('Unexpected end of multipart data'))
  31548. if (self._part && !self._ignoreData) {
  31549. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31550. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31551. self._part.push(null)
  31552. process.nextTick(function () {
  31553. self._realFinish = true
  31554. self.emit('finish')
  31555. self._realFinish = false
  31556. })
  31557. return
  31558. }
  31559. self._realFinish = true
  31560. self.emit('finish')
  31561. self._realFinish = false
  31562. })
  31563. }
  31564. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31565. }
  31566. Dicer.prototype._write = function (data, encoding, cb) {
  31567. // ignore unexpected data (e.g. extra trailer data after finished)
  31568. if (!this._hparser && !this._bparser) { return cb() }
  31569. if (this._headerFirst && this._isPreamble) {
  31570. if (!this._part) {
  31571. this._part = new PartStream(this._partOpts)
  31572. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31573. }
  31574. const r = this._hparser.push(data)
  31575. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31576. }
  31577. // allows for "easier" testing
  31578. if (this._firstWrite) {
  31579. this._bparser.push(B_CRLF)
  31580. this._firstWrite = false
  31581. }
  31582. this._bparser.push(data)
  31583. if (this._pause) { this._cb = cb } else { cb() }
  31584. }
  31585. Dicer.prototype.reset = function () {
  31586. this._part = undefined
  31587. this._bparser = undefined
  31588. this._hparser = undefined
  31589. }
  31590. Dicer.prototype.setBoundary = function (boundary) {
  31591. const self = this
  31592. this._bparser = new StreamSearch('\r\n--' + boundary)
  31593. this._bparser.on('info', function (isMatch, data, start, end) {
  31594. self._oninfo(isMatch, data, start, end)
  31595. })
  31596. }
  31597. Dicer.prototype._ignore = function () {
  31598. if (this._part && !this._ignoreData) {
  31599. this._ignoreData = true
  31600. this._part.on('error', EMPTY_FN)
  31601. // we must perform some kind of read on the stream even though we are
  31602. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31603. // after pushing null to the stream
  31604. this._part.resume()
  31605. }
  31606. }
  31607. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31608. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31609. if (!this._part && this._justMatched && data) {
  31610. while (this._dashes < 2 && (start + i) < end) {
  31611. if (data[start + i] === DASH) {
  31612. ++i
  31613. ++this._dashes
  31614. } else {
  31615. if (this._dashes) { buf = B_ONEDASH }
  31616. this._dashes = 0
  31617. break
  31618. }
  31619. }
  31620. if (this._dashes === 2) {
  31621. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31622. this.reset()
  31623. this._finished = true
  31624. // no more parts will be added
  31625. if (self._parts === 0) {
  31626. self._realFinish = true
  31627. self.emit('finish')
  31628. self._realFinish = false
  31629. }
  31630. }
  31631. if (this._dashes) { return }
  31632. }
  31633. if (this._justMatched) { this._justMatched = false }
  31634. if (!this._part) {
  31635. this._part = new PartStream(this._partOpts)
  31636. this._part._read = function (n) {
  31637. self._unpause()
  31638. }
  31639. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31640. this.emit('preamble', this._part)
  31641. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31642. this.emit('part', this._part)
  31643. } else {
  31644. this._ignore()
  31645. }
  31646. if (!this._isPreamble) { this._inHeader = true }
  31647. }
  31648. if (data && start < end && !this._ignoreData) {
  31649. if (this._isPreamble || !this._inHeader) {
  31650. if (buf) { shouldWriteMore = this._part.push(buf) }
  31651. shouldWriteMore = this._part.push(data.slice(start, end))
  31652. if (!shouldWriteMore) { this._pause = true }
  31653. } else if (!this._isPreamble && this._inHeader) {
  31654. if (buf) { this._hparser.push(buf) }
  31655. r = this._hparser.push(data.slice(start, end))
  31656. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31657. }
  31658. }
  31659. if (isMatch) {
  31660. this._hparser.reset()
  31661. if (this._isPreamble) { this._isPreamble = false } else {
  31662. if (start !== end) {
  31663. ++this._parts
  31664. this._part.on('end', function () {
  31665. if (--self._parts === 0) {
  31666. if (self._finished) {
  31667. self._realFinish = true
  31668. self.emit('finish')
  31669. self._realFinish = false
  31670. } else {
  31671. self._unpause()
  31672. }
  31673. }
  31674. })
  31675. }
  31676. }
  31677. this._part.push(null)
  31678. this._part = undefined
  31679. this._ignoreData = false
  31680. this._justMatched = true
  31681. this._dashes = 0
  31682. }
  31683. }
  31684. Dicer.prototype._unpause = function () {
  31685. if (!this._pause) { return }
  31686. this._pause = false
  31687. if (this._cb) {
  31688. const cb = this._cb
  31689. this._cb = undefined
  31690. cb()
  31691. }
  31692. }
  31693. module.exports = Dicer
  31694. /***/ }),
  31695. /***/ 2032:
  31696. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31697. "use strict";
  31698. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31699. const inherits = (__nccwpck_require__(7261).inherits)
  31700. const getLimit = __nccwpck_require__(1467)
  31701. const StreamSearch = __nccwpck_require__(1142)
  31702. const B_DCRLF = Buffer.from('\r\n\r\n')
  31703. const RE_CRLF = /\r\n/g
  31704. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31705. function HeaderParser (cfg) {
  31706. EventEmitter.call(this)
  31707. cfg = cfg || {}
  31708. const self = this
  31709. this.nread = 0
  31710. this.maxed = false
  31711. this.npairs = 0
  31712. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  31713. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  31714. this.buffer = ''
  31715. this.header = {}
  31716. this.finished = false
  31717. this.ss = new StreamSearch(B_DCRLF)
  31718. this.ss.on('info', function (isMatch, data, start, end) {
  31719. if (data && !self.maxed) {
  31720. if (self.nread + end - start >= self.maxHeaderSize) {
  31721. end = self.maxHeaderSize - self.nread + start
  31722. self.nread = self.maxHeaderSize
  31723. self.maxed = true
  31724. } else { self.nread += (end - start) }
  31725. self.buffer += data.toString('binary', start, end)
  31726. }
  31727. if (isMatch) { self._finish() }
  31728. })
  31729. }
  31730. inherits(HeaderParser, EventEmitter)
  31731. HeaderParser.prototype.push = function (data) {
  31732. const r = this.ss.push(data)
  31733. if (this.finished) { return r }
  31734. }
  31735. HeaderParser.prototype.reset = function () {
  31736. this.finished = false
  31737. this.buffer = ''
  31738. this.header = {}
  31739. this.ss.reset()
  31740. }
  31741. HeaderParser.prototype._finish = function () {
  31742. if (this.buffer) { this._parseHeader() }
  31743. this.ss.matches = this.ss.maxMatches
  31744. const header = this.header
  31745. this.header = {}
  31746. this.buffer = ''
  31747. this.finished = true
  31748. this.nread = this.npairs = 0
  31749. this.maxed = false
  31750. this.emit('header', header)
  31751. }
  31752. HeaderParser.prototype._parseHeader = function () {
  31753. if (this.npairs === this.maxHeaderPairs) { return }
  31754. const lines = this.buffer.split(RE_CRLF)
  31755. const len = lines.length
  31756. let m, h
  31757. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31758. if (lines[i].length === 0) { continue }
  31759. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  31760. // folded header content
  31761. // RFC2822 says to just remove the CRLF and not the whitespace following
  31762. // it, so we follow the RFC and include the leading whitespace ...
  31763. if (h) {
  31764. this.header[h][this.header[h].length - 1] += lines[i]
  31765. continue
  31766. }
  31767. }
  31768. const posColon = lines[i].indexOf(':')
  31769. if (
  31770. posColon === -1 ||
  31771. posColon === 0
  31772. ) {
  31773. return
  31774. }
  31775. m = RE_HDR.exec(lines[i])
  31776. h = m[1].toLowerCase()
  31777. this.header[h] = this.header[h] || []
  31778. this.header[h].push((m[2] || ''))
  31779. if (++this.npairs === this.maxHeaderPairs) { break }
  31780. }
  31781. }
  31782. module.exports = HeaderParser
  31783. /***/ }),
  31784. /***/ 1620:
  31785. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31786. "use strict";
  31787. const inherits = (__nccwpck_require__(7261).inherits)
  31788. const ReadableStream = (__nccwpck_require__(4492).Readable)
  31789. function PartStream (opts) {
  31790. ReadableStream.call(this, opts)
  31791. }
  31792. inherits(PartStream, ReadableStream)
  31793. PartStream.prototype._read = function (n) {}
  31794. module.exports = PartStream
  31795. /***/ }),
  31796. /***/ 1142:
  31797. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31798. "use strict";
  31799. /**
  31800. * Copyright Brian White. All rights reserved.
  31801. *
  31802. * @see https://github.com/mscdex/streamsearch
  31803. *
  31804. * Permission is hereby granted, free of charge, to any person obtaining a copy
  31805. * of this software and associated documentation files (the "Software"), to
  31806. * deal in the Software without restriction, including without limitation the
  31807. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  31808. * sell copies of the Software, and to permit persons to whom the Software is
  31809. * furnished to do so, subject to the following conditions:
  31810. *
  31811. * The above copyright notice and this permission notice shall be included in
  31812. * all copies or substantial portions of the Software.
  31813. *
  31814. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  31815. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  31816. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  31817. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  31818. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  31819. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  31820. * IN THE SOFTWARE.
  31821. *
  31822. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  31823. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  31824. */
  31825. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31826. const inherits = (__nccwpck_require__(7261).inherits)
  31827. function SBMH (needle) {
  31828. if (typeof needle === 'string') {
  31829. needle = Buffer.from(needle)
  31830. }
  31831. if (!Buffer.isBuffer(needle)) {
  31832. throw new TypeError('The needle has to be a String or a Buffer.')
  31833. }
  31834. const needleLength = needle.length
  31835. if (needleLength === 0) {
  31836. throw new Error('The needle cannot be an empty String/Buffer.')
  31837. }
  31838. if (needleLength > 256) {
  31839. throw new Error('The needle cannot have a length bigger than 256.')
  31840. }
  31841. this.maxMatches = Infinity
  31842. this.matches = 0
  31843. this._occ = new Array(256)
  31844. .fill(needleLength) // Initialize occurrence table.
  31845. this._lookbehind_size = 0
  31846. this._needle = needle
  31847. this._bufpos = 0
  31848. this._lookbehind = Buffer.alloc(needleLength)
  31849. // Populate occurrence table with analysis of the needle,
  31850. // ignoring last letter.
  31851. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  31852. this._occ[needle[i]] = needleLength - 1 - i
  31853. }
  31854. }
  31855. inherits(SBMH, EventEmitter)
  31856. SBMH.prototype.reset = function () {
  31857. this._lookbehind_size = 0
  31858. this.matches = 0
  31859. this._bufpos = 0
  31860. }
  31861. SBMH.prototype.push = function (chunk, pos) {
  31862. if (!Buffer.isBuffer(chunk)) {
  31863. chunk = Buffer.from(chunk, 'binary')
  31864. }
  31865. const chlen = chunk.length
  31866. this._bufpos = pos || 0
  31867. let r
  31868. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  31869. return r
  31870. }
  31871. SBMH.prototype._sbmh_feed = function (data) {
  31872. const len = data.length
  31873. const needle = this._needle
  31874. const needleLength = needle.length
  31875. const lastNeedleChar = needle[needleLength - 1]
  31876. // Positive: points to a position in `data`
  31877. // pos == 3 points to data[3]
  31878. // Negative: points to a position in the lookbehind buffer
  31879. // pos == -2 points to lookbehind[lookbehind_size - 2]
  31880. let pos = -this._lookbehind_size
  31881. let ch
  31882. if (pos < 0) {
  31883. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  31884. // search with character lookup code that considers both the
  31885. // lookbehind buffer and the current round's haystack data.
  31886. //
  31887. // Loop until
  31888. // there is a match.
  31889. // or until
  31890. // we've moved past the position that requires the
  31891. // lookbehind buffer. In this case we switch to the
  31892. // optimized loop.
  31893. // or until
  31894. // the character to look at lies outside the haystack.
  31895. while (pos < 0 && pos <= len - needleLength) {
  31896. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  31897. if (
  31898. ch === lastNeedleChar &&
  31899. this._sbmh_memcmp(data, pos, needleLength - 1)
  31900. ) {
  31901. this._lookbehind_size = 0
  31902. ++this.matches
  31903. this.emit('info', true)
  31904. return (this._bufpos = pos + needleLength)
  31905. }
  31906. pos += this._occ[ch]
  31907. }
  31908. // No match.
  31909. if (pos < 0) {
  31910. // There's too few data for Boyer-Moore-Horspool to run,
  31911. // so let's use a different algorithm to skip as much as
  31912. // we can.
  31913. // Forward pos until
  31914. // the trailing part of lookbehind + data
  31915. // looks like the beginning of the needle
  31916. // or until
  31917. // pos == 0
  31918. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  31919. }
  31920. if (pos >= 0) {
  31921. // Discard lookbehind buffer.
  31922. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  31923. this._lookbehind_size = 0
  31924. } else {
  31925. // Cut off part of the lookbehind buffer that has
  31926. // been processed and append the entire haystack
  31927. // into it.
  31928. const bytesToCutOff = this._lookbehind_size + pos
  31929. if (bytesToCutOff > 0) {
  31930. // The cut off data is guaranteed not to contain the needle.
  31931. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  31932. }
  31933. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  31934. this._lookbehind_size - bytesToCutOff)
  31935. this._lookbehind_size -= bytesToCutOff
  31936. data.copy(this._lookbehind, this._lookbehind_size)
  31937. this._lookbehind_size += len
  31938. this._bufpos = len
  31939. return len
  31940. }
  31941. }
  31942. pos += (pos >= 0) * this._bufpos
  31943. // Lookbehind buffer is now empty. We only need to check if the
  31944. // needle is in the haystack.
  31945. if (data.indexOf(needle, pos) !== -1) {
  31946. pos = data.indexOf(needle, pos)
  31947. ++this.matches
  31948. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  31949. return (this._bufpos = pos + needleLength)
  31950. } else {
  31951. pos = len - needleLength
  31952. }
  31953. // There was no match. If there's trailing haystack data that we cannot
  31954. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  31955. // data is less than the needle size) then match using a modified
  31956. // algorithm that starts matching from the beginning instead of the end.
  31957. // Whatever trailing data is left after running this algorithm is added to
  31958. // the lookbehind buffer.
  31959. while (
  31960. pos < len &&
  31961. (
  31962. data[pos] !== needle[0] ||
  31963. (
  31964. (Buffer.compare(
  31965. data.subarray(pos, pos + len - pos),
  31966. needle.subarray(0, len - pos)
  31967. ) !== 0)
  31968. )
  31969. )
  31970. ) {
  31971. ++pos
  31972. }
  31973. if (pos < len) {
  31974. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  31975. this._lookbehind_size = len - pos
  31976. }
  31977. // Everything until pos is guaranteed not to contain needle data.
  31978. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  31979. this._bufpos = len
  31980. return len
  31981. }
  31982. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  31983. return (pos < 0)
  31984. ? this._lookbehind[this._lookbehind_size + pos]
  31985. : data[pos]
  31986. }
  31987. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  31988. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31989. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  31990. }
  31991. return true
  31992. }
  31993. module.exports = SBMH
  31994. /***/ }),
  31995. /***/ 727:
  31996. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31997. "use strict";
  31998. const WritableStream = (__nccwpck_require__(4492).Writable)
  31999. const { inherits } = __nccwpck_require__(7261)
  32000. const Dicer = __nccwpck_require__(2960)
  32001. const MultipartParser = __nccwpck_require__(2183)
  32002. const UrlencodedParser = __nccwpck_require__(8306)
  32003. const parseParams = __nccwpck_require__(1854)
  32004. function Busboy (opts) {
  32005. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32006. if (typeof opts !== 'object') {
  32007. throw new TypeError('Busboy expected an options-Object.')
  32008. }
  32009. if (typeof opts.headers !== 'object') {
  32010. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32011. }
  32012. if (typeof opts.headers['content-type'] !== 'string') {
  32013. throw new TypeError('Missing Content-Type-header.')
  32014. }
  32015. const {
  32016. headers,
  32017. ...streamOptions
  32018. } = opts
  32019. this.opts = {
  32020. autoDestroy: false,
  32021. ...streamOptions
  32022. }
  32023. WritableStream.call(this, this.opts)
  32024. this._done = false
  32025. this._parser = this.getParserByHeaders(headers)
  32026. this._finished = false
  32027. }
  32028. inherits(Busboy, WritableStream)
  32029. Busboy.prototype.emit = function (ev) {
  32030. if (ev === 'finish') {
  32031. if (!this._done) {
  32032. this._parser?.end()
  32033. return
  32034. } else if (this._finished) {
  32035. return
  32036. }
  32037. this._finished = true
  32038. }
  32039. WritableStream.prototype.emit.apply(this, arguments)
  32040. }
  32041. Busboy.prototype.getParserByHeaders = function (headers) {
  32042. const parsed = parseParams(headers['content-type'])
  32043. const cfg = {
  32044. defCharset: this.opts.defCharset,
  32045. fileHwm: this.opts.fileHwm,
  32046. headers,
  32047. highWaterMark: this.opts.highWaterMark,
  32048. isPartAFile: this.opts.isPartAFile,
  32049. limits: this.opts.limits,
  32050. parsedConType: parsed,
  32051. preservePath: this.opts.preservePath
  32052. }
  32053. if (MultipartParser.detect.test(parsed[0])) {
  32054. return new MultipartParser(this, cfg)
  32055. }
  32056. if (UrlencodedParser.detect.test(parsed[0])) {
  32057. return new UrlencodedParser(this, cfg)
  32058. }
  32059. throw new Error('Unsupported Content-Type.')
  32060. }
  32061. Busboy.prototype._write = function (chunk, encoding, cb) {
  32062. this._parser.write(chunk, cb)
  32063. }
  32064. module.exports = Busboy
  32065. module.exports["default"] = Busboy
  32066. module.exports.Busboy = Busboy
  32067. module.exports.Dicer = Dicer
  32068. /***/ }),
  32069. /***/ 2183:
  32070. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32071. "use strict";
  32072. // TODO:
  32073. // * support 1 nested multipart level
  32074. // (see second multipart example here:
  32075. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32076. // * support limits.fieldNameSize
  32077. // -- this will require modifications to utils.parseParams
  32078. const { Readable } = __nccwpck_require__(4492)
  32079. const { inherits } = __nccwpck_require__(7261)
  32080. const Dicer = __nccwpck_require__(2960)
  32081. const parseParams = __nccwpck_require__(1854)
  32082. const decodeText = __nccwpck_require__(4619)
  32083. const basename = __nccwpck_require__(8647)
  32084. const getLimit = __nccwpck_require__(1467)
  32085. const RE_BOUNDARY = /^boundary$/i
  32086. const RE_FIELD = /^form-data$/i
  32087. const RE_CHARSET = /^charset$/i
  32088. const RE_FILENAME = /^filename$/i
  32089. const RE_NAME = /^name$/i
  32090. Multipart.detect = /^multipart\/form-data/i
  32091. function Multipart (boy, cfg) {
  32092. let i
  32093. let len
  32094. const self = this
  32095. let boundary
  32096. const limits = cfg.limits
  32097. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32098. const parsedConType = cfg.parsedConType || []
  32099. const defCharset = cfg.defCharset || 'utf8'
  32100. const preservePath = cfg.preservePath
  32101. const fileOpts = { highWaterMark: cfg.fileHwm }
  32102. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32103. if (Array.isArray(parsedConType[i]) &&
  32104. RE_BOUNDARY.test(parsedConType[i][0])) {
  32105. boundary = parsedConType[i][1]
  32106. break
  32107. }
  32108. }
  32109. function checkFinished () {
  32110. if (nends === 0 && finished && !boy._done) {
  32111. finished = false
  32112. self.end()
  32113. }
  32114. }
  32115. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32116. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32117. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32118. const filesLimit = getLimit(limits, 'files', Infinity)
  32119. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32120. const partsLimit = getLimit(limits, 'parts', Infinity)
  32121. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32122. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32123. let nfiles = 0
  32124. let nfields = 0
  32125. let nends = 0
  32126. let curFile
  32127. let curField
  32128. let finished = false
  32129. this._needDrain = false
  32130. this._pause = false
  32131. this._cb = undefined
  32132. this._nparts = 0
  32133. this._boy = boy
  32134. const parserCfg = {
  32135. boundary,
  32136. maxHeaderPairs: headerPairsLimit,
  32137. maxHeaderSize: headerSizeLimit,
  32138. partHwm: fileOpts.highWaterMark,
  32139. highWaterMark: cfg.highWaterMark
  32140. }
  32141. this.parser = new Dicer(parserCfg)
  32142. this.parser.on('drain', function () {
  32143. self._needDrain = false
  32144. if (self._cb && !self._pause) {
  32145. const cb = self._cb
  32146. self._cb = undefined
  32147. cb()
  32148. }
  32149. }).on('part', function onPart (part) {
  32150. if (++self._nparts > partsLimit) {
  32151. self.parser.removeListener('part', onPart)
  32152. self.parser.on('part', skipPart)
  32153. boy.hitPartsLimit = true
  32154. boy.emit('partsLimit')
  32155. return skipPart(part)
  32156. }
  32157. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32158. // us emit 'end' early since we know the part has ended if we are already
  32159. // seeing the next part
  32160. if (curField) {
  32161. const field = curField
  32162. field.emit('end')
  32163. field.removeAllListeners('end')
  32164. }
  32165. part.on('header', function (header) {
  32166. let contype
  32167. let fieldname
  32168. let parsed
  32169. let charset
  32170. let encoding
  32171. let filename
  32172. let nsize = 0
  32173. if (header['content-type']) {
  32174. parsed = parseParams(header['content-type'][0])
  32175. if (parsed[0]) {
  32176. contype = parsed[0].toLowerCase()
  32177. for (i = 0, len = parsed.length; i < len; ++i) {
  32178. if (RE_CHARSET.test(parsed[i][0])) {
  32179. charset = parsed[i][1].toLowerCase()
  32180. break
  32181. }
  32182. }
  32183. }
  32184. }
  32185. if (contype === undefined) { contype = 'text/plain' }
  32186. if (charset === undefined) { charset = defCharset }
  32187. if (header['content-disposition']) {
  32188. parsed = parseParams(header['content-disposition'][0])
  32189. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32190. for (i = 0, len = parsed.length; i < len; ++i) {
  32191. if (RE_NAME.test(parsed[i][0])) {
  32192. fieldname = parsed[i][1]
  32193. } else if (RE_FILENAME.test(parsed[i][0])) {
  32194. filename = parsed[i][1]
  32195. if (!preservePath) { filename = basename(filename) }
  32196. }
  32197. }
  32198. } else { return skipPart(part) }
  32199. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32200. let onData,
  32201. onEnd
  32202. if (isPartAFile(fieldname, contype, filename)) {
  32203. // file/binary field
  32204. if (nfiles === filesLimit) {
  32205. if (!boy.hitFilesLimit) {
  32206. boy.hitFilesLimit = true
  32207. boy.emit('filesLimit')
  32208. }
  32209. return skipPart(part)
  32210. }
  32211. ++nfiles
  32212. if (boy.listenerCount('file') === 0) {
  32213. self.parser._ignore()
  32214. return
  32215. }
  32216. ++nends
  32217. const file = new FileStream(fileOpts)
  32218. curFile = file
  32219. file.on('end', function () {
  32220. --nends
  32221. self._pause = false
  32222. checkFinished()
  32223. if (self._cb && !self._needDrain) {
  32224. const cb = self._cb
  32225. self._cb = undefined
  32226. cb()
  32227. }
  32228. })
  32229. file._read = function (n) {
  32230. if (!self._pause) { return }
  32231. self._pause = false
  32232. if (self._cb && !self._needDrain) {
  32233. const cb = self._cb
  32234. self._cb = undefined
  32235. cb()
  32236. }
  32237. }
  32238. boy.emit('file', fieldname, file, filename, encoding, contype)
  32239. onData = function (data) {
  32240. if ((nsize += data.length) > fileSizeLimit) {
  32241. const extralen = fileSizeLimit - nsize + data.length
  32242. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32243. file.truncated = true
  32244. file.bytesRead = fileSizeLimit
  32245. part.removeAllListeners('data')
  32246. file.emit('limit')
  32247. return
  32248. } else if (!file.push(data)) { self._pause = true }
  32249. file.bytesRead = nsize
  32250. }
  32251. onEnd = function () {
  32252. curFile = undefined
  32253. file.push(null)
  32254. }
  32255. } else {
  32256. // non-file field
  32257. if (nfields === fieldsLimit) {
  32258. if (!boy.hitFieldsLimit) {
  32259. boy.hitFieldsLimit = true
  32260. boy.emit('fieldsLimit')
  32261. }
  32262. return skipPart(part)
  32263. }
  32264. ++nfields
  32265. ++nends
  32266. let buffer = ''
  32267. let truncated = false
  32268. curField = part
  32269. onData = function (data) {
  32270. if ((nsize += data.length) > fieldSizeLimit) {
  32271. const extralen = (fieldSizeLimit - (nsize - data.length))
  32272. buffer += data.toString('binary', 0, extralen)
  32273. truncated = true
  32274. part.removeAllListeners('data')
  32275. } else { buffer += data.toString('binary') }
  32276. }
  32277. onEnd = function () {
  32278. curField = undefined
  32279. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32280. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32281. --nends
  32282. checkFinished()
  32283. }
  32284. }
  32285. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32286. broken. Streams2/streams3 is a huge black box of confusion, but
  32287. somehow overriding the sync state seems to fix things again (and still
  32288. seems to work for previous node versions).
  32289. */
  32290. part._readableState.sync = false
  32291. part.on('data', onData)
  32292. part.on('end', onEnd)
  32293. }).on('error', function (err) {
  32294. if (curFile) { curFile.emit('error', err) }
  32295. })
  32296. }).on('error', function (err) {
  32297. boy.emit('error', err)
  32298. }).on('finish', function () {
  32299. finished = true
  32300. checkFinished()
  32301. })
  32302. }
  32303. Multipart.prototype.write = function (chunk, cb) {
  32304. const r = this.parser.write(chunk)
  32305. if (r && !this._pause) {
  32306. cb()
  32307. } else {
  32308. this._needDrain = !r
  32309. this._cb = cb
  32310. }
  32311. }
  32312. Multipart.prototype.end = function () {
  32313. const self = this
  32314. if (self.parser.writable) {
  32315. self.parser.end()
  32316. } else if (!self._boy._done) {
  32317. process.nextTick(function () {
  32318. self._boy._done = true
  32319. self._boy.emit('finish')
  32320. })
  32321. }
  32322. }
  32323. function skipPart (part) {
  32324. part.resume()
  32325. }
  32326. function FileStream (opts) {
  32327. Readable.call(this, opts)
  32328. this.bytesRead = 0
  32329. this.truncated = false
  32330. }
  32331. inherits(FileStream, Readable)
  32332. FileStream.prototype._read = function (n) {}
  32333. module.exports = Multipart
  32334. /***/ }),
  32335. /***/ 8306:
  32336. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32337. "use strict";
  32338. const Decoder = __nccwpck_require__(7100)
  32339. const decodeText = __nccwpck_require__(4619)
  32340. const getLimit = __nccwpck_require__(1467)
  32341. const RE_CHARSET = /^charset$/i
  32342. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32343. function UrlEncoded (boy, cfg) {
  32344. const limits = cfg.limits
  32345. const parsedConType = cfg.parsedConType
  32346. this.boy = boy
  32347. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32348. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32349. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32350. let charset
  32351. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32352. if (Array.isArray(parsedConType[i]) &&
  32353. RE_CHARSET.test(parsedConType[i][0])) {
  32354. charset = parsedConType[i][1].toLowerCase()
  32355. break
  32356. }
  32357. }
  32358. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32359. this.decoder = new Decoder()
  32360. this.charset = charset
  32361. this._fields = 0
  32362. this._state = 'key'
  32363. this._checkingBytes = true
  32364. this._bytesKey = 0
  32365. this._bytesVal = 0
  32366. this._key = ''
  32367. this._val = ''
  32368. this._keyTrunc = false
  32369. this._valTrunc = false
  32370. this._hitLimit = false
  32371. }
  32372. UrlEncoded.prototype.write = function (data, cb) {
  32373. if (this._fields === this.fieldsLimit) {
  32374. if (!this.boy.hitFieldsLimit) {
  32375. this.boy.hitFieldsLimit = true
  32376. this.boy.emit('fieldsLimit')
  32377. }
  32378. return cb()
  32379. }
  32380. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32381. while (p < len) {
  32382. if (this._state === 'key') {
  32383. idxeq = idxamp = undefined
  32384. for (i = p; i < len; ++i) {
  32385. if (!this._checkingBytes) { ++p }
  32386. if (data[i] === 0x3D/* = */) {
  32387. idxeq = i
  32388. break
  32389. } else if (data[i] === 0x26/* & */) {
  32390. idxamp = i
  32391. break
  32392. }
  32393. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32394. this._hitLimit = true
  32395. break
  32396. } else if (this._checkingBytes) { ++this._bytesKey }
  32397. }
  32398. if (idxeq !== undefined) {
  32399. // key with assignment
  32400. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32401. this._state = 'val'
  32402. this._hitLimit = false
  32403. this._checkingBytes = true
  32404. this._val = ''
  32405. this._bytesVal = 0
  32406. this._valTrunc = false
  32407. this.decoder.reset()
  32408. p = idxeq + 1
  32409. } else if (idxamp !== undefined) {
  32410. // key with no assignment
  32411. ++this._fields
  32412. let key; const keyTrunc = this._keyTrunc
  32413. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32414. this._hitLimit = false
  32415. this._checkingBytes = true
  32416. this._key = ''
  32417. this._bytesKey = 0
  32418. this._keyTrunc = false
  32419. this.decoder.reset()
  32420. if (key.length) {
  32421. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32422. '',
  32423. keyTrunc,
  32424. false)
  32425. }
  32426. p = idxamp + 1
  32427. if (this._fields === this.fieldsLimit) { return cb() }
  32428. } else if (this._hitLimit) {
  32429. // we may not have hit the actual limit if there are encoded bytes...
  32430. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32431. p = i
  32432. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32433. // yep, we actually did hit the limit
  32434. this._checkingBytes = false
  32435. this._keyTrunc = true
  32436. }
  32437. } else {
  32438. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32439. p = len
  32440. }
  32441. } else {
  32442. idxamp = undefined
  32443. for (i = p; i < len; ++i) {
  32444. if (!this._checkingBytes) { ++p }
  32445. if (data[i] === 0x26/* & */) {
  32446. idxamp = i
  32447. break
  32448. }
  32449. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32450. this._hitLimit = true
  32451. break
  32452. } else if (this._checkingBytes) { ++this._bytesVal }
  32453. }
  32454. if (idxamp !== undefined) {
  32455. ++this._fields
  32456. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32457. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32458. decodeText(this._val, 'binary', this.charset),
  32459. this._keyTrunc,
  32460. this._valTrunc)
  32461. this._state = 'key'
  32462. this._hitLimit = false
  32463. this._checkingBytes = true
  32464. this._key = ''
  32465. this._bytesKey = 0
  32466. this._keyTrunc = false
  32467. this.decoder.reset()
  32468. p = idxamp + 1
  32469. if (this._fields === this.fieldsLimit) { return cb() }
  32470. } else if (this._hitLimit) {
  32471. // we may not have hit the actual limit if there are encoded bytes...
  32472. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32473. p = i
  32474. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32475. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32476. // yep, we actually did hit the limit
  32477. this._checkingBytes = false
  32478. this._valTrunc = true
  32479. }
  32480. } else {
  32481. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32482. p = len
  32483. }
  32484. }
  32485. }
  32486. cb()
  32487. }
  32488. UrlEncoded.prototype.end = function () {
  32489. if (this.boy._done) { return }
  32490. if (this._state === 'key' && this._key.length > 0) {
  32491. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32492. '',
  32493. this._keyTrunc,
  32494. false)
  32495. } else if (this._state === 'val') {
  32496. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32497. decodeText(this._val, 'binary', this.charset),
  32498. this._keyTrunc,
  32499. this._valTrunc)
  32500. }
  32501. this.boy._done = true
  32502. this.boy.emit('finish')
  32503. }
  32504. module.exports = UrlEncoded
  32505. /***/ }),
  32506. /***/ 7100:
  32507. /***/ ((module) => {
  32508. "use strict";
  32509. const RE_PLUS = /\+/g
  32510. const HEX = [
  32511. 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32514. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32515. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32516. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32517. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32518. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32519. ]
  32520. function Decoder () {
  32521. this.buffer = undefined
  32522. }
  32523. Decoder.prototype.write = function (str) {
  32524. // Replace '+' with ' ' before decoding
  32525. str = str.replace(RE_PLUS, ' ')
  32526. let res = ''
  32527. let i = 0; let p = 0; const len = str.length
  32528. for (; i < len; ++i) {
  32529. if (this.buffer !== undefined) {
  32530. if (!HEX[str.charCodeAt(i)]) {
  32531. res += '%' + this.buffer
  32532. this.buffer = undefined
  32533. --i // retry character
  32534. } else {
  32535. this.buffer += str[i]
  32536. ++p
  32537. if (this.buffer.length === 2) {
  32538. res += String.fromCharCode(parseInt(this.buffer, 16))
  32539. this.buffer = undefined
  32540. }
  32541. }
  32542. } else if (str[i] === '%') {
  32543. if (i > p) {
  32544. res += str.substring(p, i)
  32545. p = i
  32546. }
  32547. this.buffer = ''
  32548. ++p
  32549. }
  32550. }
  32551. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32552. return res
  32553. }
  32554. Decoder.prototype.reset = function () {
  32555. this.buffer = undefined
  32556. }
  32557. module.exports = Decoder
  32558. /***/ }),
  32559. /***/ 8647:
  32560. /***/ ((module) => {
  32561. "use strict";
  32562. module.exports = function basename (path) {
  32563. if (typeof path !== 'string') { return '' }
  32564. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32565. switch (path.charCodeAt(i)) {
  32566. case 0x2F: // '/'
  32567. case 0x5C: // '\'
  32568. path = path.slice(i + 1)
  32569. return (path === '..' || path === '.' ? '' : path)
  32570. }
  32571. }
  32572. return (path === '..' || path === '.' ? '' : path)
  32573. }
  32574. /***/ }),
  32575. /***/ 4619:
  32576. /***/ (function(module) {
  32577. "use strict";
  32578. // Node has always utf-8
  32579. const utf8Decoder = new TextDecoder('utf-8')
  32580. const textDecoders = new Map([
  32581. ['utf-8', utf8Decoder],
  32582. ['utf8', utf8Decoder]
  32583. ])
  32584. function getDecoder (charset) {
  32585. let lc
  32586. while (true) {
  32587. switch (charset) {
  32588. case 'utf-8':
  32589. case 'utf8':
  32590. return decoders.utf8
  32591. case 'latin1':
  32592. case 'ascii': // TODO: Make these a separate, strict decoder?
  32593. case 'us-ascii':
  32594. case 'iso-8859-1':
  32595. case 'iso8859-1':
  32596. case 'iso88591':
  32597. case 'iso_8859-1':
  32598. case 'windows-1252':
  32599. case 'iso_8859-1:1987':
  32600. case 'cp1252':
  32601. case 'x-cp1252':
  32602. return decoders.latin1
  32603. case 'utf16le':
  32604. case 'utf-16le':
  32605. case 'ucs2':
  32606. case 'ucs-2':
  32607. return decoders.utf16le
  32608. case 'base64':
  32609. return decoders.base64
  32610. default:
  32611. if (lc === undefined) {
  32612. lc = true
  32613. charset = charset.toLowerCase()
  32614. continue
  32615. }
  32616. return decoders.other.bind(charset)
  32617. }
  32618. }
  32619. }
  32620. const decoders = {
  32621. utf8: (data, sourceEncoding) => {
  32622. if (data.length === 0) {
  32623. return ''
  32624. }
  32625. if (typeof data === 'string') {
  32626. data = Buffer.from(data, sourceEncoding)
  32627. }
  32628. return data.utf8Slice(0, data.length)
  32629. },
  32630. latin1: (data, sourceEncoding) => {
  32631. if (data.length === 0) {
  32632. return ''
  32633. }
  32634. if (typeof data === 'string') {
  32635. return data
  32636. }
  32637. return data.latin1Slice(0, data.length)
  32638. },
  32639. utf16le: (data, sourceEncoding) => {
  32640. if (data.length === 0) {
  32641. return ''
  32642. }
  32643. if (typeof data === 'string') {
  32644. data = Buffer.from(data, sourceEncoding)
  32645. }
  32646. return data.ucs2Slice(0, data.length)
  32647. },
  32648. base64: (data, sourceEncoding) => {
  32649. if (data.length === 0) {
  32650. return ''
  32651. }
  32652. if (typeof data === 'string') {
  32653. data = Buffer.from(data, sourceEncoding)
  32654. }
  32655. return data.base64Slice(0, data.length)
  32656. },
  32657. other: (data, sourceEncoding) => {
  32658. if (data.length === 0) {
  32659. return ''
  32660. }
  32661. if (typeof data === 'string') {
  32662. data = Buffer.from(data, sourceEncoding)
  32663. }
  32664. if (textDecoders.has(this.toString())) {
  32665. try {
  32666. return textDecoders.get(this).decode(data)
  32667. } catch {}
  32668. }
  32669. return typeof data === 'string'
  32670. ? data
  32671. : data.toString()
  32672. }
  32673. }
  32674. function decodeText (text, sourceEncoding, destEncoding) {
  32675. if (text) {
  32676. return getDecoder(destEncoding)(text, sourceEncoding)
  32677. }
  32678. return text
  32679. }
  32680. module.exports = decodeText
  32681. /***/ }),
  32682. /***/ 1467:
  32683. /***/ ((module) => {
  32684. "use strict";
  32685. module.exports = function getLimit (limits, name, defaultLimit) {
  32686. if (
  32687. !limits ||
  32688. limits[name] === undefined ||
  32689. limits[name] === null
  32690. ) { return defaultLimit }
  32691. if (
  32692. typeof limits[name] !== 'number' ||
  32693. isNaN(limits[name])
  32694. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32695. return limits[name]
  32696. }
  32697. /***/ }),
  32698. /***/ 1854:
  32699. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32700. "use strict";
  32701. /* eslint-disable object-property-newline */
  32702. const decodeText = __nccwpck_require__(4619)
  32703. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32704. const EncodedLookup = {
  32705. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32706. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32707. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32708. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  32709. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  32710. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  32711. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  32712. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  32713. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  32714. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  32715. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  32716. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  32717. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  32718. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  32719. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  32720. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  32721. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  32722. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  32723. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  32724. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  32725. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  32726. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  32727. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  32728. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  32729. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  32730. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  32731. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  32732. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  32733. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  32734. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  32735. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  32736. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  32737. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  32738. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  32739. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  32740. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  32741. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  32742. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  32743. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  32744. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  32745. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  32746. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  32747. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  32748. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  32749. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  32750. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  32751. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  32752. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  32753. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  32754. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  32755. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  32756. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  32757. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  32758. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  32759. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  32760. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  32761. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  32762. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  32763. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  32764. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  32765. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  32766. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  32767. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  32768. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  32769. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  32770. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  32771. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  32772. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  32773. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  32774. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  32775. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  32776. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  32777. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  32778. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  32779. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  32780. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  32781. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  32782. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  32783. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  32784. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  32785. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  32786. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  32787. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  32788. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  32789. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  32790. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  32791. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  32792. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  32793. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  32794. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  32795. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  32796. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  32797. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  32798. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  32799. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  32800. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  32801. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  32802. }
  32803. function encodedReplacer (match) {
  32804. return EncodedLookup[match]
  32805. }
  32806. const STATE_KEY = 0
  32807. const STATE_VALUE = 1
  32808. const STATE_CHARSET = 2
  32809. const STATE_LANG = 3
  32810. function parseParams (str) {
  32811. const res = []
  32812. let state = STATE_KEY
  32813. let charset = ''
  32814. let inquote = false
  32815. let escaping = false
  32816. let p = 0
  32817. let tmp = ''
  32818. const len = str.length
  32819. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32820. const char = str[i]
  32821. if (char === '\\' && inquote) {
  32822. if (escaping) { escaping = false } else {
  32823. escaping = true
  32824. continue
  32825. }
  32826. } else if (char === '"') {
  32827. if (!escaping) {
  32828. if (inquote) {
  32829. inquote = false
  32830. state = STATE_KEY
  32831. } else { inquote = true }
  32832. continue
  32833. } else { escaping = false }
  32834. } else {
  32835. if (escaping && inquote) { tmp += '\\' }
  32836. escaping = false
  32837. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  32838. if (state === STATE_CHARSET) {
  32839. state = STATE_LANG
  32840. charset = tmp.substring(1)
  32841. } else { state = STATE_VALUE }
  32842. tmp = ''
  32843. continue
  32844. } else if (state === STATE_KEY &&
  32845. (char === '*' || char === '=') &&
  32846. res.length) {
  32847. state = char === '*'
  32848. ? STATE_CHARSET
  32849. : STATE_VALUE
  32850. res[p] = [tmp, undefined]
  32851. tmp = ''
  32852. continue
  32853. } else if (!inquote && char === ';') {
  32854. state = STATE_KEY
  32855. if (charset) {
  32856. if (tmp.length) {
  32857. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32858. 'binary',
  32859. charset)
  32860. }
  32861. charset = ''
  32862. } else if (tmp.length) {
  32863. tmp = decodeText(tmp, 'binary', 'utf8')
  32864. }
  32865. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  32866. tmp = ''
  32867. ++p
  32868. continue
  32869. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  32870. }
  32871. tmp += char
  32872. }
  32873. if (charset && tmp.length) {
  32874. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32875. 'binary',
  32876. charset)
  32877. } else if (tmp) {
  32878. tmp = decodeText(tmp, 'binary', 'utf8')
  32879. }
  32880. if (res[p] === undefined) {
  32881. if (tmp) { res[p] = tmp }
  32882. } else { res[p][1] = tmp }
  32883. return res
  32884. }
  32885. module.exports = parseParams
  32886. /***/ })
  32887. /******/ });
  32888. /************************************************************************/
  32889. /******/ // The module cache
  32890. /******/ var __webpack_module_cache__ = {};
  32891. /******/
  32892. /******/ // The require function
  32893. /******/ function __nccwpck_require__(moduleId) {
  32894. /******/ // Check if module is in cache
  32895. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  32896. /******/ if (cachedModule !== undefined) {
  32897. /******/ return cachedModule.exports;
  32898. /******/ }
  32899. /******/ // Create a new module (and put it into the cache)
  32900. /******/ var module = __webpack_module_cache__[moduleId] = {
  32901. /******/ // no module.id needed
  32902. /******/ // no module.loaded needed
  32903. /******/ exports: {}
  32904. /******/ };
  32905. /******/
  32906. /******/ // Execute the module function
  32907. /******/ var threw = true;
  32908. /******/ try {
  32909. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  32910. /******/ threw = false;
  32911. /******/ } finally {
  32912. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  32913. /******/ }
  32914. /******/
  32915. /******/ // Return the exports of the module
  32916. /******/ return module.exports;
  32917. /******/ }
  32918. /******/
  32919. /************************************************************************/
  32920. /******/ /* webpack/runtime/compat */
  32921. /******/
  32922. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  32923. /******/
  32924. /************************************************************************/
  32925. /******/
  32926. /******/ // startup
  32927. /******/ // Load entry module and return exports
  32928. /******/ // This entry module is referenced by other modules so it can't be inlined
  32929. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  32930. /******/ module.exports = __webpack_exports__;
  32931. /******/
  32932. /******/ })()
  32933. ;