index.js 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191
  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 = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1545. yield fs.promises.writeFile(archivePath, archiveData);
  1546. archiveData = Buffer.from(''); // Free memory
  1547. // Extract archive
  1548. core.info('Extracting the archive');
  1549. const extractPath = path.join(repositoryPath, uniqueId);
  1550. yield io.mkdirP(extractPath);
  1551. if (IS_WINDOWS) {
  1552. yield toolCache.extractZip(archivePath, extractPath);
  1553. }
  1554. else {
  1555. yield toolCache.extractTar(archivePath, extractPath);
  1556. }
  1557. yield io.rmRF(archivePath);
  1558. // Determine the path of the repository content. The archive contains
  1559. // a top-level folder and the repository content is inside.
  1560. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1561. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1562. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1563. core.info(`Resolved version ${archiveVersion}`);
  1564. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1565. // Move the files
  1566. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1567. const sourcePath = path.join(tempRepositoryPath, fileName);
  1568. const targetPath = path.join(repositoryPath, fileName);
  1569. if (IS_WINDOWS) {
  1570. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1571. }
  1572. else {
  1573. yield io.mv(sourcePath, targetPath);
  1574. }
  1575. }
  1576. yield io.rmRF(extractPath);
  1577. });
  1578. }
  1579. exports.downloadRepository = downloadRepository;
  1580. /**
  1581. * Looks up the default branch name
  1582. */
  1583. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1584. return __awaiter(this, void 0, void 0, function* () {
  1585. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1586. core.info('Retrieving the default branch name');
  1587. const octokit = github.getOctokit(authToken, {
  1588. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1589. });
  1590. let result;
  1591. try {
  1592. // Get the default branch from the repo info
  1593. const response = yield octokit.rest.repos.get({ owner, repo });
  1594. result = response.data.default_branch;
  1595. assert.ok(result, 'default_branch cannot be empty');
  1596. }
  1597. catch (err) {
  1598. // Handle .wiki repo
  1599. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1600. repo.toUpperCase().endsWith('.WIKI')) {
  1601. result = 'master';
  1602. }
  1603. // Otherwise error
  1604. else {
  1605. throw err;
  1606. }
  1607. }
  1608. // Print the default branch
  1609. core.info(`Default branch '${result}'`);
  1610. // Prefix with 'refs/heads'
  1611. if (!result.startsWith('refs/')) {
  1612. result = `refs/heads/${result}`;
  1613. }
  1614. return result;
  1615. }));
  1616. });
  1617. }
  1618. exports.getDefaultBranch = getDefaultBranch;
  1619. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1620. return __awaiter(this, void 0, void 0, function* () {
  1621. const octokit = github.getOctokit(authToken, {
  1622. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1623. });
  1624. const download = IS_WINDOWS
  1625. ? octokit.rest.repos.downloadZipballArchive
  1626. : octokit.rest.repos.downloadTarballArchive;
  1627. const response = yield download({
  1628. owner: owner,
  1629. repo: repo,
  1630. ref: commit || ref
  1631. });
  1632. return Buffer.from(response.data); // response.data is ArrayBuffer
  1633. });
  1634. }
  1635. /***/ }),
  1636. /***/ 5480:
  1637. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1638. "use strict";
  1639. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1640. if (k2 === undefined) k2 = k;
  1641. var desc = Object.getOwnPropertyDescriptor(m, k);
  1642. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1643. desc = { enumerable: true, get: function() { return m[k]; } };
  1644. }
  1645. Object.defineProperty(o, k2, desc);
  1646. }) : (function(o, m, k, k2) {
  1647. if (k2 === undefined) k2 = k;
  1648. o[k2] = m[k];
  1649. }));
  1650. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1651. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1652. }) : function(o, v) {
  1653. o["default"] = v;
  1654. });
  1655. var __importStar = (this && this.__importStar) || function (mod) {
  1656. if (mod && mod.__esModule) return mod;
  1657. var result = {};
  1658. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1659. __setModuleDefault(result, mod);
  1660. return result;
  1661. };
  1662. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1663. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1664. return new (P || (P = Promise))(function (resolve, reject) {
  1665. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1666. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1667. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1668. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1669. });
  1670. };
  1671. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1672. exports.getInputs = void 0;
  1673. const core = __importStar(__nccwpck_require__(2186));
  1674. const fsHelper = __importStar(__nccwpck_require__(7219));
  1675. const github = __importStar(__nccwpck_require__(5438));
  1676. const path = __importStar(__nccwpck_require__(1017));
  1677. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1678. function getInputs() {
  1679. return __awaiter(this, void 0, void 0, function* () {
  1680. const result = {};
  1681. // GitHub workspace
  1682. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1683. if (!githubWorkspacePath) {
  1684. throw new Error('GITHUB_WORKSPACE not defined');
  1685. }
  1686. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1687. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1688. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1689. // Qualified repository
  1690. const qualifiedRepository = core.getInput('repository') ||
  1691. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1692. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1693. const splitRepository = qualifiedRepository.split('/');
  1694. if (splitRepository.length !== 2 ||
  1695. !splitRepository[0] ||
  1696. !splitRepository[1]) {
  1697. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1698. }
  1699. result.repositoryOwner = splitRepository[0];
  1700. result.repositoryName = splitRepository[1];
  1701. // Repository path
  1702. result.repositoryPath = core.getInput('path') || '.';
  1703. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1704. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1705. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1706. }
  1707. // Workflow repository?
  1708. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1709. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1710. // Source branch, source version
  1711. result.ref = core.getInput('ref');
  1712. if (!result.ref) {
  1713. if (isWorkflowRepository) {
  1714. result.ref = github.context.ref;
  1715. result.commit = github.context.sha;
  1716. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1717. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1718. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1719. result.ref = `refs/heads/${result.ref}`;
  1720. }
  1721. }
  1722. }
  1723. // SHA?
  1724. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1725. result.commit = result.ref;
  1726. result.ref = '';
  1727. }
  1728. core.debug(`ref = '${result.ref}'`);
  1729. core.debug(`commit = '${result.commit}'`);
  1730. // Clean
  1731. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1732. core.debug(`clean = ${result.clean}`);
  1733. // Filter
  1734. const filter = core.getInput('filter');
  1735. if (filter) {
  1736. result.filter = filter;
  1737. }
  1738. core.debug(`filter = ${result.filter}`);
  1739. // Sparse checkout
  1740. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1741. if (sparseCheckout.length) {
  1742. result.sparseCheckout = sparseCheckout;
  1743. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1744. }
  1745. result.sparseCheckoutConeMode =
  1746. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1747. 'TRUE';
  1748. // Fetch depth
  1749. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  1750. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  1751. result.fetchDepth = 0;
  1752. }
  1753. core.debug(`fetch depth = ${result.fetchDepth}`);
  1754. // Fetch tags
  1755. result.fetchTags =
  1756. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  1757. core.debug(`fetch tags = ${result.fetchTags}`);
  1758. // Show fetch progress
  1759. result.showProgress =
  1760. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  1761. core.debug(`show progress = ${result.showProgress}`);
  1762. // LFS
  1763. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  1764. core.debug(`lfs = ${result.lfs}`);
  1765. // Submodules
  1766. result.submodules = false;
  1767. result.nestedSubmodules = false;
  1768. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  1769. if (submodulesString == 'RECURSIVE') {
  1770. result.submodules = true;
  1771. result.nestedSubmodules = true;
  1772. }
  1773. else if (submodulesString == 'TRUE') {
  1774. result.submodules = true;
  1775. }
  1776. core.debug(`submodules = ${result.submodules}`);
  1777. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  1778. // Auth token
  1779. result.authToken = core.getInput('token', { required: true });
  1780. // SSH
  1781. result.sshKey = core.getInput('ssh-key');
  1782. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  1783. result.sshStrict =
  1784. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  1785. result.sshUser = core.getInput('ssh-user');
  1786. // Persist credentials
  1787. result.persistCredentials =
  1788. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  1789. // Workflow organization ID
  1790. result.workflowOrganizationId =
  1791. yield workflowContextHelper.getOrganizationId();
  1792. // Set safe.directory in git global config.
  1793. result.setSafeDirectory =
  1794. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  1795. // Determine the GitHub URL that the repository is being hosted from
  1796. result.githubServerUrl = core.getInput('github-server-url');
  1797. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  1798. return result;
  1799. });
  1800. }
  1801. exports.getInputs = getInputs;
  1802. /***/ }),
  1803. /***/ 3109:
  1804. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1805. "use strict";
  1806. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1807. if (k2 === undefined) k2 = k;
  1808. var desc = Object.getOwnPropertyDescriptor(m, k);
  1809. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1810. desc = { enumerable: true, get: function() { return m[k]; } };
  1811. }
  1812. Object.defineProperty(o, k2, desc);
  1813. }) : (function(o, m, k, k2) {
  1814. if (k2 === undefined) k2 = k;
  1815. o[k2] = m[k];
  1816. }));
  1817. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1818. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1819. }) : function(o, v) {
  1820. o["default"] = v;
  1821. });
  1822. var __importStar = (this && this.__importStar) || function (mod) {
  1823. if (mod && mod.__esModule) return mod;
  1824. var result = {};
  1825. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1826. __setModuleDefault(result, mod);
  1827. return result;
  1828. };
  1829. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1830. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1831. return new (P || (P = Promise))(function (resolve, reject) {
  1832. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1833. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1834. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1835. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1836. });
  1837. };
  1838. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1839. const core = __importStar(__nccwpck_require__(2186));
  1840. const coreCommand = __importStar(__nccwpck_require__(7351));
  1841. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  1842. const inputHelper = __importStar(__nccwpck_require__(5480));
  1843. const path = __importStar(__nccwpck_require__(1017));
  1844. const stateHelper = __importStar(__nccwpck_require__(4866));
  1845. function run() {
  1846. return __awaiter(this, void 0, void 0, function* () {
  1847. var _a;
  1848. try {
  1849. const sourceSettings = yield inputHelper.getInputs();
  1850. try {
  1851. // Register problem matcher
  1852. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  1853. // Get sources
  1854. yield gitSourceProvider.getSource(sourceSettings);
  1855. }
  1856. finally {
  1857. // Unregister problem matcher
  1858. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  1859. }
  1860. }
  1861. catch (error) {
  1862. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1863. }
  1864. });
  1865. }
  1866. function cleanup() {
  1867. return __awaiter(this, void 0, void 0, function* () {
  1868. var _a;
  1869. try {
  1870. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  1871. }
  1872. catch (error) {
  1873. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1874. }
  1875. });
  1876. }
  1877. // Main
  1878. if (!stateHelper.IsPost) {
  1879. run();
  1880. }
  1881. // Post
  1882. else {
  1883. cleanup();
  1884. }
  1885. /***/ }),
  1886. /***/ 8601:
  1887. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1888. "use strict";
  1889. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1890. if (k2 === undefined) k2 = k;
  1891. var desc = Object.getOwnPropertyDescriptor(m, k);
  1892. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1893. desc = { enumerable: true, get: function() { return m[k]; } };
  1894. }
  1895. Object.defineProperty(o, k2, desc);
  1896. }) : (function(o, m, k, k2) {
  1897. if (k2 === undefined) k2 = k;
  1898. o[k2] = m[k];
  1899. }));
  1900. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1901. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1902. }) : function(o, v) {
  1903. o["default"] = v;
  1904. });
  1905. var __importStar = (this && this.__importStar) || function (mod) {
  1906. if (mod && mod.__esModule) return mod;
  1907. var result = {};
  1908. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1909. __setModuleDefault(result, mod);
  1910. return result;
  1911. };
  1912. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1913. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1914. return new (P || (P = Promise))(function (resolve, reject) {
  1915. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1916. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1917. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1918. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1919. });
  1920. };
  1921. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1922. exports.checkCommitInfo = exports.testRef = exports.getRefSpec = exports.getRefSpecForAllHistory = exports.getCheckoutInfo = exports.tagsRefSpec = void 0;
  1923. const core = __importStar(__nccwpck_require__(2186));
  1924. const github = __importStar(__nccwpck_require__(5438));
  1925. const url_helper_1 = __nccwpck_require__(9437);
  1926. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  1927. function getCheckoutInfo(git, ref, commit) {
  1928. return __awaiter(this, void 0, void 0, function* () {
  1929. if (!git) {
  1930. throw new Error('Arg git cannot be empty');
  1931. }
  1932. if (!ref && !commit) {
  1933. throw new Error('Args ref and commit cannot both be empty');
  1934. }
  1935. const result = {};
  1936. const upperRef = (ref || '').toUpperCase();
  1937. // SHA only
  1938. if (!ref) {
  1939. result.ref = commit;
  1940. }
  1941. // refs/heads/
  1942. else if (upperRef.startsWith('REFS/HEADS/')) {
  1943. const branch = ref.substring('refs/heads/'.length);
  1944. result.ref = branch;
  1945. result.startPoint = `refs/remotes/origin/${branch}`;
  1946. }
  1947. // refs/pull/
  1948. else if (upperRef.startsWith('REFS/PULL/')) {
  1949. const branch = ref.substring('refs/pull/'.length);
  1950. result.ref = `refs/remotes/pull/${branch}`;
  1951. }
  1952. // refs/tags/
  1953. else if (upperRef.startsWith('REFS/')) {
  1954. result.ref = ref;
  1955. }
  1956. // Unqualified ref, check for a matching branch or tag
  1957. else {
  1958. if (yield git.branchExists(true, `origin/${ref}`)) {
  1959. result.ref = ref;
  1960. result.startPoint = `refs/remotes/origin/${ref}`;
  1961. }
  1962. else if (yield git.tagExists(`${ref}`)) {
  1963. result.ref = `refs/tags/${ref}`;
  1964. }
  1965. else {
  1966. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  1967. }
  1968. }
  1969. return result;
  1970. });
  1971. }
  1972. exports.getCheckoutInfo = getCheckoutInfo;
  1973. function getRefSpecForAllHistory(ref, commit) {
  1974. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  1975. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  1976. const branch = ref.substring('refs/pull/'.length);
  1977. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  1978. }
  1979. return result;
  1980. }
  1981. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  1982. function getRefSpec(ref, commit) {
  1983. if (!ref && !commit) {
  1984. throw new Error('Args ref and commit cannot both be empty');
  1985. }
  1986. const upperRef = (ref || '').toUpperCase();
  1987. // SHA
  1988. if (commit) {
  1989. // refs/heads
  1990. if (upperRef.startsWith('REFS/HEADS/')) {
  1991. const branch = ref.substring('refs/heads/'.length);
  1992. return [`+${commit}:refs/remotes/origin/${branch}`];
  1993. }
  1994. // refs/pull/
  1995. else if (upperRef.startsWith('REFS/PULL/')) {
  1996. const branch = ref.substring('refs/pull/'.length);
  1997. return [`+${commit}:refs/remotes/pull/${branch}`];
  1998. }
  1999. // refs/tags/
  2000. else if (upperRef.startsWith('REFS/TAGS/')) {
  2001. return [`+${commit}:${ref}`];
  2002. }
  2003. // Otherwise no destination ref
  2004. else {
  2005. return [commit];
  2006. }
  2007. }
  2008. // Unqualified ref, check for a matching branch or tag
  2009. else if (!upperRef.startsWith('REFS/')) {
  2010. return [
  2011. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2012. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2013. ];
  2014. }
  2015. // refs/heads/
  2016. else if (upperRef.startsWith('REFS/HEADS/')) {
  2017. const branch = ref.substring('refs/heads/'.length);
  2018. return [`+${ref}:refs/remotes/origin/${branch}`];
  2019. }
  2020. // refs/pull/
  2021. else if (upperRef.startsWith('REFS/PULL/')) {
  2022. const branch = ref.substring('refs/pull/'.length);
  2023. return [`+${ref}:refs/remotes/pull/${branch}`];
  2024. }
  2025. // refs/tags/
  2026. else {
  2027. return [`+${ref}:${ref}`];
  2028. }
  2029. }
  2030. exports.getRefSpec = getRefSpec;
  2031. /**
  2032. * Tests whether the initial fetch created the ref at the expected commit
  2033. */
  2034. function testRef(git, ref, commit) {
  2035. return __awaiter(this, void 0, void 0, function* () {
  2036. if (!git) {
  2037. throw new Error('Arg git cannot be empty');
  2038. }
  2039. if (!ref && !commit) {
  2040. throw new Error('Args ref and commit cannot both be empty');
  2041. }
  2042. // No SHA? Nothing to test
  2043. if (!commit) {
  2044. return true;
  2045. }
  2046. // SHA only?
  2047. else if (!ref) {
  2048. return yield git.shaExists(commit);
  2049. }
  2050. const upperRef = ref.toUpperCase();
  2051. // refs/heads/
  2052. if (upperRef.startsWith('REFS/HEADS/')) {
  2053. const branch = ref.substring('refs/heads/'.length);
  2054. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2055. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2056. }
  2057. // refs/pull/
  2058. else if (upperRef.startsWith('REFS/PULL/')) {
  2059. // Assume matches because fetched using the commit
  2060. return true;
  2061. }
  2062. // refs/tags/
  2063. else if (upperRef.startsWith('REFS/TAGS/')) {
  2064. const tagName = ref.substring('refs/tags/'.length);
  2065. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2066. }
  2067. // Unexpected
  2068. else {
  2069. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2070. return true;
  2071. }
  2072. });
  2073. }
  2074. exports.testRef = testRef;
  2075. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2076. return __awaiter(this, void 0, void 0, function* () {
  2077. var _a;
  2078. try {
  2079. // GHES?
  2080. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2081. return;
  2082. }
  2083. // Auth token?
  2084. if (!token) {
  2085. return;
  2086. }
  2087. // Public PR synchronize, for workflow repo?
  2088. if (fromPayload('repository.private') !== false ||
  2089. github.context.eventName !== 'pull_request' ||
  2090. fromPayload('action') !== 'synchronize' ||
  2091. repositoryOwner !== github.context.repo.owner ||
  2092. repositoryName !== github.context.repo.repo ||
  2093. ref !== github.context.ref ||
  2094. !ref.startsWith('refs/pull/') ||
  2095. commit !== github.context.sha) {
  2096. return;
  2097. }
  2098. // Head SHA
  2099. const expectedHeadSha = fromPayload('after');
  2100. if (!expectedHeadSha) {
  2101. core.debug('Unable to determine head sha');
  2102. return;
  2103. }
  2104. // Base SHA
  2105. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2106. if (!expectedBaseSha) {
  2107. core.debug('Unable to determine base sha');
  2108. return;
  2109. }
  2110. // Expected message?
  2111. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2112. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2113. return;
  2114. }
  2115. // Extract details from message
  2116. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2117. if (!match) {
  2118. core.debug('Unexpected message format');
  2119. return;
  2120. }
  2121. // Post telemetry
  2122. const actualHeadSha = match[1];
  2123. if (actualHeadSha !== expectedHeadSha) {
  2124. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2125. const octokit = github.getOctokit(token, {
  2126. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2127. 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})`
  2128. });
  2129. yield octokit.rest.repos.get({
  2130. owner: repositoryOwner,
  2131. repo: repositoryName
  2132. });
  2133. }
  2134. }
  2135. catch (err) {
  2136. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2137. }
  2138. });
  2139. }
  2140. exports.checkCommitInfo = checkCommitInfo;
  2141. function fromPayload(path) {
  2142. return select(github.context.payload, path);
  2143. }
  2144. function select(obj, path) {
  2145. if (!obj) {
  2146. return undefined;
  2147. }
  2148. const i = path.indexOf('.');
  2149. if (i < 0) {
  2150. return obj[path];
  2151. }
  2152. const key = path.substr(0, i);
  2153. return select(obj[key], path.substr(i + 1));
  2154. }
  2155. /***/ }),
  2156. /***/ 3120:
  2157. /***/ ((__unused_webpack_module, exports) => {
  2158. "use strict";
  2159. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2160. exports.escape = void 0;
  2161. function escape(value) {
  2162. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2163. return `\\${x}`;
  2164. });
  2165. }
  2166. exports.escape = escape;
  2167. /***/ }),
  2168. /***/ 2155:
  2169. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2170. "use strict";
  2171. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2172. if (k2 === undefined) k2 = k;
  2173. var desc = Object.getOwnPropertyDescriptor(m, k);
  2174. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2175. desc = { enumerable: true, get: function() { return m[k]; } };
  2176. }
  2177. Object.defineProperty(o, k2, desc);
  2178. }) : (function(o, m, k, k2) {
  2179. if (k2 === undefined) k2 = k;
  2180. o[k2] = m[k];
  2181. }));
  2182. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2183. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2184. }) : function(o, v) {
  2185. o["default"] = v;
  2186. });
  2187. var __importStar = (this && this.__importStar) || function (mod) {
  2188. if (mod && mod.__esModule) return mod;
  2189. var result = {};
  2190. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2191. __setModuleDefault(result, mod);
  2192. return result;
  2193. };
  2194. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2195. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2196. return new (P || (P = Promise))(function (resolve, reject) {
  2197. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2198. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2199. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2200. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2201. });
  2202. };
  2203. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2204. exports.execute = exports.RetryHelper = void 0;
  2205. const core = __importStar(__nccwpck_require__(2186));
  2206. const defaultMaxAttempts = 3;
  2207. const defaultMinSeconds = 10;
  2208. const defaultMaxSeconds = 20;
  2209. class RetryHelper {
  2210. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2211. this.maxAttempts = maxAttempts;
  2212. this.minSeconds = Math.floor(minSeconds);
  2213. this.maxSeconds = Math.floor(maxSeconds);
  2214. if (this.minSeconds > this.maxSeconds) {
  2215. throw new Error('min seconds should be less than or equal to max seconds');
  2216. }
  2217. }
  2218. execute(action) {
  2219. return __awaiter(this, void 0, void 0, function* () {
  2220. let attempt = 1;
  2221. while (attempt < this.maxAttempts) {
  2222. // Try
  2223. try {
  2224. return yield action();
  2225. }
  2226. catch (err) {
  2227. core.info(err === null || err === void 0 ? void 0 : err.message);
  2228. }
  2229. // Sleep
  2230. const seconds = this.getSleepAmount();
  2231. core.info(`Waiting ${seconds} seconds before trying again`);
  2232. yield this.sleep(seconds);
  2233. attempt++;
  2234. }
  2235. // Last attempt
  2236. return yield action();
  2237. });
  2238. }
  2239. getSleepAmount() {
  2240. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2241. this.minSeconds);
  2242. }
  2243. sleep(seconds) {
  2244. return __awaiter(this, void 0, void 0, function* () {
  2245. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2246. });
  2247. }
  2248. }
  2249. exports.RetryHelper = RetryHelper;
  2250. function execute(action) {
  2251. return __awaiter(this, void 0, void 0, function* () {
  2252. const retryHelper = new RetryHelper();
  2253. return yield retryHelper.execute(action);
  2254. });
  2255. }
  2256. exports.execute = execute;
  2257. /***/ }),
  2258. /***/ 4866:
  2259. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2260. "use strict";
  2261. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2262. if (k2 === undefined) k2 = k;
  2263. var desc = Object.getOwnPropertyDescriptor(m, k);
  2264. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2265. desc = { enumerable: true, get: function() { return m[k]; } };
  2266. }
  2267. Object.defineProperty(o, k2, desc);
  2268. }) : (function(o, m, k, k2) {
  2269. if (k2 === undefined) k2 = k;
  2270. o[k2] = m[k];
  2271. }));
  2272. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2273. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2274. }) : function(o, v) {
  2275. o["default"] = v;
  2276. });
  2277. var __importStar = (this && this.__importStar) || function (mod) {
  2278. if (mod && mod.__esModule) return mod;
  2279. var result = {};
  2280. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2281. __setModuleDefault(result, mod);
  2282. return result;
  2283. };
  2284. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2285. exports.setSafeDirectory = exports.setSshKnownHostsPath = exports.setSshKeyPath = exports.setRepositoryPath = exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2286. const core = __importStar(__nccwpck_require__(2186));
  2287. /**
  2288. * Indicates whether the POST action is running
  2289. */
  2290. exports.IsPost = !!core.getState('isPost');
  2291. /**
  2292. * The repository path for the POST action. The value is empty during the MAIN action.
  2293. */
  2294. exports.RepositoryPath = core.getState('repositoryPath');
  2295. /**
  2296. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2297. */
  2298. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2299. /**
  2300. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2301. */
  2302. exports.SshKeyPath = core.getState('sshKeyPath');
  2303. /**
  2304. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2305. */
  2306. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2307. /**
  2308. * Save the repository path so the POST action can retrieve the value.
  2309. */
  2310. function setRepositoryPath(repositoryPath) {
  2311. core.saveState('repositoryPath', repositoryPath);
  2312. }
  2313. exports.setRepositoryPath = setRepositoryPath;
  2314. /**
  2315. * Save the SSH key path so the POST action can retrieve the value.
  2316. */
  2317. function setSshKeyPath(sshKeyPath) {
  2318. core.saveState('sshKeyPath', sshKeyPath);
  2319. }
  2320. exports.setSshKeyPath = setSshKeyPath;
  2321. /**
  2322. * Save the SSH known hosts path so the POST action can retrieve the value.
  2323. */
  2324. function setSshKnownHostsPath(sshKnownHostsPath) {
  2325. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2326. }
  2327. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2328. /**
  2329. * Save the set-safe-directory input so the POST action can retrieve the value.
  2330. */
  2331. function setSafeDirectory() {
  2332. core.saveState('setSafeDirectory', 'true');
  2333. }
  2334. exports.setSafeDirectory = setSafeDirectory;
  2335. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2336. // This is necessary since we don't have a separate entry point.
  2337. if (!exports.IsPost) {
  2338. core.saveState('isPost', 'true');
  2339. }
  2340. /***/ }),
  2341. /***/ 9437:
  2342. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2343. "use strict";
  2344. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2345. if (k2 === undefined) k2 = k;
  2346. var desc = Object.getOwnPropertyDescriptor(m, k);
  2347. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2348. desc = { enumerable: true, get: function() { return m[k]; } };
  2349. }
  2350. Object.defineProperty(o, k2, desc);
  2351. }) : (function(o, m, k, k2) {
  2352. if (k2 === undefined) k2 = k;
  2353. o[k2] = m[k];
  2354. }));
  2355. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2356. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2357. }) : function(o, v) {
  2358. o["default"] = v;
  2359. });
  2360. var __importStar = (this && this.__importStar) || function (mod) {
  2361. if (mod && mod.__esModule) return mod;
  2362. var result = {};
  2363. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2364. __setModuleDefault(result, mod);
  2365. return result;
  2366. };
  2367. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2368. exports.isGhes = exports.getServerApiUrl = exports.getServerUrl = exports.getFetchUrl = void 0;
  2369. const assert = __importStar(__nccwpck_require__(9491));
  2370. const url_1 = __nccwpck_require__(7310);
  2371. function getFetchUrl(settings) {
  2372. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2373. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2374. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2375. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2376. const encodedName = encodeURIComponent(settings.repositoryName);
  2377. if (settings.sshKey) {
  2378. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2379. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2380. }
  2381. // "origin" is SCHEME://HOSTNAME[:PORT]
  2382. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2383. }
  2384. exports.getFetchUrl = getFetchUrl;
  2385. function getServerUrl(url) {
  2386. let urlValue = url && url.trim().length > 0
  2387. ? url
  2388. : process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2389. return new url_1.URL(urlValue);
  2390. }
  2391. exports.getServerUrl = getServerUrl;
  2392. function getServerApiUrl(url) {
  2393. let apiUrl = 'https://api.github.com';
  2394. if (isGhes(url)) {
  2395. const serverUrl = getServerUrl(url);
  2396. apiUrl = new url_1.URL(`${serverUrl.origin}/api/v3`).toString();
  2397. }
  2398. return apiUrl;
  2399. }
  2400. exports.getServerApiUrl = getServerApiUrl;
  2401. function isGhes(url) {
  2402. const ghUrl = getServerUrl(url);
  2403. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  2404. }
  2405. exports.isGhes = isGhes;
  2406. /***/ }),
  2407. /***/ 9568:
  2408. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2409. "use strict";
  2410. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2411. if (k2 === undefined) k2 = k;
  2412. var desc = Object.getOwnPropertyDescriptor(m, k);
  2413. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2414. desc = { enumerable: true, get: function() { return m[k]; } };
  2415. }
  2416. Object.defineProperty(o, k2, desc);
  2417. }) : (function(o, m, k, k2) {
  2418. if (k2 === undefined) k2 = k;
  2419. o[k2] = m[k];
  2420. }));
  2421. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2422. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2423. }) : function(o, v) {
  2424. o["default"] = v;
  2425. });
  2426. var __importStar = (this && this.__importStar) || function (mod) {
  2427. if (mod && mod.__esModule) return mod;
  2428. var result = {};
  2429. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2430. __setModuleDefault(result, mod);
  2431. return result;
  2432. };
  2433. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2434. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2435. return new (P || (P = Promise))(function (resolve, reject) {
  2436. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2437. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2438. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2439. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2440. });
  2441. };
  2442. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2443. exports.getOrganizationId = void 0;
  2444. const core = __importStar(__nccwpck_require__(2186));
  2445. const fs = __importStar(__nccwpck_require__(7147));
  2446. /**
  2447. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2448. */
  2449. function getOrganizationId() {
  2450. return __awaiter(this, void 0, void 0, function* () {
  2451. var _a, _b;
  2452. try {
  2453. const eventPath = process.env.GITHUB_EVENT_PATH;
  2454. if (!eventPath) {
  2455. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2456. return;
  2457. }
  2458. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2459. const event = JSON.parse(content);
  2460. 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;
  2461. if (typeof id !== 'number') {
  2462. core.debug('Repository owner ID not found within GITHUB event info');
  2463. return;
  2464. }
  2465. return id;
  2466. }
  2467. catch (err) {
  2468. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2469. }
  2470. });
  2471. }
  2472. exports.getOrganizationId = getOrganizationId;
  2473. /***/ }),
  2474. /***/ 7351:
  2475. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2476. "use strict";
  2477. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2478. if (k2 === undefined) k2 = k;
  2479. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2480. }) : (function(o, m, k, k2) {
  2481. if (k2 === undefined) k2 = k;
  2482. o[k2] = m[k];
  2483. }));
  2484. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2485. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2486. }) : function(o, v) {
  2487. o["default"] = v;
  2488. });
  2489. var __importStar = (this && this.__importStar) || function (mod) {
  2490. if (mod && mod.__esModule) return mod;
  2491. var result = {};
  2492. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2493. __setModuleDefault(result, mod);
  2494. return result;
  2495. };
  2496. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2497. exports.issue = exports.issueCommand = void 0;
  2498. const os = __importStar(__nccwpck_require__(2037));
  2499. const utils_1 = __nccwpck_require__(5278);
  2500. /**
  2501. * Commands
  2502. *
  2503. * Command Format:
  2504. * ::name key=value,key=value::message
  2505. *
  2506. * Examples:
  2507. * ::warning::This is the message
  2508. * ::set-env name=MY_VAR::some value
  2509. */
  2510. function issueCommand(command, properties, message) {
  2511. const cmd = new Command(command, properties, message);
  2512. process.stdout.write(cmd.toString() + os.EOL);
  2513. }
  2514. exports.issueCommand = issueCommand;
  2515. function issue(name, message = '') {
  2516. issueCommand(name, {}, message);
  2517. }
  2518. exports.issue = issue;
  2519. const CMD_STRING = '::';
  2520. class Command {
  2521. constructor(command, properties, message) {
  2522. if (!command) {
  2523. command = 'missing.command';
  2524. }
  2525. this.command = command;
  2526. this.properties = properties;
  2527. this.message = message;
  2528. }
  2529. toString() {
  2530. let cmdStr = CMD_STRING + this.command;
  2531. if (this.properties && Object.keys(this.properties).length > 0) {
  2532. cmdStr += ' ';
  2533. let first = true;
  2534. for (const key in this.properties) {
  2535. if (this.properties.hasOwnProperty(key)) {
  2536. const val = this.properties[key];
  2537. if (val) {
  2538. if (first) {
  2539. first = false;
  2540. }
  2541. else {
  2542. cmdStr += ',';
  2543. }
  2544. cmdStr += `${key}=${escapeProperty(val)}`;
  2545. }
  2546. }
  2547. }
  2548. }
  2549. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2550. return cmdStr;
  2551. }
  2552. }
  2553. function escapeData(s) {
  2554. return utils_1.toCommandValue(s)
  2555. .replace(/%/g, '%25')
  2556. .replace(/\r/g, '%0D')
  2557. .replace(/\n/g, '%0A');
  2558. }
  2559. function escapeProperty(s) {
  2560. return utils_1.toCommandValue(s)
  2561. .replace(/%/g, '%25')
  2562. .replace(/\r/g, '%0D')
  2563. .replace(/\n/g, '%0A')
  2564. .replace(/:/g, '%3A')
  2565. .replace(/,/g, '%2C');
  2566. }
  2567. //# sourceMappingURL=command.js.map
  2568. /***/ }),
  2569. /***/ 2186:
  2570. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2571. "use strict";
  2572. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2573. if (k2 === undefined) k2 = k;
  2574. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2575. }) : (function(o, m, k, k2) {
  2576. if (k2 === undefined) k2 = k;
  2577. o[k2] = m[k];
  2578. }));
  2579. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2580. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2581. }) : function(o, v) {
  2582. o["default"] = v;
  2583. });
  2584. var __importStar = (this && this.__importStar) || function (mod) {
  2585. if (mod && mod.__esModule) return mod;
  2586. var result = {};
  2587. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2588. __setModuleDefault(result, mod);
  2589. return result;
  2590. };
  2591. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2592. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2593. return new (P || (P = Promise))(function (resolve, reject) {
  2594. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2595. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2596. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2597. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2598. });
  2599. };
  2600. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2601. 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;
  2602. const command_1 = __nccwpck_require__(7351);
  2603. const file_command_1 = __nccwpck_require__(717);
  2604. const utils_1 = __nccwpck_require__(5278);
  2605. const os = __importStar(__nccwpck_require__(2037));
  2606. const path = __importStar(__nccwpck_require__(1017));
  2607. const oidc_utils_1 = __nccwpck_require__(8041);
  2608. /**
  2609. * The code to exit an action
  2610. */
  2611. var ExitCode;
  2612. (function (ExitCode) {
  2613. /**
  2614. * A code indicating that the action was successful
  2615. */
  2616. ExitCode[ExitCode["Success"] = 0] = "Success";
  2617. /**
  2618. * A code indicating that the action was a failure
  2619. */
  2620. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2621. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2622. //-----------------------------------------------------------------------
  2623. // Variables
  2624. //-----------------------------------------------------------------------
  2625. /**
  2626. * Sets env variable for this action and future actions in the job
  2627. * @param name the name of the variable to set
  2628. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2629. */
  2630. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2631. function exportVariable(name, val) {
  2632. const convertedVal = utils_1.toCommandValue(val);
  2633. process.env[name] = convertedVal;
  2634. const filePath = process.env['GITHUB_ENV'] || '';
  2635. if (filePath) {
  2636. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2637. }
  2638. command_1.issueCommand('set-env', { name }, convertedVal);
  2639. }
  2640. exports.exportVariable = exportVariable;
  2641. /**
  2642. * Registers a secret which will get masked from logs
  2643. * @param secret value of the secret
  2644. */
  2645. function setSecret(secret) {
  2646. command_1.issueCommand('add-mask', {}, secret);
  2647. }
  2648. exports.setSecret = setSecret;
  2649. /**
  2650. * Prepends inputPath to the PATH (for this action and future actions)
  2651. * @param inputPath
  2652. */
  2653. function addPath(inputPath) {
  2654. const filePath = process.env['GITHUB_PATH'] || '';
  2655. if (filePath) {
  2656. file_command_1.issueFileCommand('PATH', inputPath);
  2657. }
  2658. else {
  2659. command_1.issueCommand('add-path', {}, inputPath);
  2660. }
  2661. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2662. }
  2663. exports.addPath = addPath;
  2664. /**
  2665. * Gets the value of an input.
  2666. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2667. * Returns an empty string if the value is not defined.
  2668. *
  2669. * @param name name of the input to get
  2670. * @param options optional. See InputOptions.
  2671. * @returns string
  2672. */
  2673. function getInput(name, options) {
  2674. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2675. if (options && options.required && !val) {
  2676. throw new Error(`Input required and not supplied: ${name}`);
  2677. }
  2678. if (options && options.trimWhitespace === false) {
  2679. return val;
  2680. }
  2681. return val.trim();
  2682. }
  2683. exports.getInput = getInput;
  2684. /**
  2685. * Gets the values of an multiline input. Each value is also trimmed.
  2686. *
  2687. * @param name name of the input to get
  2688. * @param options optional. See InputOptions.
  2689. * @returns string[]
  2690. *
  2691. */
  2692. function getMultilineInput(name, options) {
  2693. const inputs = getInput(name, options)
  2694. .split('\n')
  2695. .filter(x => x !== '');
  2696. if (options && options.trimWhitespace === false) {
  2697. return inputs;
  2698. }
  2699. return inputs.map(input => input.trim());
  2700. }
  2701. exports.getMultilineInput = getMultilineInput;
  2702. /**
  2703. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2704. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2705. * The return value is also in boolean type.
  2706. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2707. *
  2708. * @param name name of the input to get
  2709. * @param options optional. See InputOptions.
  2710. * @returns boolean
  2711. */
  2712. function getBooleanInput(name, options) {
  2713. const trueValue = ['true', 'True', 'TRUE'];
  2714. const falseValue = ['false', 'False', 'FALSE'];
  2715. const val = getInput(name, options);
  2716. if (trueValue.includes(val))
  2717. return true;
  2718. if (falseValue.includes(val))
  2719. return false;
  2720. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  2721. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  2722. }
  2723. exports.getBooleanInput = getBooleanInput;
  2724. /**
  2725. * Sets the value of an output.
  2726. *
  2727. * @param name name of the output to set
  2728. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2729. */
  2730. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2731. function setOutput(name, value) {
  2732. const filePath = process.env['GITHUB_OUTPUT'] || '';
  2733. if (filePath) {
  2734. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  2735. }
  2736. process.stdout.write(os.EOL);
  2737. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  2738. }
  2739. exports.setOutput = setOutput;
  2740. /**
  2741. * Enables or disables the echoing of commands into stdout for the rest of the step.
  2742. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  2743. *
  2744. */
  2745. function setCommandEcho(enabled) {
  2746. command_1.issue('echo', enabled ? 'on' : 'off');
  2747. }
  2748. exports.setCommandEcho = setCommandEcho;
  2749. //-----------------------------------------------------------------------
  2750. // Results
  2751. //-----------------------------------------------------------------------
  2752. /**
  2753. * Sets the action status to failed.
  2754. * When the action exits it will be with an exit code of 1
  2755. * @param message add error issue message
  2756. */
  2757. function setFailed(message) {
  2758. process.exitCode = ExitCode.Failure;
  2759. error(message);
  2760. }
  2761. exports.setFailed = setFailed;
  2762. //-----------------------------------------------------------------------
  2763. // Logging Commands
  2764. //-----------------------------------------------------------------------
  2765. /**
  2766. * Gets whether Actions Step Debug is on or not
  2767. */
  2768. function isDebug() {
  2769. return process.env['RUNNER_DEBUG'] === '1';
  2770. }
  2771. exports.isDebug = isDebug;
  2772. /**
  2773. * Writes debug message to user log
  2774. * @param message debug message
  2775. */
  2776. function debug(message) {
  2777. command_1.issueCommand('debug', {}, message);
  2778. }
  2779. exports.debug = debug;
  2780. /**
  2781. * Adds an error issue
  2782. * @param message error issue message. Errors will be converted to string via toString()
  2783. * @param properties optional properties to add to the annotation.
  2784. */
  2785. function error(message, properties = {}) {
  2786. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2787. }
  2788. exports.error = error;
  2789. /**
  2790. * Adds a warning issue
  2791. * @param message warning issue message. Errors will be converted to string via toString()
  2792. * @param properties optional properties to add to the annotation.
  2793. */
  2794. function warning(message, properties = {}) {
  2795. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2796. }
  2797. exports.warning = warning;
  2798. /**
  2799. * Adds a notice issue
  2800. * @param message notice issue message. Errors will be converted to string via toString()
  2801. * @param properties optional properties to add to the annotation.
  2802. */
  2803. function notice(message, properties = {}) {
  2804. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2805. }
  2806. exports.notice = notice;
  2807. /**
  2808. * Writes info to log with console.log.
  2809. * @param message info message
  2810. */
  2811. function info(message) {
  2812. process.stdout.write(message + os.EOL);
  2813. }
  2814. exports.info = info;
  2815. /**
  2816. * Begin an output group.
  2817. *
  2818. * Output until the next `groupEnd` will be foldable in this group
  2819. *
  2820. * @param name The name of the output group
  2821. */
  2822. function startGroup(name) {
  2823. command_1.issue('group', name);
  2824. }
  2825. exports.startGroup = startGroup;
  2826. /**
  2827. * End an output group.
  2828. */
  2829. function endGroup() {
  2830. command_1.issue('endgroup');
  2831. }
  2832. exports.endGroup = endGroup;
  2833. /**
  2834. * Wrap an asynchronous function call in a group.
  2835. *
  2836. * Returns the same type as the function itself.
  2837. *
  2838. * @param name The name of the group
  2839. * @param fn The function to wrap in the group
  2840. */
  2841. function group(name, fn) {
  2842. return __awaiter(this, void 0, void 0, function* () {
  2843. startGroup(name);
  2844. let result;
  2845. try {
  2846. result = yield fn();
  2847. }
  2848. finally {
  2849. endGroup();
  2850. }
  2851. return result;
  2852. });
  2853. }
  2854. exports.group = group;
  2855. //-----------------------------------------------------------------------
  2856. // Wrapper action state
  2857. //-----------------------------------------------------------------------
  2858. /**
  2859. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  2860. *
  2861. * @param name name of the state to store
  2862. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2863. */
  2864. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2865. function saveState(name, value) {
  2866. const filePath = process.env['GITHUB_STATE'] || '';
  2867. if (filePath) {
  2868. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  2869. }
  2870. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  2871. }
  2872. exports.saveState = saveState;
  2873. /**
  2874. * Gets the value of an state set by this action's main execution.
  2875. *
  2876. * @param name name of the state to get
  2877. * @returns string
  2878. */
  2879. function getState(name) {
  2880. return process.env[`STATE_${name}`] || '';
  2881. }
  2882. exports.getState = getState;
  2883. function getIDToken(aud) {
  2884. return __awaiter(this, void 0, void 0, function* () {
  2885. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  2886. });
  2887. }
  2888. exports.getIDToken = getIDToken;
  2889. /**
  2890. * Summary exports
  2891. */
  2892. var summary_1 = __nccwpck_require__(1327);
  2893. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  2894. /**
  2895. * @deprecated use core.summary
  2896. */
  2897. var summary_2 = __nccwpck_require__(1327);
  2898. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  2899. /**
  2900. * Path exports
  2901. */
  2902. var path_utils_1 = __nccwpck_require__(2981);
  2903. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  2904. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  2905. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  2906. //# sourceMappingURL=core.js.map
  2907. /***/ }),
  2908. /***/ 717:
  2909. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2910. "use strict";
  2911. // For internal use, subject to change.
  2912. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2913. if (k2 === undefined) k2 = k;
  2914. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2915. }) : (function(o, m, k, k2) {
  2916. if (k2 === undefined) k2 = k;
  2917. o[k2] = m[k];
  2918. }));
  2919. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2920. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2921. }) : function(o, v) {
  2922. o["default"] = v;
  2923. });
  2924. var __importStar = (this && this.__importStar) || function (mod) {
  2925. if (mod && mod.__esModule) return mod;
  2926. var result = {};
  2927. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2928. __setModuleDefault(result, mod);
  2929. return result;
  2930. };
  2931. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2932. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  2933. // We use any as a valid input type
  2934. /* eslint-disable @typescript-eslint/no-explicit-any */
  2935. const fs = __importStar(__nccwpck_require__(7147));
  2936. const os = __importStar(__nccwpck_require__(2037));
  2937. const uuid_1 = __nccwpck_require__(8974);
  2938. const utils_1 = __nccwpck_require__(5278);
  2939. function issueFileCommand(command, message) {
  2940. const filePath = process.env[`GITHUB_${command}`];
  2941. if (!filePath) {
  2942. throw new Error(`Unable to find environment variable for file command ${command}`);
  2943. }
  2944. if (!fs.existsSync(filePath)) {
  2945. throw new Error(`Missing file at path: ${filePath}`);
  2946. }
  2947. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  2948. encoding: 'utf8'
  2949. });
  2950. }
  2951. exports.issueFileCommand = issueFileCommand;
  2952. function prepareKeyValueMessage(key, value) {
  2953. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  2954. const convertedValue = utils_1.toCommandValue(value);
  2955. // These should realistically never happen, but just in case someone finds a
  2956. // way to exploit uuid generation let's not allow keys or values that contain
  2957. // the delimiter.
  2958. if (key.includes(delimiter)) {
  2959. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  2960. }
  2961. if (convertedValue.includes(delimiter)) {
  2962. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  2963. }
  2964. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  2965. }
  2966. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  2967. //# sourceMappingURL=file-command.js.map
  2968. /***/ }),
  2969. /***/ 8041:
  2970. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2971. "use strict";
  2972. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2973. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2974. return new (P || (P = Promise))(function (resolve, reject) {
  2975. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2976. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2977. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2978. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2979. });
  2980. };
  2981. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2982. exports.OidcClient = void 0;
  2983. const http_client_1 = __nccwpck_require__(6255);
  2984. const auth_1 = __nccwpck_require__(5526);
  2985. const core_1 = __nccwpck_require__(2186);
  2986. class OidcClient {
  2987. static createHttpClient(allowRetry = true, maxRetry = 10) {
  2988. const requestOptions = {
  2989. allowRetries: allowRetry,
  2990. maxRetries: maxRetry
  2991. };
  2992. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  2993. }
  2994. static getRequestToken() {
  2995. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  2996. if (!token) {
  2997. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  2998. }
  2999. return token;
  3000. }
  3001. static getIDTokenUrl() {
  3002. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3003. if (!runtimeUrl) {
  3004. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3005. }
  3006. return runtimeUrl;
  3007. }
  3008. static getCall(id_token_url) {
  3009. var _a;
  3010. return __awaiter(this, void 0, void 0, function* () {
  3011. const httpclient = OidcClient.createHttpClient();
  3012. const res = yield httpclient
  3013. .getJson(id_token_url)
  3014. .catch(error => {
  3015. throw new Error(`Failed to get ID Token. \n
  3016. Error Code : ${error.statusCode}\n
  3017. Error Message: ${error.message}`);
  3018. });
  3019. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3020. if (!id_token) {
  3021. throw new Error('Response json body do not have ID Token field');
  3022. }
  3023. return id_token;
  3024. });
  3025. }
  3026. static getIDToken(audience) {
  3027. return __awaiter(this, void 0, void 0, function* () {
  3028. try {
  3029. // New ID Token is requested from action service
  3030. let id_token_url = OidcClient.getIDTokenUrl();
  3031. if (audience) {
  3032. const encodedAudience = encodeURIComponent(audience);
  3033. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3034. }
  3035. core_1.debug(`ID token url is ${id_token_url}`);
  3036. const id_token = yield OidcClient.getCall(id_token_url);
  3037. core_1.setSecret(id_token);
  3038. return id_token;
  3039. }
  3040. catch (error) {
  3041. throw new Error(`Error message: ${error.message}`);
  3042. }
  3043. });
  3044. }
  3045. }
  3046. exports.OidcClient = OidcClient;
  3047. //# sourceMappingURL=oidc-utils.js.map
  3048. /***/ }),
  3049. /***/ 2981:
  3050. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3051. "use strict";
  3052. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3053. if (k2 === undefined) k2 = k;
  3054. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3055. }) : (function(o, m, k, k2) {
  3056. if (k2 === undefined) k2 = k;
  3057. o[k2] = m[k];
  3058. }));
  3059. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3060. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3061. }) : function(o, v) {
  3062. o["default"] = v;
  3063. });
  3064. var __importStar = (this && this.__importStar) || function (mod) {
  3065. if (mod && mod.__esModule) return mod;
  3066. var result = {};
  3067. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3068. __setModuleDefault(result, mod);
  3069. return result;
  3070. };
  3071. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3072. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3073. const path = __importStar(__nccwpck_require__(1017));
  3074. /**
  3075. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3076. * replaced with /.
  3077. *
  3078. * @param pth. Path to transform.
  3079. * @return string Posix path.
  3080. */
  3081. function toPosixPath(pth) {
  3082. return pth.replace(/[\\]/g, '/');
  3083. }
  3084. exports.toPosixPath = toPosixPath;
  3085. /**
  3086. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3087. * replaced with \\.
  3088. *
  3089. * @param pth. Path to transform.
  3090. * @return string Win32 path.
  3091. */
  3092. function toWin32Path(pth) {
  3093. return pth.replace(/[/]/g, '\\');
  3094. }
  3095. exports.toWin32Path = toWin32Path;
  3096. /**
  3097. * toPlatformPath converts the given path to a platform-specific path. It does
  3098. * this by replacing instances of / and \ with the platform-specific path
  3099. * separator.
  3100. *
  3101. * @param pth The path to platformize.
  3102. * @return string The platform-specific path.
  3103. */
  3104. function toPlatformPath(pth) {
  3105. return pth.replace(/[/\\]/g, path.sep);
  3106. }
  3107. exports.toPlatformPath = toPlatformPath;
  3108. //# sourceMappingURL=path-utils.js.map
  3109. /***/ }),
  3110. /***/ 1327:
  3111. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3112. "use strict";
  3113. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3114. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3115. return new (P || (P = Promise))(function (resolve, reject) {
  3116. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3117. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3118. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3119. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3120. });
  3121. };
  3122. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3123. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3124. const os_1 = __nccwpck_require__(2037);
  3125. const fs_1 = __nccwpck_require__(7147);
  3126. const { access, appendFile, writeFile } = fs_1.promises;
  3127. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3128. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3129. class Summary {
  3130. constructor() {
  3131. this._buffer = '';
  3132. }
  3133. /**
  3134. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3135. * Also checks r/w permissions.
  3136. *
  3137. * @returns step summary file path
  3138. */
  3139. filePath() {
  3140. return __awaiter(this, void 0, void 0, function* () {
  3141. if (this._filePath) {
  3142. return this._filePath;
  3143. }
  3144. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3145. if (!pathFromEnv) {
  3146. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3147. }
  3148. try {
  3149. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3150. }
  3151. catch (_a) {
  3152. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3153. }
  3154. this._filePath = pathFromEnv;
  3155. return this._filePath;
  3156. });
  3157. }
  3158. /**
  3159. * Wraps content in an HTML tag, adding any HTML attributes
  3160. *
  3161. * @param {string} tag HTML tag to wrap
  3162. * @param {string | null} content content within the tag
  3163. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3164. *
  3165. * @returns {string} content wrapped in HTML element
  3166. */
  3167. wrap(tag, content, attrs = {}) {
  3168. const htmlAttrs = Object.entries(attrs)
  3169. .map(([key, value]) => ` ${key}="${value}"`)
  3170. .join('');
  3171. if (!content) {
  3172. return `<${tag}${htmlAttrs}>`;
  3173. }
  3174. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3175. }
  3176. /**
  3177. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3178. *
  3179. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3180. *
  3181. * @returns {Promise<Summary>} summary instance
  3182. */
  3183. write(options) {
  3184. return __awaiter(this, void 0, void 0, function* () {
  3185. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3186. const filePath = yield this.filePath();
  3187. const writeFunc = overwrite ? writeFile : appendFile;
  3188. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3189. return this.emptyBuffer();
  3190. });
  3191. }
  3192. /**
  3193. * Clears the summary buffer and wipes the summary file
  3194. *
  3195. * @returns {Summary} summary instance
  3196. */
  3197. clear() {
  3198. return __awaiter(this, void 0, void 0, function* () {
  3199. return this.emptyBuffer().write({ overwrite: true });
  3200. });
  3201. }
  3202. /**
  3203. * Returns the current summary buffer as a string
  3204. *
  3205. * @returns {string} string of summary buffer
  3206. */
  3207. stringify() {
  3208. return this._buffer;
  3209. }
  3210. /**
  3211. * If the summary buffer is empty
  3212. *
  3213. * @returns {boolen} true if the buffer is empty
  3214. */
  3215. isEmptyBuffer() {
  3216. return this._buffer.length === 0;
  3217. }
  3218. /**
  3219. * Resets the summary buffer without writing to summary file
  3220. *
  3221. * @returns {Summary} summary instance
  3222. */
  3223. emptyBuffer() {
  3224. this._buffer = '';
  3225. return this;
  3226. }
  3227. /**
  3228. * Adds raw text to the summary buffer
  3229. *
  3230. * @param {string} text content to add
  3231. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3232. *
  3233. * @returns {Summary} summary instance
  3234. */
  3235. addRaw(text, addEOL = false) {
  3236. this._buffer += text;
  3237. return addEOL ? this.addEOL() : this;
  3238. }
  3239. /**
  3240. * Adds the operating system-specific end-of-line marker to the buffer
  3241. *
  3242. * @returns {Summary} summary instance
  3243. */
  3244. addEOL() {
  3245. return this.addRaw(os_1.EOL);
  3246. }
  3247. /**
  3248. * Adds an HTML codeblock to the summary buffer
  3249. *
  3250. * @param {string} code content to render within fenced code block
  3251. * @param {string} lang (optional) language to syntax highlight code
  3252. *
  3253. * @returns {Summary} summary instance
  3254. */
  3255. addCodeBlock(code, lang) {
  3256. const attrs = Object.assign({}, (lang && { lang }));
  3257. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3258. return this.addRaw(element).addEOL();
  3259. }
  3260. /**
  3261. * Adds an HTML list to the summary buffer
  3262. *
  3263. * @param {string[]} items list of items to render
  3264. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3265. *
  3266. * @returns {Summary} summary instance
  3267. */
  3268. addList(items, ordered = false) {
  3269. const tag = ordered ? 'ol' : 'ul';
  3270. const listItems = items.map(item => this.wrap('li', item)).join('');
  3271. const element = this.wrap(tag, listItems);
  3272. return this.addRaw(element).addEOL();
  3273. }
  3274. /**
  3275. * Adds an HTML table to the summary buffer
  3276. *
  3277. * @param {SummaryTableCell[]} rows table rows
  3278. *
  3279. * @returns {Summary} summary instance
  3280. */
  3281. addTable(rows) {
  3282. const tableBody = rows
  3283. .map(row => {
  3284. const cells = row
  3285. .map(cell => {
  3286. if (typeof cell === 'string') {
  3287. return this.wrap('td', cell);
  3288. }
  3289. const { header, data, colspan, rowspan } = cell;
  3290. const tag = header ? 'th' : 'td';
  3291. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3292. return this.wrap(tag, data, attrs);
  3293. })
  3294. .join('');
  3295. return this.wrap('tr', cells);
  3296. })
  3297. .join('');
  3298. const element = this.wrap('table', tableBody);
  3299. return this.addRaw(element).addEOL();
  3300. }
  3301. /**
  3302. * Adds a collapsable HTML details element to the summary buffer
  3303. *
  3304. * @param {string} label text for the closed state
  3305. * @param {string} content collapsable content
  3306. *
  3307. * @returns {Summary} summary instance
  3308. */
  3309. addDetails(label, content) {
  3310. const element = this.wrap('details', this.wrap('summary', label) + content);
  3311. return this.addRaw(element).addEOL();
  3312. }
  3313. /**
  3314. * Adds an HTML image tag to the summary buffer
  3315. *
  3316. * @param {string} src path to the image you to embed
  3317. * @param {string} alt text description of the image
  3318. * @param {SummaryImageOptions} options (optional) addition image attributes
  3319. *
  3320. * @returns {Summary} summary instance
  3321. */
  3322. addImage(src, alt, options) {
  3323. const { width, height } = options || {};
  3324. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3325. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3326. return this.addRaw(element).addEOL();
  3327. }
  3328. /**
  3329. * Adds an HTML section heading element
  3330. *
  3331. * @param {string} text heading text
  3332. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3333. *
  3334. * @returns {Summary} summary instance
  3335. */
  3336. addHeading(text, level) {
  3337. const tag = `h${level}`;
  3338. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3339. ? tag
  3340. : 'h1';
  3341. const element = this.wrap(allowedTag, text);
  3342. return this.addRaw(element).addEOL();
  3343. }
  3344. /**
  3345. * Adds an HTML thematic break (<hr>) to the summary buffer
  3346. *
  3347. * @returns {Summary} summary instance
  3348. */
  3349. addSeparator() {
  3350. const element = this.wrap('hr', null);
  3351. return this.addRaw(element).addEOL();
  3352. }
  3353. /**
  3354. * Adds an HTML line break (<br>) to the summary buffer
  3355. *
  3356. * @returns {Summary} summary instance
  3357. */
  3358. addBreak() {
  3359. const element = this.wrap('br', null);
  3360. return this.addRaw(element).addEOL();
  3361. }
  3362. /**
  3363. * Adds an HTML blockquote to the summary buffer
  3364. *
  3365. * @param {string} text quote text
  3366. * @param {string} cite (optional) citation url
  3367. *
  3368. * @returns {Summary} summary instance
  3369. */
  3370. addQuote(text, cite) {
  3371. const attrs = Object.assign({}, (cite && { cite }));
  3372. const element = this.wrap('blockquote', text, attrs);
  3373. return this.addRaw(element).addEOL();
  3374. }
  3375. /**
  3376. * Adds an HTML anchor tag to the summary buffer
  3377. *
  3378. * @param {string} text link text/content
  3379. * @param {string} href hyperlink
  3380. *
  3381. * @returns {Summary} summary instance
  3382. */
  3383. addLink(text, href) {
  3384. const element = this.wrap('a', text, { href });
  3385. return this.addRaw(element).addEOL();
  3386. }
  3387. }
  3388. const _summary = new Summary();
  3389. /**
  3390. * @deprecated use `core.summary`
  3391. */
  3392. exports.markdownSummary = _summary;
  3393. exports.summary = _summary;
  3394. //# sourceMappingURL=summary.js.map
  3395. /***/ }),
  3396. /***/ 5278:
  3397. /***/ ((__unused_webpack_module, exports) => {
  3398. "use strict";
  3399. // We use any as a valid input type
  3400. /* eslint-disable @typescript-eslint/no-explicit-any */
  3401. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3402. exports.toCommandProperties = exports.toCommandValue = void 0;
  3403. /**
  3404. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3405. * @param input input to sanitize into a string
  3406. */
  3407. function toCommandValue(input) {
  3408. if (input === null || input === undefined) {
  3409. return '';
  3410. }
  3411. else if (typeof input === 'string' || input instanceof String) {
  3412. return input;
  3413. }
  3414. return JSON.stringify(input);
  3415. }
  3416. exports.toCommandValue = toCommandValue;
  3417. /**
  3418. *
  3419. * @param annotationProperties
  3420. * @returns The command properties to send with the actual annotation command
  3421. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3422. */
  3423. function toCommandProperties(annotationProperties) {
  3424. if (!Object.keys(annotationProperties).length) {
  3425. return {};
  3426. }
  3427. return {
  3428. title: annotationProperties.title,
  3429. file: annotationProperties.file,
  3430. line: annotationProperties.startLine,
  3431. endLine: annotationProperties.endLine,
  3432. col: annotationProperties.startColumn,
  3433. endColumn: annotationProperties.endColumn
  3434. };
  3435. }
  3436. exports.toCommandProperties = toCommandProperties;
  3437. //# sourceMappingURL=utils.js.map
  3438. /***/ }),
  3439. /***/ 8974:
  3440. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3441. "use strict";
  3442. Object.defineProperty(exports, "__esModule", ({
  3443. value: true
  3444. }));
  3445. Object.defineProperty(exports, "v1", ({
  3446. enumerable: true,
  3447. get: function () {
  3448. return _v.default;
  3449. }
  3450. }));
  3451. Object.defineProperty(exports, "v3", ({
  3452. enumerable: true,
  3453. get: function () {
  3454. return _v2.default;
  3455. }
  3456. }));
  3457. Object.defineProperty(exports, "v4", ({
  3458. enumerable: true,
  3459. get: function () {
  3460. return _v3.default;
  3461. }
  3462. }));
  3463. Object.defineProperty(exports, "v5", ({
  3464. enumerable: true,
  3465. get: function () {
  3466. return _v4.default;
  3467. }
  3468. }));
  3469. Object.defineProperty(exports, "NIL", ({
  3470. enumerable: true,
  3471. get: function () {
  3472. return _nil.default;
  3473. }
  3474. }));
  3475. Object.defineProperty(exports, "version", ({
  3476. enumerable: true,
  3477. get: function () {
  3478. return _version.default;
  3479. }
  3480. }));
  3481. Object.defineProperty(exports, "validate", ({
  3482. enumerable: true,
  3483. get: function () {
  3484. return _validate.default;
  3485. }
  3486. }));
  3487. Object.defineProperty(exports, "stringify", ({
  3488. enumerable: true,
  3489. get: function () {
  3490. return _stringify.default;
  3491. }
  3492. }));
  3493. Object.defineProperty(exports, "parse", ({
  3494. enumerable: true,
  3495. get: function () {
  3496. return _parse.default;
  3497. }
  3498. }));
  3499. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3500. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3501. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3502. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3503. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3504. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3505. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3506. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3507. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3508. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3509. /***/ }),
  3510. /***/ 5842:
  3511. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3512. "use strict";
  3513. Object.defineProperty(exports, "__esModule", ({
  3514. value: true
  3515. }));
  3516. exports["default"] = void 0;
  3517. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3518. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3519. function md5(bytes) {
  3520. if (Array.isArray(bytes)) {
  3521. bytes = Buffer.from(bytes);
  3522. } else if (typeof bytes === 'string') {
  3523. bytes = Buffer.from(bytes, 'utf8');
  3524. }
  3525. return _crypto.default.createHash('md5').update(bytes).digest();
  3526. }
  3527. var _default = md5;
  3528. exports["default"] = _default;
  3529. /***/ }),
  3530. /***/ 2381:
  3531. /***/ ((__unused_webpack_module, exports) => {
  3532. "use strict";
  3533. Object.defineProperty(exports, "__esModule", ({
  3534. value: true
  3535. }));
  3536. exports["default"] = void 0;
  3537. var _default = '00000000-0000-0000-0000-000000000000';
  3538. exports["default"] = _default;
  3539. /***/ }),
  3540. /***/ 6385:
  3541. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3542. "use strict";
  3543. Object.defineProperty(exports, "__esModule", ({
  3544. value: true
  3545. }));
  3546. exports["default"] = void 0;
  3547. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3548. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3549. function parse(uuid) {
  3550. if (!(0, _validate.default)(uuid)) {
  3551. throw TypeError('Invalid UUID');
  3552. }
  3553. let v;
  3554. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3555. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3556. arr[1] = v >>> 16 & 0xff;
  3557. arr[2] = v >>> 8 & 0xff;
  3558. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3559. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3560. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3561. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3562. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3563. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3564. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3565. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3566. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3567. arr[11] = v / 0x100000000 & 0xff;
  3568. arr[12] = v >>> 24 & 0xff;
  3569. arr[13] = v >>> 16 & 0xff;
  3570. arr[14] = v >>> 8 & 0xff;
  3571. arr[15] = v & 0xff;
  3572. return arr;
  3573. }
  3574. var _default = parse;
  3575. exports["default"] = _default;
  3576. /***/ }),
  3577. /***/ 6230:
  3578. /***/ ((__unused_webpack_module, exports) => {
  3579. "use strict";
  3580. Object.defineProperty(exports, "__esModule", ({
  3581. value: true
  3582. }));
  3583. exports["default"] = void 0;
  3584. 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;
  3585. exports["default"] = _default;
  3586. /***/ }),
  3587. /***/ 9784:
  3588. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3589. "use strict";
  3590. Object.defineProperty(exports, "__esModule", ({
  3591. value: true
  3592. }));
  3593. exports["default"] = rng;
  3594. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3595. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3596. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3597. let poolPtr = rnds8Pool.length;
  3598. function rng() {
  3599. if (poolPtr > rnds8Pool.length - 16) {
  3600. _crypto.default.randomFillSync(rnds8Pool);
  3601. poolPtr = 0;
  3602. }
  3603. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3604. }
  3605. /***/ }),
  3606. /***/ 8844:
  3607. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3608. "use strict";
  3609. Object.defineProperty(exports, "__esModule", ({
  3610. value: true
  3611. }));
  3612. exports["default"] = void 0;
  3613. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3614. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3615. function sha1(bytes) {
  3616. if (Array.isArray(bytes)) {
  3617. bytes = Buffer.from(bytes);
  3618. } else if (typeof bytes === 'string') {
  3619. bytes = Buffer.from(bytes, 'utf8');
  3620. }
  3621. return _crypto.default.createHash('sha1').update(bytes).digest();
  3622. }
  3623. var _default = sha1;
  3624. exports["default"] = _default;
  3625. /***/ }),
  3626. /***/ 1458:
  3627. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3628. "use strict";
  3629. Object.defineProperty(exports, "__esModule", ({
  3630. value: true
  3631. }));
  3632. exports["default"] = void 0;
  3633. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3634. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3635. /**
  3636. * Convert array of 16 byte values to UUID string format of the form:
  3637. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3638. */
  3639. const byteToHex = [];
  3640. for (let i = 0; i < 256; ++i) {
  3641. byteToHex.push((i + 0x100).toString(16).substr(1));
  3642. }
  3643. function stringify(arr, offset = 0) {
  3644. // Note: Be careful editing this code! It's been tuned for performance
  3645. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3646. 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
  3647. // of the following:
  3648. // - One or more input array values don't map to a hex octet (leading to
  3649. // "undefined" in the uuid)
  3650. // - Invalid input values for the RFC `version` or `variant` fields
  3651. if (!(0, _validate.default)(uuid)) {
  3652. throw TypeError('Stringified UUID is invalid');
  3653. }
  3654. return uuid;
  3655. }
  3656. var _default = stringify;
  3657. exports["default"] = _default;
  3658. /***/ }),
  3659. /***/ 1595:
  3660. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3661. "use strict";
  3662. Object.defineProperty(exports, "__esModule", ({
  3663. value: true
  3664. }));
  3665. exports["default"] = void 0;
  3666. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3667. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3668. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3669. // **`v1()` - Generate time-based UUID**
  3670. //
  3671. // Inspired by https://github.com/LiosK/UUID.js
  3672. // and http://docs.python.org/library/uuid.html
  3673. let _nodeId;
  3674. let _clockseq; // Previous uuid creation time
  3675. let _lastMSecs = 0;
  3676. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3677. function v1(options, buf, offset) {
  3678. let i = buf && offset || 0;
  3679. const b = buf || new Array(16);
  3680. options = options || {};
  3681. let node = options.node || _nodeId;
  3682. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3683. // specified. We do this lazily to minimize issues related to insufficient
  3684. // system entropy. See #189
  3685. if (node == null || clockseq == null) {
  3686. const seedBytes = options.random || (options.rng || _rng.default)();
  3687. if (node == null) {
  3688. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3689. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3690. }
  3691. if (clockseq == null) {
  3692. // Per 4.2.2, randomize (14 bit) clockseq
  3693. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3694. }
  3695. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3696. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3697. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3698. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3699. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3700. // cycle to simulate higher resolution clock
  3701. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3702. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3703. if (dt < 0 && options.clockseq === undefined) {
  3704. clockseq = clockseq + 1 & 0x3fff;
  3705. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3706. // time interval
  3707. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3708. nsecs = 0;
  3709. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3710. if (nsecs >= 10000) {
  3711. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3712. }
  3713. _lastMSecs = msecs;
  3714. _lastNSecs = nsecs;
  3715. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3716. msecs += 12219292800000; // `time_low`
  3717. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3718. b[i++] = tl >>> 24 & 0xff;
  3719. b[i++] = tl >>> 16 & 0xff;
  3720. b[i++] = tl >>> 8 & 0xff;
  3721. b[i++] = tl & 0xff; // `time_mid`
  3722. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  3723. b[i++] = tmh >>> 8 & 0xff;
  3724. b[i++] = tmh & 0xff; // `time_high_and_version`
  3725. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  3726. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  3727. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  3728. b[i++] = clockseq & 0xff; // `node`
  3729. for (let n = 0; n < 6; ++n) {
  3730. b[i + n] = node[n];
  3731. }
  3732. return buf || (0, _stringify.default)(b);
  3733. }
  3734. var _default = v1;
  3735. exports["default"] = _default;
  3736. /***/ }),
  3737. /***/ 6993:
  3738. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3739. "use strict";
  3740. Object.defineProperty(exports, "__esModule", ({
  3741. value: true
  3742. }));
  3743. exports["default"] = void 0;
  3744. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3745. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  3746. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3747. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  3748. var _default = v3;
  3749. exports["default"] = _default;
  3750. /***/ }),
  3751. /***/ 5920:
  3752. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3753. "use strict";
  3754. Object.defineProperty(exports, "__esModule", ({
  3755. value: true
  3756. }));
  3757. exports["default"] = _default;
  3758. exports.URL = exports.DNS = void 0;
  3759. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3760. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3761. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3762. function stringToBytes(str) {
  3763. str = unescape(encodeURIComponent(str)); // UTF8 escape
  3764. const bytes = [];
  3765. for (let i = 0; i < str.length; ++i) {
  3766. bytes.push(str.charCodeAt(i));
  3767. }
  3768. return bytes;
  3769. }
  3770. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  3771. exports.DNS = DNS;
  3772. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  3773. exports.URL = URL;
  3774. function _default(name, version, hashfunc) {
  3775. function generateUUID(value, namespace, buf, offset) {
  3776. if (typeof value === 'string') {
  3777. value = stringToBytes(value);
  3778. }
  3779. if (typeof namespace === 'string') {
  3780. namespace = (0, _parse.default)(namespace);
  3781. }
  3782. if (namespace.length !== 16) {
  3783. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  3784. } // Compute hash of namespace and value, Per 4.3
  3785. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  3786. // hashfunc([...namespace, ... value])`
  3787. let bytes = new Uint8Array(16 + value.length);
  3788. bytes.set(namespace);
  3789. bytes.set(value, namespace.length);
  3790. bytes = hashfunc(bytes);
  3791. bytes[6] = bytes[6] & 0x0f | version;
  3792. bytes[8] = bytes[8] & 0x3f | 0x80;
  3793. if (buf) {
  3794. offset = offset || 0;
  3795. for (let i = 0; i < 16; ++i) {
  3796. buf[offset + i] = bytes[i];
  3797. }
  3798. return buf;
  3799. }
  3800. return (0, _stringify.default)(bytes);
  3801. } // Function#name is not settable on some platforms (#270)
  3802. try {
  3803. generateUUID.name = name; // eslint-disable-next-line no-empty
  3804. } catch (err) {} // For CommonJS default export support
  3805. generateUUID.DNS = DNS;
  3806. generateUUID.URL = URL;
  3807. return generateUUID;
  3808. }
  3809. /***/ }),
  3810. /***/ 1472:
  3811. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3812. "use strict";
  3813. Object.defineProperty(exports, "__esModule", ({
  3814. value: true
  3815. }));
  3816. exports["default"] = void 0;
  3817. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3818. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3819. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3820. function v4(options, buf, offset) {
  3821. options = options || {};
  3822. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  3823. rnds[6] = rnds[6] & 0x0f | 0x40;
  3824. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  3825. if (buf) {
  3826. offset = offset || 0;
  3827. for (let i = 0; i < 16; ++i) {
  3828. buf[offset + i] = rnds[i];
  3829. }
  3830. return buf;
  3831. }
  3832. return (0, _stringify.default)(rnds);
  3833. }
  3834. var _default = v4;
  3835. exports["default"] = _default;
  3836. /***/ }),
  3837. /***/ 6217:
  3838. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3839. "use strict";
  3840. Object.defineProperty(exports, "__esModule", ({
  3841. value: true
  3842. }));
  3843. exports["default"] = void 0;
  3844. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3845. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  3846. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3847. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  3848. var _default = v5;
  3849. exports["default"] = _default;
  3850. /***/ }),
  3851. /***/ 2609:
  3852. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3853. "use strict";
  3854. Object.defineProperty(exports, "__esModule", ({
  3855. value: true
  3856. }));
  3857. exports["default"] = void 0;
  3858. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  3859. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3860. function validate(uuid) {
  3861. return typeof uuid === 'string' && _regex.default.test(uuid);
  3862. }
  3863. var _default = validate;
  3864. exports["default"] = _default;
  3865. /***/ }),
  3866. /***/ 427:
  3867. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3868. "use strict";
  3869. Object.defineProperty(exports, "__esModule", ({
  3870. value: true
  3871. }));
  3872. exports["default"] = void 0;
  3873. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3874. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3875. function version(uuid) {
  3876. if (!(0, _validate.default)(uuid)) {
  3877. throw TypeError('Invalid UUID');
  3878. }
  3879. return parseInt(uuid.substr(14, 1), 16);
  3880. }
  3881. var _default = version;
  3882. exports["default"] = _default;
  3883. /***/ }),
  3884. /***/ 1514:
  3885. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3886. "use strict";
  3887. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3888. if (k2 === undefined) k2 = k;
  3889. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3890. }) : (function(o, m, k, k2) {
  3891. if (k2 === undefined) k2 = k;
  3892. o[k2] = m[k];
  3893. }));
  3894. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3895. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3896. }) : function(o, v) {
  3897. o["default"] = v;
  3898. });
  3899. var __importStar = (this && this.__importStar) || function (mod) {
  3900. if (mod && mod.__esModule) return mod;
  3901. var result = {};
  3902. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3903. __setModuleDefault(result, mod);
  3904. return result;
  3905. };
  3906. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3907. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3908. return new (P || (P = Promise))(function (resolve, reject) {
  3909. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3910. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3911. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3912. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3913. });
  3914. };
  3915. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3916. exports.getExecOutput = exports.exec = void 0;
  3917. const string_decoder_1 = __nccwpck_require__(1576);
  3918. const tr = __importStar(__nccwpck_require__(8159));
  3919. /**
  3920. * Exec a command.
  3921. * Output will be streamed to the live console.
  3922. * Returns promise with return code
  3923. *
  3924. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3925. * @param args optional arguments for tool. Escaping is handled by the lib.
  3926. * @param options optional exec options. See ExecOptions
  3927. * @returns Promise<number> exit code
  3928. */
  3929. function exec(commandLine, args, options) {
  3930. return __awaiter(this, void 0, void 0, function* () {
  3931. const commandArgs = tr.argStringToArray(commandLine);
  3932. if (commandArgs.length === 0) {
  3933. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  3934. }
  3935. // Path to tool to execute should be first arg
  3936. const toolPath = commandArgs[0];
  3937. args = commandArgs.slice(1).concat(args || []);
  3938. const runner = new tr.ToolRunner(toolPath, args, options);
  3939. return runner.exec();
  3940. });
  3941. }
  3942. exports.exec = exec;
  3943. /**
  3944. * Exec a command and get the output.
  3945. * Output will be streamed to the live console.
  3946. * Returns promise with the exit code and collected stdout and stderr
  3947. *
  3948. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3949. * @param args optional arguments for tool. Escaping is handled by the lib.
  3950. * @param options optional exec options. See ExecOptions
  3951. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  3952. */
  3953. function getExecOutput(commandLine, args, options) {
  3954. var _a, _b;
  3955. return __awaiter(this, void 0, void 0, function* () {
  3956. let stdout = '';
  3957. let stderr = '';
  3958. //Using string decoder covers the case where a mult-byte character is split
  3959. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  3960. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  3961. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  3962. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  3963. const stdErrListener = (data) => {
  3964. stderr += stderrDecoder.write(data);
  3965. if (originalStdErrListener) {
  3966. originalStdErrListener(data);
  3967. }
  3968. };
  3969. const stdOutListener = (data) => {
  3970. stdout += stdoutDecoder.write(data);
  3971. if (originalStdoutListener) {
  3972. originalStdoutListener(data);
  3973. }
  3974. };
  3975. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  3976. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  3977. //flush any remaining characters
  3978. stdout += stdoutDecoder.end();
  3979. stderr += stderrDecoder.end();
  3980. return {
  3981. exitCode,
  3982. stdout,
  3983. stderr
  3984. };
  3985. });
  3986. }
  3987. exports.getExecOutput = getExecOutput;
  3988. //# sourceMappingURL=exec.js.map
  3989. /***/ }),
  3990. /***/ 8159:
  3991. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3992. "use strict";
  3993. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3994. if (k2 === undefined) k2 = k;
  3995. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3996. }) : (function(o, m, k, k2) {
  3997. if (k2 === undefined) k2 = k;
  3998. o[k2] = m[k];
  3999. }));
  4000. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4001. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4002. }) : function(o, v) {
  4003. o["default"] = v;
  4004. });
  4005. var __importStar = (this && this.__importStar) || function (mod) {
  4006. if (mod && mod.__esModule) return mod;
  4007. var result = {};
  4008. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4009. __setModuleDefault(result, mod);
  4010. return result;
  4011. };
  4012. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4013. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4014. return new (P || (P = Promise))(function (resolve, reject) {
  4015. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4016. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4017. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4018. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4019. });
  4020. };
  4021. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4022. exports.argStringToArray = exports.ToolRunner = void 0;
  4023. const os = __importStar(__nccwpck_require__(2037));
  4024. const events = __importStar(__nccwpck_require__(2361));
  4025. const child = __importStar(__nccwpck_require__(2081));
  4026. const path = __importStar(__nccwpck_require__(1017));
  4027. const io = __importStar(__nccwpck_require__(7436));
  4028. const ioUtil = __importStar(__nccwpck_require__(1962));
  4029. const timers_1 = __nccwpck_require__(9512);
  4030. /* eslint-disable @typescript-eslint/unbound-method */
  4031. const IS_WINDOWS = process.platform === 'win32';
  4032. /*
  4033. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4034. */
  4035. class ToolRunner extends events.EventEmitter {
  4036. constructor(toolPath, args, options) {
  4037. super();
  4038. if (!toolPath) {
  4039. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4040. }
  4041. this.toolPath = toolPath;
  4042. this.args = args || [];
  4043. this.options = options || {};
  4044. }
  4045. _debug(message) {
  4046. if (this.options.listeners && this.options.listeners.debug) {
  4047. this.options.listeners.debug(message);
  4048. }
  4049. }
  4050. _getCommandString(options, noPrefix) {
  4051. const toolPath = this._getSpawnFileName();
  4052. const args = this._getSpawnArgs(options);
  4053. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4054. if (IS_WINDOWS) {
  4055. // Windows + cmd file
  4056. if (this._isCmdFile()) {
  4057. cmd += toolPath;
  4058. for (const a of args) {
  4059. cmd += ` ${a}`;
  4060. }
  4061. }
  4062. // Windows + verbatim
  4063. else if (options.windowsVerbatimArguments) {
  4064. cmd += `"${toolPath}"`;
  4065. for (const a of args) {
  4066. cmd += ` ${a}`;
  4067. }
  4068. }
  4069. // Windows (regular)
  4070. else {
  4071. cmd += this._windowsQuoteCmdArg(toolPath);
  4072. for (const a of args) {
  4073. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4074. }
  4075. }
  4076. }
  4077. else {
  4078. // OSX/Linux - this can likely be improved with some form of quoting.
  4079. // creating processes on Unix is fundamentally different than Windows.
  4080. // on Unix, execvp() takes an arg array.
  4081. cmd += toolPath;
  4082. for (const a of args) {
  4083. cmd += ` ${a}`;
  4084. }
  4085. }
  4086. return cmd;
  4087. }
  4088. _processLineBuffer(data, strBuffer, onLine) {
  4089. try {
  4090. let s = strBuffer + data.toString();
  4091. let n = s.indexOf(os.EOL);
  4092. while (n > -1) {
  4093. const line = s.substring(0, n);
  4094. onLine(line);
  4095. // the rest of the string ...
  4096. s = s.substring(n + os.EOL.length);
  4097. n = s.indexOf(os.EOL);
  4098. }
  4099. return s;
  4100. }
  4101. catch (err) {
  4102. // streaming lines to console is best effort. Don't fail a build.
  4103. this._debug(`error processing line. Failed with error ${err}`);
  4104. return '';
  4105. }
  4106. }
  4107. _getSpawnFileName() {
  4108. if (IS_WINDOWS) {
  4109. if (this._isCmdFile()) {
  4110. return process.env['COMSPEC'] || 'cmd.exe';
  4111. }
  4112. }
  4113. return this.toolPath;
  4114. }
  4115. _getSpawnArgs(options) {
  4116. if (IS_WINDOWS) {
  4117. if (this._isCmdFile()) {
  4118. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4119. for (const a of this.args) {
  4120. argline += ' ';
  4121. argline += options.windowsVerbatimArguments
  4122. ? a
  4123. : this._windowsQuoteCmdArg(a);
  4124. }
  4125. argline += '"';
  4126. return [argline];
  4127. }
  4128. }
  4129. return this.args;
  4130. }
  4131. _endsWith(str, end) {
  4132. return str.endsWith(end);
  4133. }
  4134. _isCmdFile() {
  4135. const upperToolPath = this.toolPath.toUpperCase();
  4136. return (this._endsWith(upperToolPath, '.CMD') ||
  4137. this._endsWith(upperToolPath, '.BAT'));
  4138. }
  4139. _windowsQuoteCmdArg(arg) {
  4140. // for .exe, apply the normal quoting rules that libuv applies
  4141. if (!this._isCmdFile()) {
  4142. return this._uvQuoteCmdArg(arg);
  4143. }
  4144. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4145. // the libuv rules are generic and are not designed specifically for cmd.exe
  4146. // command line parser.
  4147. //
  4148. // for a detailed description of the cmd.exe command line parser, refer to
  4149. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4150. // need quotes for empty arg
  4151. if (!arg) {
  4152. return '""';
  4153. }
  4154. // determine whether the arg needs to be quoted
  4155. const cmdSpecialChars = [
  4156. ' ',
  4157. '\t',
  4158. '&',
  4159. '(',
  4160. ')',
  4161. '[',
  4162. ']',
  4163. '{',
  4164. '}',
  4165. '^',
  4166. '=',
  4167. ';',
  4168. '!',
  4169. "'",
  4170. '+',
  4171. ',',
  4172. '`',
  4173. '~',
  4174. '|',
  4175. '<',
  4176. '>',
  4177. '"'
  4178. ];
  4179. let needsQuotes = false;
  4180. for (const char of arg) {
  4181. if (cmdSpecialChars.some(x => x === char)) {
  4182. needsQuotes = true;
  4183. break;
  4184. }
  4185. }
  4186. // short-circuit if quotes not needed
  4187. if (!needsQuotes) {
  4188. return arg;
  4189. }
  4190. // the following quoting rules are very similar to the rules that by libuv applies.
  4191. //
  4192. // 1) wrap the string in quotes
  4193. //
  4194. // 2) double-up quotes - i.e. " => ""
  4195. //
  4196. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4197. // doesn't work well with a cmd.exe command line.
  4198. //
  4199. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4200. // for example, the command line:
  4201. // foo.exe "myarg:""my val"""
  4202. // is parsed by a .NET console app into an arg array:
  4203. // [ "myarg:\"my val\"" ]
  4204. // which is the same end result when applying libuv quoting rules. although the actual
  4205. // command line from libuv quoting rules would look like:
  4206. // foo.exe "myarg:\"my val\""
  4207. //
  4208. // 3) double-up slashes that precede a quote,
  4209. // e.g. hello \world => "hello \world"
  4210. // hello\"world => "hello\\""world"
  4211. // hello\\"world => "hello\\\\""world"
  4212. // hello world\ => "hello world\\"
  4213. //
  4214. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4215. // the reasons for including this as a .cmd quoting rule are:
  4216. //
  4217. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4218. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4219. //
  4220. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4221. // haven't heard any complaints about that aspect.
  4222. //
  4223. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4224. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4225. // by using %%.
  4226. //
  4227. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4228. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4229. //
  4230. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4231. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4232. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4233. // to an external program.
  4234. //
  4235. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4236. // % can be escaped within a .cmd file.
  4237. let reverse = '"';
  4238. let quoteHit = true;
  4239. for (let i = arg.length; i > 0; i--) {
  4240. // walk the string in reverse
  4241. reverse += arg[i - 1];
  4242. if (quoteHit && arg[i - 1] === '\\') {
  4243. reverse += '\\'; // double the slash
  4244. }
  4245. else if (arg[i - 1] === '"') {
  4246. quoteHit = true;
  4247. reverse += '"'; // double the quote
  4248. }
  4249. else {
  4250. quoteHit = false;
  4251. }
  4252. }
  4253. reverse += '"';
  4254. return reverse
  4255. .split('')
  4256. .reverse()
  4257. .join('');
  4258. }
  4259. _uvQuoteCmdArg(arg) {
  4260. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4261. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4262. // is used.
  4263. //
  4264. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4265. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4266. // pasting copyright notice from Node within this function:
  4267. //
  4268. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4269. //
  4270. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4271. // of this software and associated documentation files (the "Software"), to
  4272. // deal in the Software without restriction, including without limitation the
  4273. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4274. // sell copies of the Software, and to permit persons to whom the Software is
  4275. // furnished to do so, subject to the following conditions:
  4276. //
  4277. // The above copyright notice and this permission notice shall be included in
  4278. // all copies or substantial portions of the Software.
  4279. //
  4280. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4281. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4282. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4283. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4284. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4285. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4286. // IN THE SOFTWARE.
  4287. if (!arg) {
  4288. // Need double quotation for empty argument
  4289. return '""';
  4290. }
  4291. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4292. // No quotation needed
  4293. return arg;
  4294. }
  4295. if (!arg.includes('"') && !arg.includes('\\')) {
  4296. // No embedded double quotes or backslashes, so I can just wrap
  4297. // quote marks around the whole thing.
  4298. return `"${arg}"`;
  4299. }
  4300. // Expected input/output:
  4301. // input : hello"world
  4302. // output: "hello\"world"
  4303. // input : hello""world
  4304. // output: "hello\"\"world"
  4305. // input : hello\world
  4306. // output: hello\world
  4307. // input : hello\\world
  4308. // output: hello\\world
  4309. // input : hello\"world
  4310. // output: "hello\\\"world"
  4311. // input : hello\\"world
  4312. // output: "hello\\\\\"world"
  4313. // input : hello world\
  4314. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4315. // but it appears the comment is wrong, it should be "hello world\\"
  4316. let reverse = '"';
  4317. let quoteHit = true;
  4318. for (let i = arg.length; i > 0; i--) {
  4319. // walk the string in reverse
  4320. reverse += arg[i - 1];
  4321. if (quoteHit && arg[i - 1] === '\\') {
  4322. reverse += '\\';
  4323. }
  4324. else if (arg[i - 1] === '"') {
  4325. quoteHit = true;
  4326. reverse += '\\';
  4327. }
  4328. else {
  4329. quoteHit = false;
  4330. }
  4331. }
  4332. reverse += '"';
  4333. return reverse
  4334. .split('')
  4335. .reverse()
  4336. .join('');
  4337. }
  4338. _cloneExecOptions(options) {
  4339. options = options || {};
  4340. const result = {
  4341. cwd: options.cwd || process.cwd(),
  4342. env: options.env || process.env,
  4343. silent: options.silent || false,
  4344. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4345. failOnStdErr: options.failOnStdErr || false,
  4346. ignoreReturnCode: options.ignoreReturnCode || false,
  4347. delay: options.delay || 10000
  4348. };
  4349. result.outStream = options.outStream || process.stdout;
  4350. result.errStream = options.errStream || process.stderr;
  4351. return result;
  4352. }
  4353. _getSpawnOptions(options, toolPath) {
  4354. options = options || {};
  4355. const result = {};
  4356. result.cwd = options.cwd;
  4357. result.env = options.env;
  4358. result['windowsVerbatimArguments'] =
  4359. options.windowsVerbatimArguments || this._isCmdFile();
  4360. if (options.windowsVerbatimArguments) {
  4361. result.argv0 = `"${toolPath}"`;
  4362. }
  4363. return result;
  4364. }
  4365. /**
  4366. * Exec a tool.
  4367. * Output will be streamed to the live console.
  4368. * Returns promise with return code
  4369. *
  4370. * @param tool path to tool to exec
  4371. * @param options optional exec options. See ExecOptions
  4372. * @returns number
  4373. */
  4374. exec() {
  4375. return __awaiter(this, void 0, void 0, function* () {
  4376. // root the tool path if it is unrooted and contains relative pathing
  4377. if (!ioUtil.isRooted(this.toolPath) &&
  4378. (this.toolPath.includes('/') ||
  4379. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4380. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4381. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4382. }
  4383. // if the tool is only a file name, then resolve it from the PATH
  4384. // otherwise verify it exists (add extension on Windows if necessary)
  4385. this.toolPath = yield io.which(this.toolPath, true);
  4386. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4387. this._debug(`exec tool: ${this.toolPath}`);
  4388. this._debug('arguments:');
  4389. for (const arg of this.args) {
  4390. this._debug(` ${arg}`);
  4391. }
  4392. const optionsNonNull = this._cloneExecOptions(this.options);
  4393. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4394. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4395. }
  4396. const state = new ExecState(optionsNonNull, this.toolPath);
  4397. state.on('debug', (message) => {
  4398. this._debug(message);
  4399. });
  4400. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4401. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4402. }
  4403. const fileName = this._getSpawnFileName();
  4404. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4405. let stdbuffer = '';
  4406. if (cp.stdout) {
  4407. cp.stdout.on('data', (data) => {
  4408. if (this.options.listeners && this.options.listeners.stdout) {
  4409. this.options.listeners.stdout(data);
  4410. }
  4411. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4412. optionsNonNull.outStream.write(data);
  4413. }
  4414. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4415. if (this.options.listeners && this.options.listeners.stdline) {
  4416. this.options.listeners.stdline(line);
  4417. }
  4418. });
  4419. });
  4420. }
  4421. let errbuffer = '';
  4422. if (cp.stderr) {
  4423. cp.stderr.on('data', (data) => {
  4424. state.processStderr = true;
  4425. if (this.options.listeners && this.options.listeners.stderr) {
  4426. this.options.listeners.stderr(data);
  4427. }
  4428. if (!optionsNonNull.silent &&
  4429. optionsNonNull.errStream &&
  4430. optionsNonNull.outStream) {
  4431. const s = optionsNonNull.failOnStdErr
  4432. ? optionsNonNull.errStream
  4433. : optionsNonNull.outStream;
  4434. s.write(data);
  4435. }
  4436. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4437. if (this.options.listeners && this.options.listeners.errline) {
  4438. this.options.listeners.errline(line);
  4439. }
  4440. });
  4441. });
  4442. }
  4443. cp.on('error', (err) => {
  4444. state.processError = err.message;
  4445. state.processExited = true;
  4446. state.processClosed = true;
  4447. state.CheckComplete();
  4448. });
  4449. cp.on('exit', (code) => {
  4450. state.processExitCode = code;
  4451. state.processExited = true;
  4452. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4453. state.CheckComplete();
  4454. });
  4455. cp.on('close', (code) => {
  4456. state.processExitCode = code;
  4457. state.processExited = true;
  4458. state.processClosed = true;
  4459. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4460. state.CheckComplete();
  4461. });
  4462. state.on('done', (error, exitCode) => {
  4463. if (stdbuffer.length > 0) {
  4464. this.emit('stdline', stdbuffer);
  4465. }
  4466. if (errbuffer.length > 0) {
  4467. this.emit('errline', errbuffer);
  4468. }
  4469. cp.removeAllListeners();
  4470. if (error) {
  4471. reject(error);
  4472. }
  4473. else {
  4474. resolve(exitCode);
  4475. }
  4476. });
  4477. if (this.options.input) {
  4478. if (!cp.stdin) {
  4479. throw new Error('child process missing stdin');
  4480. }
  4481. cp.stdin.end(this.options.input);
  4482. }
  4483. }));
  4484. });
  4485. }
  4486. }
  4487. exports.ToolRunner = ToolRunner;
  4488. /**
  4489. * Convert an arg string to an array of args. Handles escaping
  4490. *
  4491. * @param argString string of arguments
  4492. * @returns string[] array of arguments
  4493. */
  4494. function argStringToArray(argString) {
  4495. const args = [];
  4496. let inQuotes = false;
  4497. let escaped = false;
  4498. let arg = '';
  4499. function append(c) {
  4500. // we only escape double quotes.
  4501. if (escaped && c !== '"') {
  4502. arg += '\\';
  4503. }
  4504. arg += c;
  4505. escaped = false;
  4506. }
  4507. for (let i = 0; i < argString.length; i++) {
  4508. const c = argString.charAt(i);
  4509. if (c === '"') {
  4510. if (!escaped) {
  4511. inQuotes = !inQuotes;
  4512. }
  4513. else {
  4514. append(c);
  4515. }
  4516. continue;
  4517. }
  4518. if (c === '\\' && escaped) {
  4519. append(c);
  4520. continue;
  4521. }
  4522. if (c === '\\' && inQuotes) {
  4523. escaped = true;
  4524. continue;
  4525. }
  4526. if (c === ' ' && !inQuotes) {
  4527. if (arg.length > 0) {
  4528. args.push(arg);
  4529. arg = '';
  4530. }
  4531. continue;
  4532. }
  4533. append(c);
  4534. }
  4535. if (arg.length > 0) {
  4536. args.push(arg.trim());
  4537. }
  4538. return args;
  4539. }
  4540. exports.argStringToArray = argStringToArray;
  4541. class ExecState extends events.EventEmitter {
  4542. constructor(options, toolPath) {
  4543. super();
  4544. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4545. this.processError = '';
  4546. this.processExitCode = 0;
  4547. this.processExited = false; // tracks whether the process has exited
  4548. this.processStderr = false; // tracks whether stderr was written to
  4549. this.delay = 10000; // 10 seconds
  4550. this.done = false;
  4551. this.timeout = null;
  4552. if (!toolPath) {
  4553. throw new Error('toolPath must not be empty');
  4554. }
  4555. this.options = options;
  4556. this.toolPath = toolPath;
  4557. if (options.delay) {
  4558. this.delay = options.delay;
  4559. }
  4560. }
  4561. CheckComplete() {
  4562. if (this.done) {
  4563. return;
  4564. }
  4565. if (this.processClosed) {
  4566. this._setResult();
  4567. }
  4568. else if (this.processExited) {
  4569. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4570. }
  4571. }
  4572. _debug(message) {
  4573. this.emit('debug', message);
  4574. }
  4575. _setResult() {
  4576. // determine whether there is an error
  4577. let error;
  4578. if (this.processExited) {
  4579. if (this.processError) {
  4580. 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}`);
  4581. }
  4582. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4583. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4584. }
  4585. else if (this.processStderr && this.options.failOnStdErr) {
  4586. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4587. }
  4588. }
  4589. // clear the timeout
  4590. if (this.timeout) {
  4591. clearTimeout(this.timeout);
  4592. this.timeout = null;
  4593. }
  4594. this.done = true;
  4595. this.emit('done', error, this.processExitCode);
  4596. }
  4597. static HandleTimeout(state) {
  4598. if (state.done) {
  4599. return;
  4600. }
  4601. if (!state.processClosed && state.processExited) {
  4602. const message = `The STDIO streams did not close within ${state.delay /
  4603. 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.`;
  4604. state._debug(message);
  4605. }
  4606. state._setResult();
  4607. }
  4608. }
  4609. //# sourceMappingURL=toolrunner.js.map
  4610. /***/ }),
  4611. /***/ 4087:
  4612. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4613. "use strict";
  4614. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4615. exports.Context = void 0;
  4616. const fs_1 = __nccwpck_require__(7147);
  4617. const os_1 = __nccwpck_require__(2037);
  4618. class Context {
  4619. /**
  4620. * Hydrate the context from the environment
  4621. */
  4622. constructor() {
  4623. var _a, _b, _c;
  4624. this.payload = {};
  4625. if (process.env.GITHUB_EVENT_PATH) {
  4626. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4627. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4628. }
  4629. else {
  4630. const path = process.env.GITHUB_EVENT_PATH;
  4631. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4632. }
  4633. }
  4634. this.eventName = process.env.GITHUB_EVENT_NAME;
  4635. this.sha = process.env.GITHUB_SHA;
  4636. this.ref = process.env.GITHUB_REF;
  4637. this.workflow = process.env.GITHUB_WORKFLOW;
  4638. this.action = process.env.GITHUB_ACTION;
  4639. this.actor = process.env.GITHUB_ACTOR;
  4640. this.job = process.env.GITHUB_JOB;
  4641. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4642. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4643. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4644. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4645. this.graphqlUrl =
  4646. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4647. }
  4648. get issue() {
  4649. const payload = this.payload;
  4650. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4651. }
  4652. get repo() {
  4653. if (process.env.GITHUB_REPOSITORY) {
  4654. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4655. return { owner, repo };
  4656. }
  4657. if (this.payload.repository) {
  4658. return {
  4659. owner: this.payload.repository.owner.login,
  4660. repo: this.payload.repository.name
  4661. };
  4662. }
  4663. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4664. }
  4665. }
  4666. exports.Context = Context;
  4667. //# sourceMappingURL=context.js.map
  4668. /***/ }),
  4669. /***/ 5438:
  4670. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4671. "use strict";
  4672. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4673. if (k2 === undefined) k2 = k;
  4674. var desc = Object.getOwnPropertyDescriptor(m, k);
  4675. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4676. desc = { enumerable: true, get: function() { return m[k]; } };
  4677. }
  4678. Object.defineProperty(o, k2, desc);
  4679. }) : (function(o, m, k, k2) {
  4680. if (k2 === undefined) k2 = k;
  4681. o[k2] = m[k];
  4682. }));
  4683. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4684. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4685. }) : function(o, v) {
  4686. o["default"] = v;
  4687. });
  4688. var __importStar = (this && this.__importStar) || function (mod) {
  4689. if (mod && mod.__esModule) return mod;
  4690. var result = {};
  4691. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4692. __setModuleDefault(result, mod);
  4693. return result;
  4694. };
  4695. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4696. exports.getOctokit = exports.context = void 0;
  4697. const Context = __importStar(__nccwpck_require__(4087));
  4698. const utils_1 = __nccwpck_require__(3030);
  4699. exports.context = new Context.Context();
  4700. /**
  4701. * Returns a hydrated octokit ready to use for GitHub Actions
  4702. *
  4703. * @param token the repo PAT or GITHUB_TOKEN
  4704. * @param options other options to set
  4705. */
  4706. function getOctokit(token, options, ...additionalPlugins) {
  4707. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4708. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4709. }
  4710. exports.getOctokit = getOctokit;
  4711. //# sourceMappingURL=github.js.map
  4712. /***/ }),
  4713. /***/ 7914:
  4714. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4715. "use strict";
  4716. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4717. if (k2 === undefined) k2 = k;
  4718. var desc = Object.getOwnPropertyDescriptor(m, k);
  4719. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4720. desc = { enumerable: true, get: function() { return m[k]; } };
  4721. }
  4722. Object.defineProperty(o, k2, desc);
  4723. }) : (function(o, m, k, k2) {
  4724. if (k2 === undefined) k2 = k;
  4725. o[k2] = m[k];
  4726. }));
  4727. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4728. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4729. }) : function(o, v) {
  4730. o["default"] = v;
  4731. });
  4732. var __importStar = (this && this.__importStar) || function (mod) {
  4733. if (mod && mod.__esModule) return mod;
  4734. var result = {};
  4735. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4736. __setModuleDefault(result, mod);
  4737. return result;
  4738. };
  4739. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4740. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4741. return new (P || (P = Promise))(function (resolve, reject) {
  4742. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4743. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4744. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4745. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4746. });
  4747. };
  4748. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4749. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  4750. const httpClient = __importStar(__nccwpck_require__(6255));
  4751. const undici_1 = __nccwpck_require__(1773);
  4752. function getAuthString(token, options) {
  4753. if (!token && !options.auth) {
  4754. throw new Error('Parameter token or opts.auth is required');
  4755. }
  4756. else if (token && options.auth) {
  4757. throw new Error('Parameters token and opts.auth may not both be specified');
  4758. }
  4759. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  4760. }
  4761. exports.getAuthString = getAuthString;
  4762. function getProxyAgent(destinationUrl) {
  4763. const hc = new httpClient.HttpClient();
  4764. return hc.getAgent(destinationUrl);
  4765. }
  4766. exports.getProxyAgent = getProxyAgent;
  4767. function getProxyAgentDispatcher(destinationUrl) {
  4768. const hc = new httpClient.HttpClient();
  4769. return hc.getAgentDispatcher(destinationUrl);
  4770. }
  4771. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  4772. function getProxyFetch(destinationUrl) {
  4773. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  4774. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  4775. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  4776. });
  4777. return proxyFetch;
  4778. }
  4779. exports.getProxyFetch = getProxyFetch;
  4780. function getApiBaseUrl() {
  4781. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  4782. }
  4783. exports.getApiBaseUrl = getApiBaseUrl;
  4784. //# sourceMappingURL=utils.js.map
  4785. /***/ }),
  4786. /***/ 3030:
  4787. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4788. "use strict";
  4789. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4790. if (k2 === undefined) k2 = k;
  4791. var desc = Object.getOwnPropertyDescriptor(m, k);
  4792. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4793. desc = { enumerable: true, get: function() { return m[k]; } };
  4794. }
  4795. Object.defineProperty(o, k2, desc);
  4796. }) : (function(o, m, k, k2) {
  4797. if (k2 === undefined) k2 = k;
  4798. o[k2] = m[k];
  4799. }));
  4800. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4801. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4802. }) : function(o, v) {
  4803. o["default"] = v;
  4804. });
  4805. var __importStar = (this && this.__importStar) || function (mod) {
  4806. if (mod && mod.__esModule) return mod;
  4807. var result = {};
  4808. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4809. __setModuleDefault(result, mod);
  4810. return result;
  4811. };
  4812. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4813. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  4814. const Context = __importStar(__nccwpck_require__(4087));
  4815. const Utils = __importStar(__nccwpck_require__(7914));
  4816. // octokit + plugins
  4817. const core_1 = __nccwpck_require__(6762);
  4818. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  4819. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  4820. exports.context = new Context.Context();
  4821. const baseUrl = Utils.getApiBaseUrl();
  4822. exports.defaults = {
  4823. baseUrl,
  4824. request: {
  4825. agent: Utils.getProxyAgent(baseUrl),
  4826. fetch: Utils.getProxyFetch(baseUrl)
  4827. }
  4828. };
  4829. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  4830. /**
  4831. * Convience function to correctly format Octokit Options to pass into the constructor.
  4832. *
  4833. * @param token the repo PAT or GITHUB_TOKEN
  4834. * @param options other options to set
  4835. */
  4836. function getOctokitOptions(token, options) {
  4837. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  4838. // Auth
  4839. const auth = Utils.getAuthString(token, opts);
  4840. if (auth) {
  4841. opts.auth = auth;
  4842. }
  4843. return opts;
  4844. }
  4845. exports.getOctokitOptions = getOctokitOptions;
  4846. //# sourceMappingURL=utils.js.map
  4847. /***/ }),
  4848. /***/ 5526:
  4849. /***/ (function(__unused_webpack_module, exports) {
  4850. "use strict";
  4851. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4852. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4853. return new (P || (P = Promise))(function (resolve, reject) {
  4854. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4855. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4856. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4857. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4858. });
  4859. };
  4860. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4861. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  4862. class BasicCredentialHandler {
  4863. constructor(username, password) {
  4864. this.username = username;
  4865. this.password = password;
  4866. }
  4867. prepareRequest(options) {
  4868. if (!options.headers) {
  4869. throw Error('The request has no headers');
  4870. }
  4871. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  4872. }
  4873. // This handler cannot handle 401
  4874. canHandleAuthentication() {
  4875. return false;
  4876. }
  4877. handleAuthentication() {
  4878. return __awaiter(this, void 0, void 0, function* () {
  4879. throw new Error('not implemented');
  4880. });
  4881. }
  4882. }
  4883. exports.BasicCredentialHandler = BasicCredentialHandler;
  4884. class BearerCredentialHandler {
  4885. constructor(token) {
  4886. this.token = token;
  4887. }
  4888. // currently implements pre-authorization
  4889. // TODO: support preAuth = false where it hooks on 401
  4890. prepareRequest(options) {
  4891. if (!options.headers) {
  4892. throw Error('The request has no headers');
  4893. }
  4894. options.headers['Authorization'] = `Bearer ${this.token}`;
  4895. }
  4896. // This handler cannot handle 401
  4897. canHandleAuthentication() {
  4898. return false;
  4899. }
  4900. handleAuthentication() {
  4901. return __awaiter(this, void 0, void 0, function* () {
  4902. throw new Error('not implemented');
  4903. });
  4904. }
  4905. }
  4906. exports.BearerCredentialHandler = BearerCredentialHandler;
  4907. class PersonalAccessTokenCredentialHandler {
  4908. constructor(token) {
  4909. this.token = token;
  4910. }
  4911. // currently implements pre-authorization
  4912. // TODO: support preAuth = false where it hooks on 401
  4913. prepareRequest(options) {
  4914. if (!options.headers) {
  4915. throw Error('The request has no headers');
  4916. }
  4917. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  4918. }
  4919. // This handler cannot handle 401
  4920. canHandleAuthentication() {
  4921. return false;
  4922. }
  4923. handleAuthentication() {
  4924. return __awaiter(this, void 0, void 0, function* () {
  4925. throw new Error('not implemented');
  4926. });
  4927. }
  4928. }
  4929. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  4930. //# sourceMappingURL=auth.js.map
  4931. /***/ }),
  4932. /***/ 6255:
  4933. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4934. "use strict";
  4935. /* eslint-disable @typescript-eslint/no-explicit-any */
  4936. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4937. if (k2 === undefined) k2 = k;
  4938. var desc = Object.getOwnPropertyDescriptor(m, k);
  4939. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4940. desc = { enumerable: true, get: function() { return m[k]; } };
  4941. }
  4942. Object.defineProperty(o, k2, desc);
  4943. }) : (function(o, m, k, k2) {
  4944. if (k2 === undefined) k2 = k;
  4945. o[k2] = m[k];
  4946. }));
  4947. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4948. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4949. }) : function(o, v) {
  4950. o["default"] = v;
  4951. });
  4952. var __importStar = (this && this.__importStar) || function (mod) {
  4953. if (mod && mod.__esModule) return mod;
  4954. var result = {};
  4955. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4956. __setModuleDefault(result, mod);
  4957. return result;
  4958. };
  4959. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4960. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4961. return new (P || (P = Promise))(function (resolve, reject) {
  4962. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4963. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4964. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4965. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4966. });
  4967. };
  4968. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4969. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  4970. const http = __importStar(__nccwpck_require__(3685));
  4971. const https = __importStar(__nccwpck_require__(5687));
  4972. const pm = __importStar(__nccwpck_require__(9835));
  4973. const tunnel = __importStar(__nccwpck_require__(4294));
  4974. const undici_1 = __nccwpck_require__(1773);
  4975. var HttpCodes;
  4976. (function (HttpCodes) {
  4977. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  4978. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  4979. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  4980. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  4981. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  4982. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  4983. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  4984. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  4985. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  4986. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  4987. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  4988. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  4989. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  4990. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  4991. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  4992. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  4993. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  4994. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  4995. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  4996. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  4997. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  4998. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  4999. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5000. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5001. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5002. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5003. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5004. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5005. var Headers;
  5006. (function (Headers) {
  5007. Headers["Accept"] = "accept";
  5008. Headers["ContentType"] = "content-type";
  5009. })(Headers || (exports.Headers = Headers = {}));
  5010. var MediaTypes;
  5011. (function (MediaTypes) {
  5012. MediaTypes["ApplicationJson"] = "application/json";
  5013. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5014. /**
  5015. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5016. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5017. */
  5018. function getProxyUrl(serverUrl) {
  5019. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5020. return proxyUrl ? proxyUrl.href : '';
  5021. }
  5022. exports.getProxyUrl = getProxyUrl;
  5023. const HttpRedirectCodes = [
  5024. HttpCodes.MovedPermanently,
  5025. HttpCodes.ResourceMoved,
  5026. HttpCodes.SeeOther,
  5027. HttpCodes.TemporaryRedirect,
  5028. HttpCodes.PermanentRedirect
  5029. ];
  5030. const HttpResponseRetryCodes = [
  5031. HttpCodes.BadGateway,
  5032. HttpCodes.ServiceUnavailable,
  5033. HttpCodes.GatewayTimeout
  5034. ];
  5035. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5036. const ExponentialBackoffCeiling = 10;
  5037. const ExponentialBackoffTimeSlice = 5;
  5038. class HttpClientError extends Error {
  5039. constructor(message, statusCode) {
  5040. super(message);
  5041. this.name = 'HttpClientError';
  5042. this.statusCode = statusCode;
  5043. Object.setPrototypeOf(this, HttpClientError.prototype);
  5044. }
  5045. }
  5046. exports.HttpClientError = HttpClientError;
  5047. class HttpClientResponse {
  5048. constructor(message) {
  5049. this.message = message;
  5050. }
  5051. readBody() {
  5052. return __awaiter(this, void 0, void 0, function* () {
  5053. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5054. let output = Buffer.alloc(0);
  5055. this.message.on('data', (chunk) => {
  5056. output = Buffer.concat([output, chunk]);
  5057. });
  5058. this.message.on('end', () => {
  5059. resolve(output.toString());
  5060. });
  5061. }));
  5062. });
  5063. }
  5064. readBodyBuffer() {
  5065. return __awaiter(this, void 0, void 0, function* () {
  5066. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5067. const chunks = [];
  5068. this.message.on('data', (chunk) => {
  5069. chunks.push(chunk);
  5070. });
  5071. this.message.on('end', () => {
  5072. resolve(Buffer.concat(chunks));
  5073. });
  5074. }));
  5075. });
  5076. }
  5077. }
  5078. exports.HttpClientResponse = HttpClientResponse;
  5079. function isHttps(requestUrl) {
  5080. const parsedUrl = new URL(requestUrl);
  5081. return parsedUrl.protocol === 'https:';
  5082. }
  5083. exports.isHttps = isHttps;
  5084. class HttpClient {
  5085. constructor(userAgent, handlers, requestOptions) {
  5086. this._ignoreSslError = false;
  5087. this._allowRedirects = true;
  5088. this._allowRedirectDowngrade = false;
  5089. this._maxRedirects = 50;
  5090. this._allowRetries = false;
  5091. this._maxRetries = 1;
  5092. this._keepAlive = false;
  5093. this._disposed = false;
  5094. this.userAgent = userAgent;
  5095. this.handlers = handlers || [];
  5096. this.requestOptions = requestOptions;
  5097. if (requestOptions) {
  5098. if (requestOptions.ignoreSslError != null) {
  5099. this._ignoreSslError = requestOptions.ignoreSslError;
  5100. }
  5101. this._socketTimeout = requestOptions.socketTimeout;
  5102. if (requestOptions.allowRedirects != null) {
  5103. this._allowRedirects = requestOptions.allowRedirects;
  5104. }
  5105. if (requestOptions.allowRedirectDowngrade != null) {
  5106. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5107. }
  5108. if (requestOptions.maxRedirects != null) {
  5109. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5110. }
  5111. if (requestOptions.keepAlive != null) {
  5112. this._keepAlive = requestOptions.keepAlive;
  5113. }
  5114. if (requestOptions.allowRetries != null) {
  5115. this._allowRetries = requestOptions.allowRetries;
  5116. }
  5117. if (requestOptions.maxRetries != null) {
  5118. this._maxRetries = requestOptions.maxRetries;
  5119. }
  5120. }
  5121. }
  5122. options(requestUrl, additionalHeaders) {
  5123. return __awaiter(this, void 0, void 0, function* () {
  5124. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5125. });
  5126. }
  5127. get(requestUrl, additionalHeaders) {
  5128. return __awaiter(this, void 0, void 0, function* () {
  5129. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5130. });
  5131. }
  5132. del(requestUrl, additionalHeaders) {
  5133. return __awaiter(this, void 0, void 0, function* () {
  5134. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5135. });
  5136. }
  5137. post(requestUrl, data, additionalHeaders) {
  5138. return __awaiter(this, void 0, void 0, function* () {
  5139. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5140. });
  5141. }
  5142. patch(requestUrl, data, additionalHeaders) {
  5143. return __awaiter(this, void 0, void 0, function* () {
  5144. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5145. });
  5146. }
  5147. put(requestUrl, data, additionalHeaders) {
  5148. return __awaiter(this, void 0, void 0, function* () {
  5149. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5150. });
  5151. }
  5152. head(requestUrl, additionalHeaders) {
  5153. return __awaiter(this, void 0, void 0, function* () {
  5154. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5155. });
  5156. }
  5157. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5158. return __awaiter(this, void 0, void 0, function* () {
  5159. return this.request(verb, requestUrl, stream, additionalHeaders);
  5160. });
  5161. }
  5162. /**
  5163. * Gets a typed object from an endpoint
  5164. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5165. */
  5166. getJson(requestUrl, additionalHeaders = {}) {
  5167. return __awaiter(this, void 0, void 0, function* () {
  5168. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5169. const res = yield this.get(requestUrl, additionalHeaders);
  5170. return this._processResponse(res, this.requestOptions);
  5171. });
  5172. }
  5173. postJson(requestUrl, obj, additionalHeaders = {}) {
  5174. return __awaiter(this, void 0, void 0, function* () {
  5175. const data = JSON.stringify(obj, null, 2);
  5176. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5177. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5178. const res = yield this.post(requestUrl, data, additionalHeaders);
  5179. return this._processResponse(res, this.requestOptions);
  5180. });
  5181. }
  5182. putJson(requestUrl, obj, additionalHeaders = {}) {
  5183. return __awaiter(this, void 0, void 0, function* () {
  5184. const data = JSON.stringify(obj, null, 2);
  5185. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5186. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5187. const res = yield this.put(requestUrl, data, additionalHeaders);
  5188. return this._processResponse(res, this.requestOptions);
  5189. });
  5190. }
  5191. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5192. return __awaiter(this, void 0, void 0, function* () {
  5193. const data = JSON.stringify(obj, null, 2);
  5194. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5195. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5196. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5197. return this._processResponse(res, this.requestOptions);
  5198. });
  5199. }
  5200. /**
  5201. * Makes a raw http request.
  5202. * All other methods such as get, post, patch, and request ultimately call this.
  5203. * Prefer get, del, post and patch
  5204. */
  5205. request(verb, requestUrl, data, headers) {
  5206. return __awaiter(this, void 0, void 0, function* () {
  5207. if (this._disposed) {
  5208. throw new Error('Client has already been disposed.');
  5209. }
  5210. const parsedUrl = new URL(requestUrl);
  5211. let info = this._prepareRequest(verb, parsedUrl, headers);
  5212. // Only perform retries on reads since writes may not be idempotent.
  5213. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5214. ? this._maxRetries + 1
  5215. : 1;
  5216. let numTries = 0;
  5217. let response;
  5218. do {
  5219. response = yield this.requestRaw(info, data);
  5220. // Check if it's an authentication challenge
  5221. if (response &&
  5222. response.message &&
  5223. response.message.statusCode === HttpCodes.Unauthorized) {
  5224. let authenticationHandler;
  5225. for (const handler of this.handlers) {
  5226. if (handler.canHandleAuthentication(response)) {
  5227. authenticationHandler = handler;
  5228. break;
  5229. }
  5230. }
  5231. if (authenticationHandler) {
  5232. return authenticationHandler.handleAuthentication(this, info, data);
  5233. }
  5234. else {
  5235. // We have received an unauthorized response but have no handlers to handle it.
  5236. // Let the response return to the caller.
  5237. return response;
  5238. }
  5239. }
  5240. let redirectsRemaining = this._maxRedirects;
  5241. while (response.message.statusCode &&
  5242. HttpRedirectCodes.includes(response.message.statusCode) &&
  5243. this._allowRedirects &&
  5244. redirectsRemaining > 0) {
  5245. const redirectUrl = response.message.headers['location'];
  5246. if (!redirectUrl) {
  5247. // if there's no location to redirect to, we won't
  5248. break;
  5249. }
  5250. const parsedRedirectUrl = new URL(redirectUrl);
  5251. if (parsedUrl.protocol === 'https:' &&
  5252. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5253. !this._allowRedirectDowngrade) {
  5254. 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.');
  5255. }
  5256. // we need to finish reading the response before reassigning response
  5257. // which will leak the open socket.
  5258. yield response.readBody();
  5259. // strip authorization header if redirected to a different hostname
  5260. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5261. for (const header in headers) {
  5262. // header names are case insensitive
  5263. if (header.toLowerCase() === 'authorization') {
  5264. delete headers[header];
  5265. }
  5266. }
  5267. }
  5268. // let's make the request with the new redirectUrl
  5269. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5270. response = yield this.requestRaw(info, data);
  5271. redirectsRemaining--;
  5272. }
  5273. if (!response.message.statusCode ||
  5274. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5275. // If not a retry code, return immediately instead of retrying
  5276. return response;
  5277. }
  5278. numTries += 1;
  5279. if (numTries < maxTries) {
  5280. yield response.readBody();
  5281. yield this._performExponentialBackoff(numTries);
  5282. }
  5283. } while (numTries < maxTries);
  5284. return response;
  5285. });
  5286. }
  5287. /**
  5288. * Needs to be called if keepAlive is set to true in request options.
  5289. */
  5290. dispose() {
  5291. if (this._agent) {
  5292. this._agent.destroy();
  5293. }
  5294. this._disposed = true;
  5295. }
  5296. /**
  5297. * Raw request.
  5298. * @param info
  5299. * @param data
  5300. */
  5301. requestRaw(info, data) {
  5302. return __awaiter(this, void 0, void 0, function* () {
  5303. return new Promise((resolve, reject) => {
  5304. function callbackForResult(err, res) {
  5305. if (err) {
  5306. reject(err);
  5307. }
  5308. else if (!res) {
  5309. // If `err` is not passed, then `res` must be passed.
  5310. reject(new Error('Unknown error'));
  5311. }
  5312. else {
  5313. resolve(res);
  5314. }
  5315. }
  5316. this.requestRawWithCallback(info, data, callbackForResult);
  5317. });
  5318. });
  5319. }
  5320. /**
  5321. * Raw request with callback.
  5322. * @param info
  5323. * @param data
  5324. * @param onResult
  5325. */
  5326. requestRawWithCallback(info, data, onResult) {
  5327. if (typeof data === 'string') {
  5328. if (!info.options.headers) {
  5329. info.options.headers = {};
  5330. }
  5331. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5332. }
  5333. let callbackCalled = false;
  5334. function handleResult(err, res) {
  5335. if (!callbackCalled) {
  5336. callbackCalled = true;
  5337. onResult(err, res);
  5338. }
  5339. }
  5340. const req = info.httpModule.request(info.options, (msg) => {
  5341. const res = new HttpClientResponse(msg);
  5342. handleResult(undefined, res);
  5343. });
  5344. let socket;
  5345. req.on('socket', sock => {
  5346. socket = sock;
  5347. });
  5348. // If we ever get disconnected, we want the socket to timeout eventually
  5349. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5350. if (socket) {
  5351. socket.end();
  5352. }
  5353. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5354. });
  5355. req.on('error', function (err) {
  5356. // err has statusCode property
  5357. // res should have headers
  5358. handleResult(err);
  5359. });
  5360. if (data && typeof data === 'string') {
  5361. req.write(data, 'utf8');
  5362. }
  5363. if (data && typeof data !== 'string') {
  5364. data.on('close', function () {
  5365. req.end();
  5366. });
  5367. data.pipe(req);
  5368. }
  5369. else {
  5370. req.end();
  5371. }
  5372. }
  5373. /**
  5374. * Gets an http agent. This function is useful when you need an http agent that handles
  5375. * routing through a proxy server - depending upon the url and proxy environment variables.
  5376. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5377. */
  5378. getAgent(serverUrl) {
  5379. const parsedUrl = new URL(serverUrl);
  5380. return this._getAgent(parsedUrl);
  5381. }
  5382. getAgentDispatcher(serverUrl) {
  5383. const parsedUrl = new URL(serverUrl);
  5384. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5385. const useProxy = proxyUrl && proxyUrl.hostname;
  5386. if (!useProxy) {
  5387. return;
  5388. }
  5389. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5390. }
  5391. _prepareRequest(method, requestUrl, headers) {
  5392. const info = {};
  5393. info.parsedUrl = requestUrl;
  5394. const usingSsl = info.parsedUrl.protocol === 'https:';
  5395. info.httpModule = usingSsl ? https : http;
  5396. const defaultPort = usingSsl ? 443 : 80;
  5397. info.options = {};
  5398. info.options.host = info.parsedUrl.hostname;
  5399. info.options.port = info.parsedUrl.port
  5400. ? parseInt(info.parsedUrl.port)
  5401. : defaultPort;
  5402. info.options.path =
  5403. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5404. info.options.method = method;
  5405. info.options.headers = this._mergeHeaders(headers);
  5406. if (this.userAgent != null) {
  5407. info.options.headers['user-agent'] = this.userAgent;
  5408. }
  5409. info.options.agent = this._getAgent(info.parsedUrl);
  5410. // gives handlers an opportunity to participate
  5411. if (this.handlers) {
  5412. for (const handler of this.handlers) {
  5413. handler.prepareRequest(info.options);
  5414. }
  5415. }
  5416. return info;
  5417. }
  5418. _mergeHeaders(headers) {
  5419. if (this.requestOptions && this.requestOptions.headers) {
  5420. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5421. }
  5422. return lowercaseKeys(headers || {});
  5423. }
  5424. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5425. let clientHeader;
  5426. if (this.requestOptions && this.requestOptions.headers) {
  5427. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5428. }
  5429. return additionalHeaders[header] || clientHeader || _default;
  5430. }
  5431. _getAgent(parsedUrl) {
  5432. let agent;
  5433. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5434. const useProxy = proxyUrl && proxyUrl.hostname;
  5435. if (this._keepAlive && useProxy) {
  5436. agent = this._proxyAgent;
  5437. }
  5438. if (!useProxy) {
  5439. agent = this._agent;
  5440. }
  5441. // if agent is already assigned use that agent.
  5442. if (agent) {
  5443. return agent;
  5444. }
  5445. const usingSsl = parsedUrl.protocol === 'https:';
  5446. let maxSockets = 100;
  5447. if (this.requestOptions) {
  5448. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5449. }
  5450. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5451. if (proxyUrl && proxyUrl.hostname) {
  5452. const agentOptions = {
  5453. maxSockets,
  5454. keepAlive: this._keepAlive,
  5455. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5456. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5457. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5458. };
  5459. let tunnelAgent;
  5460. const overHttps = proxyUrl.protocol === 'https:';
  5461. if (usingSsl) {
  5462. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5463. }
  5464. else {
  5465. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5466. }
  5467. agent = tunnelAgent(agentOptions);
  5468. this._proxyAgent = agent;
  5469. }
  5470. // if tunneling agent isn't assigned create a new agent
  5471. if (!agent) {
  5472. const options = { keepAlive: this._keepAlive, maxSockets };
  5473. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5474. this._agent = agent;
  5475. }
  5476. if (usingSsl && this._ignoreSslError) {
  5477. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5478. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5479. // we have to cast it to any and change it directly
  5480. agent.options = Object.assign(agent.options || {}, {
  5481. rejectUnauthorized: false
  5482. });
  5483. }
  5484. return agent;
  5485. }
  5486. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5487. let proxyAgent;
  5488. if (this._keepAlive) {
  5489. proxyAgent = this._proxyAgentDispatcher;
  5490. }
  5491. // if agent is already assigned use that agent.
  5492. if (proxyAgent) {
  5493. return proxyAgent;
  5494. }
  5495. const usingSsl = parsedUrl.protocol === 'https:';
  5496. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5497. token: `${proxyUrl.username}:${proxyUrl.password}`
  5498. })));
  5499. this._proxyAgentDispatcher = proxyAgent;
  5500. if (usingSsl && this._ignoreSslError) {
  5501. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5502. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5503. // we have to cast it to any and change it directly
  5504. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5505. rejectUnauthorized: false
  5506. });
  5507. }
  5508. return proxyAgent;
  5509. }
  5510. _performExponentialBackoff(retryNumber) {
  5511. return __awaiter(this, void 0, void 0, function* () {
  5512. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5513. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5514. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5515. });
  5516. }
  5517. _processResponse(res, options) {
  5518. return __awaiter(this, void 0, void 0, function* () {
  5519. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5520. const statusCode = res.message.statusCode || 0;
  5521. const response = {
  5522. statusCode,
  5523. result: null,
  5524. headers: {}
  5525. };
  5526. // not found leads to null obj returned
  5527. if (statusCode === HttpCodes.NotFound) {
  5528. resolve(response);
  5529. }
  5530. // get the result from the body
  5531. function dateTimeDeserializer(key, value) {
  5532. if (typeof value === 'string') {
  5533. const a = new Date(value);
  5534. if (!isNaN(a.valueOf())) {
  5535. return a;
  5536. }
  5537. }
  5538. return value;
  5539. }
  5540. let obj;
  5541. let contents;
  5542. try {
  5543. contents = yield res.readBody();
  5544. if (contents && contents.length > 0) {
  5545. if (options && options.deserializeDates) {
  5546. obj = JSON.parse(contents, dateTimeDeserializer);
  5547. }
  5548. else {
  5549. obj = JSON.parse(contents);
  5550. }
  5551. response.result = obj;
  5552. }
  5553. response.headers = res.message.headers;
  5554. }
  5555. catch (err) {
  5556. // Invalid resource (contents not json); leaving result obj null
  5557. }
  5558. // note that 3xx redirects are handled by the http layer.
  5559. if (statusCode > 299) {
  5560. let msg;
  5561. // if exception/error in body, attempt to get better error
  5562. if (obj && obj.message) {
  5563. msg = obj.message;
  5564. }
  5565. else if (contents && contents.length > 0) {
  5566. // it may be the case that the exception is in the body message as string
  5567. msg = contents;
  5568. }
  5569. else {
  5570. msg = `Failed request: (${statusCode})`;
  5571. }
  5572. const err = new HttpClientError(msg, statusCode);
  5573. err.result = response.result;
  5574. reject(err);
  5575. }
  5576. else {
  5577. resolve(response);
  5578. }
  5579. }));
  5580. });
  5581. }
  5582. }
  5583. exports.HttpClient = HttpClient;
  5584. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5585. //# sourceMappingURL=index.js.map
  5586. /***/ }),
  5587. /***/ 9835:
  5588. /***/ ((__unused_webpack_module, exports) => {
  5589. "use strict";
  5590. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5591. exports.checkBypass = exports.getProxyUrl = void 0;
  5592. function getProxyUrl(reqUrl) {
  5593. const usingSsl = reqUrl.protocol === 'https:';
  5594. if (checkBypass(reqUrl)) {
  5595. return undefined;
  5596. }
  5597. const proxyVar = (() => {
  5598. if (usingSsl) {
  5599. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5600. }
  5601. else {
  5602. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5603. }
  5604. })();
  5605. if (proxyVar) {
  5606. try {
  5607. return new URL(proxyVar);
  5608. }
  5609. catch (_a) {
  5610. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5611. return new URL(`http://${proxyVar}`);
  5612. }
  5613. }
  5614. else {
  5615. return undefined;
  5616. }
  5617. }
  5618. exports.getProxyUrl = getProxyUrl;
  5619. function checkBypass(reqUrl) {
  5620. if (!reqUrl.hostname) {
  5621. return false;
  5622. }
  5623. const reqHost = reqUrl.hostname;
  5624. if (isLoopbackAddress(reqHost)) {
  5625. return true;
  5626. }
  5627. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5628. if (!noProxy) {
  5629. return false;
  5630. }
  5631. // Determine the request port
  5632. let reqPort;
  5633. if (reqUrl.port) {
  5634. reqPort = Number(reqUrl.port);
  5635. }
  5636. else if (reqUrl.protocol === 'http:') {
  5637. reqPort = 80;
  5638. }
  5639. else if (reqUrl.protocol === 'https:') {
  5640. reqPort = 443;
  5641. }
  5642. // Format the request hostname and hostname with port
  5643. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5644. if (typeof reqPort === 'number') {
  5645. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5646. }
  5647. // Compare request host against noproxy
  5648. for (const upperNoProxyItem of noProxy
  5649. .split(',')
  5650. .map(x => x.trim().toUpperCase())
  5651. .filter(x => x)) {
  5652. if (upperNoProxyItem === '*' ||
  5653. upperReqHosts.some(x => x === upperNoProxyItem ||
  5654. x.endsWith(`.${upperNoProxyItem}`) ||
  5655. (upperNoProxyItem.startsWith('.') &&
  5656. x.endsWith(`${upperNoProxyItem}`)))) {
  5657. return true;
  5658. }
  5659. }
  5660. return false;
  5661. }
  5662. exports.checkBypass = checkBypass;
  5663. function isLoopbackAddress(host) {
  5664. const hostLower = host.toLowerCase();
  5665. return (hostLower === 'localhost' ||
  5666. hostLower.startsWith('127.') ||
  5667. hostLower.startsWith('[::1]') ||
  5668. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5669. }
  5670. //# sourceMappingURL=proxy.js.map
  5671. /***/ }),
  5672. /***/ 1962:
  5673. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5674. "use strict";
  5675. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5676. if (k2 === undefined) k2 = k;
  5677. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5678. }) : (function(o, m, k, k2) {
  5679. if (k2 === undefined) k2 = k;
  5680. o[k2] = m[k];
  5681. }));
  5682. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5683. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5684. }) : function(o, v) {
  5685. o["default"] = v;
  5686. });
  5687. var __importStar = (this && this.__importStar) || function (mod) {
  5688. if (mod && mod.__esModule) return mod;
  5689. var result = {};
  5690. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5691. __setModuleDefault(result, mod);
  5692. return result;
  5693. };
  5694. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5695. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5696. return new (P || (P = Promise))(function (resolve, reject) {
  5697. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5698. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5699. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5700. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5701. });
  5702. };
  5703. var _a;
  5704. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5705. 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;
  5706. const fs = __importStar(__nccwpck_require__(7147));
  5707. const path = __importStar(__nccwpck_require__(1017));
  5708. _a = fs.promises
  5709. // export const {open} = 'fs'
  5710. , 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;
  5711. // export const {open} = 'fs'
  5712. exports.IS_WINDOWS = process.platform === 'win32';
  5713. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5714. exports.UV_FS_O_EXLOCK = 0x10000000;
  5715. exports.READONLY = fs.constants.O_RDONLY;
  5716. function exists(fsPath) {
  5717. return __awaiter(this, void 0, void 0, function* () {
  5718. try {
  5719. yield exports.stat(fsPath);
  5720. }
  5721. catch (err) {
  5722. if (err.code === 'ENOENT') {
  5723. return false;
  5724. }
  5725. throw err;
  5726. }
  5727. return true;
  5728. });
  5729. }
  5730. exports.exists = exists;
  5731. function isDirectory(fsPath, useStat = false) {
  5732. return __awaiter(this, void 0, void 0, function* () {
  5733. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  5734. return stats.isDirectory();
  5735. });
  5736. }
  5737. exports.isDirectory = isDirectory;
  5738. /**
  5739. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  5740. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  5741. */
  5742. function isRooted(p) {
  5743. p = normalizeSeparators(p);
  5744. if (!p) {
  5745. throw new Error('isRooted() parameter "p" cannot be empty');
  5746. }
  5747. if (exports.IS_WINDOWS) {
  5748. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  5749. ); // e.g. C: or C:\hello
  5750. }
  5751. return p.startsWith('/');
  5752. }
  5753. exports.isRooted = isRooted;
  5754. /**
  5755. * Best effort attempt to determine whether a file exists and is executable.
  5756. * @param filePath file path to check
  5757. * @param extensions additional file extensions to try
  5758. * @return if file exists and is executable, returns the file path. otherwise empty string.
  5759. */
  5760. function tryGetExecutablePath(filePath, extensions) {
  5761. return __awaiter(this, void 0, void 0, function* () {
  5762. let stats = undefined;
  5763. try {
  5764. // test file exists
  5765. stats = yield exports.stat(filePath);
  5766. }
  5767. catch (err) {
  5768. if (err.code !== 'ENOENT') {
  5769. // eslint-disable-next-line no-console
  5770. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5771. }
  5772. }
  5773. if (stats && stats.isFile()) {
  5774. if (exports.IS_WINDOWS) {
  5775. // on Windows, test for valid extension
  5776. const upperExt = path.extname(filePath).toUpperCase();
  5777. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  5778. return filePath;
  5779. }
  5780. }
  5781. else {
  5782. if (isUnixExecutable(stats)) {
  5783. return filePath;
  5784. }
  5785. }
  5786. }
  5787. // try each extension
  5788. const originalFilePath = filePath;
  5789. for (const extension of extensions) {
  5790. filePath = originalFilePath + extension;
  5791. stats = undefined;
  5792. try {
  5793. stats = yield exports.stat(filePath);
  5794. }
  5795. catch (err) {
  5796. if (err.code !== 'ENOENT') {
  5797. // eslint-disable-next-line no-console
  5798. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5799. }
  5800. }
  5801. if (stats && stats.isFile()) {
  5802. if (exports.IS_WINDOWS) {
  5803. // preserve the case of the actual file (since an extension was appended)
  5804. try {
  5805. const directory = path.dirname(filePath);
  5806. const upperName = path.basename(filePath).toUpperCase();
  5807. for (const actualName of yield exports.readdir(directory)) {
  5808. if (upperName === actualName.toUpperCase()) {
  5809. filePath = path.join(directory, actualName);
  5810. break;
  5811. }
  5812. }
  5813. }
  5814. catch (err) {
  5815. // eslint-disable-next-line no-console
  5816. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  5817. }
  5818. return filePath;
  5819. }
  5820. else {
  5821. if (isUnixExecutable(stats)) {
  5822. return filePath;
  5823. }
  5824. }
  5825. }
  5826. }
  5827. return '';
  5828. });
  5829. }
  5830. exports.tryGetExecutablePath = tryGetExecutablePath;
  5831. function normalizeSeparators(p) {
  5832. p = p || '';
  5833. if (exports.IS_WINDOWS) {
  5834. // convert slashes on Windows
  5835. p = p.replace(/\//g, '\\');
  5836. // remove redundant slashes
  5837. return p.replace(/\\\\+/g, '\\');
  5838. }
  5839. // remove redundant slashes
  5840. return p.replace(/\/\/+/g, '/');
  5841. }
  5842. // on Mac/Linux, test the execute bit
  5843. // R W X R W X R W X
  5844. // 256 128 64 32 16 8 4 2 1
  5845. function isUnixExecutable(stats) {
  5846. return ((stats.mode & 1) > 0 ||
  5847. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  5848. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  5849. }
  5850. // Get the path of cmd.exe in windows
  5851. function getCmdPath() {
  5852. var _a;
  5853. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  5854. }
  5855. exports.getCmdPath = getCmdPath;
  5856. //# sourceMappingURL=io-util.js.map
  5857. /***/ }),
  5858. /***/ 7436:
  5859. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5860. "use strict";
  5861. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5862. if (k2 === undefined) k2 = k;
  5863. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5864. }) : (function(o, m, k, k2) {
  5865. if (k2 === undefined) k2 = k;
  5866. o[k2] = m[k];
  5867. }));
  5868. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5869. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5870. }) : function(o, v) {
  5871. o["default"] = v;
  5872. });
  5873. var __importStar = (this && this.__importStar) || function (mod) {
  5874. if (mod && mod.__esModule) return mod;
  5875. var result = {};
  5876. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5877. __setModuleDefault(result, mod);
  5878. return result;
  5879. };
  5880. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5881. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5882. return new (P || (P = Promise))(function (resolve, reject) {
  5883. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5884. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5885. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5886. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5887. });
  5888. };
  5889. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5890. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  5891. const assert_1 = __nccwpck_require__(9491);
  5892. const path = __importStar(__nccwpck_require__(1017));
  5893. const ioUtil = __importStar(__nccwpck_require__(1962));
  5894. /**
  5895. * Copies a file or folder.
  5896. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  5897. *
  5898. * @param source source path
  5899. * @param dest destination path
  5900. * @param options optional. See CopyOptions.
  5901. */
  5902. function cp(source, dest, options = {}) {
  5903. return __awaiter(this, void 0, void 0, function* () {
  5904. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  5905. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  5906. // Dest is an existing file, but not forcing
  5907. if (destStat && destStat.isFile() && !force) {
  5908. return;
  5909. }
  5910. // If dest is an existing directory, should copy inside.
  5911. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  5912. ? path.join(dest, path.basename(source))
  5913. : dest;
  5914. if (!(yield ioUtil.exists(source))) {
  5915. throw new Error(`no such file or directory: ${source}`);
  5916. }
  5917. const sourceStat = yield ioUtil.stat(source);
  5918. if (sourceStat.isDirectory()) {
  5919. if (!recursive) {
  5920. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  5921. }
  5922. else {
  5923. yield cpDirRecursive(source, newDest, 0, force);
  5924. }
  5925. }
  5926. else {
  5927. if (path.relative(source, newDest) === '') {
  5928. // a file cannot be copied to itself
  5929. throw new Error(`'${newDest}' and '${source}' are the same file`);
  5930. }
  5931. yield copyFile(source, newDest, force);
  5932. }
  5933. });
  5934. }
  5935. exports.cp = cp;
  5936. /**
  5937. * Moves a path.
  5938. *
  5939. * @param source source path
  5940. * @param dest destination path
  5941. * @param options optional. See MoveOptions.
  5942. */
  5943. function mv(source, dest, options = {}) {
  5944. return __awaiter(this, void 0, void 0, function* () {
  5945. if (yield ioUtil.exists(dest)) {
  5946. let destExists = true;
  5947. if (yield ioUtil.isDirectory(dest)) {
  5948. // If dest is directory copy src into dest
  5949. dest = path.join(dest, path.basename(source));
  5950. destExists = yield ioUtil.exists(dest);
  5951. }
  5952. if (destExists) {
  5953. if (options.force == null || options.force) {
  5954. yield rmRF(dest);
  5955. }
  5956. else {
  5957. throw new Error('Destination already exists');
  5958. }
  5959. }
  5960. }
  5961. yield mkdirP(path.dirname(dest));
  5962. yield ioUtil.rename(source, dest);
  5963. });
  5964. }
  5965. exports.mv = mv;
  5966. /**
  5967. * Remove a path recursively with force
  5968. *
  5969. * @param inputPath path to remove
  5970. */
  5971. function rmRF(inputPath) {
  5972. return __awaiter(this, void 0, void 0, function* () {
  5973. if (ioUtil.IS_WINDOWS) {
  5974. // Check for invalid characters
  5975. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  5976. if (/[*"<>|]/.test(inputPath)) {
  5977. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  5978. }
  5979. }
  5980. try {
  5981. // note if path does not exist, error is silent
  5982. yield ioUtil.rm(inputPath, {
  5983. force: true,
  5984. maxRetries: 3,
  5985. recursive: true,
  5986. retryDelay: 300
  5987. });
  5988. }
  5989. catch (err) {
  5990. throw new Error(`File was unable to be removed ${err}`);
  5991. }
  5992. });
  5993. }
  5994. exports.rmRF = rmRF;
  5995. /**
  5996. * Make a directory. Creates the full path with folders in between
  5997. * Will throw if it fails
  5998. *
  5999. * @param fsPath path to create
  6000. * @returns Promise<void>
  6001. */
  6002. function mkdirP(fsPath) {
  6003. return __awaiter(this, void 0, void 0, function* () {
  6004. assert_1.ok(fsPath, 'a path argument must be provided');
  6005. yield ioUtil.mkdir(fsPath, { recursive: true });
  6006. });
  6007. }
  6008. exports.mkdirP = mkdirP;
  6009. /**
  6010. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6011. * If you check and the tool does not exist, it will throw.
  6012. *
  6013. * @param tool name of the tool
  6014. * @param check whether to check if tool exists
  6015. * @returns Promise<string> path to tool
  6016. */
  6017. function which(tool, check) {
  6018. return __awaiter(this, void 0, void 0, function* () {
  6019. if (!tool) {
  6020. throw new Error("parameter 'tool' is required");
  6021. }
  6022. // recursive when check=true
  6023. if (check) {
  6024. const result = yield which(tool, false);
  6025. if (!result) {
  6026. if (ioUtil.IS_WINDOWS) {
  6027. 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.`);
  6028. }
  6029. else {
  6030. 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.`);
  6031. }
  6032. }
  6033. return result;
  6034. }
  6035. const matches = yield findInPath(tool);
  6036. if (matches && matches.length > 0) {
  6037. return matches[0];
  6038. }
  6039. return '';
  6040. });
  6041. }
  6042. exports.which = which;
  6043. /**
  6044. * Returns a list of all occurrences of the given tool on the system path.
  6045. *
  6046. * @returns Promise<string[]> the paths of the tool
  6047. */
  6048. function findInPath(tool) {
  6049. return __awaiter(this, void 0, void 0, function* () {
  6050. if (!tool) {
  6051. throw new Error("parameter 'tool' is required");
  6052. }
  6053. // build the list of extensions to try
  6054. const extensions = [];
  6055. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6056. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6057. if (extension) {
  6058. extensions.push(extension);
  6059. }
  6060. }
  6061. }
  6062. // if it's rooted, return it if exists. otherwise return empty.
  6063. if (ioUtil.isRooted(tool)) {
  6064. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6065. if (filePath) {
  6066. return [filePath];
  6067. }
  6068. return [];
  6069. }
  6070. // if any path separators, return empty
  6071. if (tool.includes(path.sep)) {
  6072. return [];
  6073. }
  6074. // build the list of directories
  6075. //
  6076. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6077. // it feels like we should not do this. Checking the current directory seems like more of a use
  6078. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6079. // across platforms.
  6080. const directories = [];
  6081. if (process.env.PATH) {
  6082. for (const p of process.env.PATH.split(path.delimiter)) {
  6083. if (p) {
  6084. directories.push(p);
  6085. }
  6086. }
  6087. }
  6088. // find all matches
  6089. const matches = [];
  6090. for (const directory of directories) {
  6091. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6092. if (filePath) {
  6093. matches.push(filePath);
  6094. }
  6095. }
  6096. return matches;
  6097. });
  6098. }
  6099. exports.findInPath = findInPath;
  6100. function readCopyOptions(options) {
  6101. const force = options.force == null ? true : options.force;
  6102. const recursive = Boolean(options.recursive);
  6103. const copySourceDirectory = options.copySourceDirectory == null
  6104. ? true
  6105. : Boolean(options.copySourceDirectory);
  6106. return { force, recursive, copySourceDirectory };
  6107. }
  6108. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6109. return __awaiter(this, void 0, void 0, function* () {
  6110. // Ensure there is not a run away recursive copy
  6111. if (currentDepth >= 255)
  6112. return;
  6113. currentDepth++;
  6114. yield mkdirP(destDir);
  6115. const files = yield ioUtil.readdir(sourceDir);
  6116. for (const fileName of files) {
  6117. const srcFile = `${sourceDir}/${fileName}`;
  6118. const destFile = `${destDir}/${fileName}`;
  6119. const srcFileStat = yield ioUtil.lstat(srcFile);
  6120. if (srcFileStat.isDirectory()) {
  6121. // Recurse
  6122. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6123. }
  6124. else {
  6125. yield copyFile(srcFile, destFile, force);
  6126. }
  6127. }
  6128. // Change the mode for the newly created directory
  6129. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6130. });
  6131. }
  6132. // Buffered file copy
  6133. function copyFile(srcFile, destFile, force) {
  6134. return __awaiter(this, void 0, void 0, function* () {
  6135. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6136. // unlink/re-link it
  6137. try {
  6138. yield ioUtil.lstat(destFile);
  6139. yield ioUtil.unlink(destFile);
  6140. }
  6141. catch (e) {
  6142. // Try to override file permission
  6143. if (e.code === 'EPERM') {
  6144. yield ioUtil.chmod(destFile, '0666');
  6145. yield ioUtil.unlink(destFile);
  6146. }
  6147. // other errors = it doesn't exist, no work to do
  6148. }
  6149. // Copy over symlink
  6150. const symlinkFull = yield ioUtil.readlink(srcFile);
  6151. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6152. }
  6153. else if (!(yield ioUtil.exists(destFile)) || force) {
  6154. yield ioUtil.copyFile(srcFile, destFile);
  6155. }
  6156. });
  6157. }
  6158. //# sourceMappingURL=io.js.map
  6159. /***/ }),
  6160. /***/ 2473:
  6161. /***/ (function(module, exports, __nccwpck_require__) {
  6162. "use strict";
  6163. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6164. if (k2 === undefined) k2 = k;
  6165. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6166. }) : (function(o, m, k, k2) {
  6167. if (k2 === undefined) k2 = k;
  6168. o[k2] = m[k];
  6169. }));
  6170. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6171. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6172. }) : function(o, v) {
  6173. o["default"] = v;
  6174. });
  6175. var __importStar = (this && this.__importStar) || function (mod) {
  6176. if (mod && mod.__esModule) return mod;
  6177. var result = {};
  6178. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6179. __setModuleDefault(result, mod);
  6180. return result;
  6181. };
  6182. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6183. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6184. return new (P || (P = Promise))(function (resolve, reject) {
  6185. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6186. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6187. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6188. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6189. });
  6190. };
  6191. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6192. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6193. const semver = __importStar(__nccwpck_require__(5911));
  6194. const core_1 = __nccwpck_require__(2186);
  6195. // needs to be require for core node modules to be mocked
  6196. /* eslint @typescript-eslint/no-require-imports: 0 */
  6197. const os = __nccwpck_require__(2037);
  6198. const cp = __nccwpck_require__(2081);
  6199. const fs = __nccwpck_require__(7147);
  6200. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6201. return __awaiter(this, void 0, void 0, function* () {
  6202. const platFilter = os.platform();
  6203. let result;
  6204. let match;
  6205. let file;
  6206. for (const candidate of candidates) {
  6207. const version = candidate.version;
  6208. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6209. if (semver.satisfies(version, versionSpec) &&
  6210. (!stable || candidate.stable === stable)) {
  6211. file = candidate.files.find(item => {
  6212. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6213. let chk = item.arch === archFilter && item.platform === platFilter;
  6214. if (chk && item.platform_version) {
  6215. const osVersion = module.exports._getOsVersion();
  6216. if (osVersion === item.platform_version) {
  6217. chk = true;
  6218. }
  6219. else {
  6220. chk = semver.satisfies(osVersion, item.platform_version);
  6221. }
  6222. }
  6223. return chk;
  6224. });
  6225. if (file) {
  6226. core_1.debug(`matched ${candidate.version}`);
  6227. match = candidate;
  6228. break;
  6229. }
  6230. }
  6231. }
  6232. if (match && file) {
  6233. // clone since we're mutating the file list to be only the file that matches
  6234. result = Object.assign({}, match);
  6235. result.files = [file];
  6236. }
  6237. return result;
  6238. });
  6239. }
  6240. exports._findMatch = _findMatch;
  6241. function _getOsVersion() {
  6242. // TODO: add windows and other linux, arm variants
  6243. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6244. const plat = os.platform();
  6245. let version = '';
  6246. if (plat === 'darwin') {
  6247. version = cp.execSync('sw_vers -productVersion').toString();
  6248. }
  6249. else if (plat === 'linux') {
  6250. // lsb_release process not in some containers, readfile
  6251. // Run cat /etc/lsb-release
  6252. // DISTRIB_ID=Ubuntu
  6253. // DISTRIB_RELEASE=18.04
  6254. // DISTRIB_CODENAME=bionic
  6255. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6256. const lsbContents = module.exports._readLinuxVersionFile();
  6257. if (lsbContents) {
  6258. const lines = lsbContents.split('\n');
  6259. for (const line of lines) {
  6260. const parts = line.split('=');
  6261. if (parts.length === 2 &&
  6262. (parts[0].trim() === 'VERSION_ID' ||
  6263. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6264. version = parts[1]
  6265. .trim()
  6266. .replace(/^"/, '')
  6267. .replace(/"$/, '');
  6268. break;
  6269. }
  6270. }
  6271. }
  6272. }
  6273. return version;
  6274. }
  6275. exports._getOsVersion = _getOsVersion;
  6276. function _readLinuxVersionFile() {
  6277. const lsbReleaseFile = '/etc/lsb-release';
  6278. const osReleaseFile = '/etc/os-release';
  6279. let contents = '';
  6280. if (fs.existsSync(lsbReleaseFile)) {
  6281. contents = fs.readFileSync(lsbReleaseFile).toString();
  6282. }
  6283. else if (fs.existsSync(osReleaseFile)) {
  6284. contents = fs.readFileSync(osReleaseFile).toString();
  6285. }
  6286. return contents;
  6287. }
  6288. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6289. //# sourceMappingURL=manifest.js.map
  6290. /***/ }),
  6291. /***/ 8279:
  6292. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6293. "use strict";
  6294. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6295. if (k2 === undefined) k2 = k;
  6296. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6297. }) : (function(o, m, k, k2) {
  6298. if (k2 === undefined) k2 = k;
  6299. o[k2] = m[k];
  6300. }));
  6301. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6302. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6303. }) : function(o, v) {
  6304. o["default"] = v;
  6305. });
  6306. var __importStar = (this && this.__importStar) || function (mod) {
  6307. if (mod && mod.__esModule) return mod;
  6308. var result = {};
  6309. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6310. __setModuleDefault(result, mod);
  6311. return result;
  6312. };
  6313. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6314. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6315. return new (P || (P = Promise))(function (resolve, reject) {
  6316. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6317. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6318. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6319. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6320. });
  6321. };
  6322. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6323. exports.RetryHelper = void 0;
  6324. const core = __importStar(__nccwpck_require__(2186));
  6325. /**
  6326. * Internal class for retries
  6327. */
  6328. class RetryHelper {
  6329. constructor(maxAttempts, minSeconds, maxSeconds) {
  6330. if (maxAttempts < 1) {
  6331. throw new Error('max attempts should be greater than or equal to 1');
  6332. }
  6333. this.maxAttempts = maxAttempts;
  6334. this.minSeconds = Math.floor(minSeconds);
  6335. this.maxSeconds = Math.floor(maxSeconds);
  6336. if (this.minSeconds > this.maxSeconds) {
  6337. throw new Error('min seconds should be less than or equal to max seconds');
  6338. }
  6339. }
  6340. execute(action, isRetryable) {
  6341. return __awaiter(this, void 0, void 0, function* () {
  6342. let attempt = 1;
  6343. while (attempt < this.maxAttempts) {
  6344. // Try
  6345. try {
  6346. return yield action();
  6347. }
  6348. catch (err) {
  6349. if (isRetryable && !isRetryable(err)) {
  6350. throw err;
  6351. }
  6352. core.info(err.message);
  6353. }
  6354. // Sleep
  6355. const seconds = this.getSleepAmount();
  6356. core.info(`Waiting ${seconds} seconds before trying again`);
  6357. yield this.sleep(seconds);
  6358. attempt++;
  6359. }
  6360. // Last attempt
  6361. return yield action();
  6362. });
  6363. }
  6364. getSleepAmount() {
  6365. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6366. this.minSeconds);
  6367. }
  6368. sleep(seconds) {
  6369. return __awaiter(this, void 0, void 0, function* () {
  6370. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6371. });
  6372. }
  6373. }
  6374. exports.RetryHelper = RetryHelper;
  6375. //# sourceMappingURL=retry-helper.js.map
  6376. /***/ }),
  6377. /***/ 7784:
  6378. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6379. "use strict";
  6380. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6381. if (k2 === undefined) k2 = k;
  6382. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6383. }) : (function(o, m, k, k2) {
  6384. if (k2 === undefined) k2 = k;
  6385. o[k2] = m[k];
  6386. }));
  6387. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6388. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6389. }) : function(o, v) {
  6390. o["default"] = v;
  6391. });
  6392. var __importStar = (this && this.__importStar) || function (mod) {
  6393. if (mod && mod.__esModule) return mod;
  6394. var result = {};
  6395. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6396. __setModuleDefault(result, mod);
  6397. return result;
  6398. };
  6399. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6400. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6401. return new (P || (P = Promise))(function (resolve, reject) {
  6402. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6403. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6404. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6405. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6406. });
  6407. };
  6408. var __importDefault = (this && this.__importDefault) || function (mod) {
  6409. return (mod && mod.__esModule) ? mod : { "default": mod };
  6410. };
  6411. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6412. 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;
  6413. const core = __importStar(__nccwpck_require__(2186));
  6414. const io = __importStar(__nccwpck_require__(7436));
  6415. const fs = __importStar(__nccwpck_require__(7147));
  6416. const mm = __importStar(__nccwpck_require__(2473));
  6417. const os = __importStar(__nccwpck_require__(2037));
  6418. const path = __importStar(__nccwpck_require__(1017));
  6419. const httpm = __importStar(__nccwpck_require__(6255));
  6420. const semver = __importStar(__nccwpck_require__(5911));
  6421. const stream = __importStar(__nccwpck_require__(2781));
  6422. const util = __importStar(__nccwpck_require__(3837));
  6423. const assert_1 = __nccwpck_require__(9491);
  6424. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6425. const exec_1 = __nccwpck_require__(1514);
  6426. const retry_helper_1 = __nccwpck_require__(8279);
  6427. class HTTPError extends Error {
  6428. constructor(httpStatusCode) {
  6429. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6430. this.httpStatusCode = httpStatusCode;
  6431. Object.setPrototypeOf(this, new.target.prototype);
  6432. }
  6433. }
  6434. exports.HTTPError = HTTPError;
  6435. const IS_WINDOWS = process.platform === 'win32';
  6436. const IS_MAC = process.platform === 'darwin';
  6437. const userAgent = 'actions/tool-cache';
  6438. /**
  6439. * Download a tool from an url and stream it into a file
  6440. *
  6441. * @param url url of tool to download
  6442. * @param dest path to download tool
  6443. * @param auth authorization header
  6444. * @param headers other headers
  6445. * @returns path to downloaded tool
  6446. */
  6447. function downloadTool(url, dest, auth, headers) {
  6448. return __awaiter(this, void 0, void 0, function* () {
  6449. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6450. yield io.mkdirP(path.dirname(dest));
  6451. core.debug(`Downloading ${url}`);
  6452. core.debug(`Destination ${dest}`);
  6453. const maxAttempts = 3;
  6454. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6455. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6456. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6457. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6458. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6459. }), (err) => {
  6460. if (err instanceof HTTPError && err.httpStatusCode) {
  6461. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6462. if (err.httpStatusCode < 500 &&
  6463. err.httpStatusCode !== 408 &&
  6464. err.httpStatusCode !== 429) {
  6465. return false;
  6466. }
  6467. }
  6468. // Otherwise retry
  6469. return true;
  6470. });
  6471. });
  6472. }
  6473. exports.downloadTool = downloadTool;
  6474. function downloadToolAttempt(url, dest, auth, headers) {
  6475. return __awaiter(this, void 0, void 0, function* () {
  6476. if (fs.existsSync(dest)) {
  6477. throw new Error(`Destination file path ${dest} already exists`);
  6478. }
  6479. // Get the response headers
  6480. const http = new httpm.HttpClient(userAgent, [], {
  6481. allowRetries: false
  6482. });
  6483. if (auth) {
  6484. core.debug('set auth');
  6485. if (headers === undefined) {
  6486. headers = {};
  6487. }
  6488. headers.authorization = auth;
  6489. }
  6490. const response = yield http.get(url, headers);
  6491. if (response.message.statusCode !== 200) {
  6492. const err = new HTTPError(response.message.statusCode);
  6493. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6494. throw err;
  6495. }
  6496. // Download the response body
  6497. const pipeline = util.promisify(stream.pipeline);
  6498. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6499. const readStream = responseMessageFactory();
  6500. let succeeded = false;
  6501. try {
  6502. yield pipeline(readStream, fs.createWriteStream(dest));
  6503. core.debug('download complete');
  6504. succeeded = true;
  6505. return dest;
  6506. }
  6507. finally {
  6508. // Error, delete dest before retry
  6509. if (!succeeded) {
  6510. core.debug('download failed');
  6511. try {
  6512. yield io.rmRF(dest);
  6513. }
  6514. catch (err) {
  6515. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6516. }
  6517. }
  6518. }
  6519. });
  6520. }
  6521. /**
  6522. * Extract a .7z file
  6523. *
  6524. * @param file path to the .7z file
  6525. * @param dest destination directory. Optional.
  6526. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6527. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6528. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6529. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6530. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6531. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6532. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6533. * to 7zr.exe can be pass to this function.
  6534. * @returns path to the destination directory
  6535. */
  6536. function extract7z(file, dest, _7zPath) {
  6537. return __awaiter(this, void 0, void 0, function* () {
  6538. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6539. assert_1.ok(file, 'parameter "file" is required');
  6540. dest = yield _createExtractFolder(dest);
  6541. const originalCwd = process.cwd();
  6542. process.chdir(dest);
  6543. if (_7zPath) {
  6544. try {
  6545. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6546. const args = [
  6547. 'x',
  6548. logLevel,
  6549. '-bd',
  6550. '-sccUTF-8',
  6551. file
  6552. ];
  6553. const options = {
  6554. silent: true
  6555. };
  6556. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6557. }
  6558. finally {
  6559. process.chdir(originalCwd);
  6560. }
  6561. }
  6562. else {
  6563. const escapedScript = path
  6564. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6565. .replace(/'/g, "''")
  6566. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6567. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6568. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6569. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6570. const args = [
  6571. '-NoLogo',
  6572. '-Sta',
  6573. '-NoProfile',
  6574. '-NonInteractive',
  6575. '-ExecutionPolicy',
  6576. 'Unrestricted',
  6577. '-Command',
  6578. command
  6579. ];
  6580. const options = {
  6581. silent: true
  6582. };
  6583. try {
  6584. const powershellPath = yield io.which('powershell', true);
  6585. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6586. }
  6587. finally {
  6588. process.chdir(originalCwd);
  6589. }
  6590. }
  6591. return dest;
  6592. });
  6593. }
  6594. exports.extract7z = extract7z;
  6595. /**
  6596. * Extract a compressed tar archive
  6597. *
  6598. * @param file path to the tar
  6599. * @param dest destination directory. Optional.
  6600. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6601. * @returns path to the destination directory
  6602. */
  6603. function extractTar(file, dest, flags = 'xz') {
  6604. return __awaiter(this, void 0, void 0, function* () {
  6605. if (!file) {
  6606. throw new Error("parameter 'file' is required");
  6607. }
  6608. // Create dest
  6609. dest = yield _createExtractFolder(dest);
  6610. // Determine whether GNU tar
  6611. core.debug('Checking tar --version');
  6612. let versionOutput = '';
  6613. yield exec_1.exec('tar --version', [], {
  6614. ignoreReturnCode: true,
  6615. silent: true,
  6616. listeners: {
  6617. stdout: (data) => (versionOutput += data.toString()),
  6618. stderr: (data) => (versionOutput += data.toString())
  6619. }
  6620. });
  6621. core.debug(versionOutput.trim());
  6622. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6623. // Initialize args
  6624. let args;
  6625. if (flags instanceof Array) {
  6626. args = flags;
  6627. }
  6628. else {
  6629. args = [flags];
  6630. }
  6631. if (core.isDebug() && !flags.includes('v')) {
  6632. args.push('-v');
  6633. }
  6634. let destArg = dest;
  6635. let fileArg = file;
  6636. if (IS_WINDOWS && isGnuTar) {
  6637. args.push('--force-local');
  6638. destArg = dest.replace(/\\/g, '/');
  6639. // Technically only the dest needs to have `/` but for aesthetic consistency
  6640. // convert slashes in the file arg too.
  6641. fileArg = file.replace(/\\/g, '/');
  6642. }
  6643. if (isGnuTar) {
  6644. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6645. args.push('--warning=no-unknown-keyword');
  6646. args.push('--overwrite');
  6647. }
  6648. args.push('-C', destArg, '-f', fileArg);
  6649. yield exec_1.exec(`tar`, args);
  6650. return dest;
  6651. });
  6652. }
  6653. exports.extractTar = extractTar;
  6654. /**
  6655. * Extract a xar compatible archive
  6656. *
  6657. * @param file path to the archive
  6658. * @param dest destination directory. Optional.
  6659. * @param flags flags for the xar. Optional.
  6660. * @returns path to the destination directory
  6661. */
  6662. function extractXar(file, dest, flags = []) {
  6663. return __awaiter(this, void 0, void 0, function* () {
  6664. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6665. assert_1.ok(file, 'parameter "file" is required');
  6666. dest = yield _createExtractFolder(dest);
  6667. let args;
  6668. if (flags instanceof Array) {
  6669. args = flags;
  6670. }
  6671. else {
  6672. args = [flags];
  6673. }
  6674. args.push('-x', '-C', dest, '-f', file);
  6675. if (core.isDebug()) {
  6676. args.push('-v');
  6677. }
  6678. const xarPath = yield io.which('xar', true);
  6679. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6680. return dest;
  6681. });
  6682. }
  6683. exports.extractXar = extractXar;
  6684. /**
  6685. * Extract a zip
  6686. *
  6687. * @param file path to the zip
  6688. * @param dest destination directory. Optional.
  6689. * @returns path to the destination directory
  6690. */
  6691. function extractZip(file, dest) {
  6692. return __awaiter(this, void 0, void 0, function* () {
  6693. if (!file) {
  6694. throw new Error("parameter 'file' is required");
  6695. }
  6696. dest = yield _createExtractFolder(dest);
  6697. if (IS_WINDOWS) {
  6698. yield extractZipWin(file, dest);
  6699. }
  6700. else {
  6701. yield extractZipNix(file, dest);
  6702. }
  6703. return dest;
  6704. });
  6705. }
  6706. exports.extractZip = extractZip;
  6707. function extractZipWin(file, dest) {
  6708. return __awaiter(this, void 0, void 0, function* () {
  6709. // build the powershell command
  6710. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6711. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6712. const pwshPath = yield io.which('pwsh', false);
  6713. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6714. //and the -Force flag for Expand-Archive as a fallback
  6715. if (pwshPath) {
  6716. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6717. const pwshCommand = [
  6718. `$ErrorActionPreference = 'Stop' ;`,
  6719. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6720. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  6721. `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 $_ } } ;`
  6722. ].join(' ');
  6723. const args = [
  6724. '-NoLogo',
  6725. '-NoProfile',
  6726. '-NonInteractive',
  6727. '-ExecutionPolicy',
  6728. 'Unrestricted',
  6729. '-Command',
  6730. pwshCommand
  6731. ];
  6732. core.debug(`Using pwsh at path: ${pwshPath}`);
  6733. yield exec_1.exec(`"${pwshPath}"`, args);
  6734. }
  6735. else {
  6736. const powershellCommand = [
  6737. `$ErrorActionPreference = 'Stop' ;`,
  6738. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  6739. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  6740. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  6741. ].join(' ');
  6742. const args = [
  6743. '-NoLogo',
  6744. '-Sta',
  6745. '-NoProfile',
  6746. '-NonInteractive',
  6747. '-ExecutionPolicy',
  6748. 'Unrestricted',
  6749. '-Command',
  6750. powershellCommand
  6751. ];
  6752. const powershellPath = yield io.which('powershell', true);
  6753. core.debug(`Using powershell at path: ${powershellPath}`);
  6754. yield exec_1.exec(`"${powershellPath}"`, args);
  6755. }
  6756. });
  6757. }
  6758. function extractZipNix(file, dest) {
  6759. return __awaiter(this, void 0, void 0, function* () {
  6760. const unzipPath = yield io.which('unzip', true);
  6761. const args = [file];
  6762. if (!core.isDebug()) {
  6763. args.unshift('-q');
  6764. }
  6765. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  6766. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  6767. });
  6768. }
  6769. /**
  6770. * Caches a directory and installs it into the tool cacheDir
  6771. *
  6772. * @param sourceDir the directory to cache into tools
  6773. * @param tool tool name
  6774. * @param version version of the tool. semver format
  6775. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6776. */
  6777. function cacheDir(sourceDir, tool, version, arch) {
  6778. return __awaiter(this, void 0, void 0, function* () {
  6779. version = semver.clean(version) || version;
  6780. arch = arch || os.arch();
  6781. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6782. core.debug(`source dir: ${sourceDir}`);
  6783. if (!fs.statSync(sourceDir).isDirectory()) {
  6784. throw new Error('sourceDir is not a directory');
  6785. }
  6786. // Create the tool dir
  6787. const destPath = yield _createToolPath(tool, version, arch);
  6788. // copy each child item. do not move. move can fail on Windows
  6789. // due to anti-virus software having an open handle on a file.
  6790. for (const itemName of fs.readdirSync(sourceDir)) {
  6791. const s = path.join(sourceDir, itemName);
  6792. yield io.cp(s, destPath, { recursive: true });
  6793. }
  6794. // write .complete
  6795. _completeToolPath(tool, version, arch);
  6796. return destPath;
  6797. });
  6798. }
  6799. exports.cacheDir = cacheDir;
  6800. /**
  6801. * Caches a downloaded file (GUID) and installs it
  6802. * into the tool cache with a given targetName
  6803. *
  6804. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  6805. * @param targetFile the name of the file name in the tools directory
  6806. * @param tool tool name
  6807. * @param version version of the tool. semver format
  6808. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6809. */
  6810. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  6811. return __awaiter(this, void 0, void 0, function* () {
  6812. version = semver.clean(version) || version;
  6813. arch = arch || os.arch();
  6814. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6815. core.debug(`source file: ${sourceFile}`);
  6816. if (!fs.statSync(sourceFile).isFile()) {
  6817. throw new Error('sourceFile is not a file');
  6818. }
  6819. // create the tool dir
  6820. const destFolder = yield _createToolPath(tool, version, arch);
  6821. // copy instead of move. move can fail on Windows due to
  6822. // anti-virus software having an open handle on a file.
  6823. const destPath = path.join(destFolder, targetFile);
  6824. core.debug(`destination file ${destPath}`);
  6825. yield io.cp(sourceFile, destPath);
  6826. // write .complete
  6827. _completeToolPath(tool, version, arch);
  6828. return destFolder;
  6829. });
  6830. }
  6831. exports.cacheFile = cacheFile;
  6832. /**
  6833. * Finds the path to a tool version in the local installed tool cache
  6834. *
  6835. * @param toolName name of the tool
  6836. * @param versionSpec version of the tool
  6837. * @param arch optional arch. defaults to arch of computer
  6838. */
  6839. function find(toolName, versionSpec, arch) {
  6840. if (!toolName) {
  6841. throw new Error('toolName parameter is required');
  6842. }
  6843. if (!versionSpec) {
  6844. throw new Error('versionSpec parameter is required');
  6845. }
  6846. arch = arch || os.arch();
  6847. // attempt to resolve an explicit version
  6848. if (!isExplicitVersion(versionSpec)) {
  6849. const localVersions = findAllVersions(toolName, arch);
  6850. const match = evaluateVersions(localVersions, versionSpec);
  6851. versionSpec = match;
  6852. }
  6853. // check for the explicit version in the cache
  6854. let toolPath = '';
  6855. if (versionSpec) {
  6856. versionSpec = semver.clean(versionSpec) || '';
  6857. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  6858. core.debug(`checking cache: ${cachePath}`);
  6859. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  6860. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  6861. toolPath = cachePath;
  6862. }
  6863. else {
  6864. core.debug('not found');
  6865. }
  6866. }
  6867. return toolPath;
  6868. }
  6869. exports.find = find;
  6870. /**
  6871. * Finds the paths to all versions of a tool that are installed in the local tool cache
  6872. *
  6873. * @param toolName name of the tool
  6874. * @param arch optional arch. defaults to arch of computer
  6875. */
  6876. function findAllVersions(toolName, arch) {
  6877. const versions = [];
  6878. arch = arch || os.arch();
  6879. const toolPath = path.join(_getCacheDirectory(), toolName);
  6880. if (fs.existsSync(toolPath)) {
  6881. const children = fs.readdirSync(toolPath);
  6882. for (const child of children) {
  6883. if (isExplicitVersion(child)) {
  6884. const fullPath = path.join(toolPath, child, arch || '');
  6885. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  6886. versions.push(child);
  6887. }
  6888. }
  6889. }
  6890. }
  6891. return versions;
  6892. }
  6893. exports.findAllVersions = findAllVersions;
  6894. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  6895. return __awaiter(this, void 0, void 0, function* () {
  6896. let releases = [];
  6897. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  6898. const http = new httpm.HttpClient('tool-cache');
  6899. const headers = {};
  6900. if (auth) {
  6901. core.debug('set auth');
  6902. headers.authorization = auth;
  6903. }
  6904. const response = yield http.getJson(treeUrl, headers);
  6905. if (!response.result) {
  6906. return releases;
  6907. }
  6908. let manifestUrl = '';
  6909. for (const item of response.result.tree) {
  6910. if (item.path === 'versions-manifest.json') {
  6911. manifestUrl = item.url;
  6912. break;
  6913. }
  6914. }
  6915. headers['accept'] = 'application/vnd.github.VERSION.raw';
  6916. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  6917. if (versionsRaw) {
  6918. // shouldn't be needed but protects against invalid json saved with BOM
  6919. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  6920. try {
  6921. releases = JSON.parse(versionsRaw);
  6922. }
  6923. catch (_a) {
  6924. core.debug('Invalid json');
  6925. }
  6926. }
  6927. return releases;
  6928. });
  6929. }
  6930. exports.getManifestFromRepo = getManifestFromRepo;
  6931. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  6932. return __awaiter(this, void 0, void 0, function* () {
  6933. // wrap the internal impl
  6934. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  6935. return match;
  6936. });
  6937. }
  6938. exports.findFromManifest = findFromManifest;
  6939. function _createExtractFolder(dest) {
  6940. return __awaiter(this, void 0, void 0, function* () {
  6941. if (!dest) {
  6942. // create a temp dir
  6943. dest = path.join(_getTempDirectory(), v4_1.default());
  6944. }
  6945. yield io.mkdirP(dest);
  6946. return dest;
  6947. });
  6948. }
  6949. function _createToolPath(tool, version, arch) {
  6950. return __awaiter(this, void 0, void 0, function* () {
  6951. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6952. core.debug(`destination ${folderPath}`);
  6953. const markerPath = `${folderPath}.complete`;
  6954. yield io.rmRF(folderPath);
  6955. yield io.rmRF(markerPath);
  6956. yield io.mkdirP(folderPath);
  6957. return folderPath;
  6958. });
  6959. }
  6960. function _completeToolPath(tool, version, arch) {
  6961. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6962. const markerPath = `${folderPath}.complete`;
  6963. fs.writeFileSync(markerPath, '');
  6964. core.debug('finished caching tool');
  6965. }
  6966. /**
  6967. * Check if version string is explicit
  6968. *
  6969. * @param versionSpec version string to check
  6970. */
  6971. function isExplicitVersion(versionSpec) {
  6972. const c = semver.clean(versionSpec) || '';
  6973. core.debug(`isExplicit: ${c}`);
  6974. const valid = semver.valid(c) != null;
  6975. core.debug(`explicit? ${valid}`);
  6976. return valid;
  6977. }
  6978. exports.isExplicitVersion = isExplicitVersion;
  6979. /**
  6980. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  6981. *
  6982. * @param versions array of versions to evaluate
  6983. * @param versionSpec semantic version spec to satisfy
  6984. */
  6985. function evaluateVersions(versions, versionSpec) {
  6986. let version = '';
  6987. core.debug(`evaluating ${versions.length} versions`);
  6988. versions = versions.sort((a, b) => {
  6989. if (semver.gt(a, b)) {
  6990. return 1;
  6991. }
  6992. return -1;
  6993. });
  6994. for (let i = versions.length - 1; i >= 0; i--) {
  6995. const potential = versions[i];
  6996. const satisfied = semver.satisfies(potential, versionSpec);
  6997. if (satisfied) {
  6998. version = potential;
  6999. break;
  7000. }
  7001. }
  7002. if (version) {
  7003. core.debug(`matched: ${version}`);
  7004. }
  7005. else {
  7006. core.debug('match not found');
  7007. }
  7008. return version;
  7009. }
  7010. exports.evaluateVersions = evaluateVersions;
  7011. /**
  7012. * Gets RUNNER_TOOL_CACHE
  7013. */
  7014. function _getCacheDirectory() {
  7015. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7016. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7017. return cacheDirectory;
  7018. }
  7019. /**
  7020. * Gets RUNNER_TEMP
  7021. */
  7022. function _getTempDirectory() {
  7023. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7024. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7025. return tempDirectory;
  7026. }
  7027. /**
  7028. * Gets a global variable
  7029. */
  7030. function _getGlobal(key, defaultValue) {
  7031. /* eslint-disable @typescript-eslint/no-explicit-any */
  7032. const value = global[key];
  7033. /* eslint-enable @typescript-eslint/no-explicit-any */
  7034. return value !== undefined ? value : defaultValue;
  7035. }
  7036. /**
  7037. * Returns an array of unique values.
  7038. * @param values Values to make unique.
  7039. */
  7040. function _unique(values) {
  7041. return Array.from(new Set(values));
  7042. }
  7043. //# sourceMappingURL=tool-cache.js.map
  7044. /***/ }),
  7045. /***/ 7701:
  7046. /***/ ((module) => {
  7047. /**
  7048. * Convert array of 16 byte values to UUID string format of the form:
  7049. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7050. */
  7051. var byteToHex = [];
  7052. for (var i = 0; i < 256; ++i) {
  7053. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7054. }
  7055. function bytesToUuid(buf, offset) {
  7056. var i = offset || 0;
  7057. var bth = byteToHex;
  7058. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7059. return ([
  7060. bth[buf[i++]], bth[buf[i++]],
  7061. bth[buf[i++]], bth[buf[i++]], '-',
  7062. bth[buf[i++]], bth[buf[i++]], '-',
  7063. bth[buf[i++]], bth[buf[i++]], '-',
  7064. bth[buf[i++]], bth[buf[i++]], '-',
  7065. bth[buf[i++]], bth[buf[i++]],
  7066. bth[buf[i++]], bth[buf[i++]],
  7067. bth[buf[i++]], bth[buf[i++]]
  7068. ]).join('');
  7069. }
  7070. module.exports = bytesToUuid;
  7071. /***/ }),
  7072. /***/ 7269:
  7073. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7074. // Unique ID creation requires a high quality random # generator. In node.js
  7075. // this is pretty straight-forward - we use the crypto API.
  7076. var crypto = __nccwpck_require__(6113);
  7077. module.exports = function nodeRNG() {
  7078. return crypto.randomBytes(16);
  7079. };
  7080. /***/ }),
  7081. /***/ 7468:
  7082. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7083. var rng = __nccwpck_require__(7269);
  7084. var bytesToUuid = __nccwpck_require__(7701);
  7085. function v4(options, buf, offset) {
  7086. var i = buf && offset || 0;
  7087. if (typeof(options) == 'string') {
  7088. buf = options === 'binary' ? new Array(16) : null;
  7089. options = null;
  7090. }
  7091. options = options || {};
  7092. var rnds = options.random || (options.rng || rng)();
  7093. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7094. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7095. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7096. // Copy bytes to buffer, if provided
  7097. if (buf) {
  7098. for (var ii = 0; ii < 16; ++ii) {
  7099. buf[i + ii] = rnds[ii];
  7100. }
  7101. }
  7102. return buf || bytesToUuid(rnds);
  7103. }
  7104. module.exports = v4;
  7105. /***/ }),
  7106. /***/ 334:
  7107. /***/ ((module) => {
  7108. "use strict";
  7109. var __defProp = Object.defineProperty;
  7110. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7111. var __getOwnPropNames = Object.getOwnPropertyNames;
  7112. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7113. var __export = (target, all) => {
  7114. for (var name in all)
  7115. __defProp(target, name, { get: all[name], enumerable: true });
  7116. };
  7117. var __copyProps = (to, from, except, desc) => {
  7118. if (from && typeof from === "object" || typeof from === "function") {
  7119. for (let key of __getOwnPropNames(from))
  7120. if (!__hasOwnProp.call(to, key) && key !== except)
  7121. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7122. }
  7123. return to;
  7124. };
  7125. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7126. // pkg/dist-src/index.js
  7127. var dist_src_exports = {};
  7128. __export(dist_src_exports, {
  7129. createTokenAuth: () => createTokenAuth
  7130. });
  7131. module.exports = __toCommonJS(dist_src_exports);
  7132. // pkg/dist-src/auth.js
  7133. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7134. var REGEX_IS_INSTALLATION = /^ghs_/;
  7135. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7136. async function auth(token) {
  7137. const isApp = token.split(/\./).length === 3;
  7138. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7139. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7140. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7141. return {
  7142. type: "token",
  7143. token,
  7144. tokenType
  7145. };
  7146. }
  7147. // pkg/dist-src/with-authorization-prefix.js
  7148. function withAuthorizationPrefix(token) {
  7149. if (token.split(/\./).length === 3) {
  7150. return `bearer ${token}`;
  7151. }
  7152. return `token ${token}`;
  7153. }
  7154. // pkg/dist-src/hook.js
  7155. async function hook(token, request, route, parameters) {
  7156. const endpoint = request.endpoint.merge(
  7157. route,
  7158. parameters
  7159. );
  7160. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7161. return request(endpoint);
  7162. }
  7163. // pkg/dist-src/index.js
  7164. var createTokenAuth = function createTokenAuth2(token) {
  7165. if (!token) {
  7166. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7167. }
  7168. if (typeof token !== "string") {
  7169. throw new Error(
  7170. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7171. );
  7172. }
  7173. token = token.replace(/^(token|bearer) +/i, "");
  7174. return Object.assign(auth.bind(null, token), {
  7175. hook: hook.bind(null, token)
  7176. });
  7177. };
  7178. // Annotate the CommonJS export names for ESM import in node:
  7179. 0 && (0);
  7180. /***/ }),
  7181. /***/ 6762:
  7182. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7183. "use strict";
  7184. var __defProp = Object.defineProperty;
  7185. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7186. var __getOwnPropNames = Object.getOwnPropertyNames;
  7187. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7188. var __export = (target, all) => {
  7189. for (var name in all)
  7190. __defProp(target, name, { get: all[name], enumerable: true });
  7191. };
  7192. var __copyProps = (to, from, except, desc) => {
  7193. if (from && typeof from === "object" || typeof from === "function") {
  7194. for (let key of __getOwnPropNames(from))
  7195. if (!__hasOwnProp.call(to, key) && key !== except)
  7196. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7197. }
  7198. return to;
  7199. };
  7200. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7201. // pkg/dist-src/index.js
  7202. var dist_src_exports = {};
  7203. __export(dist_src_exports, {
  7204. Octokit: () => Octokit
  7205. });
  7206. module.exports = __toCommonJS(dist_src_exports);
  7207. var import_universal_user_agent = __nccwpck_require__(5030);
  7208. var import_before_after_hook = __nccwpck_require__(3682);
  7209. var import_request = __nccwpck_require__(6234);
  7210. var import_graphql = __nccwpck_require__(8467);
  7211. var import_auth_token = __nccwpck_require__(334);
  7212. // pkg/dist-src/version.js
  7213. var VERSION = "5.2.0";
  7214. // pkg/dist-src/index.js
  7215. var noop = () => {
  7216. };
  7217. var consoleWarn = console.warn.bind(console);
  7218. var consoleError = console.error.bind(console);
  7219. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7220. var Octokit = class {
  7221. static {
  7222. this.VERSION = VERSION;
  7223. }
  7224. static defaults(defaults) {
  7225. const OctokitWithDefaults = class extends this {
  7226. constructor(...args) {
  7227. const options = args[0] || {};
  7228. if (typeof defaults === "function") {
  7229. super(defaults(options));
  7230. return;
  7231. }
  7232. super(
  7233. Object.assign(
  7234. {},
  7235. defaults,
  7236. options,
  7237. options.userAgent && defaults.userAgent ? {
  7238. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7239. } : null
  7240. )
  7241. );
  7242. }
  7243. };
  7244. return OctokitWithDefaults;
  7245. }
  7246. static {
  7247. this.plugins = [];
  7248. }
  7249. /**
  7250. * Attach a plugin (or many) to your Octokit instance.
  7251. *
  7252. * @example
  7253. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7254. */
  7255. static plugin(...newPlugins) {
  7256. const currentPlugins = this.plugins;
  7257. const NewOctokit = class extends this {
  7258. static {
  7259. this.plugins = currentPlugins.concat(
  7260. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7261. );
  7262. }
  7263. };
  7264. return NewOctokit;
  7265. }
  7266. constructor(options = {}) {
  7267. const hook = new import_before_after_hook.Collection();
  7268. const requestDefaults = {
  7269. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7270. headers: {},
  7271. request: Object.assign({}, options.request, {
  7272. // @ts-ignore internal usage only, no need to type
  7273. hook: hook.bind(null, "request")
  7274. }),
  7275. mediaType: {
  7276. previews: [],
  7277. format: ""
  7278. }
  7279. };
  7280. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7281. if (options.baseUrl) {
  7282. requestDefaults.baseUrl = options.baseUrl;
  7283. }
  7284. if (options.previews) {
  7285. requestDefaults.mediaType.previews = options.previews;
  7286. }
  7287. if (options.timeZone) {
  7288. requestDefaults.headers["time-zone"] = options.timeZone;
  7289. }
  7290. this.request = import_request.request.defaults(requestDefaults);
  7291. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7292. this.log = Object.assign(
  7293. {
  7294. debug: noop,
  7295. info: noop,
  7296. warn: consoleWarn,
  7297. error: consoleError
  7298. },
  7299. options.log
  7300. );
  7301. this.hook = hook;
  7302. if (!options.authStrategy) {
  7303. if (!options.auth) {
  7304. this.auth = async () => ({
  7305. type: "unauthenticated"
  7306. });
  7307. } else {
  7308. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7309. hook.wrap("request", auth.hook);
  7310. this.auth = auth;
  7311. }
  7312. } else {
  7313. const { authStrategy, ...otherOptions } = options;
  7314. const auth = authStrategy(
  7315. Object.assign(
  7316. {
  7317. request: this.request,
  7318. log: this.log,
  7319. // we pass the current octokit instance as well as its constructor options
  7320. // to allow for authentication strategies that return a new octokit instance
  7321. // that shares the same internal state as the current one. The original
  7322. // requirement for this was the "event-octokit" authentication strategy
  7323. // of https://github.com/probot/octokit-auth-probot.
  7324. octokit: this,
  7325. octokitOptions: otherOptions
  7326. },
  7327. options.auth
  7328. )
  7329. );
  7330. hook.wrap("request", auth.hook);
  7331. this.auth = auth;
  7332. }
  7333. const classConstructor = this.constructor;
  7334. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7335. Object.assign(this, classConstructor.plugins[i](this, options));
  7336. }
  7337. }
  7338. };
  7339. // Annotate the CommonJS export names for ESM import in node:
  7340. 0 && (0);
  7341. /***/ }),
  7342. /***/ 9440:
  7343. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7344. "use strict";
  7345. var __defProp = Object.defineProperty;
  7346. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7347. var __getOwnPropNames = Object.getOwnPropertyNames;
  7348. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7349. var __export = (target, all) => {
  7350. for (var name in all)
  7351. __defProp(target, name, { get: all[name], enumerable: true });
  7352. };
  7353. var __copyProps = (to, from, except, desc) => {
  7354. if (from && typeof from === "object" || typeof from === "function") {
  7355. for (let key of __getOwnPropNames(from))
  7356. if (!__hasOwnProp.call(to, key) && key !== except)
  7357. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7358. }
  7359. return to;
  7360. };
  7361. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7362. // pkg/dist-src/index.js
  7363. var dist_src_exports = {};
  7364. __export(dist_src_exports, {
  7365. endpoint: () => endpoint
  7366. });
  7367. module.exports = __toCommonJS(dist_src_exports);
  7368. // pkg/dist-src/defaults.js
  7369. var import_universal_user_agent = __nccwpck_require__(5030);
  7370. // pkg/dist-src/version.js
  7371. var VERSION = "9.0.5";
  7372. // pkg/dist-src/defaults.js
  7373. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7374. var DEFAULTS = {
  7375. method: "GET",
  7376. baseUrl: "https://api.github.com",
  7377. headers: {
  7378. accept: "application/vnd.github.v3+json",
  7379. "user-agent": userAgent
  7380. },
  7381. mediaType: {
  7382. format: ""
  7383. }
  7384. };
  7385. // pkg/dist-src/util/lowercase-keys.js
  7386. function lowercaseKeys(object) {
  7387. if (!object) {
  7388. return {};
  7389. }
  7390. return Object.keys(object).reduce((newObj, key) => {
  7391. newObj[key.toLowerCase()] = object[key];
  7392. return newObj;
  7393. }, {});
  7394. }
  7395. // pkg/dist-src/util/is-plain-object.js
  7396. function isPlainObject(value) {
  7397. if (typeof value !== "object" || value === null)
  7398. return false;
  7399. if (Object.prototype.toString.call(value) !== "[object Object]")
  7400. return false;
  7401. const proto = Object.getPrototypeOf(value);
  7402. if (proto === null)
  7403. return true;
  7404. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7405. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7406. }
  7407. // pkg/dist-src/util/merge-deep.js
  7408. function mergeDeep(defaults, options) {
  7409. const result = Object.assign({}, defaults);
  7410. Object.keys(options).forEach((key) => {
  7411. if (isPlainObject(options[key])) {
  7412. if (!(key in defaults))
  7413. Object.assign(result, { [key]: options[key] });
  7414. else
  7415. result[key] = mergeDeep(defaults[key], options[key]);
  7416. } else {
  7417. Object.assign(result, { [key]: options[key] });
  7418. }
  7419. });
  7420. return result;
  7421. }
  7422. // pkg/dist-src/util/remove-undefined-properties.js
  7423. function removeUndefinedProperties(obj) {
  7424. for (const key in obj) {
  7425. if (obj[key] === void 0) {
  7426. delete obj[key];
  7427. }
  7428. }
  7429. return obj;
  7430. }
  7431. // pkg/dist-src/merge.js
  7432. function merge(defaults, route, options) {
  7433. if (typeof route === "string") {
  7434. let [method, url] = route.split(" ");
  7435. options = Object.assign(url ? { method, url } : { url: method }, options);
  7436. } else {
  7437. options = Object.assign({}, route);
  7438. }
  7439. options.headers = lowercaseKeys(options.headers);
  7440. removeUndefinedProperties(options);
  7441. removeUndefinedProperties(options.headers);
  7442. const mergedOptions = mergeDeep(defaults || {}, options);
  7443. if (options.url === "/graphql") {
  7444. if (defaults && defaults.mediaType.previews?.length) {
  7445. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7446. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7447. ).concat(mergedOptions.mediaType.previews);
  7448. }
  7449. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7450. }
  7451. return mergedOptions;
  7452. }
  7453. // pkg/dist-src/util/add-query-parameters.js
  7454. function addQueryParameters(url, parameters) {
  7455. const separator = /\?/.test(url) ? "&" : "?";
  7456. const names = Object.keys(parameters);
  7457. if (names.length === 0) {
  7458. return url;
  7459. }
  7460. return url + separator + names.map((name) => {
  7461. if (name === "q") {
  7462. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7463. }
  7464. return `${name}=${encodeURIComponent(parameters[name])}`;
  7465. }).join("&");
  7466. }
  7467. // pkg/dist-src/util/extract-url-variable-names.js
  7468. var urlVariableRegex = /\{[^}]+\}/g;
  7469. function removeNonChars(variableName) {
  7470. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  7471. }
  7472. function extractUrlVariableNames(url) {
  7473. const matches = url.match(urlVariableRegex);
  7474. if (!matches) {
  7475. return [];
  7476. }
  7477. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7478. }
  7479. // pkg/dist-src/util/omit.js
  7480. function omit(object, keysToOmit) {
  7481. const result = { __proto__: null };
  7482. for (const key of Object.keys(object)) {
  7483. if (keysToOmit.indexOf(key) === -1) {
  7484. result[key] = object[key];
  7485. }
  7486. }
  7487. return result;
  7488. }
  7489. // pkg/dist-src/util/url-template.js
  7490. function encodeReserved(str) {
  7491. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7492. if (!/%[0-9A-Fa-f]/.test(part)) {
  7493. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7494. }
  7495. return part;
  7496. }).join("");
  7497. }
  7498. function encodeUnreserved(str) {
  7499. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7500. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7501. });
  7502. }
  7503. function encodeValue(operator, value, key) {
  7504. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7505. if (key) {
  7506. return encodeUnreserved(key) + "=" + value;
  7507. } else {
  7508. return value;
  7509. }
  7510. }
  7511. function isDefined(value) {
  7512. return value !== void 0 && value !== null;
  7513. }
  7514. function isKeyOperator(operator) {
  7515. return operator === ";" || operator === "&" || operator === "?";
  7516. }
  7517. function getValues(context, operator, key, modifier) {
  7518. var value = context[key], result = [];
  7519. if (isDefined(value) && value !== "") {
  7520. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7521. value = value.toString();
  7522. if (modifier && modifier !== "*") {
  7523. value = value.substring(0, parseInt(modifier, 10));
  7524. }
  7525. result.push(
  7526. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7527. );
  7528. } else {
  7529. if (modifier === "*") {
  7530. if (Array.isArray(value)) {
  7531. value.filter(isDefined).forEach(function(value2) {
  7532. result.push(
  7533. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7534. );
  7535. });
  7536. } else {
  7537. Object.keys(value).forEach(function(k) {
  7538. if (isDefined(value[k])) {
  7539. result.push(encodeValue(operator, value[k], k));
  7540. }
  7541. });
  7542. }
  7543. } else {
  7544. const tmp = [];
  7545. if (Array.isArray(value)) {
  7546. value.filter(isDefined).forEach(function(value2) {
  7547. tmp.push(encodeValue(operator, value2));
  7548. });
  7549. } else {
  7550. Object.keys(value).forEach(function(k) {
  7551. if (isDefined(value[k])) {
  7552. tmp.push(encodeUnreserved(k));
  7553. tmp.push(encodeValue(operator, value[k].toString()));
  7554. }
  7555. });
  7556. }
  7557. if (isKeyOperator(operator)) {
  7558. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7559. } else if (tmp.length !== 0) {
  7560. result.push(tmp.join(","));
  7561. }
  7562. }
  7563. }
  7564. } else {
  7565. if (operator === ";") {
  7566. if (isDefined(value)) {
  7567. result.push(encodeUnreserved(key));
  7568. }
  7569. } else if (value === "" && (operator === "&" || operator === "?")) {
  7570. result.push(encodeUnreserved(key) + "=");
  7571. } else if (value === "") {
  7572. result.push("");
  7573. }
  7574. }
  7575. return result;
  7576. }
  7577. function parseUrl(template) {
  7578. return {
  7579. expand: expand.bind(null, template)
  7580. };
  7581. }
  7582. function expand(template, context) {
  7583. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7584. template = template.replace(
  7585. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7586. function(_, expression, literal) {
  7587. if (expression) {
  7588. let operator = "";
  7589. const values = [];
  7590. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7591. operator = expression.charAt(0);
  7592. expression = expression.substr(1);
  7593. }
  7594. expression.split(/,/g).forEach(function(variable) {
  7595. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7596. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7597. });
  7598. if (operator && operator !== "+") {
  7599. var separator = ",";
  7600. if (operator === "?") {
  7601. separator = "&";
  7602. } else if (operator !== "#") {
  7603. separator = operator;
  7604. }
  7605. return (values.length !== 0 ? operator : "") + values.join(separator);
  7606. } else {
  7607. return values.join(",");
  7608. }
  7609. } else {
  7610. return encodeReserved(literal);
  7611. }
  7612. }
  7613. );
  7614. if (template === "/") {
  7615. return template;
  7616. } else {
  7617. return template.replace(/\/$/, "");
  7618. }
  7619. }
  7620. // pkg/dist-src/parse.js
  7621. function parse(options) {
  7622. let method = options.method.toUpperCase();
  7623. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7624. let headers = Object.assign({}, options.headers);
  7625. let body;
  7626. let parameters = omit(options, [
  7627. "method",
  7628. "baseUrl",
  7629. "url",
  7630. "headers",
  7631. "request",
  7632. "mediaType"
  7633. ]);
  7634. const urlVariableNames = extractUrlVariableNames(url);
  7635. url = parseUrl(url).expand(parameters);
  7636. if (!/^http/.test(url)) {
  7637. url = options.baseUrl + url;
  7638. }
  7639. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7640. const remainingParameters = omit(parameters, omittedParameters);
  7641. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7642. if (!isBinaryRequest) {
  7643. if (options.mediaType.format) {
  7644. headers.accept = headers.accept.split(/,/).map(
  7645. (format) => format.replace(
  7646. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7647. `application/vnd$1$2.${options.mediaType.format}`
  7648. )
  7649. ).join(",");
  7650. }
  7651. if (url.endsWith("/graphql")) {
  7652. if (options.mediaType.previews?.length) {
  7653. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  7654. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7655. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7656. return `application/vnd.github.${preview}-preview${format}`;
  7657. }).join(",");
  7658. }
  7659. }
  7660. }
  7661. if (["GET", "HEAD"].includes(method)) {
  7662. url = addQueryParameters(url, remainingParameters);
  7663. } else {
  7664. if ("data" in remainingParameters) {
  7665. body = remainingParameters.data;
  7666. } else {
  7667. if (Object.keys(remainingParameters).length) {
  7668. body = remainingParameters;
  7669. }
  7670. }
  7671. }
  7672. if (!headers["content-type"] && typeof body !== "undefined") {
  7673. headers["content-type"] = "application/json; charset=utf-8";
  7674. }
  7675. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7676. body = "";
  7677. }
  7678. return Object.assign(
  7679. { method, url, headers },
  7680. typeof body !== "undefined" ? { body } : null,
  7681. options.request ? { request: options.request } : null
  7682. );
  7683. }
  7684. // pkg/dist-src/endpoint-with-defaults.js
  7685. function endpointWithDefaults(defaults, route, options) {
  7686. return parse(merge(defaults, route, options));
  7687. }
  7688. // pkg/dist-src/with-defaults.js
  7689. function withDefaults(oldDefaults, newDefaults) {
  7690. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7691. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7692. return Object.assign(endpoint2, {
  7693. DEFAULTS: DEFAULTS2,
  7694. defaults: withDefaults.bind(null, DEFAULTS2),
  7695. merge: merge.bind(null, DEFAULTS2),
  7696. parse
  7697. });
  7698. }
  7699. // pkg/dist-src/index.js
  7700. var endpoint = withDefaults(null, DEFAULTS);
  7701. // Annotate the CommonJS export names for ESM import in node:
  7702. 0 && (0);
  7703. /***/ }),
  7704. /***/ 8467:
  7705. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7706. "use strict";
  7707. var __defProp = Object.defineProperty;
  7708. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7709. var __getOwnPropNames = Object.getOwnPropertyNames;
  7710. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7711. var __export = (target, all) => {
  7712. for (var name in all)
  7713. __defProp(target, name, { get: all[name], enumerable: true });
  7714. };
  7715. var __copyProps = (to, from, except, desc) => {
  7716. if (from && typeof from === "object" || typeof from === "function") {
  7717. for (let key of __getOwnPropNames(from))
  7718. if (!__hasOwnProp.call(to, key) && key !== except)
  7719. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7720. }
  7721. return to;
  7722. };
  7723. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7724. // pkg/dist-src/index.js
  7725. var dist_src_exports = {};
  7726. __export(dist_src_exports, {
  7727. GraphqlResponseError: () => GraphqlResponseError,
  7728. graphql: () => graphql2,
  7729. withCustomRequest: () => withCustomRequest
  7730. });
  7731. module.exports = __toCommonJS(dist_src_exports);
  7732. var import_request3 = __nccwpck_require__(6234);
  7733. var import_universal_user_agent = __nccwpck_require__(5030);
  7734. // pkg/dist-src/version.js
  7735. var VERSION = "7.1.0";
  7736. // pkg/dist-src/with-defaults.js
  7737. var import_request2 = __nccwpck_require__(6234);
  7738. // pkg/dist-src/graphql.js
  7739. var import_request = __nccwpck_require__(6234);
  7740. // pkg/dist-src/error.js
  7741. function _buildMessageForResponseErrors(data) {
  7742. return `Request failed due to following response errors:
  7743. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  7744. }
  7745. var GraphqlResponseError = class extends Error {
  7746. constructor(request2, headers, response) {
  7747. super(_buildMessageForResponseErrors(response));
  7748. this.request = request2;
  7749. this.headers = headers;
  7750. this.response = response;
  7751. this.name = "GraphqlResponseError";
  7752. this.errors = response.errors;
  7753. this.data = response.data;
  7754. if (Error.captureStackTrace) {
  7755. Error.captureStackTrace(this, this.constructor);
  7756. }
  7757. }
  7758. };
  7759. // pkg/dist-src/graphql.js
  7760. var NON_VARIABLE_OPTIONS = [
  7761. "method",
  7762. "baseUrl",
  7763. "url",
  7764. "headers",
  7765. "request",
  7766. "query",
  7767. "mediaType"
  7768. ];
  7769. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  7770. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  7771. function graphql(request2, query, options) {
  7772. if (options) {
  7773. if (typeof query === "string" && "query" in options) {
  7774. return Promise.reject(
  7775. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  7776. );
  7777. }
  7778. for (const key in options) {
  7779. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  7780. continue;
  7781. return Promise.reject(
  7782. new Error(
  7783. `[@octokit/graphql] "${key}" cannot be used as variable name`
  7784. )
  7785. );
  7786. }
  7787. }
  7788. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  7789. const requestOptions = Object.keys(
  7790. parsedOptions
  7791. ).reduce((result, key) => {
  7792. if (NON_VARIABLE_OPTIONS.includes(key)) {
  7793. result[key] = parsedOptions[key];
  7794. return result;
  7795. }
  7796. if (!result.variables) {
  7797. result.variables = {};
  7798. }
  7799. result.variables[key] = parsedOptions[key];
  7800. return result;
  7801. }, {});
  7802. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  7803. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  7804. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  7805. }
  7806. return request2(requestOptions).then((response) => {
  7807. if (response.data.errors) {
  7808. const headers = {};
  7809. for (const key of Object.keys(response.headers)) {
  7810. headers[key] = response.headers[key];
  7811. }
  7812. throw new GraphqlResponseError(
  7813. requestOptions,
  7814. headers,
  7815. response.data
  7816. );
  7817. }
  7818. return response.data.data;
  7819. });
  7820. }
  7821. // pkg/dist-src/with-defaults.js
  7822. function withDefaults(request2, newDefaults) {
  7823. const newRequest = request2.defaults(newDefaults);
  7824. const newApi = (query, options) => {
  7825. return graphql(newRequest, query, options);
  7826. };
  7827. return Object.assign(newApi, {
  7828. defaults: withDefaults.bind(null, newRequest),
  7829. endpoint: newRequest.endpoint
  7830. });
  7831. }
  7832. // pkg/dist-src/index.js
  7833. var graphql2 = withDefaults(import_request3.request, {
  7834. headers: {
  7835. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  7836. },
  7837. method: "POST",
  7838. url: "/graphql"
  7839. });
  7840. function withCustomRequest(customRequest) {
  7841. return withDefaults(customRequest, {
  7842. method: "POST",
  7843. url: "/graphql"
  7844. });
  7845. }
  7846. // Annotate the CommonJS export names for ESM import in node:
  7847. 0 && (0);
  7848. /***/ }),
  7849. /***/ 4193:
  7850. /***/ ((module) => {
  7851. "use strict";
  7852. var __defProp = Object.defineProperty;
  7853. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7854. var __getOwnPropNames = Object.getOwnPropertyNames;
  7855. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7856. var __export = (target, all) => {
  7857. for (var name in all)
  7858. __defProp(target, name, { get: all[name], enumerable: true });
  7859. };
  7860. var __copyProps = (to, from, except, desc) => {
  7861. if (from && typeof from === "object" || typeof from === "function") {
  7862. for (let key of __getOwnPropNames(from))
  7863. if (!__hasOwnProp.call(to, key) && key !== except)
  7864. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7865. }
  7866. return to;
  7867. };
  7868. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7869. // pkg/dist-src/index.js
  7870. var dist_src_exports = {};
  7871. __export(dist_src_exports, {
  7872. composePaginateRest: () => composePaginateRest,
  7873. isPaginatingEndpoint: () => isPaginatingEndpoint,
  7874. paginateRest: () => paginateRest,
  7875. paginatingEndpoints: () => paginatingEndpoints
  7876. });
  7877. module.exports = __toCommonJS(dist_src_exports);
  7878. // pkg/dist-src/version.js
  7879. var VERSION = "9.2.1";
  7880. // pkg/dist-src/normalize-paginated-list-response.js
  7881. function normalizePaginatedListResponse(response) {
  7882. if (!response.data) {
  7883. return {
  7884. ...response,
  7885. data: []
  7886. };
  7887. }
  7888. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  7889. if (!responseNeedsNormalization)
  7890. return response;
  7891. const incompleteResults = response.data.incomplete_results;
  7892. const repositorySelection = response.data.repository_selection;
  7893. const totalCount = response.data.total_count;
  7894. delete response.data.incomplete_results;
  7895. delete response.data.repository_selection;
  7896. delete response.data.total_count;
  7897. const namespaceKey = Object.keys(response.data)[0];
  7898. const data = response.data[namespaceKey];
  7899. response.data = data;
  7900. if (typeof incompleteResults !== "undefined") {
  7901. response.data.incomplete_results = incompleteResults;
  7902. }
  7903. if (typeof repositorySelection !== "undefined") {
  7904. response.data.repository_selection = repositorySelection;
  7905. }
  7906. response.data.total_count = totalCount;
  7907. return response;
  7908. }
  7909. // pkg/dist-src/iterator.js
  7910. function iterator(octokit, route, parameters) {
  7911. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  7912. const requestMethod = typeof route === "function" ? route : octokit.request;
  7913. const method = options.method;
  7914. const headers = options.headers;
  7915. let url = options.url;
  7916. return {
  7917. [Symbol.asyncIterator]: () => ({
  7918. async next() {
  7919. if (!url)
  7920. return { done: true };
  7921. try {
  7922. const response = await requestMethod({ method, url, headers });
  7923. const normalizedResponse = normalizePaginatedListResponse(response);
  7924. url = ((normalizedResponse.headers.link || "").match(
  7925. /<([^>]+)>;\s*rel="next"/
  7926. ) || [])[1];
  7927. return { value: normalizedResponse };
  7928. } catch (error) {
  7929. if (error.status !== 409)
  7930. throw error;
  7931. url = "";
  7932. return {
  7933. value: {
  7934. status: 200,
  7935. headers: {},
  7936. data: []
  7937. }
  7938. };
  7939. }
  7940. }
  7941. })
  7942. };
  7943. }
  7944. // pkg/dist-src/paginate.js
  7945. function paginate(octokit, route, parameters, mapFn) {
  7946. if (typeof parameters === "function") {
  7947. mapFn = parameters;
  7948. parameters = void 0;
  7949. }
  7950. return gather(
  7951. octokit,
  7952. [],
  7953. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  7954. mapFn
  7955. );
  7956. }
  7957. function gather(octokit, results, iterator2, mapFn) {
  7958. return iterator2.next().then((result) => {
  7959. if (result.done) {
  7960. return results;
  7961. }
  7962. let earlyExit = false;
  7963. function done() {
  7964. earlyExit = true;
  7965. }
  7966. results = results.concat(
  7967. mapFn ? mapFn(result.value, done) : result.value.data
  7968. );
  7969. if (earlyExit) {
  7970. return results;
  7971. }
  7972. return gather(octokit, results, iterator2, mapFn);
  7973. });
  7974. }
  7975. // pkg/dist-src/compose-paginate.js
  7976. var composePaginateRest = Object.assign(paginate, {
  7977. iterator
  7978. });
  7979. // pkg/dist-src/generated/paginating-endpoints.js
  7980. var paginatingEndpoints = [
  7981. "GET /advisories",
  7982. "GET /app/hook/deliveries",
  7983. "GET /app/installation-requests",
  7984. "GET /app/installations",
  7985. "GET /assignments/{assignment_id}/accepted_assignments",
  7986. "GET /classrooms",
  7987. "GET /classrooms/{classroom_id}/assignments",
  7988. "GET /enterprises/{enterprise}/dependabot/alerts",
  7989. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  7990. "GET /events",
  7991. "GET /gists",
  7992. "GET /gists/public",
  7993. "GET /gists/starred",
  7994. "GET /gists/{gist_id}/comments",
  7995. "GET /gists/{gist_id}/commits",
  7996. "GET /gists/{gist_id}/forks",
  7997. "GET /installation/repositories",
  7998. "GET /issues",
  7999. "GET /licenses",
  8000. "GET /marketplace_listing/plans",
  8001. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8002. "GET /marketplace_listing/stubbed/plans",
  8003. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8004. "GET /networks/{owner}/{repo}/events",
  8005. "GET /notifications",
  8006. "GET /organizations",
  8007. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8008. "GET /orgs/{org}/actions/permissions/repositories",
  8009. "GET /orgs/{org}/actions/runners",
  8010. "GET /orgs/{org}/actions/secrets",
  8011. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8012. "GET /orgs/{org}/actions/variables",
  8013. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8014. "GET /orgs/{org}/blocks",
  8015. "GET /orgs/{org}/code-scanning/alerts",
  8016. "GET /orgs/{org}/codespaces",
  8017. "GET /orgs/{org}/codespaces/secrets",
  8018. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8019. "GET /orgs/{org}/copilot/billing/seats",
  8020. "GET /orgs/{org}/dependabot/alerts",
  8021. "GET /orgs/{org}/dependabot/secrets",
  8022. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8023. "GET /orgs/{org}/events",
  8024. "GET /orgs/{org}/failed_invitations",
  8025. "GET /orgs/{org}/hooks",
  8026. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8027. "GET /orgs/{org}/installations",
  8028. "GET /orgs/{org}/invitations",
  8029. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8030. "GET /orgs/{org}/issues",
  8031. "GET /orgs/{org}/members",
  8032. "GET /orgs/{org}/members/{username}/codespaces",
  8033. "GET /orgs/{org}/migrations",
  8034. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8035. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8036. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8037. "GET /orgs/{org}/outside_collaborators",
  8038. "GET /orgs/{org}/packages",
  8039. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8040. "GET /orgs/{org}/personal-access-token-requests",
  8041. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8042. "GET /orgs/{org}/personal-access-tokens",
  8043. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8044. "GET /orgs/{org}/projects",
  8045. "GET /orgs/{org}/properties/values",
  8046. "GET /orgs/{org}/public_members",
  8047. "GET /orgs/{org}/repos",
  8048. "GET /orgs/{org}/rulesets",
  8049. "GET /orgs/{org}/rulesets/rule-suites",
  8050. "GET /orgs/{org}/secret-scanning/alerts",
  8051. "GET /orgs/{org}/security-advisories",
  8052. "GET /orgs/{org}/teams",
  8053. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8054. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8055. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8056. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8057. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8058. "GET /orgs/{org}/teams/{team_slug}/members",
  8059. "GET /orgs/{org}/teams/{team_slug}/projects",
  8060. "GET /orgs/{org}/teams/{team_slug}/repos",
  8061. "GET /orgs/{org}/teams/{team_slug}/teams",
  8062. "GET /projects/columns/{column_id}/cards",
  8063. "GET /projects/{project_id}/collaborators",
  8064. "GET /projects/{project_id}/columns",
  8065. "GET /repos/{owner}/{repo}/actions/artifacts",
  8066. "GET /repos/{owner}/{repo}/actions/caches",
  8067. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8068. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8069. "GET /repos/{owner}/{repo}/actions/runners",
  8070. "GET /repos/{owner}/{repo}/actions/runs",
  8071. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8072. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8073. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8074. "GET /repos/{owner}/{repo}/actions/secrets",
  8075. "GET /repos/{owner}/{repo}/actions/variables",
  8076. "GET /repos/{owner}/{repo}/actions/workflows",
  8077. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8078. "GET /repos/{owner}/{repo}/activity",
  8079. "GET /repos/{owner}/{repo}/assignees",
  8080. "GET /repos/{owner}/{repo}/branches",
  8081. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8082. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8083. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8084. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8085. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8086. "GET /repos/{owner}/{repo}/codespaces",
  8087. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8088. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8089. "GET /repos/{owner}/{repo}/collaborators",
  8090. "GET /repos/{owner}/{repo}/comments",
  8091. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8092. "GET /repos/{owner}/{repo}/commits",
  8093. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8094. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8095. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8096. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8097. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8098. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8099. "GET /repos/{owner}/{repo}/contributors",
  8100. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8101. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8102. "GET /repos/{owner}/{repo}/deployments",
  8103. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8104. "GET /repos/{owner}/{repo}/environments",
  8105. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8106. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8107. "GET /repos/{owner}/{repo}/events",
  8108. "GET /repos/{owner}/{repo}/forks",
  8109. "GET /repos/{owner}/{repo}/hooks",
  8110. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8111. "GET /repos/{owner}/{repo}/invitations",
  8112. "GET /repos/{owner}/{repo}/issues",
  8113. "GET /repos/{owner}/{repo}/issues/comments",
  8114. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8115. "GET /repos/{owner}/{repo}/issues/events",
  8116. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8117. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8118. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8119. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8120. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8121. "GET /repos/{owner}/{repo}/keys",
  8122. "GET /repos/{owner}/{repo}/labels",
  8123. "GET /repos/{owner}/{repo}/milestones",
  8124. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8125. "GET /repos/{owner}/{repo}/notifications",
  8126. "GET /repos/{owner}/{repo}/pages/builds",
  8127. "GET /repos/{owner}/{repo}/projects",
  8128. "GET /repos/{owner}/{repo}/pulls",
  8129. "GET /repos/{owner}/{repo}/pulls/comments",
  8130. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8131. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8132. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8133. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8134. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8135. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8136. "GET /repos/{owner}/{repo}/releases",
  8137. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8138. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8139. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8140. "GET /repos/{owner}/{repo}/rulesets",
  8141. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8142. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8143. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8144. "GET /repos/{owner}/{repo}/security-advisories",
  8145. "GET /repos/{owner}/{repo}/stargazers",
  8146. "GET /repos/{owner}/{repo}/subscribers",
  8147. "GET /repos/{owner}/{repo}/tags",
  8148. "GET /repos/{owner}/{repo}/teams",
  8149. "GET /repos/{owner}/{repo}/topics",
  8150. "GET /repositories",
  8151. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8152. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8153. "GET /search/code",
  8154. "GET /search/commits",
  8155. "GET /search/issues",
  8156. "GET /search/labels",
  8157. "GET /search/repositories",
  8158. "GET /search/topics",
  8159. "GET /search/users",
  8160. "GET /teams/{team_id}/discussions",
  8161. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8162. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8163. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8164. "GET /teams/{team_id}/invitations",
  8165. "GET /teams/{team_id}/members",
  8166. "GET /teams/{team_id}/projects",
  8167. "GET /teams/{team_id}/repos",
  8168. "GET /teams/{team_id}/teams",
  8169. "GET /user/blocks",
  8170. "GET /user/codespaces",
  8171. "GET /user/codespaces/secrets",
  8172. "GET /user/emails",
  8173. "GET /user/followers",
  8174. "GET /user/following",
  8175. "GET /user/gpg_keys",
  8176. "GET /user/installations",
  8177. "GET /user/installations/{installation_id}/repositories",
  8178. "GET /user/issues",
  8179. "GET /user/keys",
  8180. "GET /user/marketplace_purchases",
  8181. "GET /user/marketplace_purchases/stubbed",
  8182. "GET /user/memberships/orgs",
  8183. "GET /user/migrations",
  8184. "GET /user/migrations/{migration_id}/repositories",
  8185. "GET /user/orgs",
  8186. "GET /user/packages",
  8187. "GET /user/packages/{package_type}/{package_name}/versions",
  8188. "GET /user/public_emails",
  8189. "GET /user/repos",
  8190. "GET /user/repository_invitations",
  8191. "GET /user/social_accounts",
  8192. "GET /user/ssh_signing_keys",
  8193. "GET /user/starred",
  8194. "GET /user/subscriptions",
  8195. "GET /user/teams",
  8196. "GET /users",
  8197. "GET /users/{username}/events",
  8198. "GET /users/{username}/events/orgs/{org}",
  8199. "GET /users/{username}/events/public",
  8200. "GET /users/{username}/followers",
  8201. "GET /users/{username}/following",
  8202. "GET /users/{username}/gists",
  8203. "GET /users/{username}/gpg_keys",
  8204. "GET /users/{username}/keys",
  8205. "GET /users/{username}/orgs",
  8206. "GET /users/{username}/packages",
  8207. "GET /users/{username}/projects",
  8208. "GET /users/{username}/received_events",
  8209. "GET /users/{username}/received_events/public",
  8210. "GET /users/{username}/repos",
  8211. "GET /users/{username}/social_accounts",
  8212. "GET /users/{username}/ssh_signing_keys",
  8213. "GET /users/{username}/starred",
  8214. "GET /users/{username}/subscriptions"
  8215. ];
  8216. // pkg/dist-src/paginating-endpoints.js
  8217. function isPaginatingEndpoint(arg) {
  8218. if (typeof arg === "string") {
  8219. return paginatingEndpoints.includes(arg);
  8220. } else {
  8221. return false;
  8222. }
  8223. }
  8224. // pkg/dist-src/index.js
  8225. function paginateRest(octokit) {
  8226. return {
  8227. paginate: Object.assign(paginate.bind(null, octokit), {
  8228. iterator: iterator.bind(null, octokit)
  8229. })
  8230. };
  8231. }
  8232. paginateRest.VERSION = VERSION;
  8233. // Annotate the CommonJS export names for ESM import in node:
  8234. 0 && (0);
  8235. /***/ }),
  8236. /***/ 3044:
  8237. /***/ ((module) => {
  8238. "use strict";
  8239. var __defProp = Object.defineProperty;
  8240. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8241. var __getOwnPropNames = Object.getOwnPropertyNames;
  8242. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8243. var __export = (target, all) => {
  8244. for (var name in all)
  8245. __defProp(target, name, { get: all[name], enumerable: true });
  8246. };
  8247. var __copyProps = (to, from, except, desc) => {
  8248. if (from && typeof from === "object" || typeof from === "function") {
  8249. for (let key of __getOwnPropNames(from))
  8250. if (!__hasOwnProp.call(to, key) && key !== except)
  8251. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8252. }
  8253. return to;
  8254. };
  8255. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8256. // pkg/dist-src/index.js
  8257. var dist_src_exports = {};
  8258. __export(dist_src_exports, {
  8259. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8260. restEndpointMethods: () => restEndpointMethods
  8261. });
  8262. module.exports = __toCommonJS(dist_src_exports);
  8263. // pkg/dist-src/version.js
  8264. var VERSION = "10.4.1";
  8265. // pkg/dist-src/generated/endpoints.js
  8266. var Endpoints = {
  8267. actions: {
  8268. addCustomLabelsToSelfHostedRunnerForOrg: [
  8269. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8270. ],
  8271. addCustomLabelsToSelfHostedRunnerForRepo: [
  8272. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8273. ],
  8274. addSelectedRepoToOrgSecret: [
  8275. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8276. ],
  8277. addSelectedRepoToOrgVariable: [
  8278. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8279. ],
  8280. approveWorkflowRun: [
  8281. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8282. ],
  8283. cancelWorkflowRun: [
  8284. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8285. ],
  8286. createEnvironmentVariable: [
  8287. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8288. ],
  8289. createOrUpdateEnvironmentSecret: [
  8290. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8291. ],
  8292. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8293. createOrUpdateRepoSecret: [
  8294. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8295. ],
  8296. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8297. createRegistrationTokenForOrg: [
  8298. "POST /orgs/{org}/actions/runners/registration-token"
  8299. ],
  8300. createRegistrationTokenForRepo: [
  8301. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8302. ],
  8303. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8304. createRemoveTokenForRepo: [
  8305. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8306. ],
  8307. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8308. createWorkflowDispatch: [
  8309. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8310. ],
  8311. deleteActionsCacheById: [
  8312. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8313. ],
  8314. deleteActionsCacheByKey: [
  8315. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8316. ],
  8317. deleteArtifact: [
  8318. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8319. ],
  8320. deleteEnvironmentSecret: [
  8321. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8322. ],
  8323. deleteEnvironmentVariable: [
  8324. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8325. ],
  8326. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8327. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8328. deleteRepoSecret: [
  8329. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8330. ],
  8331. deleteRepoVariable: [
  8332. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8333. ],
  8334. deleteSelfHostedRunnerFromOrg: [
  8335. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8336. ],
  8337. deleteSelfHostedRunnerFromRepo: [
  8338. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8339. ],
  8340. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8341. deleteWorkflowRunLogs: [
  8342. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8343. ],
  8344. disableSelectedRepositoryGithubActionsOrganization: [
  8345. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8346. ],
  8347. disableWorkflow: [
  8348. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8349. ],
  8350. downloadArtifact: [
  8351. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8352. ],
  8353. downloadJobLogsForWorkflowRun: [
  8354. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8355. ],
  8356. downloadWorkflowRunAttemptLogs: [
  8357. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8358. ],
  8359. downloadWorkflowRunLogs: [
  8360. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8361. ],
  8362. enableSelectedRepositoryGithubActionsOrganization: [
  8363. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8364. ],
  8365. enableWorkflow: [
  8366. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8367. ],
  8368. forceCancelWorkflowRun: [
  8369. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8370. ],
  8371. generateRunnerJitconfigForOrg: [
  8372. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8373. ],
  8374. generateRunnerJitconfigForRepo: [
  8375. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8376. ],
  8377. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8378. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8379. getActionsCacheUsageByRepoForOrg: [
  8380. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8381. ],
  8382. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8383. getAllowedActionsOrganization: [
  8384. "GET /orgs/{org}/actions/permissions/selected-actions"
  8385. ],
  8386. getAllowedActionsRepository: [
  8387. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8388. ],
  8389. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8390. getCustomOidcSubClaimForRepo: [
  8391. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8392. ],
  8393. getEnvironmentPublicKey: [
  8394. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8395. ],
  8396. getEnvironmentSecret: [
  8397. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8398. ],
  8399. getEnvironmentVariable: [
  8400. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8401. ],
  8402. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8403. "GET /orgs/{org}/actions/permissions/workflow"
  8404. ],
  8405. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8406. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8407. ],
  8408. getGithubActionsPermissionsOrganization: [
  8409. "GET /orgs/{org}/actions/permissions"
  8410. ],
  8411. getGithubActionsPermissionsRepository: [
  8412. "GET /repos/{owner}/{repo}/actions/permissions"
  8413. ],
  8414. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8415. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8416. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8417. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8418. getPendingDeploymentsForRun: [
  8419. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8420. ],
  8421. getRepoPermissions: [
  8422. "GET /repos/{owner}/{repo}/actions/permissions",
  8423. {},
  8424. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8425. ],
  8426. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8427. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8428. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8429. getReviewsForRun: [
  8430. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8431. ],
  8432. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8433. getSelfHostedRunnerForRepo: [
  8434. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8435. ],
  8436. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8437. getWorkflowAccessToRepository: [
  8438. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8439. ],
  8440. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8441. getWorkflowRunAttempt: [
  8442. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8443. ],
  8444. getWorkflowRunUsage: [
  8445. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8446. ],
  8447. getWorkflowUsage: [
  8448. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8449. ],
  8450. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8451. listEnvironmentSecrets: [
  8452. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8453. ],
  8454. listEnvironmentVariables: [
  8455. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8456. ],
  8457. listJobsForWorkflowRun: [
  8458. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8459. ],
  8460. listJobsForWorkflowRunAttempt: [
  8461. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8462. ],
  8463. listLabelsForSelfHostedRunnerForOrg: [
  8464. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8465. ],
  8466. listLabelsForSelfHostedRunnerForRepo: [
  8467. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8468. ],
  8469. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8470. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8471. listRepoOrganizationSecrets: [
  8472. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8473. ],
  8474. listRepoOrganizationVariables: [
  8475. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8476. ],
  8477. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8478. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8479. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8480. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8481. listRunnerApplicationsForRepo: [
  8482. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8483. ],
  8484. listSelectedReposForOrgSecret: [
  8485. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8486. ],
  8487. listSelectedReposForOrgVariable: [
  8488. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8489. ],
  8490. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8491. "GET /orgs/{org}/actions/permissions/repositories"
  8492. ],
  8493. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8494. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8495. listWorkflowRunArtifacts: [
  8496. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8497. ],
  8498. listWorkflowRuns: [
  8499. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8500. ],
  8501. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8502. reRunJobForWorkflowRun: [
  8503. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8504. ],
  8505. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8506. reRunWorkflowFailedJobs: [
  8507. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8508. ],
  8509. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8510. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8511. ],
  8512. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8513. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8514. ],
  8515. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8516. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8517. ],
  8518. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8519. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8520. ],
  8521. removeSelectedRepoFromOrgSecret: [
  8522. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8523. ],
  8524. removeSelectedRepoFromOrgVariable: [
  8525. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8526. ],
  8527. reviewCustomGatesForRun: [
  8528. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8529. ],
  8530. reviewPendingDeploymentsForRun: [
  8531. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8532. ],
  8533. setAllowedActionsOrganization: [
  8534. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8535. ],
  8536. setAllowedActionsRepository: [
  8537. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8538. ],
  8539. setCustomLabelsForSelfHostedRunnerForOrg: [
  8540. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8541. ],
  8542. setCustomLabelsForSelfHostedRunnerForRepo: [
  8543. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8544. ],
  8545. setCustomOidcSubClaimForRepo: [
  8546. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8547. ],
  8548. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8549. "PUT /orgs/{org}/actions/permissions/workflow"
  8550. ],
  8551. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8552. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8553. ],
  8554. setGithubActionsPermissionsOrganization: [
  8555. "PUT /orgs/{org}/actions/permissions"
  8556. ],
  8557. setGithubActionsPermissionsRepository: [
  8558. "PUT /repos/{owner}/{repo}/actions/permissions"
  8559. ],
  8560. setSelectedReposForOrgSecret: [
  8561. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8562. ],
  8563. setSelectedReposForOrgVariable: [
  8564. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8565. ],
  8566. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8567. "PUT /orgs/{org}/actions/permissions/repositories"
  8568. ],
  8569. setWorkflowAccessToRepository: [
  8570. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8571. ],
  8572. updateEnvironmentVariable: [
  8573. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8574. ],
  8575. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8576. updateRepoVariable: [
  8577. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8578. ]
  8579. },
  8580. activity: {
  8581. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8582. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8583. deleteThreadSubscription: [
  8584. "DELETE /notifications/threads/{thread_id}/subscription"
  8585. ],
  8586. getFeeds: ["GET /feeds"],
  8587. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8588. getThread: ["GET /notifications/threads/{thread_id}"],
  8589. getThreadSubscriptionForAuthenticatedUser: [
  8590. "GET /notifications/threads/{thread_id}/subscription"
  8591. ],
  8592. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8593. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8594. listOrgEventsForAuthenticatedUser: [
  8595. "GET /users/{username}/events/orgs/{org}"
  8596. ],
  8597. listPublicEvents: ["GET /events"],
  8598. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8599. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8600. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8601. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8602. listReceivedPublicEventsForUser: [
  8603. "GET /users/{username}/received_events/public"
  8604. ],
  8605. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8606. listRepoNotificationsForAuthenticatedUser: [
  8607. "GET /repos/{owner}/{repo}/notifications"
  8608. ],
  8609. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8610. listReposStarredByUser: ["GET /users/{username}/starred"],
  8611. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8612. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8613. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8614. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8615. markNotificationsAsRead: ["PUT /notifications"],
  8616. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8617. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8618. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8619. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8620. setThreadSubscription: [
  8621. "PUT /notifications/threads/{thread_id}/subscription"
  8622. ],
  8623. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8624. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8625. },
  8626. apps: {
  8627. addRepoToInstallation: [
  8628. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8629. {},
  8630. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8631. ],
  8632. addRepoToInstallationForAuthenticatedUser: [
  8633. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8634. ],
  8635. checkToken: ["POST /applications/{client_id}/token"],
  8636. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8637. createInstallationAccessToken: [
  8638. "POST /app/installations/{installation_id}/access_tokens"
  8639. ],
  8640. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8641. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8642. deleteToken: ["DELETE /applications/{client_id}/token"],
  8643. getAuthenticated: ["GET /app"],
  8644. getBySlug: ["GET /apps/{app_slug}"],
  8645. getInstallation: ["GET /app/installations/{installation_id}"],
  8646. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8647. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8648. getSubscriptionPlanForAccount: [
  8649. "GET /marketplace_listing/accounts/{account_id}"
  8650. ],
  8651. getSubscriptionPlanForAccountStubbed: [
  8652. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8653. ],
  8654. getUserInstallation: ["GET /users/{username}/installation"],
  8655. getWebhookConfigForApp: ["GET /app/hook/config"],
  8656. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8657. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8658. listAccountsForPlanStubbed: [
  8659. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8660. ],
  8661. listInstallationReposForAuthenticatedUser: [
  8662. "GET /user/installations/{installation_id}/repositories"
  8663. ],
  8664. listInstallationRequestsForAuthenticatedApp: [
  8665. "GET /app/installation-requests"
  8666. ],
  8667. listInstallations: ["GET /app/installations"],
  8668. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8669. listPlans: ["GET /marketplace_listing/plans"],
  8670. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8671. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8672. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8673. listSubscriptionsForAuthenticatedUserStubbed: [
  8674. "GET /user/marketplace_purchases/stubbed"
  8675. ],
  8676. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8677. redeliverWebhookDelivery: [
  8678. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8679. ],
  8680. removeRepoFromInstallation: [
  8681. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8682. {},
  8683. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8684. ],
  8685. removeRepoFromInstallationForAuthenticatedUser: [
  8686. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8687. ],
  8688. resetToken: ["PATCH /applications/{client_id}/token"],
  8689. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8690. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8691. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8692. unsuspendInstallation: [
  8693. "DELETE /app/installations/{installation_id}/suspended"
  8694. ],
  8695. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8696. },
  8697. billing: {
  8698. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8699. getGithubActionsBillingUser: [
  8700. "GET /users/{username}/settings/billing/actions"
  8701. ],
  8702. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8703. getGithubPackagesBillingUser: [
  8704. "GET /users/{username}/settings/billing/packages"
  8705. ],
  8706. getSharedStorageBillingOrg: [
  8707. "GET /orgs/{org}/settings/billing/shared-storage"
  8708. ],
  8709. getSharedStorageBillingUser: [
  8710. "GET /users/{username}/settings/billing/shared-storage"
  8711. ]
  8712. },
  8713. checks: {
  8714. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8715. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8716. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8717. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8718. listAnnotations: [
  8719. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8720. ],
  8721. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  8722. listForSuite: [
  8723. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  8724. ],
  8725. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  8726. rerequestRun: [
  8727. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  8728. ],
  8729. rerequestSuite: [
  8730. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  8731. ],
  8732. setSuitesPreferences: [
  8733. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  8734. ],
  8735. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  8736. },
  8737. codeScanning: {
  8738. deleteAnalysis: [
  8739. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  8740. ],
  8741. getAlert: [
  8742. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  8743. {},
  8744. { renamedParameters: { alert_id: "alert_number" } }
  8745. ],
  8746. getAnalysis: [
  8747. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  8748. ],
  8749. getCodeqlDatabase: [
  8750. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  8751. ],
  8752. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  8753. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  8754. listAlertInstances: [
  8755. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  8756. ],
  8757. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  8758. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  8759. listAlertsInstances: [
  8760. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8761. {},
  8762. { renamed: ["codeScanning", "listAlertInstances"] }
  8763. ],
  8764. listCodeqlDatabases: [
  8765. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  8766. ],
  8767. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  8768. updateAlert: [
  8769. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  8770. ],
  8771. updateDefaultSetup: [
  8772. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  8773. ],
  8774. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  8775. },
  8776. codesOfConduct: {
  8777. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  8778. getConductCode: ["GET /codes_of_conduct/{key}"]
  8779. },
  8780. codespaces: {
  8781. addRepositoryForSecretForAuthenticatedUser: [
  8782. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8783. ],
  8784. addSelectedRepoToOrgSecret: [
  8785. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8786. ],
  8787. checkPermissionsForDevcontainer: [
  8788. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  8789. ],
  8790. codespaceMachinesForAuthenticatedUser: [
  8791. "GET /user/codespaces/{codespace_name}/machines"
  8792. ],
  8793. createForAuthenticatedUser: ["POST /user/codespaces"],
  8794. createOrUpdateOrgSecret: [
  8795. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  8796. ],
  8797. createOrUpdateRepoSecret: [
  8798. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8799. ],
  8800. createOrUpdateSecretForAuthenticatedUser: [
  8801. "PUT /user/codespaces/secrets/{secret_name}"
  8802. ],
  8803. createWithPrForAuthenticatedUser: [
  8804. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  8805. ],
  8806. createWithRepoForAuthenticatedUser: [
  8807. "POST /repos/{owner}/{repo}/codespaces"
  8808. ],
  8809. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  8810. deleteFromOrganization: [
  8811. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  8812. ],
  8813. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  8814. deleteRepoSecret: [
  8815. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8816. ],
  8817. deleteSecretForAuthenticatedUser: [
  8818. "DELETE /user/codespaces/secrets/{secret_name}"
  8819. ],
  8820. exportForAuthenticatedUser: [
  8821. "POST /user/codespaces/{codespace_name}/exports"
  8822. ],
  8823. getCodespacesForUserInOrg: [
  8824. "GET /orgs/{org}/members/{username}/codespaces"
  8825. ],
  8826. getExportDetailsForAuthenticatedUser: [
  8827. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  8828. ],
  8829. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  8830. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  8831. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  8832. getPublicKeyForAuthenticatedUser: [
  8833. "GET /user/codespaces/secrets/public-key"
  8834. ],
  8835. getRepoPublicKey: [
  8836. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  8837. ],
  8838. getRepoSecret: [
  8839. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8840. ],
  8841. getSecretForAuthenticatedUser: [
  8842. "GET /user/codespaces/secrets/{secret_name}"
  8843. ],
  8844. listDevcontainersInRepositoryForAuthenticatedUser: [
  8845. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  8846. ],
  8847. listForAuthenticatedUser: ["GET /user/codespaces"],
  8848. listInOrganization: [
  8849. "GET /orgs/{org}/codespaces",
  8850. {},
  8851. { renamedParameters: { org_id: "org" } }
  8852. ],
  8853. listInRepositoryForAuthenticatedUser: [
  8854. "GET /repos/{owner}/{repo}/codespaces"
  8855. ],
  8856. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  8857. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  8858. listRepositoriesForSecretForAuthenticatedUser: [
  8859. "GET /user/codespaces/secrets/{secret_name}/repositories"
  8860. ],
  8861. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  8862. listSelectedReposForOrgSecret: [
  8863. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8864. ],
  8865. preFlightWithRepoForAuthenticatedUser: [
  8866. "GET /repos/{owner}/{repo}/codespaces/new"
  8867. ],
  8868. publishForAuthenticatedUser: [
  8869. "POST /user/codespaces/{codespace_name}/publish"
  8870. ],
  8871. removeRepositoryForSecretForAuthenticatedUser: [
  8872. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8873. ],
  8874. removeSelectedRepoFromOrgSecret: [
  8875. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8876. ],
  8877. repoMachinesForAuthenticatedUser: [
  8878. "GET /repos/{owner}/{repo}/codespaces/machines"
  8879. ],
  8880. setRepositoriesForSecretForAuthenticatedUser: [
  8881. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  8882. ],
  8883. setSelectedReposForOrgSecret: [
  8884. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8885. ],
  8886. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  8887. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  8888. stopInOrganization: [
  8889. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  8890. ],
  8891. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  8892. },
  8893. copilot: {
  8894. addCopilotSeatsForTeams: [
  8895. "POST /orgs/{org}/copilot/billing/selected_teams"
  8896. ],
  8897. addCopilotSeatsForUsers: [
  8898. "POST /orgs/{org}/copilot/billing/selected_users"
  8899. ],
  8900. cancelCopilotSeatAssignmentForTeams: [
  8901. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  8902. ],
  8903. cancelCopilotSeatAssignmentForUsers: [
  8904. "DELETE /orgs/{org}/copilot/billing/selected_users"
  8905. ],
  8906. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  8907. getCopilotSeatDetailsForUser: [
  8908. "GET /orgs/{org}/members/{username}/copilot"
  8909. ],
  8910. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  8911. },
  8912. dependabot: {
  8913. addSelectedRepoToOrgSecret: [
  8914. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8915. ],
  8916. createOrUpdateOrgSecret: [
  8917. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  8918. ],
  8919. createOrUpdateRepoSecret: [
  8920. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8921. ],
  8922. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  8923. deleteRepoSecret: [
  8924. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8925. ],
  8926. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  8927. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  8928. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  8929. getRepoPublicKey: [
  8930. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  8931. ],
  8932. getRepoSecret: [
  8933. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8934. ],
  8935. listAlertsForEnterprise: [
  8936. "GET /enterprises/{enterprise}/dependabot/alerts"
  8937. ],
  8938. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  8939. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  8940. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  8941. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  8942. listSelectedReposForOrgSecret: [
  8943. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8944. ],
  8945. removeSelectedRepoFromOrgSecret: [
  8946. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8947. ],
  8948. setSelectedReposForOrgSecret: [
  8949. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8950. ],
  8951. updateAlert: [
  8952. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  8953. ]
  8954. },
  8955. dependencyGraph: {
  8956. createRepositorySnapshot: [
  8957. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  8958. ],
  8959. diffRange: [
  8960. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  8961. ],
  8962. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  8963. },
  8964. emojis: { get: ["GET /emojis"] },
  8965. gists: {
  8966. checkIsStarred: ["GET /gists/{gist_id}/star"],
  8967. create: ["POST /gists"],
  8968. createComment: ["POST /gists/{gist_id}/comments"],
  8969. delete: ["DELETE /gists/{gist_id}"],
  8970. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  8971. fork: ["POST /gists/{gist_id}/forks"],
  8972. get: ["GET /gists/{gist_id}"],
  8973. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  8974. getRevision: ["GET /gists/{gist_id}/{sha}"],
  8975. list: ["GET /gists"],
  8976. listComments: ["GET /gists/{gist_id}/comments"],
  8977. listCommits: ["GET /gists/{gist_id}/commits"],
  8978. listForUser: ["GET /users/{username}/gists"],
  8979. listForks: ["GET /gists/{gist_id}/forks"],
  8980. listPublic: ["GET /gists/public"],
  8981. listStarred: ["GET /gists/starred"],
  8982. star: ["PUT /gists/{gist_id}/star"],
  8983. unstar: ["DELETE /gists/{gist_id}/star"],
  8984. update: ["PATCH /gists/{gist_id}"],
  8985. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  8986. },
  8987. git: {
  8988. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  8989. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  8990. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  8991. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  8992. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  8993. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  8994. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  8995. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  8996. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  8997. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  8998. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  8999. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9000. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9001. },
  9002. gitignore: {
  9003. getAllTemplates: ["GET /gitignore/templates"],
  9004. getTemplate: ["GET /gitignore/templates/{name}"]
  9005. },
  9006. interactions: {
  9007. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9008. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9009. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9010. getRestrictionsForYourPublicRepos: [
  9011. "GET /user/interaction-limits",
  9012. {},
  9013. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9014. ],
  9015. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9016. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9017. removeRestrictionsForRepo: [
  9018. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9019. ],
  9020. removeRestrictionsForYourPublicRepos: [
  9021. "DELETE /user/interaction-limits",
  9022. {},
  9023. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9024. ],
  9025. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9026. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9027. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9028. setRestrictionsForYourPublicRepos: [
  9029. "PUT /user/interaction-limits",
  9030. {},
  9031. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9032. ]
  9033. },
  9034. issues: {
  9035. addAssignees: [
  9036. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9037. ],
  9038. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9039. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9040. checkUserCanBeAssignedToIssue: [
  9041. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9042. ],
  9043. create: ["POST /repos/{owner}/{repo}/issues"],
  9044. createComment: [
  9045. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9046. ],
  9047. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9048. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9049. deleteComment: [
  9050. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9051. ],
  9052. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9053. deleteMilestone: [
  9054. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9055. ],
  9056. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9057. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9058. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9059. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9060. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9061. list: ["GET /issues"],
  9062. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9063. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9064. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9065. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9066. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9067. listEventsForTimeline: [
  9068. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9069. ],
  9070. listForAuthenticatedUser: ["GET /user/issues"],
  9071. listForOrg: ["GET /orgs/{org}/issues"],
  9072. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9073. listLabelsForMilestone: [
  9074. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9075. ],
  9076. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9077. listLabelsOnIssue: [
  9078. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9079. ],
  9080. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9081. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9082. removeAllLabels: [
  9083. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9084. ],
  9085. removeAssignees: [
  9086. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9087. ],
  9088. removeLabel: [
  9089. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9090. ],
  9091. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9092. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9093. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9094. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9095. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9096. updateMilestone: [
  9097. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9098. ]
  9099. },
  9100. licenses: {
  9101. get: ["GET /licenses/{license}"],
  9102. getAllCommonlyUsed: ["GET /licenses"],
  9103. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9104. },
  9105. markdown: {
  9106. render: ["POST /markdown"],
  9107. renderRaw: [
  9108. "POST /markdown/raw",
  9109. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9110. ]
  9111. },
  9112. meta: {
  9113. get: ["GET /meta"],
  9114. getAllVersions: ["GET /versions"],
  9115. getOctocat: ["GET /octocat"],
  9116. getZen: ["GET /zen"],
  9117. root: ["GET /"]
  9118. },
  9119. migrations: {
  9120. cancelImport: [
  9121. "DELETE /repos/{owner}/{repo}/import",
  9122. {},
  9123. {
  9124. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9125. }
  9126. ],
  9127. deleteArchiveForAuthenticatedUser: [
  9128. "DELETE /user/migrations/{migration_id}/archive"
  9129. ],
  9130. deleteArchiveForOrg: [
  9131. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9132. ],
  9133. downloadArchiveForOrg: [
  9134. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9135. ],
  9136. getArchiveForAuthenticatedUser: [
  9137. "GET /user/migrations/{migration_id}/archive"
  9138. ],
  9139. getCommitAuthors: [
  9140. "GET /repos/{owner}/{repo}/import/authors",
  9141. {},
  9142. {
  9143. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9144. }
  9145. ],
  9146. getImportStatus: [
  9147. "GET /repos/{owner}/{repo}/import",
  9148. {},
  9149. {
  9150. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9151. }
  9152. ],
  9153. getLargeFiles: [
  9154. "GET /repos/{owner}/{repo}/import/large_files",
  9155. {},
  9156. {
  9157. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9158. }
  9159. ],
  9160. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9161. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9162. listForAuthenticatedUser: ["GET /user/migrations"],
  9163. listForOrg: ["GET /orgs/{org}/migrations"],
  9164. listReposForAuthenticatedUser: [
  9165. "GET /user/migrations/{migration_id}/repositories"
  9166. ],
  9167. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9168. listReposForUser: [
  9169. "GET /user/migrations/{migration_id}/repositories",
  9170. {},
  9171. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9172. ],
  9173. mapCommitAuthor: [
  9174. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9175. {},
  9176. {
  9177. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9178. }
  9179. ],
  9180. setLfsPreference: [
  9181. "PATCH /repos/{owner}/{repo}/import/lfs",
  9182. {},
  9183. {
  9184. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9185. }
  9186. ],
  9187. startForAuthenticatedUser: ["POST /user/migrations"],
  9188. startForOrg: ["POST /orgs/{org}/migrations"],
  9189. startImport: [
  9190. "PUT /repos/{owner}/{repo}/import",
  9191. {},
  9192. {
  9193. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9194. }
  9195. ],
  9196. unlockRepoForAuthenticatedUser: [
  9197. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9198. ],
  9199. unlockRepoForOrg: [
  9200. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9201. ],
  9202. updateImport: [
  9203. "PATCH /repos/{owner}/{repo}/import",
  9204. {},
  9205. {
  9206. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9207. }
  9208. ]
  9209. },
  9210. oidc: {
  9211. getOidcCustomSubTemplateForOrg: [
  9212. "GET /orgs/{org}/actions/oidc/customization/sub"
  9213. ],
  9214. updateOidcCustomSubTemplateForOrg: [
  9215. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9216. ]
  9217. },
  9218. orgs: {
  9219. addSecurityManagerTeam: [
  9220. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9221. ],
  9222. assignTeamToOrgRole: [
  9223. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9224. ],
  9225. assignUserToOrgRole: [
  9226. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9227. ],
  9228. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9229. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9230. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9231. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9232. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9233. convertMemberToOutsideCollaborator: [
  9234. "PUT /orgs/{org}/outside_collaborators/{username}"
  9235. ],
  9236. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9237. createInvitation: ["POST /orgs/{org}/invitations"],
  9238. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9239. createOrUpdateCustomPropertiesValuesForRepos: [
  9240. "PATCH /orgs/{org}/properties/values"
  9241. ],
  9242. createOrUpdateCustomProperty: [
  9243. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9244. ],
  9245. createWebhook: ["POST /orgs/{org}/hooks"],
  9246. delete: ["DELETE /orgs/{org}"],
  9247. deleteCustomOrganizationRole: [
  9248. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9249. ],
  9250. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9251. enableOrDisableSecurityProductOnAllOrgRepos: [
  9252. "POST /orgs/{org}/{security_product}/{enablement}"
  9253. ],
  9254. get: ["GET /orgs/{org}"],
  9255. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9256. getCustomProperty: [
  9257. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9258. ],
  9259. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9260. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9261. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9262. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9263. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9264. getWebhookDelivery: [
  9265. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9266. ],
  9267. list: ["GET /organizations"],
  9268. listAppInstallations: ["GET /orgs/{org}/installations"],
  9269. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9270. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9271. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9272. listForAuthenticatedUser: ["GET /user/orgs"],
  9273. listForUser: ["GET /users/{username}/orgs"],
  9274. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9275. listMembers: ["GET /orgs/{org}/members"],
  9276. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9277. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9278. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9279. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9280. listOrganizationFineGrainedPermissions: [
  9281. "GET /orgs/{org}/organization-fine-grained-permissions"
  9282. ],
  9283. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9284. listPatGrantRepositories: [
  9285. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9286. ],
  9287. listPatGrantRequestRepositories: [
  9288. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9289. ],
  9290. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9291. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9292. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9293. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9294. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9295. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9296. listWebhooks: ["GET /orgs/{org}/hooks"],
  9297. patchCustomOrganizationRole: [
  9298. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9299. ],
  9300. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9301. redeliverWebhookDelivery: [
  9302. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9303. ],
  9304. removeCustomProperty: [
  9305. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9306. ],
  9307. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9308. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9309. removeOutsideCollaborator: [
  9310. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9311. ],
  9312. removePublicMembershipForAuthenticatedUser: [
  9313. "DELETE /orgs/{org}/public_members/{username}"
  9314. ],
  9315. removeSecurityManagerTeam: [
  9316. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9317. ],
  9318. reviewPatGrantRequest: [
  9319. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9320. ],
  9321. reviewPatGrantRequestsInBulk: [
  9322. "POST /orgs/{org}/personal-access-token-requests"
  9323. ],
  9324. revokeAllOrgRolesTeam: [
  9325. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9326. ],
  9327. revokeAllOrgRolesUser: [
  9328. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9329. ],
  9330. revokeOrgRoleTeam: [
  9331. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9332. ],
  9333. revokeOrgRoleUser: [
  9334. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9335. ],
  9336. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9337. setPublicMembershipForAuthenticatedUser: [
  9338. "PUT /orgs/{org}/public_members/{username}"
  9339. ],
  9340. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9341. update: ["PATCH /orgs/{org}"],
  9342. updateMembershipForAuthenticatedUser: [
  9343. "PATCH /user/memberships/orgs/{org}"
  9344. ],
  9345. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9346. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9347. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9348. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9349. },
  9350. packages: {
  9351. deletePackageForAuthenticatedUser: [
  9352. "DELETE /user/packages/{package_type}/{package_name}"
  9353. ],
  9354. deletePackageForOrg: [
  9355. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9356. ],
  9357. deletePackageForUser: [
  9358. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9359. ],
  9360. deletePackageVersionForAuthenticatedUser: [
  9361. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9362. ],
  9363. deletePackageVersionForOrg: [
  9364. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9365. ],
  9366. deletePackageVersionForUser: [
  9367. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9368. ],
  9369. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9370. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9371. {},
  9372. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9373. ],
  9374. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9375. "GET /user/packages/{package_type}/{package_name}/versions",
  9376. {},
  9377. {
  9378. renamed: [
  9379. "packages",
  9380. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9381. ]
  9382. }
  9383. ],
  9384. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9385. "GET /user/packages/{package_type}/{package_name}/versions"
  9386. ],
  9387. getAllPackageVersionsForPackageOwnedByOrg: [
  9388. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9389. ],
  9390. getAllPackageVersionsForPackageOwnedByUser: [
  9391. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9392. ],
  9393. getPackageForAuthenticatedUser: [
  9394. "GET /user/packages/{package_type}/{package_name}"
  9395. ],
  9396. getPackageForOrganization: [
  9397. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9398. ],
  9399. getPackageForUser: [
  9400. "GET /users/{username}/packages/{package_type}/{package_name}"
  9401. ],
  9402. getPackageVersionForAuthenticatedUser: [
  9403. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9404. ],
  9405. getPackageVersionForOrganization: [
  9406. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9407. ],
  9408. getPackageVersionForUser: [
  9409. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9410. ],
  9411. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9412. "GET /user/docker/conflicts"
  9413. ],
  9414. listDockerMigrationConflictingPackagesForOrganization: [
  9415. "GET /orgs/{org}/docker/conflicts"
  9416. ],
  9417. listDockerMigrationConflictingPackagesForUser: [
  9418. "GET /users/{username}/docker/conflicts"
  9419. ],
  9420. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9421. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9422. listPackagesForUser: ["GET /users/{username}/packages"],
  9423. restorePackageForAuthenticatedUser: [
  9424. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9425. ],
  9426. restorePackageForOrg: [
  9427. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9428. ],
  9429. restorePackageForUser: [
  9430. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9431. ],
  9432. restorePackageVersionForAuthenticatedUser: [
  9433. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9434. ],
  9435. restorePackageVersionForOrg: [
  9436. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9437. ],
  9438. restorePackageVersionForUser: [
  9439. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9440. ]
  9441. },
  9442. projects: {
  9443. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9444. createCard: ["POST /projects/columns/{column_id}/cards"],
  9445. createColumn: ["POST /projects/{project_id}/columns"],
  9446. createForAuthenticatedUser: ["POST /user/projects"],
  9447. createForOrg: ["POST /orgs/{org}/projects"],
  9448. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9449. delete: ["DELETE /projects/{project_id}"],
  9450. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9451. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9452. get: ["GET /projects/{project_id}"],
  9453. getCard: ["GET /projects/columns/cards/{card_id}"],
  9454. getColumn: ["GET /projects/columns/{column_id}"],
  9455. getPermissionForUser: [
  9456. "GET /projects/{project_id}/collaborators/{username}/permission"
  9457. ],
  9458. listCards: ["GET /projects/columns/{column_id}/cards"],
  9459. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9460. listColumns: ["GET /projects/{project_id}/columns"],
  9461. listForOrg: ["GET /orgs/{org}/projects"],
  9462. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9463. listForUser: ["GET /users/{username}/projects"],
  9464. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9465. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9466. removeCollaborator: [
  9467. "DELETE /projects/{project_id}/collaborators/{username}"
  9468. ],
  9469. update: ["PATCH /projects/{project_id}"],
  9470. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9471. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9472. },
  9473. pulls: {
  9474. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9475. create: ["POST /repos/{owner}/{repo}/pulls"],
  9476. createReplyForReviewComment: [
  9477. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9478. ],
  9479. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9480. createReviewComment: [
  9481. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9482. ],
  9483. deletePendingReview: [
  9484. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9485. ],
  9486. deleteReviewComment: [
  9487. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9488. ],
  9489. dismissReview: [
  9490. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9491. ],
  9492. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9493. getReview: [
  9494. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9495. ],
  9496. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9497. list: ["GET /repos/{owner}/{repo}/pulls"],
  9498. listCommentsForReview: [
  9499. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9500. ],
  9501. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9502. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9503. listRequestedReviewers: [
  9504. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9505. ],
  9506. listReviewComments: [
  9507. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9508. ],
  9509. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9510. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9511. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9512. removeRequestedReviewers: [
  9513. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9514. ],
  9515. requestReviewers: [
  9516. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9517. ],
  9518. submitReview: [
  9519. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9520. ],
  9521. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9522. updateBranch: [
  9523. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9524. ],
  9525. updateReview: [
  9526. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9527. ],
  9528. updateReviewComment: [
  9529. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9530. ]
  9531. },
  9532. rateLimit: { get: ["GET /rate_limit"] },
  9533. reactions: {
  9534. createForCommitComment: [
  9535. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9536. ],
  9537. createForIssue: [
  9538. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9539. ],
  9540. createForIssueComment: [
  9541. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9542. ],
  9543. createForPullRequestReviewComment: [
  9544. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9545. ],
  9546. createForRelease: [
  9547. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9548. ],
  9549. createForTeamDiscussionCommentInOrg: [
  9550. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9551. ],
  9552. createForTeamDiscussionInOrg: [
  9553. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9554. ],
  9555. deleteForCommitComment: [
  9556. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9557. ],
  9558. deleteForIssue: [
  9559. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9560. ],
  9561. deleteForIssueComment: [
  9562. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9563. ],
  9564. deleteForPullRequestComment: [
  9565. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9566. ],
  9567. deleteForRelease: [
  9568. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9569. ],
  9570. deleteForTeamDiscussion: [
  9571. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9572. ],
  9573. deleteForTeamDiscussionComment: [
  9574. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9575. ],
  9576. listForCommitComment: [
  9577. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9578. ],
  9579. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9580. listForIssueComment: [
  9581. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9582. ],
  9583. listForPullRequestReviewComment: [
  9584. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9585. ],
  9586. listForRelease: [
  9587. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9588. ],
  9589. listForTeamDiscussionCommentInOrg: [
  9590. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9591. ],
  9592. listForTeamDiscussionInOrg: [
  9593. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9594. ]
  9595. },
  9596. repos: {
  9597. acceptInvitation: [
  9598. "PATCH /user/repository_invitations/{invitation_id}",
  9599. {},
  9600. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9601. ],
  9602. acceptInvitationForAuthenticatedUser: [
  9603. "PATCH /user/repository_invitations/{invitation_id}"
  9604. ],
  9605. addAppAccessRestrictions: [
  9606. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9607. {},
  9608. { mapToData: "apps" }
  9609. ],
  9610. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9611. addStatusCheckContexts: [
  9612. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9613. {},
  9614. { mapToData: "contexts" }
  9615. ],
  9616. addTeamAccessRestrictions: [
  9617. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9618. {},
  9619. { mapToData: "teams" }
  9620. ],
  9621. addUserAccessRestrictions: [
  9622. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9623. {},
  9624. { mapToData: "users" }
  9625. ],
  9626. cancelPagesDeployment: [
  9627. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9628. ],
  9629. checkAutomatedSecurityFixes: [
  9630. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9631. ],
  9632. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9633. checkVulnerabilityAlerts: [
  9634. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9635. ],
  9636. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9637. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9638. compareCommitsWithBasehead: [
  9639. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9640. ],
  9641. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9642. createCommitComment: [
  9643. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9644. ],
  9645. createCommitSignatureProtection: [
  9646. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9647. ],
  9648. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9649. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9650. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9651. createDeploymentBranchPolicy: [
  9652. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9653. ],
  9654. createDeploymentProtectionRule: [
  9655. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9656. ],
  9657. createDeploymentStatus: [
  9658. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9659. ],
  9660. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9661. createForAuthenticatedUser: ["POST /user/repos"],
  9662. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9663. createInOrg: ["POST /orgs/{org}/repos"],
  9664. createOrUpdateCustomPropertiesValues: [
  9665. "PATCH /repos/{owner}/{repo}/properties/values"
  9666. ],
  9667. createOrUpdateEnvironment: [
  9668. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9669. ],
  9670. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9671. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9672. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9673. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9674. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9675. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9676. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9677. createUsingTemplate: [
  9678. "POST /repos/{template_owner}/{template_repo}/generate"
  9679. ],
  9680. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9681. declineInvitation: [
  9682. "DELETE /user/repository_invitations/{invitation_id}",
  9683. {},
  9684. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9685. ],
  9686. declineInvitationForAuthenticatedUser: [
  9687. "DELETE /user/repository_invitations/{invitation_id}"
  9688. ],
  9689. delete: ["DELETE /repos/{owner}/{repo}"],
  9690. deleteAccessRestrictions: [
  9691. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9692. ],
  9693. deleteAdminBranchProtection: [
  9694. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9695. ],
  9696. deleteAnEnvironment: [
  9697. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9698. ],
  9699. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9700. deleteBranchProtection: [
  9701. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9702. ],
  9703. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9704. deleteCommitSignatureProtection: [
  9705. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9706. ],
  9707. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9708. deleteDeployment: [
  9709. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9710. ],
  9711. deleteDeploymentBranchPolicy: [
  9712. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9713. ],
  9714. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9715. deleteInvitation: [
  9716. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9717. ],
  9718. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9719. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9720. deletePullRequestReviewProtection: [
  9721. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9722. ],
  9723. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  9724. deleteReleaseAsset: [
  9725. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9726. ],
  9727. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9728. deleteTagProtection: [
  9729. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  9730. ],
  9731. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  9732. disableAutomatedSecurityFixes: [
  9733. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  9734. ],
  9735. disableDeploymentProtectionRule: [
  9736. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9737. ],
  9738. disablePrivateVulnerabilityReporting: [
  9739. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  9740. ],
  9741. disableVulnerabilityAlerts: [
  9742. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  9743. ],
  9744. downloadArchive: [
  9745. "GET /repos/{owner}/{repo}/zipball/{ref}",
  9746. {},
  9747. { renamed: ["repos", "downloadZipballArchive"] }
  9748. ],
  9749. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  9750. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  9751. enableAutomatedSecurityFixes: [
  9752. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  9753. ],
  9754. enablePrivateVulnerabilityReporting: [
  9755. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  9756. ],
  9757. enableVulnerabilityAlerts: [
  9758. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  9759. ],
  9760. generateReleaseNotes: [
  9761. "POST /repos/{owner}/{repo}/releases/generate-notes"
  9762. ],
  9763. get: ["GET /repos/{owner}/{repo}"],
  9764. getAccessRestrictions: [
  9765. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9766. ],
  9767. getAdminBranchProtection: [
  9768. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9769. ],
  9770. getAllDeploymentProtectionRules: [
  9771. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9772. ],
  9773. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  9774. getAllStatusCheckContexts: [
  9775. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  9776. ],
  9777. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  9778. getAppsWithAccessToProtectedBranch: [
  9779. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  9780. ],
  9781. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9782. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  9783. getBranchProtection: [
  9784. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  9785. ],
  9786. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  9787. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  9788. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  9789. getCollaboratorPermissionLevel: [
  9790. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  9791. ],
  9792. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  9793. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  9794. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  9795. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  9796. getCommitSignatureProtection: [
  9797. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9798. ],
  9799. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  9800. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  9801. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  9802. getCustomDeploymentProtectionRule: [
  9803. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9804. ],
  9805. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  9806. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  9807. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  9808. getDeploymentBranchPolicy: [
  9809. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9810. ],
  9811. getDeploymentStatus: [
  9812. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  9813. ],
  9814. getEnvironment: [
  9815. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  9816. ],
  9817. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  9818. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  9819. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  9820. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  9821. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  9822. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  9823. getPages: ["GET /repos/{owner}/{repo}/pages"],
  9824. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  9825. getPagesDeployment: [
  9826. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  9827. ],
  9828. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  9829. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  9830. getPullRequestReviewProtection: [
  9831. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9832. ],
  9833. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  9834. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  9835. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  9836. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  9837. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  9838. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  9839. getRepoRuleSuite: [
  9840. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  9841. ],
  9842. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  9843. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9844. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  9845. getStatusChecksProtection: [
  9846. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9847. ],
  9848. getTeamsWithAccessToProtectedBranch: [
  9849. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  9850. ],
  9851. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  9852. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  9853. getUsersWithAccessToProtectedBranch: [
  9854. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  9855. ],
  9856. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  9857. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  9858. getWebhookConfigForRepo: [
  9859. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  9860. ],
  9861. getWebhookDelivery: [
  9862. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  9863. ],
  9864. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  9865. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  9866. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  9867. listBranchesForHeadCommit: [
  9868. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  9869. ],
  9870. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  9871. listCommentsForCommit: [
  9872. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9873. ],
  9874. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  9875. listCommitStatusesForRef: [
  9876. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  9877. ],
  9878. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  9879. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  9880. listCustomDeploymentRuleIntegrations: [
  9881. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  9882. ],
  9883. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  9884. listDeploymentBranchPolicies: [
  9885. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9886. ],
  9887. listDeploymentStatuses: [
  9888. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9889. ],
  9890. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  9891. listForAuthenticatedUser: ["GET /user/repos"],
  9892. listForOrg: ["GET /orgs/{org}/repos"],
  9893. listForUser: ["GET /users/{username}/repos"],
  9894. listForks: ["GET /repos/{owner}/{repo}/forks"],
  9895. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  9896. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  9897. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  9898. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  9899. listPublic: ["GET /repositories"],
  9900. listPullRequestsAssociatedWithCommit: [
  9901. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  9902. ],
  9903. listReleaseAssets: [
  9904. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  9905. ],
  9906. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  9907. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  9908. listTags: ["GET /repos/{owner}/{repo}/tags"],
  9909. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  9910. listWebhookDeliveries: [
  9911. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  9912. ],
  9913. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  9914. merge: ["POST /repos/{owner}/{repo}/merges"],
  9915. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  9916. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  9917. redeliverWebhookDelivery: [
  9918. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9919. ],
  9920. removeAppAccessRestrictions: [
  9921. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9922. {},
  9923. { mapToData: "apps" }
  9924. ],
  9925. removeCollaborator: [
  9926. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  9927. ],
  9928. removeStatusCheckContexts: [
  9929. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9930. {},
  9931. { mapToData: "contexts" }
  9932. ],
  9933. removeStatusCheckProtection: [
  9934. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9935. ],
  9936. removeTeamAccessRestrictions: [
  9937. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9938. {},
  9939. { mapToData: "teams" }
  9940. ],
  9941. removeUserAccessRestrictions: [
  9942. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9943. {},
  9944. { mapToData: "users" }
  9945. ],
  9946. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  9947. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  9948. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  9949. setAdminBranchProtection: [
  9950. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9951. ],
  9952. setAppAccessRestrictions: [
  9953. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9954. {},
  9955. { mapToData: "apps" }
  9956. ],
  9957. setStatusCheckContexts: [
  9958. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9959. {},
  9960. { mapToData: "contexts" }
  9961. ],
  9962. setTeamAccessRestrictions: [
  9963. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9964. {},
  9965. { mapToData: "teams" }
  9966. ],
  9967. setUserAccessRestrictions: [
  9968. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9969. {},
  9970. { mapToData: "users" }
  9971. ],
  9972. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  9973. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  9974. update: ["PATCH /repos/{owner}/{repo}"],
  9975. updateBranchProtection: [
  9976. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  9977. ],
  9978. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  9979. updateDeploymentBranchPolicy: [
  9980. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9981. ],
  9982. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  9983. updateInvitation: [
  9984. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  9985. ],
  9986. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  9987. updatePullRequestReviewProtection: [
  9988. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9989. ],
  9990. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  9991. updateReleaseAsset: [
  9992. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9993. ],
  9994. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9995. updateStatusCheckPotection: [
  9996. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  9997. {},
  9998. { renamed: ["repos", "updateStatusCheckProtection"] }
  9999. ],
  10000. updateStatusCheckProtection: [
  10001. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10002. ],
  10003. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10004. updateWebhookConfigForRepo: [
  10005. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10006. ],
  10007. uploadReleaseAsset: [
  10008. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10009. { baseUrl: "https://uploads.github.com" }
  10010. ]
  10011. },
  10012. search: {
  10013. code: ["GET /search/code"],
  10014. commits: ["GET /search/commits"],
  10015. issuesAndPullRequests: ["GET /search/issues"],
  10016. labels: ["GET /search/labels"],
  10017. repos: ["GET /search/repositories"],
  10018. topics: ["GET /search/topics"],
  10019. users: ["GET /search/users"]
  10020. },
  10021. secretScanning: {
  10022. getAlert: [
  10023. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10024. ],
  10025. listAlertsForEnterprise: [
  10026. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10027. ],
  10028. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10029. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10030. listLocationsForAlert: [
  10031. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10032. ],
  10033. updateAlert: [
  10034. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10035. ]
  10036. },
  10037. securityAdvisories: {
  10038. createFork: [
  10039. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10040. ],
  10041. createPrivateVulnerabilityReport: [
  10042. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10043. ],
  10044. createRepositoryAdvisory: [
  10045. "POST /repos/{owner}/{repo}/security-advisories"
  10046. ],
  10047. createRepositoryAdvisoryCveRequest: [
  10048. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10049. ],
  10050. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10051. getRepositoryAdvisory: [
  10052. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10053. ],
  10054. listGlobalAdvisories: ["GET /advisories"],
  10055. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10056. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10057. updateRepositoryAdvisory: [
  10058. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10059. ]
  10060. },
  10061. teams: {
  10062. addOrUpdateMembershipForUserInOrg: [
  10063. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10064. ],
  10065. addOrUpdateProjectPermissionsInOrg: [
  10066. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10067. ],
  10068. addOrUpdateRepoPermissionsInOrg: [
  10069. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10070. ],
  10071. checkPermissionsForProjectInOrg: [
  10072. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10073. ],
  10074. checkPermissionsForRepoInOrg: [
  10075. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10076. ],
  10077. create: ["POST /orgs/{org}/teams"],
  10078. createDiscussionCommentInOrg: [
  10079. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10080. ],
  10081. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10082. deleteDiscussionCommentInOrg: [
  10083. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10084. ],
  10085. deleteDiscussionInOrg: [
  10086. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10087. ],
  10088. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10089. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10090. getDiscussionCommentInOrg: [
  10091. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10092. ],
  10093. getDiscussionInOrg: [
  10094. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10095. ],
  10096. getMembershipForUserInOrg: [
  10097. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10098. ],
  10099. list: ["GET /orgs/{org}/teams"],
  10100. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10101. listDiscussionCommentsInOrg: [
  10102. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10103. ],
  10104. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10105. listForAuthenticatedUser: ["GET /user/teams"],
  10106. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10107. listPendingInvitationsInOrg: [
  10108. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10109. ],
  10110. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10111. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10112. removeMembershipForUserInOrg: [
  10113. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10114. ],
  10115. removeProjectInOrg: [
  10116. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10117. ],
  10118. removeRepoInOrg: [
  10119. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10120. ],
  10121. updateDiscussionCommentInOrg: [
  10122. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10123. ],
  10124. updateDiscussionInOrg: [
  10125. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10126. ],
  10127. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10128. },
  10129. users: {
  10130. addEmailForAuthenticated: [
  10131. "POST /user/emails",
  10132. {},
  10133. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10134. ],
  10135. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10136. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10137. block: ["PUT /user/blocks/{username}"],
  10138. checkBlocked: ["GET /user/blocks/{username}"],
  10139. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10140. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10141. createGpgKeyForAuthenticated: [
  10142. "POST /user/gpg_keys",
  10143. {},
  10144. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10145. ],
  10146. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10147. createPublicSshKeyForAuthenticated: [
  10148. "POST /user/keys",
  10149. {},
  10150. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10151. ],
  10152. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10153. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10154. deleteEmailForAuthenticated: [
  10155. "DELETE /user/emails",
  10156. {},
  10157. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10158. ],
  10159. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10160. deleteGpgKeyForAuthenticated: [
  10161. "DELETE /user/gpg_keys/{gpg_key_id}",
  10162. {},
  10163. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10164. ],
  10165. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10166. deletePublicSshKeyForAuthenticated: [
  10167. "DELETE /user/keys/{key_id}",
  10168. {},
  10169. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10170. ],
  10171. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10172. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10173. deleteSshSigningKeyForAuthenticatedUser: [
  10174. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10175. ],
  10176. follow: ["PUT /user/following/{username}"],
  10177. getAuthenticated: ["GET /user"],
  10178. getByUsername: ["GET /users/{username}"],
  10179. getContextForUser: ["GET /users/{username}/hovercard"],
  10180. getGpgKeyForAuthenticated: [
  10181. "GET /user/gpg_keys/{gpg_key_id}",
  10182. {},
  10183. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10184. ],
  10185. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10186. getPublicSshKeyForAuthenticated: [
  10187. "GET /user/keys/{key_id}",
  10188. {},
  10189. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10190. ],
  10191. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10192. getSshSigningKeyForAuthenticatedUser: [
  10193. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10194. ],
  10195. list: ["GET /users"],
  10196. listBlockedByAuthenticated: [
  10197. "GET /user/blocks",
  10198. {},
  10199. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10200. ],
  10201. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10202. listEmailsForAuthenticated: [
  10203. "GET /user/emails",
  10204. {},
  10205. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10206. ],
  10207. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10208. listFollowedByAuthenticated: [
  10209. "GET /user/following",
  10210. {},
  10211. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10212. ],
  10213. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10214. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10215. listFollowersForUser: ["GET /users/{username}/followers"],
  10216. listFollowingForUser: ["GET /users/{username}/following"],
  10217. listGpgKeysForAuthenticated: [
  10218. "GET /user/gpg_keys",
  10219. {},
  10220. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10221. ],
  10222. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10223. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10224. listPublicEmailsForAuthenticated: [
  10225. "GET /user/public_emails",
  10226. {},
  10227. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10228. ],
  10229. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10230. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10231. listPublicSshKeysForAuthenticated: [
  10232. "GET /user/keys",
  10233. {},
  10234. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10235. ],
  10236. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10237. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10238. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10239. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10240. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10241. setPrimaryEmailVisibilityForAuthenticated: [
  10242. "PATCH /user/email/visibility",
  10243. {},
  10244. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10245. ],
  10246. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10247. "PATCH /user/email/visibility"
  10248. ],
  10249. unblock: ["DELETE /user/blocks/{username}"],
  10250. unfollow: ["DELETE /user/following/{username}"],
  10251. updateAuthenticated: ["PATCH /user"]
  10252. }
  10253. };
  10254. var endpoints_default = Endpoints;
  10255. // pkg/dist-src/endpoints-to-methods.js
  10256. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10257. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10258. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10259. const [route, defaults, decorations] = endpoint;
  10260. const [method, url] = route.split(/ /);
  10261. const endpointDefaults = Object.assign(
  10262. {
  10263. method,
  10264. url
  10265. },
  10266. defaults
  10267. );
  10268. if (!endpointMethodsMap.has(scope)) {
  10269. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10270. }
  10271. endpointMethodsMap.get(scope).set(methodName, {
  10272. scope,
  10273. methodName,
  10274. endpointDefaults,
  10275. decorations
  10276. });
  10277. }
  10278. }
  10279. var handler = {
  10280. has({ scope }, methodName) {
  10281. return endpointMethodsMap.get(scope).has(methodName);
  10282. },
  10283. getOwnPropertyDescriptor(target, methodName) {
  10284. return {
  10285. value: this.get(target, methodName),
  10286. // ensures method is in the cache
  10287. configurable: true,
  10288. writable: true,
  10289. enumerable: true
  10290. };
  10291. },
  10292. defineProperty(target, methodName, descriptor) {
  10293. Object.defineProperty(target.cache, methodName, descriptor);
  10294. return true;
  10295. },
  10296. deleteProperty(target, methodName) {
  10297. delete target.cache[methodName];
  10298. return true;
  10299. },
  10300. ownKeys({ scope }) {
  10301. return [...endpointMethodsMap.get(scope).keys()];
  10302. },
  10303. set(target, methodName, value) {
  10304. return target.cache[methodName] = value;
  10305. },
  10306. get({ octokit, scope, cache }, methodName) {
  10307. if (cache[methodName]) {
  10308. return cache[methodName];
  10309. }
  10310. const method = endpointMethodsMap.get(scope).get(methodName);
  10311. if (!method) {
  10312. return void 0;
  10313. }
  10314. const { endpointDefaults, decorations } = method;
  10315. if (decorations) {
  10316. cache[methodName] = decorate(
  10317. octokit,
  10318. scope,
  10319. methodName,
  10320. endpointDefaults,
  10321. decorations
  10322. );
  10323. } else {
  10324. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10325. }
  10326. return cache[methodName];
  10327. }
  10328. };
  10329. function endpointsToMethods(octokit) {
  10330. const newMethods = {};
  10331. for (const scope of endpointMethodsMap.keys()) {
  10332. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10333. }
  10334. return newMethods;
  10335. }
  10336. function decorate(octokit, scope, methodName, defaults, decorations) {
  10337. const requestWithDefaults = octokit.request.defaults(defaults);
  10338. function withDecorations(...args) {
  10339. let options = requestWithDefaults.endpoint.merge(...args);
  10340. if (decorations.mapToData) {
  10341. options = Object.assign({}, options, {
  10342. data: options[decorations.mapToData],
  10343. [decorations.mapToData]: void 0
  10344. });
  10345. return requestWithDefaults(options);
  10346. }
  10347. if (decorations.renamed) {
  10348. const [newScope, newMethodName] = decorations.renamed;
  10349. octokit.log.warn(
  10350. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10351. );
  10352. }
  10353. if (decorations.deprecated) {
  10354. octokit.log.warn(decorations.deprecated);
  10355. }
  10356. if (decorations.renamedParameters) {
  10357. const options2 = requestWithDefaults.endpoint.merge(...args);
  10358. for (const [name, alias] of Object.entries(
  10359. decorations.renamedParameters
  10360. )) {
  10361. if (name in options2) {
  10362. octokit.log.warn(
  10363. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10364. );
  10365. if (!(alias in options2)) {
  10366. options2[alias] = options2[name];
  10367. }
  10368. delete options2[name];
  10369. }
  10370. }
  10371. return requestWithDefaults(options2);
  10372. }
  10373. return requestWithDefaults(...args);
  10374. }
  10375. return Object.assign(withDecorations, requestWithDefaults);
  10376. }
  10377. // pkg/dist-src/index.js
  10378. function restEndpointMethods(octokit) {
  10379. const api = endpointsToMethods(octokit);
  10380. return {
  10381. rest: api
  10382. };
  10383. }
  10384. restEndpointMethods.VERSION = VERSION;
  10385. function legacyRestEndpointMethods(octokit) {
  10386. const api = endpointsToMethods(octokit);
  10387. return {
  10388. ...api,
  10389. rest: api
  10390. };
  10391. }
  10392. legacyRestEndpointMethods.VERSION = VERSION;
  10393. // Annotate the CommonJS export names for ESM import in node:
  10394. 0 && (0);
  10395. /***/ }),
  10396. /***/ 537:
  10397. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10398. "use strict";
  10399. var __create = Object.create;
  10400. var __defProp = Object.defineProperty;
  10401. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10402. var __getOwnPropNames = Object.getOwnPropertyNames;
  10403. var __getProtoOf = Object.getPrototypeOf;
  10404. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10405. var __export = (target, all) => {
  10406. for (var name in all)
  10407. __defProp(target, name, { get: all[name], enumerable: true });
  10408. };
  10409. var __copyProps = (to, from, except, desc) => {
  10410. if (from && typeof from === "object" || typeof from === "function") {
  10411. for (let key of __getOwnPropNames(from))
  10412. if (!__hasOwnProp.call(to, key) && key !== except)
  10413. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10414. }
  10415. return to;
  10416. };
  10417. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10418. // If the importer is in node compatibility mode or this is not an ESM
  10419. // file that has been converted to a CommonJS file using a Babel-
  10420. // compatible transform (i.e. "__esModule" has not been set), then set
  10421. // "default" to the CommonJS "module.exports" for node compatibility.
  10422. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10423. mod
  10424. ));
  10425. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10426. // pkg/dist-src/index.js
  10427. var dist_src_exports = {};
  10428. __export(dist_src_exports, {
  10429. RequestError: () => RequestError
  10430. });
  10431. module.exports = __toCommonJS(dist_src_exports);
  10432. var import_deprecation = __nccwpck_require__(8932);
  10433. var import_once = __toESM(__nccwpck_require__(1223));
  10434. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10435. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10436. var RequestError = class extends Error {
  10437. constructor(message, statusCode, options) {
  10438. super(message);
  10439. if (Error.captureStackTrace) {
  10440. Error.captureStackTrace(this, this.constructor);
  10441. }
  10442. this.name = "HttpError";
  10443. this.status = statusCode;
  10444. let headers;
  10445. if ("headers" in options && typeof options.headers !== "undefined") {
  10446. headers = options.headers;
  10447. }
  10448. if ("response" in options) {
  10449. this.response = options.response;
  10450. headers = options.response.headers;
  10451. }
  10452. const requestCopy = Object.assign({}, options.request);
  10453. if (options.request.headers.authorization) {
  10454. requestCopy.headers = Object.assign({}, options.request.headers, {
  10455. authorization: options.request.headers.authorization.replace(
  10456. / .*$/,
  10457. " [REDACTED]"
  10458. )
  10459. });
  10460. }
  10461. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10462. this.request = requestCopy;
  10463. Object.defineProperty(this, "code", {
  10464. get() {
  10465. logOnceCode(
  10466. new import_deprecation.Deprecation(
  10467. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10468. )
  10469. );
  10470. return statusCode;
  10471. }
  10472. });
  10473. Object.defineProperty(this, "headers", {
  10474. get() {
  10475. logOnceHeaders(
  10476. new import_deprecation.Deprecation(
  10477. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10478. )
  10479. );
  10480. return headers || {};
  10481. }
  10482. });
  10483. }
  10484. };
  10485. // Annotate the CommonJS export names for ESM import in node:
  10486. 0 && (0);
  10487. /***/ }),
  10488. /***/ 6234:
  10489. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10490. "use strict";
  10491. var __defProp = Object.defineProperty;
  10492. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10493. var __getOwnPropNames = Object.getOwnPropertyNames;
  10494. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10495. var __export = (target, all) => {
  10496. for (var name in all)
  10497. __defProp(target, name, { get: all[name], enumerable: true });
  10498. };
  10499. var __copyProps = (to, from, except, desc) => {
  10500. if (from && typeof from === "object" || typeof from === "function") {
  10501. for (let key of __getOwnPropNames(from))
  10502. if (!__hasOwnProp.call(to, key) && key !== except)
  10503. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10504. }
  10505. return to;
  10506. };
  10507. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10508. // pkg/dist-src/index.js
  10509. var dist_src_exports = {};
  10510. __export(dist_src_exports, {
  10511. request: () => request
  10512. });
  10513. module.exports = __toCommonJS(dist_src_exports);
  10514. var import_endpoint = __nccwpck_require__(9440);
  10515. var import_universal_user_agent = __nccwpck_require__(5030);
  10516. // pkg/dist-src/version.js
  10517. var VERSION = "8.4.0";
  10518. // pkg/dist-src/is-plain-object.js
  10519. function isPlainObject(value) {
  10520. if (typeof value !== "object" || value === null)
  10521. return false;
  10522. if (Object.prototype.toString.call(value) !== "[object Object]")
  10523. return false;
  10524. const proto = Object.getPrototypeOf(value);
  10525. if (proto === null)
  10526. return true;
  10527. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10528. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10529. }
  10530. // pkg/dist-src/fetch-wrapper.js
  10531. var import_request_error = __nccwpck_require__(537);
  10532. // pkg/dist-src/get-buffer-response.js
  10533. function getBufferResponse(response) {
  10534. return response.arrayBuffer();
  10535. }
  10536. // pkg/dist-src/fetch-wrapper.js
  10537. function fetchWrapper(requestOptions) {
  10538. var _a, _b, _c, _d;
  10539. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10540. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10541. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10542. requestOptions.body = JSON.stringify(requestOptions.body);
  10543. }
  10544. let headers = {};
  10545. let status;
  10546. let url;
  10547. let { fetch } = globalThis;
  10548. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10549. fetch = requestOptions.request.fetch;
  10550. }
  10551. if (!fetch) {
  10552. throw new Error(
  10553. "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"
  10554. );
  10555. }
  10556. return fetch(requestOptions.url, {
  10557. method: requestOptions.method,
  10558. body: requestOptions.body,
  10559. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10560. headers: requestOptions.headers,
  10561. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10562. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10563. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10564. ...requestOptions.body && { duplex: "half" }
  10565. }).then(async (response) => {
  10566. url = response.url;
  10567. status = response.status;
  10568. for (const keyAndValue of response.headers) {
  10569. headers[keyAndValue[0]] = keyAndValue[1];
  10570. }
  10571. if ("deprecation" in headers) {
  10572. const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
  10573. const deprecationLink = matches && matches.pop();
  10574. log.warn(
  10575. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10576. );
  10577. }
  10578. if (status === 204 || status === 205) {
  10579. return;
  10580. }
  10581. if (requestOptions.method === "HEAD") {
  10582. if (status < 400) {
  10583. return;
  10584. }
  10585. throw new import_request_error.RequestError(response.statusText, status, {
  10586. response: {
  10587. url,
  10588. status,
  10589. headers,
  10590. data: void 0
  10591. },
  10592. request: requestOptions
  10593. });
  10594. }
  10595. if (status === 304) {
  10596. throw new import_request_error.RequestError("Not modified", status, {
  10597. response: {
  10598. url,
  10599. status,
  10600. headers,
  10601. data: await getResponseData(response)
  10602. },
  10603. request: requestOptions
  10604. });
  10605. }
  10606. if (status >= 400) {
  10607. const data = await getResponseData(response);
  10608. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10609. response: {
  10610. url,
  10611. status,
  10612. headers,
  10613. data
  10614. },
  10615. request: requestOptions
  10616. });
  10617. throw error;
  10618. }
  10619. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10620. }).then((data) => {
  10621. return {
  10622. status,
  10623. url,
  10624. headers,
  10625. data
  10626. };
  10627. }).catch((error) => {
  10628. if (error instanceof import_request_error.RequestError)
  10629. throw error;
  10630. else if (error.name === "AbortError")
  10631. throw error;
  10632. let message = error.message;
  10633. if (error.name === "TypeError" && "cause" in error) {
  10634. if (error.cause instanceof Error) {
  10635. message = error.cause.message;
  10636. } else if (typeof error.cause === "string") {
  10637. message = error.cause;
  10638. }
  10639. }
  10640. throw new import_request_error.RequestError(message, 500, {
  10641. request: requestOptions
  10642. });
  10643. });
  10644. }
  10645. async function getResponseData(response) {
  10646. const contentType = response.headers.get("content-type");
  10647. if (/application\/json/.test(contentType)) {
  10648. return response.json().catch(() => response.text()).catch(() => "");
  10649. }
  10650. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10651. return response.text();
  10652. }
  10653. return getBufferResponse(response);
  10654. }
  10655. function toErrorMessage(data) {
  10656. if (typeof data === "string")
  10657. return data;
  10658. let suffix;
  10659. if ("documentation_url" in data) {
  10660. suffix = ` - ${data.documentation_url}`;
  10661. } else {
  10662. suffix = "";
  10663. }
  10664. if ("message" in data) {
  10665. if (Array.isArray(data.errors)) {
  10666. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10667. }
  10668. return `${data.message}${suffix}`;
  10669. }
  10670. return `Unknown error: ${JSON.stringify(data)}`;
  10671. }
  10672. // pkg/dist-src/with-defaults.js
  10673. function withDefaults(oldEndpoint, newDefaults) {
  10674. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10675. const newApi = function(route, parameters) {
  10676. const endpointOptions = endpoint2.merge(route, parameters);
  10677. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10678. return fetchWrapper(endpoint2.parse(endpointOptions));
  10679. }
  10680. const request2 = (route2, parameters2) => {
  10681. return fetchWrapper(
  10682. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10683. );
  10684. };
  10685. Object.assign(request2, {
  10686. endpoint: endpoint2,
  10687. defaults: withDefaults.bind(null, endpoint2)
  10688. });
  10689. return endpointOptions.request.hook(request2, endpointOptions);
  10690. };
  10691. return Object.assign(newApi, {
  10692. endpoint: endpoint2,
  10693. defaults: withDefaults.bind(null, endpoint2)
  10694. });
  10695. }
  10696. // pkg/dist-src/index.js
  10697. var request = withDefaults(import_endpoint.endpoint, {
  10698. headers: {
  10699. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10700. }
  10701. });
  10702. // Annotate the CommonJS export names for ESM import in node:
  10703. 0 && (0);
  10704. /***/ }),
  10705. /***/ 3682:
  10706. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10707. var register = __nccwpck_require__(4670);
  10708. var addHook = __nccwpck_require__(5549);
  10709. var removeHook = __nccwpck_require__(6819);
  10710. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10711. var bind = Function.bind;
  10712. var bindable = bind.bind(bind);
  10713. function bindApi(hook, state, name) {
  10714. var removeHookRef = bindable(removeHook, null).apply(
  10715. null,
  10716. name ? [state, name] : [state]
  10717. );
  10718. hook.api = { remove: removeHookRef };
  10719. hook.remove = removeHookRef;
  10720. ["before", "error", "after", "wrap"].forEach(function (kind) {
  10721. var args = name ? [state, kind, name] : [state, kind];
  10722. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  10723. });
  10724. }
  10725. function HookSingular() {
  10726. var singularHookName = "h";
  10727. var singularHookState = {
  10728. registry: {},
  10729. };
  10730. var singularHook = register.bind(null, singularHookState, singularHookName);
  10731. bindApi(singularHook, singularHookState, singularHookName);
  10732. return singularHook;
  10733. }
  10734. function HookCollection() {
  10735. var state = {
  10736. registry: {},
  10737. };
  10738. var hook = register.bind(null, state);
  10739. bindApi(hook, state);
  10740. return hook;
  10741. }
  10742. var collectionHookDeprecationMessageDisplayed = false;
  10743. function Hook() {
  10744. if (!collectionHookDeprecationMessageDisplayed) {
  10745. console.warn(
  10746. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  10747. );
  10748. collectionHookDeprecationMessageDisplayed = true;
  10749. }
  10750. return HookCollection();
  10751. }
  10752. Hook.Singular = HookSingular.bind();
  10753. Hook.Collection = HookCollection.bind();
  10754. module.exports = Hook;
  10755. // expose constructors as a named property for TypeScript
  10756. module.exports.Hook = Hook;
  10757. module.exports.Singular = Hook.Singular;
  10758. module.exports.Collection = Hook.Collection;
  10759. /***/ }),
  10760. /***/ 5549:
  10761. /***/ ((module) => {
  10762. module.exports = addHook;
  10763. function addHook(state, kind, name, hook) {
  10764. var orig = hook;
  10765. if (!state.registry[name]) {
  10766. state.registry[name] = [];
  10767. }
  10768. if (kind === "before") {
  10769. hook = function (method, options) {
  10770. return Promise.resolve()
  10771. .then(orig.bind(null, options))
  10772. .then(method.bind(null, options));
  10773. };
  10774. }
  10775. if (kind === "after") {
  10776. hook = function (method, options) {
  10777. var result;
  10778. return Promise.resolve()
  10779. .then(method.bind(null, options))
  10780. .then(function (result_) {
  10781. result = result_;
  10782. return orig(result, options);
  10783. })
  10784. .then(function () {
  10785. return result;
  10786. });
  10787. };
  10788. }
  10789. if (kind === "error") {
  10790. hook = function (method, options) {
  10791. return Promise.resolve()
  10792. .then(method.bind(null, options))
  10793. .catch(function (error) {
  10794. return orig(error, options);
  10795. });
  10796. };
  10797. }
  10798. state.registry[name].push({
  10799. hook: hook,
  10800. orig: orig,
  10801. });
  10802. }
  10803. /***/ }),
  10804. /***/ 4670:
  10805. /***/ ((module) => {
  10806. module.exports = register;
  10807. function register(state, name, method, options) {
  10808. if (typeof method !== "function") {
  10809. throw new Error("method for before hook must be a function");
  10810. }
  10811. if (!options) {
  10812. options = {};
  10813. }
  10814. if (Array.isArray(name)) {
  10815. return name.reverse().reduce(function (callback, name) {
  10816. return register.bind(null, state, name, callback, options);
  10817. }, method)();
  10818. }
  10819. return Promise.resolve().then(function () {
  10820. if (!state.registry[name]) {
  10821. return method(options);
  10822. }
  10823. return state.registry[name].reduce(function (method, registered) {
  10824. return registered.hook.bind(null, method, options);
  10825. }, method)();
  10826. });
  10827. }
  10828. /***/ }),
  10829. /***/ 6819:
  10830. /***/ ((module) => {
  10831. module.exports = removeHook;
  10832. function removeHook(state, name, method) {
  10833. if (!state.registry[name]) {
  10834. return;
  10835. }
  10836. var index = state.registry[name]
  10837. .map(function (registered) {
  10838. return registered.orig;
  10839. })
  10840. .indexOf(method);
  10841. if (index === -1) {
  10842. return;
  10843. }
  10844. state.registry[name].splice(index, 1);
  10845. }
  10846. /***/ }),
  10847. /***/ 8932:
  10848. /***/ ((__unused_webpack_module, exports) => {
  10849. "use strict";
  10850. Object.defineProperty(exports, "__esModule", ({ value: true }));
  10851. class Deprecation extends Error {
  10852. constructor(message) {
  10853. super(message); // Maintains proper stack trace (only available on V8)
  10854. /* istanbul ignore next */
  10855. if (Error.captureStackTrace) {
  10856. Error.captureStackTrace(this, this.constructor);
  10857. }
  10858. this.name = 'Deprecation';
  10859. }
  10860. }
  10861. exports.Deprecation = Deprecation;
  10862. /***/ }),
  10863. /***/ 1223:
  10864. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10865. var wrappy = __nccwpck_require__(2940)
  10866. module.exports = wrappy(once)
  10867. module.exports.strict = wrappy(onceStrict)
  10868. once.proto = once(function () {
  10869. Object.defineProperty(Function.prototype, 'once', {
  10870. value: function () {
  10871. return once(this)
  10872. },
  10873. configurable: true
  10874. })
  10875. Object.defineProperty(Function.prototype, 'onceStrict', {
  10876. value: function () {
  10877. return onceStrict(this)
  10878. },
  10879. configurable: true
  10880. })
  10881. })
  10882. function once (fn) {
  10883. var f = function () {
  10884. if (f.called) return f.value
  10885. f.called = true
  10886. return f.value = fn.apply(this, arguments)
  10887. }
  10888. f.called = false
  10889. return f
  10890. }
  10891. function onceStrict (fn) {
  10892. var f = function () {
  10893. if (f.called)
  10894. throw new Error(f.onceError)
  10895. f.called = true
  10896. return f.value = fn.apply(this, arguments)
  10897. }
  10898. var name = fn.name || 'Function wrapped with `once`'
  10899. f.onceError = name + " shouldn't be called more than once"
  10900. f.called = false
  10901. return f
  10902. }
  10903. /***/ }),
  10904. /***/ 5911:
  10905. /***/ ((module, exports) => {
  10906. exports = module.exports = SemVer
  10907. var debug
  10908. /* istanbul ignore next */
  10909. if (typeof process === 'object' &&
  10910. process.env &&
  10911. process.env.NODE_DEBUG &&
  10912. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10913. debug = function () {
  10914. var args = Array.prototype.slice.call(arguments, 0)
  10915. args.unshift('SEMVER')
  10916. console.log.apply(console, args)
  10917. }
  10918. } else {
  10919. debug = function () {}
  10920. }
  10921. // Note: this is the semver.org version of the spec that it implements
  10922. // Not necessarily the package version of this code.
  10923. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10924. var MAX_LENGTH = 256
  10925. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10926. /* istanbul ignore next */ 9007199254740991
  10927. // Max safe segment length for coercion.
  10928. var MAX_SAFE_COMPONENT_LENGTH = 16
  10929. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  10930. // The actual regexps go on exports.re
  10931. var re = exports.re = []
  10932. var safeRe = exports.safeRe = []
  10933. var src = exports.src = []
  10934. var t = exports.tokens = {}
  10935. var R = 0
  10936. function tok (n) {
  10937. t[n] = R++
  10938. }
  10939. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  10940. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  10941. // used internally via the safeRe object since all inputs in this library get
  10942. // normalized first to trim and collapse all extra whitespace. The original
  10943. // regexes are exported for userland consumption and lower level usage. A
  10944. // future breaking change could export the safer regex only with a note that
  10945. // all input should have extra whitespace removed.
  10946. var safeRegexReplacements = [
  10947. ['\\s', 1],
  10948. ['\\d', MAX_LENGTH],
  10949. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  10950. ]
  10951. function makeSafeRe (value) {
  10952. for (var i = 0; i < safeRegexReplacements.length; i++) {
  10953. var token = safeRegexReplacements[i][0]
  10954. var max = safeRegexReplacements[i][1]
  10955. value = value
  10956. .split(token + '*').join(token + '{0,' + max + '}')
  10957. .split(token + '+').join(token + '{1,' + max + '}')
  10958. }
  10959. return value
  10960. }
  10961. // The following Regular Expressions can be used for tokenizing,
  10962. // validating, and parsing SemVer version strings.
  10963. // ## Numeric Identifier
  10964. // A single `0`, or a non-zero digit followed by zero or more digits.
  10965. tok('NUMERICIDENTIFIER')
  10966. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10967. tok('NUMERICIDENTIFIERLOOSE')
  10968. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  10969. // ## Non-numeric Identifier
  10970. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10971. // more letters, digits, or hyphens.
  10972. tok('NONNUMERICIDENTIFIER')
  10973. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  10974. // ## Main Version
  10975. // Three dot-separated numeric identifiers.
  10976. tok('MAINVERSION')
  10977. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10978. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10979. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10980. tok('MAINVERSIONLOOSE')
  10981. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10982. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10983. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10984. // ## Pre-release Version Identifier
  10985. // A numeric identifier, or a non-numeric identifier.
  10986. tok('PRERELEASEIDENTIFIER')
  10987. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10988. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10989. tok('PRERELEASEIDENTIFIERLOOSE')
  10990. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10991. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10992. // ## Pre-release Version
  10993. // Hyphen, followed by one or more dot-separated pre-release version
  10994. // identifiers.
  10995. tok('PRERELEASE')
  10996. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10997. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10998. tok('PRERELEASELOOSE')
  10999. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11000. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11001. // ## Build Metadata Identifier
  11002. // Any combination of digits, letters, or hyphens.
  11003. tok('BUILDIDENTIFIER')
  11004. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11005. // ## Build Metadata
  11006. // Plus sign, followed by one or more period-separated build metadata
  11007. // identifiers.
  11008. tok('BUILD')
  11009. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11010. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11011. // ## Full Version String
  11012. // A main version, followed optionally by a pre-release version and
  11013. // build metadata.
  11014. // Note that the only major, minor, patch, and pre-release sections of
  11015. // the version string are capturing groups. The build metadata is not a
  11016. // capturing group, because it should not ever be used in version
  11017. // comparison.
  11018. tok('FULL')
  11019. tok('FULLPLAIN')
  11020. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11021. src[t.PRERELEASE] + '?' +
  11022. src[t.BUILD] + '?'
  11023. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11024. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11025. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11026. // common in the npm registry.
  11027. tok('LOOSEPLAIN')
  11028. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11029. src[t.PRERELEASELOOSE] + '?' +
  11030. src[t.BUILD] + '?'
  11031. tok('LOOSE')
  11032. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11033. tok('GTLT')
  11034. src[t.GTLT] = '((?:<|>)?=?)'
  11035. // Something like "2.*" or "1.2.x".
  11036. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11037. // Only the first item is strictly required.
  11038. tok('XRANGEIDENTIFIERLOOSE')
  11039. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11040. tok('XRANGEIDENTIFIER')
  11041. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11042. tok('XRANGEPLAIN')
  11043. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11044. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11045. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11046. '(?:' + src[t.PRERELEASE] + ')?' +
  11047. src[t.BUILD] + '?' +
  11048. ')?)?'
  11049. tok('XRANGEPLAINLOOSE')
  11050. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11051. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11052. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11053. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11054. src[t.BUILD] + '?' +
  11055. ')?)?'
  11056. tok('XRANGE')
  11057. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11058. tok('XRANGELOOSE')
  11059. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11060. // Coercion.
  11061. // Extract anything that could conceivably be a part of a valid semver
  11062. tok('COERCE')
  11063. src[t.COERCE] = '(^|[^\\d])' +
  11064. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11065. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11066. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11067. '(?:$|[^\\d])'
  11068. tok('COERCERTL')
  11069. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11070. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11071. // Tilde ranges.
  11072. // Meaning is "reasonably at or greater than"
  11073. tok('LONETILDE')
  11074. src[t.LONETILDE] = '(?:~>?)'
  11075. tok('TILDETRIM')
  11076. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11077. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11078. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11079. var tildeTrimReplace = '$1~'
  11080. tok('TILDE')
  11081. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11082. tok('TILDELOOSE')
  11083. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11084. // Caret ranges.
  11085. // Meaning is "at least and backwards compatible with"
  11086. tok('LONECARET')
  11087. src[t.LONECARET] = '(?:\\^)'
  11088. tok('CARETTRIM')
  11089. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11090. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11091. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11092. var caretTrimReplace = '$1^'
  11093. tok('CARET')
  11094. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11095. tok('CARETLOOSE')
  11096. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11097. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11098. tok('COMPARATORLOOSE')
  11099. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11100. tok('COMPARATOR')
  11101. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11102. // An expression to strip any whitespace between the gtlt and the thing
  11103. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11104. tok('COMPARATORTRIM')
  11105. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11106. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11107. // this one has to use the /g flag
  11108. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11109. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11110. var comparatorTrimReplace = '$1$2$3'
  11111. // Something like `1.2.3 - 1.2.4`
  11112. // Note that these all use the loose form, because they'll be
  11113. // checked against either the strict or loose comparator form
  11114. // later.
  11115. tok('HYPHENRANGE')
  11116. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11117. '\\s+-\\s+' +
  11118. '(' + src[t.XRANGEPLAIN] + ')' +
  11119. '\\s*$'
  11120. tok('HYPHENRANGELOOSE')
  11121. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11122. '\\s+-\\s+' +
  11123. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11124. '\\s*$'
  11125. // Star ranges basically just allow anything at all.
  11126. tok('STAR')
  11127. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11128. // Compile to actual regexp objects.
  11129. // All are flag-free, unless they were created above with a flag.
  11130. for (var i = 0; i < R; i++) {
  11131. debug(i, src[i])
  11132. if (!re[i]) {
  11133. re[i] = new RegExp(src[i])
  11134. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11135. // used internally via the safeRe object since all inputs in this library get
  11136. // normalized first to trim and collapse all extra whitespace. The original
  11137. // regexes are exported for userland consumption and lower level usage. A
  11138. // future breaking change could export the safer regex only with a note that
  11139. // all input should have extra whitespace removed.
  11140. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11141. }
  11142. }
  11143. exports.parse = parse
  11144. function parse (version, options) {
  11145. if (!options || typeof options !== 'object') {
  11146. options = {
  11147. loose: !!options,
  11148. includePrerelease: false
  11149. }
  11150. }
  11151. if (version instanceof SemVer) {
  11152. return version
  11153. }
  11154. if (typeof version !== 'string') {
  11155. return null
  11156. }
  11157. if (version.length > MAX_LENGTH) {
  11158. return null
  11159. }
  11160. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11161. if (!r.test(version)) {
  11162. return null
  11163. }
  11164. try {
  11165. return new SemVer(version, options)
  11166. } catch (er) {
  11167. return null
  11168. }
  11169. }
  11170. exports.valid = valid
  11171. function valid (version, options) {
  11172. var v = parse(version, options)
  11173. return v ? v.version : null
  11174. }
  11175. exports.clean = clean
  11176. function clean (version, options) {
  11177. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11178. return s ? s.version : null
  11179. }
  11180. exports.SemVer = SemVer
  11181. function SemVer (version, options) {
  11182. if (!options || typeof options !== 'object') {
  11183. options = {
  11184. loose: !!options,
  11185. includePrerelease: false
  11186. }
  11187. }
  11188. if (version instanceof SemVer) {
  11189. if (version.loose === options.loose) {
  11190. return version
  11191. } else {
  11192. version = version.version
  11193. }
  11194. } else if (typeof version !== 'string') {
  11195. throw new TypeError('Invalid Version: ' + version)
  11196. }
  11197. if (version.length > MAX_LENGTH) {
  11198. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11199. }
  11200. if (!(this instanceof SemVer)) {
  11201. return new SemVer(version, options)
  11202. }
  11203. debug('SemVer', version, options)
  11204. this.options = options
  11205. this.loose = !!options.loose
  11206. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11207. if (!m) {
  11208. throw new TypeError('Invalid Version: ' + version)
  11209. }
  11210. this.raw = version
  11211. // these are actually numbers
  11212. this.major = +m[1]
  11213. this.minor = +m[2]
  11214. this.patch = +m[3]
  11215. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11216. throw new TypeError('Invalid major version')
  11217. }
  11218. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11219. throw new TypeError('Invalid minor version')
  11220. }
  11221. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11222. throw new TypeError('Invalid patch version')
  11223. }
  11224. // numberify any prerelease numeric ids
  11225. if (!m[4]) {
  11226. this.prerelease = []
  11227. } else {
  11228. this.prerelease = m[4].split('.').map(function (id) {
  11229. if (/^[0-9]+$/.test(id)) {
  11230. var num = +id
  11231. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11232. return num
  11233. }
  11234. }
  11235. return id
  11236. })
  11237. }
  11238. this.build = m[5] ? m[5].split('.') : []
  11239. this.format()
  11240. }
  11241. SemVer.prototype.format = function () {
  11242. this.version = this.major + '.' + this.minor + '.' + this.patch
  11243. if (this.prerelease.length) {
  11244. this.version += '-' + this.prerelease.join('.')
  11245. }
  11246. return this.version
  11247. }
  11248. SemVer.prototype.toString = function () {
  11249. return this.version
  11250. }
  11251. SemVer.prototype.compare = function (other) {
  11252. debug('SemVer.compare', this.version, this.options, other)
  11253. if (!(other instanceof SemVer)) {
  11254. other = new SemVer(other, this.options)
  11255. }
  11256. return this.compareMain(other) || this.comparePre(other)
  11257. }
  11258. SemVer.prototype.compareMain = function (other) {
  11259. if (!(other instanceof SemVer)) {
  11260. other = new SemVer(other, this.options)
  11261. }
  11262. return compareIdentifiers(this.major, other.major) ||
  11263. compareIdentifiers(this.minor, other.minor) ||
  11264. compareIdentifiers(this.patch, other.patch)
  11265. }
  11266. SemVer.prototype.comparePre = function (other) {
  11267. if (!(other instanceof SemVer)) {
  11268. other = new SemVer(other, this.options)
  11269. }
  11270. // NOT having a prerelease is > having one
  11271. if (this.prerelease.length && !other.prerelease.length) {
  11272. return -1
  11273. } else if (!this.prerelease.length && other.prerelease.length) {
  11274. return 1
  11275. } else if (!this.prerelease.length && !other.prerelease.length) {
  11276. return 0
  11277. }
  11278. var i = 0
  11279. do {
  11280. var a = this.prerelease[i]
  11281. var b = other.prerelease[i]
  11282. debug('prerelease compare', i, a, b)
  11283. if (a === undefined && b === undefined) {
  11284. return 0
  11285. } else if (b === undefined) {
  11286. return 1
  11287. } else if (a === undefined) {
  11288. return -1
  11289. } else if (a === b) {
  11290. continue
  11291. } else {
  11292. return compareIdentifiers(a, b)
  11293. }
  11294. } while (++i)
  11295. }
  11296. SemVer.prototype.compareBuild = function (other) {
  11297. if (!(other instanceof SemVer)) {
  11298. other = new SemVer(other, this.options)
  11299. }
  11300. var i = 0
  11301. do {
  11302. var a = this.build[i]
  11303. var b = other.build[i]
  11304. debug('prerelease compare', i, a, b)
  11305. if (a === undefined && b === undefined) {
  11306. return 0
  11307. } else if (b === undefined) {
  11308. return 1
  11309. } else if (a === undefined) {
  11310. return -1
  11311. } else if (a === b) {
  11312. continue
  11313. } else {
  11314. return compareIdentifiers(a, b)
  11315. }
  11316. } while (++i)
  11317. }
  11318. // preminor will bump the version up to the next minor release, and immediately
  11319. // down to pre-release. premajor and prepatch work the same way.
  11320. SemVer.prototype.inc = function (release, identifier) {
  11321. switch (release) {
  11322. case 'premajor':
  11323. this.prerelease.length = 0
  11324. this.patch = 0
  11325. this.minor = 0
  11326. this.major++
  11327. this.inc('pre', identifier)
  11328. break
  11329. case 'preminor':
  11330. this.prerelease.length = 0
  11331. this.patch = 0
  11332. this.minor++
  11333. this.inc('pre', identifier)
  11334. break
  11335. case 'prepatch':
  11336. // If this is already a prerelease, it will bump to the next version
  11337. // drop any prereleases that might already exist, since they are not
  11338. // relevant at this point.
  11339. this.prerelease.length = 0
  11340. this.inc('patch', identifier)
  11341. this.inc('pre', identifier)
  11342. break
  11343. // If the input is a non-prerelease version, this acts the same as
  11344. // prepatch.
  11345. case 'prerelease':
  11346. if (this.prerelease.length === 0) {
  11347. this.inc('patch', identifier)
  11348. }
  11349. this.inc('pre', identifier)
  11350. break
  11351. case 'major':
  11352. // If this is a pre-major version, bump up to the same major version.
  11353. // Otherwise increment major.
  11354. // 1.0.0-5 bumps to 1.0.0
  11355. // 1.1.0 bumps to 2.0.0
  11356. if (this.minor !== 0 ||
  11357. this.patch !== 0 ||
  11358. this.prerelease.length === 0) {
  11359. this.major++
  11360. }
  11361. this.minor = 0
  11362. this.patch = 0
  11363. this.prerelease = []
  11364. break
  11365. case 'minor':
  11366. // If this is a pre-minor version, bump up to the same minor version.
  11367. // Otherwise increment minor.
  11368. // 1.2.0-5 bumps to 1.2.0
  11369. // 1.2.1 bumps to 1.3.0
  11370. if (this.patch !== 0 || this.prerelease.length === 0) {
  11371. this.minor++
  11372. }
  11373. this.patch = 0
  11374. this.prerelease = []
  11375. break
  11376. case 'patch':
  11377. // If this is not a pre-release version, it will increment the patch.
  11378. // If it is a pre-release it will bump up to the same patch version.
  11379. // 1.2.0-5 patches to 1.2.0
  11380. // 1.2.0 patches to 1.2.1
  11381. if (this.prerelease.length === 0) {
  11382. this.patch++
  11383. }
  11384. this.prerelease = []
  11385. break
  11386. // This probably shouldn't be used publicly.
  11387. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11388. case 'pre':
  11389. if (this.prerelease.length === 0) {
  11390. this.prerelease = [0]
  11391. } else {
  11392. var i = this.prerelease.length
  11393. while (--i >= 0) {
  11394. if (typeof this.prerelease[i] === 'number') {
  11395. this.prerelease[i]++
  11396. i = -2
  11397. }
  11398. }
  11399. if (i === -1) {
  11400. // didn't increment anything
  11401. this.prerelease.push(0)
  11402. }
  11403. }
  11404. if (identifier) {
  11405. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11406. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11407. if (this.prerelease[0] === identifier) {
  11408. if (isNaN(this.prerelease[1])) {
  11409. this.prerelease = [identifier, 0]
  11410. }
  11411. } else {
  11412. this.prerelease = [identifier, 0]
  11413. }
  11414. }
  11415. break
  11416. default:
  11417. throw new Error('invalid increment argument: ' + release)
  11418. }
  11419. this.format()
  11420. this.raw = this.version
  11421. return this
  11422. }
  11423. exports.inc = inc
  11424. function inc (version, release, loose, identifier) {
  11425. if (typeof (loose) === 'string') {
  11426. identifier = loose
  11427. loose = undefined
  11428. }
  11429. try {
  11430. return new SemVer(version, loose).inc(release, identifier).version
  11431. } catch (er) {
  11432. return null
  11433. }
  11434. }
  11435. exports.diff = diff
  11436. function diff (version1, version2) {
  11437. if (eq(version1, version2)) {
  11438. return null
  11439. } else {
  11440. var v1 = parse(version1)
  11441. var v2 = parse(version2)
  11442. var prefix = ''
  11443. if (v1.prerelease.length || v2.prerelease.length) {
  11444. prefix = 'pre'
  11445. var defaultResult = 'prerelease'
  11446. }
  11447. for (var key in v1) {
  11448. if (key === 'major' || key === 'minor' || key === 'patch') {
  11449. if (v1[key] !== v2[key]) {
  11450. return prefix + key
  11451. }
  11452. }
  11453. }
  11454. return defaultResult // may be undefined
  11455. }
  11456. }
  11457. exports.compareIdentifiers = compareIdentifiers
  11458. var numeric = /^[0-9]+$/
  11459. function compareIdentifiers (a, b) {
  11460. var anum = numeric.test(a)
  11461. var bnum = numeric.test(b)
  11462. if (anum && bnum) {
  11463. a = +a
  11464. b = +b
  11465. }
  11466. return a === b ? 0
  11467. : (anum && !bnum) ? -1
  11468. : (bnum && !anum) ? 1
  11469. : a < b ? -1
  11470. : 1
  11471. }
  11472. exports.rcompareIdentifiers = rcompareIdentifiers
  11473. function rcompareIdentifiers (a, b) {
  11474. return compareIdentifiers(b, a)
  11475. }
  11476. exports.major = major
  11477. function major (a, loose) {
  11478. return new SemVer(a, loose).major
  11479. }
  11480. exports.minor = minor
  11481. function minor (a, loose) {
  11482. return new SemVer(a, loose).minor
  11483. }
  11484. exports.patch = patch
  11485. function patch (a, loose) {
  11486. return new SemVer(a, loose).patch
  11487. }
  11488. exports.compare = compare
  11489. function compare (a, b, loose) {
  11490. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11491. }
  11492. exports.compareLoose = compareLoose
  11493. function compareLoose (a, b) {
  11494. return compare(a, b, true)
  11495. }
  11496. exports.compareBuild = compareBuild
  11497. function compareBuild (a, b, loose) {
  11498. var versionA = new SemVer(a, loose)
  11499. var versionB = new SemVer(b, loose)
  11500. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11501. }
  11502. exports.rcompare = rcompare
  11503. function rcompare (a, b, loose) {
  11504. return compare(b, a, loose)
  11505. }
  11506. exports.sort = sort
  11507. function sort (list, loose) {
  11508. return list.sort(function (a, b) {
  11509. return exports.compareBuild(a, b, loose)
  11510. })
  11511. }
  11512. exports.rsort = rsort
  11513. function rsort (list, loose) {
  11514. return list.sort(function (a, b) {
  11515. return exports.compareBuild(b, a, loose)
  11516. })
  11517. }
  11518. exports.gt = gt
  11519. function gt (a, b, loose) {
  11520. return compare(a, b, loose) > 0
  11521. }
  11522. exports.lt = lt
  11523. function lt (a, b, loose) {
  11524. return compare(a, b, loose) < 0
  11525. }
  11526. exports.eq = eq
  11527. function eq (a, b, loose) {
  11528. return compare(a, b, loose) === 0
  11529. }
  11530. exports.neq = neq
  11531. function neq (a, b, loose) {
  11532. return compare(a, b, loose) !== 0
  11533. }
  11534. exports.gte = gte
  11535. function gte (a, b, loose) {
  11536. return compare(a, b, loose) >= 0
  11537. }
  11538. exports.lte = lte
  11539. function lte (a, b, loose) {
  11540. return compare(a, b, loose) <= 0
  11541. }
  11542. exports.cmp = cmp
  11543. function cmp (a, op, b, loose) {
  11544. switch (op) {
  11545. case '===':
  11546. if (typeof a === 'object')
  11547. a = a.version
  11548. if (typeof b === 'object')
  11549. b = b.version
  11550. return a === b
  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. case '=':
  11559. case '==':
  11560. return eq(a, b, loose)
  11561. case '!=':
  11562. return neq(a, b, loose)
  11563. case '>':
  11564. return gt(a, b, loose)
  11565. case '>=':
  11566. return gte(a, b, loose)
  11567. case '<':
  11568. return lt(a, b, loose)
  11569. case '<=':
  11570. return lte(a, b, loose)
  11571. default:
  11572. throw new TypeError('Invalid operator: ' + op)
  11573. }
  11574. }
  11575. exports.Comparator = Comparator
  11576. function Comparator (comp, options) {
  11577. if (!options || typeof options !== 'object') {
  11578. options = {
  11579. loose: !!options,
  11580. includePrerelease: false
  11581. }
  11582. }
  11583. if (comp instanceof Comparator) {
  11584. if (comp.loose === !!options.loose) {
  11585. return comp
  11586. } else {
  11587. comp = comp.value
  11588. }
  11589. }
  11590. if (!(this instanceof Comparator)) {
  11591. return new Comparator(comp, options)
  11592. }
  11593. comp = comp.trim().split(/\s+/).join(' ')
  11594. debug('comparator', comp, options)
  11595. this.options = options
  11596. this.loose = !!options.loose
  11597. this.parse(comp)
  11598. if (this.semver === ANY) {
  11599. this.value = ''
  11600. } else {
  11601. this.value = this.operator + this.semver.version
  11602. }
  11603. debug('comp', this)
  11604. }
  11605. var ANY = {}
  11606. Comparator.prototype.parse = function (comp) {
  11607. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11608. var m = comp.match(r)
  11609. if (!m) {
  11610. throw new TypeError('Invalid comparator: ' + comp)
  11611. }
  11612. this.operator = m[1] !== undefined ? m[1] : ''
  11613. if (this.operator === '=') {
  11614. this.operator = ''
  11615. }
  11616. // if it literally is just '>' or '' then allow anything.
  11617. if (!m[2]) {
  11618. this.semver = ANY
  11619. } else {
  11620. this.semver = new SemVer(m[2], this.options.loose)
  11621. }
  11622. }
  11623. Comparator.prototype.toString = function () {
  11624. return this.value
  11625. }
  11626. Comparator.prototype.test = function (version) {
  11627. debug('Comparator.test', version, this.options.loose)
  11628. if (this.semver === ANY || version === ANY) {
  11629. return true
  11630. }
  11631. if (typeof version === 'string') {
  11632. try {
  11633. version = new SemVer(version, this.options)
  11634. } catch (er) {
  11635. return false
  11636. }
  11637. }
  11638. return cmp(version, this.operator, this.semver, this.options)
  11639. }
  11640. Comparator.prototype.intersects = function (comp, options) {
  11641. if (!(comp instanceof Comparator)) {
  11642. throw new TypeError('a Comparator is required')
  11643. }
  11644. if (!options || typeof options !== 'object') {
  11645. options = {
  11646. loose: !!options,
  11647. includePrerelease: false
  11648. }
  11649. }
  11650. var rangeTmp
  11651. if (this.operator === '') {
  11652. if (this.value === '') {
  11653. return true
  11654. }
  11655. rangeTmp = new Range(comp.value, options)
  11656. return satisfies(this.value, rangeTmp, options)
  11657. } else if (comp.operator === '') {
  11658. if (comp.value === '') {
  11659. return true
  11660. }
  11661. rangeTmp = new Range(this.value, options)
  11662. return satisfies(comp.semver, rangeTmp, options)
  11663. }
  11664. var sameDirectionIncreasing =
  11665. (this.operator === '>=' || this.operator === '>') &&
  11666. (comp.operator === '>=' || comp.operator === '>')
  11667. var sameDirectionDecreasing =
  11668. (this.operator === '<=' || this.operator === '<') &&
  11669. (comp.operator === '<=' || comp.operator === '<')
  11670. var sameSemVer = this.semver.version === comp.semver.version
  11671. var differentDirectionsInclusive =
  11672. (this.operator === '>=' || this.operator === '<=') &&
  11673. (comp.operator === '>=' || comp.operator === '<=')
  11674. var oppositeDirectionsLessThan =
  11675. cmp(this.semver, '<', comp.semver, options) &&
  11676. ((this.operator === '>=' || this.operator === '>') &&
  11677. (comp.operator === '<=' || comp.operator === '<'))
  11678. var oppositeDirectionsGreaterThan =
  11679. cmp(this.semver, '>', comp.semver, options) &&
  11680. ((this.operator === '<=' || this.operator === '<') &&
  11681. (comp.operator === '>=' || comp.operator === '>'))
  11682. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11683. (sameSemVer && differentDirectionsInclusive) ||
  11684. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11685. }
  11686. exports.Range = Range
  11687. function Range (range, options) {
  11688. if (!options || typeof options !== 'object') {
  11689. options = {
  11690. loose: !!options,
  11691. includePrerelease: false
  11692. }
  11693. }
  11694. if (range instanceof Range) {
  11695. if (range.loose === !!options.loose &&
  11696. range.includePrerelease === !!options.includePrerelease) {
  11697. return range
  11698. } else {
  11699. return new Range(range.raw, options)
  11700. }
  11701. }
  11702. if (range instanceof Comparator) {
  11703. return new Range(range.value, options)
  11704. }
  11705. if (!(this instanceof Range)) {
  11706. return new Range(range, options)
  11707. }
  11708. this.options = options
  11709. this.loose = !!options.loose
  11710. this.includePrerelease = !!options.includePrerelease
  11711. // First reduce all whitespace as much as possible so we do not have to rely
  11712. // on potentially slow regexes like \s*. This is then stored and used for
  11713. // future error messages as well.
  11714. this.raw = range
  11715. .trim()
  11716. .split(/\s+/)
  11717. .join(' ')
  11718. // First, split based on boolean or ||
  11719. this.set = this.raw.split('||').map(function (range) {
  11720. return this.parseRange(range.trim())
  11721. }, this).filter(function (c) {
  11722. // throw out any that are not relevant for whatever reason
  11723. return c.length
  11724. })
  11725. if (!this.set.length) {
  11726. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  11727. }
  11728. this.format()
  11729. }
  11730. Range.prototype.format = function () {
  11731. this.range = this.set.map(function (comps) {
  11732. return comps.join(' ').trim()
  11733. }).join('||').trim()
  11734. return this.range
  11735. }
  11736. Range.prototype.toString = function () {
  11737. return this.range
  11738. }
  11739. Range.prototype.parseRange = function (range) {
  11740. var loose = this.options.loose
  11741. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11742. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  11743. range = range.replace(hr, hyphenReplace)
  11744. debug('hyphen replace', range)
  11745. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11746. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  11747. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  11748. // `~ 1.2.3` => `~1.2.3`
  11749. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  11750. // `^ 1.2.3` => `^1.2.3`
  11751. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  11752. // normalize spaces
  11753. range = range.split(/\s+/).join(' ')
  11754. // At this point, the range is completely trimmed and
  11755. // ready to be split into comparators.
  11756. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11757. var set = range.split(' ').map(function (comp) {
  11758. return parseComparator(comp, this.options)
  11759. }, this).join(' ').split(/\s+/)
  11760. if (this.options.loose) {
  11761. // in loose mode, throw out any that are not valid comparators
  11762. set = set.filter(function (comp) {
  11763. return !!comp.match(compRe)
  11764. })
  11765. }
  11766. set = set.map(function (comp) {
  11767. return new Comparator(comp, this.options)
  11768. }, this)
  11769. return set
  11770. }
  11771. Range.prototype.intersects = function (range, options) {
  11772. if (!(range instanceof Range)) {
  11773. throw new TypeError('a Range is required')
  11774. }
  11775. return this.set.some(function (thisComparators) {
  11776. return (
  11777. isSatisfiable(thisComparators, options) &&
  11778. range.set.some(function (rangeComparators) {
  11779. return (
  11780. isSatisfiable(rangeComparators, options) &&
  11781. thisComparators.every(function (thisComparator) {
  11782. return rangeComparators.every(function (rangeComparator) {
  11783. return thisComparator.intersects(rangeComparator, options)
  11784. })
  11785. })
  11786. )
  11787. })
  11788. )
  11789. })
  11790. }
  11791. // take a set of comparators and determine whether there
  11792. // exists a version which can satisfy it
  11793. function isSatisfiable (comparators, options) {
  11794. var result = true
  11795. var remainingComparators = comparators.slice()
  11796. var testComparator = remainingComparators.pop()
  11797. while (result && remainingComparators.length) {
  11798. result = remainingComparators.every(function (otherComparator) {
  11799. return testComparator.intersects(otherComparator, options)
  11800. })
  11801. testComparator = remainingComparators.pop()
  11802. }
  11803. return result
  11804. }
  11805. // Mostly just for testing and legacy API reasons
  11806. exports.toComparators = toComparators
  11807. function toComparators (range, options) {
  11808. return new Range(range, options).set.map(function (comp) {
  11809. return comp.map(function (c) {
  11810. return c.value
  11811. }).join(' ').trim().split(' ')
  11812. })
  11813. }
  11814. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11815. // already replaced the hyphen ranges
  11816. // turn into a set of JUST comparators.
  11817. function parseComparator (comp, options) {
  11818. debug('comp', comp, options)
  11819. comp = replaceCarets(comp, options)
  11820. debug('caret', comp)
  11821. comp = replaceTildes(comp, options)
  11822. debug('tildes', comp)
  11823. comp = replaceXRanges(comp, options)
  11824. debug('xrange', comp)
  11825. comp = replaceStars(comp, options)
  11826. debug('stars', comp)
  11827. return comp
  11828. }
  11829. function isX (id) {
  11830. return !id || id.toLowerCase() === 'x' || id === '*'
  11831. }
  11832. // ~, ~> --> * (any, kinda silly)
  11833. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11834. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11835. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11836. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11837. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11838. function replaceTildes (comp, options) {
  11839. return comp.trim().split(/\s+/).map(function (comp) {
  11840. return replaceTilde(comp, options)
  11841. }).join(' ')
  11842. }
  11843. function replaceTilde (comp, options) {
  11844. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  11845. return comp.replace(r, function (_, M, m, p, pr) {
  11846. debug('tilde', comp, _, M, m, p, pr)
  11847. var ret
  11848. if (isX(M)) {
  11849. ret = ''
  11850. } else if (isX(m)) {
  11851. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11852. } else if (isX(p)) {
  11853. // ~1.2 == >=1.2.0 <1.3.0
  11854. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11855. } else if (pr) {
  11856. debug('replaceTilde pr', pr)
  11857. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11858. ' <' + M + '.' + (+m + 1) + '.0'
  11859. } else {
  11860. // ~1.2.3 == >=1.2.3 <1.3.0
  11861. ret = '>=' + M + '.' + m + '.' + p +
  11862. ' <' + M + '.' + (+m + 1) + '.0'
  11863. }
  11864. debug('tilde return', ret)
  11865. return ret
  11866. })
  11867. }
  11868. // ^ --> * (any, kinda silly)
  11869. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11870. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11871. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11872. // ^1.2.3 --> >=1.2.3 <2.0.0
  11873. // ^1.2.0 --> >=1.2.0 <2.0.0
  11874. function replaceCarets (comp, options) {
  11875. return comp.trim().split(/\s+/).map(function (comp) {
  11876. return replaceCaret(comp, options)
  11877. }).join(' ')
  11878. }
  11879. function replaceCaret (comp, options) {
  11880. debug('caret', comp, options)
  11881. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  11882. return comp.replace(r, function (_, M, m, p, pr) {
  11883. debug('caret', comp, _, M, m, p, pr)
  11884. var ret
  11885. if (isX(M)) {
  11886. ret = ''
  11887. } else if (isX(m)) {
  11888. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11889. } else if (isX(p)) {
  11890. if (M === '0') {
  11891. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11892. } else {
  11893. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11894. }
  11895. } else if (pr) {
  11896. debug('replaceCaret pr', pr)
  11897. if (M === '0') {
  11898. if (m === '0') {
  11899. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11900. ' <' + M + '.' + m + '.' + (+p + 1)
  11901. } else {
  11902. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11903. ' <' + M + '.' + (+m + 1) + '.0'
  11904. }
  11905. } else {
  11906. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11907. ' <' + (+M + 1) + '.0.0'
  11908. }
  11909. } else {
  11910. debug('no pr')
  11911. if (M === '0') {
  11912. if (m === '0') {
  11913. ret = '>=' + M + '.' + m + '.' + p +
  11914. ' <' + M + '.' + m + '.' + (+p + 1)
  11915. } else {
  11916. ret = '>=' + M + '.' + m + '.' + p +
  11917. ' <' + M + '.' + (+m + 1) + '.0'
  11918. }
  11919. } else {
  11920. ret = '>=' + M + '.' + m + '.' + p +
  11921. ' <' + (+M + 1) + '.0.0'
  11922. }
  11923. }
  11924. debug('caret return', ret)
  11925. return ret
  11926. })
  11927. }
  11928. function replaceXRanges (comp, options) {
  11929. debug('replaceXRanges', comp, options)
  11930. return comp.split(/\s+/).map(function (comp) {
  11931. return replaceXRange(comp, options)
  11932. }).join(' ')
  11933. }
  11934. function replaceXRange (comp, options) {
  11935. comp = comp.trim()
  11936. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  11937. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11938. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11939. var xM = isX(M)
  11940. var xm = xM || isX(m)
  11941. var xp = xm || isX(p)
  11942. var anyX = xp
  11943. if (gtlt === '=' && anyX) {
  11944. gtlt = ''
  11945. }
  11946. // if we're including prereleases in the match, then we need
  11947. // to fix this to -0, the lowest possible prerelease value
  11948. pr = options.includePrerelease ? '-0' : ''
  11949. if (xM) {
  11950. if (gtlt === '>' || gtlt === '<') {
  11951. // nothing is allowed
  11952. ret = '<0.0.0-0'
  11953. } else {
  11954. // nothing is forbidden
  11955. ret = '*'
  11956. }
  11957. } else if (gtlt && anyX) {
  11958. // we know patch is an x, because we have any x at all.
  11959. // replace X with 0
  11960. if (xm) {
  11961. m = 0
  11962. }
  11963. p = 0
  11964. if (gtlt === '>') {
  11965. // >1 => >=2.0.0
  11966. // >1.2 => >=1.3.0
  11967. // >1.2.3 => >= 1.2.4
  11968. gtlt = '>='
  11969. if (xm) {
  11970. M = +M + 1
  11971. m = 0
  11972. p = 0
  11973. } else {
  11974. m = +m + 1
  11975. p = 0
  11976. }
  11977. } else if (gtlt === '<=') {
  11978. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11979. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11980. gtlt = '<'
  11981. if (xm) {
  11982. M = +M + 1
  11983. } else {
  11984. m = +m + 1
  11985. }
  11986. }
  11987. ret = gtlt + M + '.' + m + '.' + p + pr
  11988. } else if (xm) {
  11989. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11990. } else if (xp) {
  11991. ret = '>=' + M + '.' + m + '.0' + pr +
  11992. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11993. }
  11994. debug('xRange return', ret)
  11995. return ret
  11996. })
  11997. }
  11998. // Because * is AND-ed with everything else in the comparator,
  11999. // and '' means "any version", just remove the *s entirely.
  12000. function replaceStars (comp, options) {
  12001. debug('replaceStars', comp, options)
  12002. // Looseness is ignored here. star is always as loose as it gets!
  12003. return comp.trim().replace(safeRe[t.STAR], '')
  12004. }
  12005. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12006. // M, m, patch, prerelease, build
  12007. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12008. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12009. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12010. function hyphenReplace ($0,
  12011. from, fM, fm, fp, fpr, fb,
  12012. to, tM, tm, tp, tpr, tb) {
  12013. if (isX(fM)) {
  12014. from = ''
  12015. } else if (isX(fm)) {
  12016. from = '>=' + fM + '.0.0'
  12017. } else if (isX(fp)) {
  12018. from = '>=' + fM + '.' + fm + '.0'
  12019. } else {
  12020. from = '>=' + from
  12021. }
  12022. if (isX(tM)) {
  12023. to = ''
  12024. } else if (isX(tm)) {
  12025. to = '<' + (+tM + 1) + '.0.0'
  12026. } else if (isX(tp)) {
  12027. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12028. } else if (tpr) {
  12029. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12030. } else {
  12031. to = '<=' + to
  12032. }
  12033. return (from + ' ' + to).trim()
  12034. }
  12035. // if ANY of the sets match ALL of its comparators, then pass
  12036. Range.prototype.test = function (version) {
  12037. if (!version) {
  12038. return false
  12039. }
  12040. if (typeof version === 'string') {
  12041. try {
  12042. version = new SemVer(version, this.options)
  12043. } catch (er) {
  12044. return false
  12045. }
  12046. }
  12047. for (var i = 0; i < this.set.length; i++) {
  12048. if (testSet(this.set[i], version, this.options)) {
  12049. return true
  12050. }
  12051. }
  12052. return false
  12053. }
  12054. function testSet (set, version, options) {
  12055. for (var i = 0; i < set.length; i++) {
  12056. if (!set[i].test(version)) {
  12057. return false
  12058. }
  12059. }
  12060. if (version.prerelease.length && !options.includePrerelease) {
  12061. // Find the set of versions that are allowed to have prereleases
  12062. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12063. // That should allow `1.2.3-pr.2` to pass.
  12064. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12065. // even though it's within the range set by the comparators.
  12066. for (i = 0; i < set.length; i++) {
  12067. debug(set[i].semver)
  12068. if (set[i].semver === ANY) {
  12069. continue
  12070. }
  12071. if (set[i].semver.prerelease.length > 0) {
  12072. var allowed = set[i].semver
  12073. if (allowed.major === version.major &&
  12074. allowed.minor === version.minor &&
  12075. allowed.patch === version.patch) {
  12076. return true
  12077. }
  12078. }
  12079. }
  12080. // Version has a -pre, but it's not one of the ones we like.
  12081. return false
  12082. }
  12083. return true
  12084. }
  12085. exports.satisfies = satisfies
  12086. function satisfies (version, range, options) {
  12087. try {
  12088. range = new Range(range, options)
  12089. } catch (er) {
  12090. return false
  12091. }
  12092. return range.test(version)
  12093. }
  12094. exports.maxSatisfying = maxSatisfying
  12095. function maxSatisfying (versions, range, options) {
  12096. var max = null
  12097. var maxSV = null
  12098. try {
  12099. var rangeObj = new Range(range, options)
  12100. } catch (er) {
  12101. return null
  12102. }
  12103. versions.forEach(function (v) {
  12104. if (rangeObj.test(v)) {
  12105. // satisfies(v, range, options)
  12106. if (!max || maxSV.compare(v) === -1) {
  12107. // compare(max, v, true)
  12108. max = v
  12109. maxSV = new SemVer(max, options)
  12110. }
  12111. }
  12112. })
  12113. return max
  12114. }
  12115. exports.minSatisfying = minSatisfying
  12116. function minSatisfying (versions, range, options) {
  12117. var min = null
  12118. var minSV = null
  12119. try {
  12120. var rangeObj = new Range(range, options)
  12121. } catch (er) {
  12122. return null
  12123. }
  12124. versions.forEach(function (v) {
  12125. if (rangeObj.test(v)) {
  12126. // satisfies(v, range, options)
  12127. if (!min || minSV.compare(v) === 1) {
  12128. // compare(min, v, true)
  12129. min = v
  12130. minSV = new SemVer(min, options)
  12131. }
  12132. }
  12133. })
  12134. return min
  12135. }
  12136. exports.minVersion = minVersion
  12137. function minVersion (range, loose) {
  12138. range = new Range(range, loose)
  12139. var minver = new SemVer('0.0.0')
  12140. if (range.test(minver)) {
  12141. return minver
  12142. }
  12143. minver = new SemVer('0.0.0-0')
  12144. if (range.test(minver)) {
  12145. return minver
  12146. }
  12147. minver = null
  12148. for (var i = 0; i < range.set.length; ++i) {
  12149. var comparators = range.set[i]
  12150. comparators.forEach(function (comparator) {
  12151. // Clone to avoid manipulating the comparator's semver object.
  12152. var compver = new SemVer(comparator.semver.version)
  12153. switch (comparator.operator) {
  12154. case '>':
  12155. if (compver.prerelease.length === 0) {
  12156. compver.patch++
  12157. } else {
  12158. compver.prerelease.push(0)
  12159. }
  12160. compver.raw = compver.format()
  12161. /* fallthrough */
  12162. case '':
  12163. case '>=':
  12164. if (!minver || gt(minver, compver)) {
  12165. minver = compver
  12166. }
  12167. break
  12168. case '<':
  12169. case '<=':
  12170. /* Ignore maximum versions */
  12171. break
  12172. /* istanbul ignore next */
  12173. default:
  12174. throw new Error('Unexpected operation: ' + comparator.operator)
  12175. }
  12176. })
  12177. }
  12178. if (minver && range.test(minver)) {
  12179. return minver
  12180. }
  12181. return null
  12182. }
  12183. exports.validRange = validRange
  12184. function validRange (range, options) {
  12185. try {
  12186. // Return '*' instead of '' so that truthiness works.
  12187. // This will throw if it's invalid anyway
  12188. return new Range(range, options).range || '*'
  12189. } catch (er) {
  12190. return null
  12191. }
  12192. }
  12193. // Determine if version is less than all the versions possible in the range
  12194. exports.ltr = ltr
  12195. function ltr (version, range, options) {
  12196. return outside(version, range, '<', options)
  12197. }
  12198. // Determine if version is greater than all the versions possible in the range.
  12199. exports.gtr = gtr
  12200. function gtr (version, range, options) {
  12201. return outside(version, range, '>', options)
  12202. }
  12203. exports.outside = outside
  12204. function outside (version, range, hilo, options) {
  12205. version = new SemVer(version, options)
  12206. range = new Range(range, options)
  12207. var gtfn, ltefn, ltfn, comp, ecomp
  12208. switch (hilo) {
  12209. case '>':
  12210. gtfn = gt
  12211. ltefn = lte
  12212. ltfn = lt
  12213. comp = '>'
  12214. ecomp = '>='
  12215. break
  12216. case '<':
  12217. gtfn = lt
  12218. ltefn = gte
  12219. ltfn = gt
  12220. comp = '<'
  12221. ecomp = '<='
  12222. break
  12223. default:
  12224. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12225. }
  12226. // If it satisifes the range it is not outside
  12227. if (satisfies(version, range, options)) {
  12228. return false
  12229. }
  12230. // From now on, variable terms are as if we're in "gtr" mode.
  12231. // but note that everything is flipped for the "ltr" function.
  12232. for (var i = 0; i < range.set.length; ++i) {
  12233. var comparators = range.set[i]
  12234. var high = null
  12235. var low = null
  12236. comparators.forEach(function (comparator) {
  12237. if (comparator.semver === ANY) {
  12238. comparator = new Comparator('>=0.0.0')
  12239. }
  12240. high = high || comparator
  12241. low = low || comparator
  12242. if (gtfn(comparator.semver, high.semver, options)) {
  12243. high = comparator
  12244. } else if (ltfn(comparator.semver, low.semver, options)) {
  12245. low = comparator
  12246. }
  12247. })
  12248. // If the edge version comparator has a operator then our version
  12249. // isn't outside it
  12250. if (high.operator === comp || high.operator === ecomp) {
  12251. return false
  12252. }
  12253. // If the lowest version comparator has an operator and our version
  12254. // is less than it then it isn't higher than the range
  12255. if ((!low.operator || low.operator === comp) &&
  12256. ltefn(version, low.semver)) {
  12257. return false
  12258. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12259. return false
  12260. }
  12261. }
  12262. return true
  12263. }
  12264. exports.prerelease = prerelease
  12265. function prerelease (version, options) {
  12266. var parsed = parse(version, options)
  12267. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12268. }
  12269. exports.intersects = intersects
  12270. function intersects (r1, r2, options) {
  12271. r1 = new Range(r1, options)
  12272. r2 = new Range(r2, options)
  12273. return r1.intersects(r2)
  12274. }
  12275. exports.coerce = coerce
  12276. function coerce (version, options) {
  12277. if (version instanceof SemVer) {
  12278. return version
  12279. }
  12280. if (typeof version === 'number') {
  12281. version = String(version)
  12282. }
  12283. if (typeof version !== 'string') {
  12284. return null
  12285. }
  12286. options = options || {}
  12287. var match = null
  12288. if (!options.rtl) {
  12289. match = version.match(safeRe[t.COERCE])
  12290. } else {
  12291. // Find the right-most coercible string that does not share
  12292. // a terminus with a more left-ward coercible string.
  12293. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12294. //
  12295. // Walk through the string checking with a /g regexp
  12296. // Manually set the index so as to pick up overlapping matches.
  12297. // Stop when we get a match that ends at the string end, since no
  12298. // coercible string can be more right-ward without the same terminus.
  12299. var next
  12300. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12301. (!match || match.index + match[0].length !== version.length)
  12302. ) {
  12303. if (!match ||
  12304. next.index + next[0].length !== match.index + match[0].length) {
  12305. match = next
  12306. }
  12307. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12308. }
  12309. // leave it in a clean state
  12310. safeRe[t.COERCERTL].lastIndex = -1
  12311. }
  12312. if (match === null) {
  12313. return null
  12314. }
  12315. return parse(match[2] +
  12316. '.' + (match[3] || '0') +
  12317. '.' + (match[4] || '0'), options)
  12318. }
  12319. /***/ }),
  12320. /***/ 4294:
  12321. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12322. module.exports = __nccwpck_require__(4219);
  12323. /***/ }),
  12324. /***/ 4219:
  12325. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12326. "use strict";
  12327. var net = __nccwpck_require__(1808);
  12328. var tls = __nccwpck_require__(4404);
  12329. var http = __nccwpck_require__(3685);
  12330. var https = __nccwpck_require__(5687);
  12331. var events = __nccwpck_require__(2361);
  12332. var assert = __nccwpck_require__(9491);
  12333. var util = __nccwpck_require__(3837);
  12334. exports.httpOverHttp = httpOverHttp;
  12335. exports.httpsOverHttp = httpsOverHttp;
  12336. exports.httpOverHttps = httpOverHttps;
  12337. exports.httpsOverHttps = httpsOverHttps;
  12338. function httpOverHttp(options) {
  12339. var agent = new TunnelingAgent(options);
  12340. agent.request = http.request;
  12341. return agent;
  12342. }
  12343. function httpsOverHttp(options) {
  12344. var agent = new TunnelingAgent(options);
  12345. agent.request = http.request;
  12346. agent.createSocket = createSecureSocket;
  12347. agent.defaultPort = 443;
  12348. return agent;
  12349. }
  12350. function httpOverHttps(options) {
  12351. var agent = new TunnelingAgent(options);
  12352. agent.request = https.request;
  12353. return agent;
  12354. }
  12355. function httpsOverHttps(options) {
  12356. var agent = new TunnelingAgent(options);
  12357. agent.request = https.request;
  12358. agent.createSocket = createSecureSocket;
  12359. agent.defaultPort = 443;
  12360. return agent;
  12361. }
  12362. function TunnelingAgent(options) {
  12363. var self = this;
  12364. self.options = options || {};
  12365. self.proxyOptions = self.options.proxy || {};
  12366. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12367. self.requests = [];
  12368. self.sockets = [];
  12369. self.on('free', function onFree(socket, host, port, localAddress) {
  12370. var options = toOptions(host, port, localAddress);
  12371. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12372. var pending = self.requests[i];
  12373. if (pending.host === options.host && pending.port === options.port) {
  12374. // Detect the request to connect same origin server,
  12375. // reuse the connection.
  12376. self.requests.splice(i, 1);
  12377. pending.request.onSocket(socket);
  12378. return;
  12379. }
  12380. }
  12381. socket.destroy();
  12382. self.removeSocket(socket);
  12383. });
  12384. }
  12385. util.inherits(TunnelingAgent, events.EventEmitter);
  12386. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12387. var self = this;
  12388. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12389. if (self.sockets.length >= this.maxSockets) {
  12390. // We are over limit so we'll add it to the queue.
  12391. self.requests.push(options);
  12392. return;
  12393. }
  12394. // If we are under maxSockets create a new one.
  12395. self.createSocket(options, function(socket) {
  12396. socket.on('free', onFree);
  12397. socket.on('close', onCloseOrRemove);
  12398. socket.on('agentRemove', onCloseOrRemove);
  12399. req.onSocket(socket);
  12400. function onFree() {
  12401. self.emit('free', socket, options);
  12402. }
  12403. function onCloseOrRemove(err) {
  12404. self.removeSocket(socket);
  12405. socket.removeListener('free', onFree);
  12406. socket.removeListener('close', onCloseOrRemove);
  12407. socket.removeListener('agentRemove', onCloseOrRemove);
  12408. }
  12409. });
  12410. };
  12411. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12412. var self = this;
  12413. var placeholder = {};
  12414. self.sockets.push(placeholder);
  12415. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12416. method: 'CONNECT',
  12417. path: options.host + ':' + options.port,
  12418. agent: false,
  12419. headers: {
  12420. host: options.host + ':' + options.port
  12421. }
  12422. });
  12423. if (options.localAddress) {
  12424. connectOptions.localAddress = options.localAddress;
  12425. }
  12426. if (connectOptions.proxyAuth) {
  12427. connectOptions.headers = connectOptions.headers || {};
  12428. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12429. new Buffer(connectOptions.proxyAuth).toString('base64');
  12430. }
  12431. debug('making CONNECT request');
  12432. var connectReq = self.request(connectOptions);
  12433. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12434. connectReq.once('response', onResponse); // for v0.6
  12435. connectReq.once('upgrade', onUpgrade); // for v0.6
  12436. connectReq.once('connect', onConnect); // for v0.7 or later
  12437. connectReq.once('error', onError);
  12438. connectReq.end();
  12439. function onResponse(res) {
  12440. // Very hacky. This is necessary to avoid http-parser leaks.
  12441. res.upgrade = true;
  12442. }
  12443. function onUpgrade(res, socket, head) {
  12444. // Hacky.
  12445. process.nextTick(function() {
  12446. onConnect(res, socket, head);
  12447. });
  12448. }
  12449. function onConnect(res, socket, head) {
  12450. connectReq.removeAllListeners();
  12451. socket.removeAllListeners();
  12452. if (res.statusCode !== 200) {
  12453. debug('tunneling socket could not be established, statusCode=%d',
  12454. res.statusCode);
  12455. socket.destroy();
  12456. var error = new Error('tunneling socket could not be established, ' +
  12457. 'statusCode=' + res.statusCode);
  12458. error.code = 'ECONNRESET';
  12459. options.request.emit('error', error);
  12460. self.removeSocket(placeholder);
  12461. return;
  12462. }
  12463. if (head.length > 0) {
  12464. debug('got illegal response body from proxy');
  12465. socket.destroy();
  12466. var error = new Error('got illegal response body from proxy');
  12467. error.code = 'ECONNRESET';
  12468. options.request.emit('error', error);
  12469. self.removeSocket(placeholder);
  12470. return;
  12471. }
  12472. debug('tunneling connection has established');
  12473. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12474. return cb(socket);
  12475. }
  12476. function onError(cause) {
  12477. connectReq.removeAllListeners();
  12478. debug('tunneling socket could not be established, cause=%s\n',
  12479. cause.message, cause.stack);
  12480. var error = new Error('tunneling socket could not be established, ' +
  12481. 'cause=' + cause.message);
  12482. error.code = 'ECONNRESET';
  12483. options.request.emit('error', error);
  12484. self.removeSocket(placeholder);
  12485. }
  12486. };
  12487. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12488. var pos = this.sockets.indexOf(socket)
  12489. if (pos === -1) {
  12490. return;
  12491. }
  12492. this.sockets.splice(pos, 1);
  12493. var pending = this.requests.shift();
  12494. if (pending) {
  12495. // If we have pending requests and a socket gets closed a new one
  12496. // needs to be created to take over in the pool for the one that closed.
  12497. this.createSocket(pending, function(socket) {
  12498. pending.request.onSocket(socket);
  12499. });
  12500. }
  12501. };
  12502. function createSecureSocket(options, cb) {
  12503. var self = this;
  12504. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12505. var hostHeader = options.request.getHeader('host');
  12506. var tlsOptions = mergeOptions({}, self.options, {
  12507. socket: socket,
  12508. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12509. });
  12510. // 0 is dummy port for v0.6
  12511. var secureSocket = tls.connect(0, tlsOptions);
  12512. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12513. cb(secureSocket);
  12514. });
  12515. }
  12516. function toOptions(host, port, localAddress) {
  12517. if (typeof host === 'string') { // since v0.10
  12518. return {
  12519. host: host,
  12520. port: port,
  12521. localAddress: localAddress
  12522. };
  12523. }
  12524. return host; // for v0.11 or later
  12525. }
  12526. function mergeOptions(target) {
  12527. for (var i = 1, len = arguments.length; i < len; ++i) {
  12528. var overrides = arguments[i];
  12529. if (typeof overrides === 'object') {
  12530. var keys = Object.keys(overrides);
  12531. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12532. var k = keys[j];
  12533. if (overrides[k] !== undefined) {
  12534. target[k] = overrides[k];
  12535. }
  12536. }
  12537. }
  12538. }
  12539. return target;
  12540. }
  12541. var debug;
  12542. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12543. debug = function() {
  12544. var args = Array.prototype.slice.call(arguments);
  12545. if (typeof args[0] === 'string') {
  12546. args[0] = 'TUNNEL: ' + args[0];
  12547. } else {
  12548. args.unshift('TUNNEL:');
  12549. }
  12550. console.error.apply(console, args);
  12551. }
  12552. } else {
  12553. debug = function() {};
  12554. }
  12555. exports.debug = debug; // for test
  12556. /***/ }),
  12557. /***/ 1773:
  12558. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12559. "use strict";
  12560. const Client = __nccwpck_require__(3598)
  12561. const Dispatcher = __nccwpck_require__(412)
  12562. const errors = __nccwpck_require__(8045)
  12563. const Pool = __nccwpck_require__(4634)
  12564. const BalancedPool = __nccwpck_require__(7931)
  12565. const Agent = __nccwpck_require__(7890)
  12566. const util = __nccwpck_require__(3983)
  12567. const { InvalidArgumentError } = errors
  12568. const api = __nccwpck_require__(4059)
  12569. const buildConnector = __nccwpck_require__(2067)
  12570. const MockClient = __nccwpck_require__(8687)
  12571. const MockAgent = __nccwpck_require__(6771)
  12572. const MockPool = __nccwpck_require__(6193)
  12573. const mockErrors = __nccwpck_require__(888)
  12574. const ProxyAgent = __nccwpck_require__(7858)
  12575. const RetryHandler = __nccwpck_require__(2286)
  12576. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12577. const DecoratorHandler = __nccwpck_require__(6930)
  12578. const RedirectHandler = __nccwpck_require__(2860)
  12579. const createRedirectInterceptor = __nccwpck_require__(8861)
  12580. let hasCrypto
  12581. try {
  12582. __nccwpck_require__(6113)
  12583. hasCrypto = true
  12584. } catch {
  12585. hasCrypto = false
  12586. }
  12587. Object.assign(Dispatcher.prototype, api)
  12588. module.exports.Dispatcher = Dispatcher
  12589. module.exports.Client = Client
  12590. module.exports.Pool = Pool
  12591. module.exports.BalancedPool = BalancedPool
  12592. module.exports.Agent = Agent
  12593. module.exports.ProxyAgent = ProxyAgent
  12594. module.exports.RetryHandler = RetryHandler
  12595. module.exports.DecoratorHandler = DecoratorHandler
  12596. module.exports.RedirectHandler = RedirectHandler
  12597. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12598. module.exports.buildConnector = buildConnector
  12599. module.exports.errors = errors
  12600. function makeDispatcher (fn) {
  12601. return (url, opts, handler) => {
  12602. if (typeof opts === 'function') {
  12603. handler = opts
  12604. opts = null
  12605. }
  12606. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12607. throw new InvalidArgumentError('invalid url')
  12608. }
  12609. if (opts != null && typeof opts !== 'object') {
  12610. throw new InvalidArgumentError('invalid opts')
  12611. }
  12612. if (opts && opts.path != null) {
  12613. if (typeof opts.path !== 'string') {
  12614. throw new InvalidArgumentError('invalid opts.path')
  12615. }
  12616. let path = opts.path
  12617. if (!opts.path.startsWith('/')) {
  12618. path = `/${path}`
  12619. }
  12620. url = new URL(util.parseOrigin(url).origin + path)
  12621. } else {
  12622. if (!opts) {
  12623. opts = typeof url === 'object' ? url : {}
  12624. }
  12625. url = util.parseURL(url)
  12626. }
  12627. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12628. if (agent) {
  12629. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12630. }
  12631. return fn.call(dispatcher, {
  12632. ...opts,
  12633. origin: url.origin,
  12634. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12635. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12636. }, handler)
  12637. }
  12638. }
  12639. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12640. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12641. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12642. let fetchImpl = null
  12643. module.exports.fetch = async function fetch (resource) {
  12644. if (!fetchImpl) {
  12645. fetchImpl = (__nccwpck_require__(4881).fetch)
  12646. }
  12647. try {
  12648. return await fetchImpl(...arguments)
  12649. } catch (err) {
  12650. if (typeof err === 'object') {
  12651. Error.captureStackTrace(err, this)
  12652. }
  12653. throw err
  12654. }
  12655. }
  12656. module.exports.Headers = __nccwpck_require__(554).Headers
  12657. module.exports.Response = __nccwpck_require__(7823).Response
  12658. module.exports.Request = __nccwpck_require__(8359).Request
  12659. module.exports.FormData = __nccwpck_require__(2015).FormData
  12660. module.exports.File = __nccwpck_require__(8511).File
  12661. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12662. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12663. module.exports.setGlobalOrigin = setGlobalOrigin
  12664. module.exports.getGlobalOrigin = getGlobalOrigin
  12665. const { CacheStorage } = __nccwpck_require__(7907)
  12666. const { kConstruct } = __nccwpck_require__(9174)
  12667. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12668. // in an older version of Node, it doesn't have any use without fetch.
  12669. module.exports.caches = new CacheStorage(kConstruct)
  12670. }
  12671. if (util.nodeMajor >= 16) {
  12672. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12673. module.exports.deleteCookie = deleteCookie
  12674. module.exports.getCookies = getCookies
  12675. module.exports.getSetCookies = getSetCookies
  12676. module.exports.setCookie = setCookie
  12677. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12678. module.exports.parseMIMEType = parseMIMEType
  12679. module.exports.serializeAMimeType = serializeAMimeType
  12680. }
  12681. if (util.nodeMajor >= 18 && hasCrypto) {
  12682. const { WebSocket } = __nccwpck_require__(4284)
  12683. module.exports.WebSocket = WebSocket
  12684. }
  12685. module.exports.request = makeDispatcher(api.request)
  12686. module.exports.stream = makeDispatcher(api.stream)
  12687. module.exports.pipeline = makeDispatcher(api.pipeline)
  12688. module.exports.connect = makeDispatcher(api.connect)
  12689. module.exports.upgrade = makeDispatcher(api.upgrade)
  12690. module.exports.MockClient = MockClient
  12691. module.exports.MockPool = MockPool
  12692. module.exports.MockAgent = MockAgent
  12693. module.exports.mockErrors = mockErrors
  12694. /***/ }),
  12695. /***/ 7890:
  12696. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12697. "use strict";
  12698. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12699. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12700. const DispatcherBase = __nccwpck_require__(4839)
  12701. const Pool = __nccwpck_require__(4634)
  12702. const Client = __nccwpck_require__(3598)
  12703. const util = __nccwpck_require__(3983)
  12704. const createRedirectInterceptor = __nccwpck_require__(8861)
  12705. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12706. const kOnConnect = Symbol('onConnect')
  12707. const kOnDisconnect = Symbol('onDisconnect')
  12708. const kOnConnectionError = Symbol('onConnectionError')
  12709. const kMaxRedirections = Symbol('maxRedirections')
  12710. const kOnDrain = Symbol('onDrain')
  12711. const kFactory = Symbol('factory')
  12712. const kFinalizer = Symbol('finalizer')
  12713. const kOptions = Symbol('options')
  12714. function defaultFactory (origin, opts) {
  12715. return opts && opts.connections === 1
  12716. ? new Client(origin, opts)
  12717. : new Pool(origin, opts)
  12718. }
  12719. class Agent extends DispatcherBase {
  12720. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  12721. super()
  12722. if (typeof factory !== 'function') {
  12723. throw new InvalidArgumentError('factory must be a function.')
  12724. }
  12725. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  12726. throw new InvalidArgumentError('connect must be a function or an object')
  12727. }
  12728. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  12729. throw new InvalidArgumentError('maxRedirections must be a positive number')
  12730. }
  12731. if (connect && typeof connect !== 'function') {
  12732. connect = { ...connect }
  12733. }
  12734. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  12735. ? options.interceptors.Agent
  12736. : [createRedirectInterceptor({ maxRedirections })]
  12737. this[kOptions] = { ...util.deepClone(options), connect }
  12738. this[kOptions].interceptors = options.interceptors
  12739. ? { ...options.interceptors }
  12740. : undefined
  12741. this[kMaxRedirections] = maxRedirections
  12742. this[kFactory] = factory
  12743. this[kClients] = new Map()
  12744. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  12745. const ref = this[kClients].get(key)
  12746. if (ref !== undefined && ref.deref() === undefined) {
  12747. this[kClients].delete(key)
  12748. }
  12749. })
  12750. const agent = this
  12751. this[kOnDrain] = (origin, targets) => {
  12752. agent.emit('drain', origin, [agent, ...targets])
  12753. }
  12754. this[kOnConnect] = (origin, targets) => {
  12755. agent.emit('connect', origin, [agent, ...targets])
  12756. }
  12757. this[kOnDisconnect] = (origin, targets, err) => {
  12758. agent.emit('disconnect', origin, [agent, ...targets], err)
  12759. }
  12760. this[kOnConnectionError] = (origin, targets, err) => {
  12761. agent.emit('connectionError', origin, [agent, ...targets], err)
  12762. }
  12763. }
  12764. get [kRunning] () {
  12765. let ret = 0
  12766. for (const ref of this[kClients].values()) {
  12767. const client = ref.deref()
  12768. /* istanbul ignore next: gc is undeterministic */
  12769. if (client) {
  12770. ret += client[kRunning]
  12771. }
  12772. }
  12773. return ret
  12774. }
  12775. [kDispatch] (opts, handler) {
  12776. let key
  12777. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  12778. key = String(opts.origin)
  12779. } else {
  12780. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  12781. }
  12782. const ref = this[kClients].get(key)
  12783. let dispatcher = ref ? ref.deref() : null
  12784. if (!dispatcher) {
  12785. dispatcher = this[kFactory](opts.origin, this[kOptions])
  12786. .on('drain', this[kOnDrain])
  12787. .on('connect', this[kOnConnect])
  12788. .on('disconnect', this[kOnDisconnect])
  12789. .on('connectionError', this[kOnConnectionError])
  12790. this[kClients].set(key, new WeakRef(dispatcher))
  12791. this[kFinalizer].register(dispatcher, key)
  12792. }
  12793. return dispatcher.dispatch(opts, handler)
  12794. }
  12795. async [kClose] () {
  12796. const closePromises = []
  12797. for (const ref of this[kClients].values()) {
  12798. const client = ref.deref()
  12799. /* istanbul ignore else: gc is undeterministic */
  12800. if (client) {
  12801. closePromises.push(client.close())
  12802. }
  12803. }
  12804. await Promise.all(closePromises)
  12805. }
  12806. async [kDestroy] (err) {
  12807. const destroyPromises = []
  12808. for (const ref of this[kClients].values()) {
  12809. const client = ref.deref()
  12810. /* istanbul ignore else: gc is undeterministic */
  12811. if (client) {
  12812. destroyPromises.push(client.destroy(err))
  12813. }
  12814. }
  12815. await Promise.all(destroyPromises)
  12816. }
  12817. }
  12818. module.exports = Agent
  12819. /***/ }),
  12820. /***/ 7032:
  12821. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12822. const { addAbortListener } = __nccwpck_require__(3983)
  12823. const { RequestAbortedError } = __nccwpck_require__(8045)
  12824. const kListener = Symbol('kListener')
  12825. const kSignal = Symbol('kSignal')
  12826. function abort (self) {
  12827. if (self.abort) {
  12828. self.abort()
  12829. } else {
  12830. self.onError(new RequestAbortedError())
  12831. }
  12832. }
  12833. function addSignal (self, signal) {
  12834. self[kSignal] = null
  12835. self[kListener] = null
  12836. if (!signal) {
  12837. return
  12838. }
  12839. if (signal.aborted) {
  12840. abort(self)
  12841. return
  12842. }
  12843. self[kSignal] = signal
  12844. self[kListener] = () => {
  12845. abort(self)
  12846. }
  12847. addAbortListener(self[kSignal], self[kListener])
  12848. }
  12849. function removeSignal (self) {
  12850. if (!self[kSignal]) {
  12851. return
  12852. }
  12853. if ('removeEventListener' in self[kSignal]) {
  12854. self[kSignal].removeEventListener('abort', self[kListener])
  12855. } else {
  12856. self[kSignal].removeListener('abort', self[kListener])
  12857. }
  12858. self[kSignal] = null
  12859. self[kListener] = null
  12860. }
  12861. module.exports = {
  12862. addSignal,
  12863. removeSignal
  12864. }
  12865. /***/ }),
  12866. /***/ 9744:
  12867. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12868. "use strict";
  12869. const { AsyncResource } = __nccwpck_require__(852)
  12870. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  12871. const util = __nccwpck_require__(3983)
  12872. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12873. class ConnectHandler extends AsyncResource {
  12874. constructor (opts, callback) {
  12875. if (!opts || typeof opts !== 'object') {
  12876. throw new InvalidArgumentError('invalid opts')
  12877. }
  12878. if (typeof callback !== 'function') {
  12879. throw new InvalidArgumentError('invalid callback')
  12880. }
  12881. const { signal, opaque, responseHeaders } = opts
  12882. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  12883. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  12884. }
  12885. super('UNDICI_CONNECT')
  12886. this.opaque = opaque || null
  12887. this.responseHeaders = responseHeaders || null
  12888. this.callback = callback
  12889. this.abort = null
  12890. addSignal(this, signal)
  12891. }
  12892. onConnect (abort, context) {
  12893. if (!this.callback) {
  12894. throw new RequestAbortedError()
  12895. }
  12896. this.abort = abort
  12897. this.context = context
  12898. }
  12899. onHeaders () {
  12900. throw new SocketError('bad connect', null)
  12901. }
  12902. onUpgrade (statusCode, rawHeaders, socket) {
  12903. const { callback, opaque, context } = this
  12904. removeSignal(this)
  12905. this.callback = null
  12906. let headers = rawHeaders
  12907. // Indicates is an HTTP2Session
  12908. if (headers != null) {
  12909. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  12910. }
  12911. this.runInAsyncScope(callback, null, null, {
  12912. statusCode,
  12913. headers,
  12914. socket,
  12915. opaque,
  12916. context
  12917. })
  12918. }
  12919. onError (err) {
  12920. const { callback, opaque } = this
  12921. removeSignal(this)
  12922. if (callback) {
  12923. this.callback = null
  12924. queueMicrotask(() => {
  12925. this.runInAsyncScope(callback, null, err, { opaque })
  12926. })
  12927. }
  12928. }
  12929. }
  12930. function connect (opts, callback) {
  12931. if (callback === undefined) {
  12932. return new Promise((resolve, reject) => {
  12933. connect.call(this, opts, (err, data) => {
  12934. return err ? reject(err) : resolve(data)
  12935. })
  12936. })
  12937. }
  12938. try {
  12939. const connectHandler = new ConnectHandler(opts, callback)
  12940. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  12941. } catch (err) {
  12942. if (typeof callback !== 'function') {
  12943. throw err
  12944. }
  12945. const opaque = opts && opts.opaque
  12946. queueMicrotask(() => callback(err, { opaque }))
  12947. }
  12948. }
  12949. module.exports = connect
  12950. /***/ }),
  12951. /***/ 8752:
  12952. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12953. "use strict";
  12954. const {
  12955. Readable,
  12956. Duplex,
  12957. PassThrough
  12958. } = __nccwpck_require__(2781)
  12959. const {
  12960. InvalidArgumentError,
  12961. InvalidReturnValueError,
  12962. RequestAbortedError
  12963. } = __nccwpck_require__(8045)
  12964. const util = __nccwpck_require__(3983)
  12965. const { AsyncResource } = __nccwpck_require__(852)
  12966. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12967. const assert = __nccwpck_require__(9491)
  12968. const kResume = Symbol('resume')
  12969. class PipelineRequest extends Readable {
  12970. constructor () {
  12971. super({ autoDestroy: true })
  12972. this[kResume] = null
  12973. }
  12974. _read () {
  12975. const { [kResume]: resume } = this
  12976. if (resume) {
  12977. this[kResume] = null
  12978. resume()
  12979. }
  12980. }
  12981. _destroy (err, callback) {
  12982. this._read()
  12983. callback(err)
  12984. }
  12985. }
  12986. class PipelineResponse extends Readable {
  12987. constructor (resume) {
  12988. super({ autoDestroy: true })
  12989. this[kResume] = resume
  12990. }
  12991. _read () {
  12992. this[kResume]()
  12993. }
  12994. _destroy (err, callback) {
  12995. if (!err && !this._readableState.endEmitted) {
  12996. err = new RequestAbortedError()
  12997. }
  12998. callback(err)
  12999. }
  13000. }
  13001. class PipelineHandler extends AsyncResource {
  13002. constructor (opts, handler) {
  13003. if (!opts || typeof opts !== 'object') {
  13004. throw new InvalidArgumentError('invalid opts')
  13005. }
  13006. if (typeof handler !== 'function') {
  13007. throw new InvalidArgumentError('invalid handler')
  13008. }
  13009. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13010. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13011. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13012. }
  13013. if (method === 'CONNECT') {
  13014. throw new InvalidArgumentError('invalid method')
  13015. }
  13016. if (onInfo && typeof onInfo !== 'function') {
  13017. throw new InvalidArgumentError('invalid onInfo callback')
  13018. }
  13019. super('UNDICI_PIPELINE')
  13020. this.opaque = opaque || null
  13021. this.responseHeaders = responseHeaders || null
  13022. this.handler = handler
  13023. this.abort = null
  13024. this.context = null
  13025. this.onInfo = onInfo || null
  13026. this.req = new PipelineRequest().on('error', util.nop)
  13027. this.ret = new Duplex({
  13028. readableObjectMode: opts.objectMode,
  13029. autoDestroy: true,
  13030. read: () => {
  13031. const { body } = this
  13032. if (body && body.resume) {
  13033. body.resume()
  13034. }
  13035. },
  13036. write: (chunk, encoding, callback) => {
  13037. const { req } = this
  13038. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13039. callback()
  13040. } else {
  13041. req[kResume] = callback
  13042. }
  13043. },
  13044. destroy: (err, callback) => {
  13045. const { body, req, res, ret, abort } = this
  13046. if (!err && !ret._readableState.endEmitted) {
  13047. err = new RequestAbortedError()
  13048. }
  13049. if (abort && err) {
  13050. abort()
  13051. }
  13052. util.destroy(body, err)
  13053. util.destroy(req, err)
  13054. util.destroy(res, err)
  13055. removeSignal(this)
  13056. callback(err)
  13057. }
  13058. }).on('prefinish', () => {
  13059. const { req } = this
  13060. // Node < 15 does not call _final in same tick.
  13061. req.push(null)
  13062. })
  13063. this.res = null
  13064. addSignal(this, signal)
  13065. }
  13066. onConnect (abort, context) {
  13067. const { ret, res } = this
  13068. assert(!res, 'pipeline cannot be retried')
  13069. if (ret.destroyed) {
  13070. throw new RequestAbortedError()
  13071. }
  13072. this.abort = abort
  13073. this.context = context
  13074. }
  13075. onHeaders (statusCode, rawHeaders, resume) {
  13076. const { opaque, handler, context } = this
  13077. if (statusCode < 200) {
  13078. if (this.onInfo) {
  13079. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13080. this.onInfo({ statusCode, headers })
  13081. }
  13082. return
  13083. }
  13084. this.res = new PipelineResponse(resume)
  13085. let body
  13086. try {
  13087. this.handler = null
  13088. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13089. body = this.runInAsyncScope(handler, null, {
  13090. statusCode,
  13091. headers,
  13092. opaque,
  13093. body: this.res,
  13094. context
  13095. })
  13096. } catch (err) {
  13097. this.res.on('error', util.nop)
  13098. throw err
  13099. }
  13100. if (!body || typeof body.on !== 'function') {
  13101. throw new InvalidReturnValueError('expected Readable')
  13102. }
  13103. body
  13104. .on('data', (chunk) => {
  13105. const { ret, body } = this
  13106. if (!ret.push(chunk) && body.pause) {
  13107. body.pause()
  13108. }
  13109. })
  13110. .on('error', (err) => {
  13111. const { ret } = this
  13112. util.destroy(ret, err)
  13113. })
  13114. .on('end', () => {
  13115. const { ret } = this
  13116. ret.push(null)
  13117. })
  13118. .on('close', () => {
  13119. const { ret } = this
  13120. if (!ret._readableState.ended) {
  13121. util.destroy(ret, new RequestAbortedError())
  13122. }
  13123. })
  13124. this.body = body
  13125. }
  13126. onData (chunk) {
  13127. const { res } = this
  13128. return res.push(chunk)
  13129. }
  13130. onComplete (trailers) {
  13131. const { res } = this
  13132. res.push(null)
  13133. }
  13134. onError (err) {
  13135. const { ret } = this
  13136. this.handler = null
  13137. util.destroy(ret, err)
  13138. }
  13139. }
  13140. function pipeline (opts, handler) {
  13141. try {
  13142. const pipelineHandler = new PipelineHandler(opts, handler)
  13143. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13144. return pipelineHandler.ret
  13145. } catch (err) {
  13146. return new PassThrough().destroy(err)
  13147. }
  13148. }
  13149. module.exports = pipeline
  13150. /***/ }),
  13151. /***/ 5448:
  13152. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13153. "use strict";
  13154. const Readable = __nccwpck_require__(3858)
  13155. const {
  13156. InvalidArgumentError,
  13157. RequestAbortedError
  13158. } = __nccwpck_require__(8045)
  13159. const util = __nccwpck_require__(3983)
  13160. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13161. const { AsyncResource } = __nccwpck_require__(852)
  13162. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13163. class RequestHandler extends AsyncResource {
  13164. constructor (opts, callback) {
  13165. if (!opts || typeof opts !== 'object') {
  13166. throw new InvalidArgumentError('invalid opts')
  13167. }
  13168. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13169. try {
  13170. if (typeof callback !== 'function') {
  13171. throw new InvalidArgumentError('invalid callback')
  13172. }
  13173. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13174. throw new InvalidArgumentError('invalid highWaterMark')
  13175. }
  13176. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13177. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13178. }
  13179. if (method === 'CONNECT') {
  13180. throw new InvalidArgumentError('invalid method')
  13181. }
  13182. if (onInfo && typeof onInfo !== 'function') {
  13183. throw new InvalidArgumentError('invalid onInfo callback')
  13184. }
  13185. super('UNDICI_REQUEST')
  13186. } catch (err) {
  13187. if (util.isStream(body)) {
  13188. util.destroy(body.on('error', util.nop), err)
  13189. }
  13190. throw err
  13191. }
  13192. this.responseHeaders = responseHeaders || null
  13193. this.opaque = opaque || null
  13194. this.callback = callback
  13195. this.res = null
  13196. this.abort = null
  13197. this.body = body
  13198. this.trailers = {}
  13199. this.context = null
  13200. this.onInfo = onInfo || null
  13201. this.throwOnError = throwOnError
  13202. this.highWaterMark = highWaterMark
  13203. if (util.isStream(body)) {
  13204. body.on('error', (err) => {
  13205. this.onError(err)
  13206. })
  13207. }
  13208. addSignal(this, signal)
  13209. }
  13210. onConnect (abort, context) {
  13211. if (!this.callback) {
  13212. throw new RequestAbortedError()
  13213. }
  13214. this.abort = abort
  13215. this.context = context
  13216. }
  13217. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13218. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13219. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13220. if (statusCode < 200) {
  13221. if (this.onInfo) {
  13222. this.onInfo({ statusCode, headers })
  13223. }
  13224. return
  13225. }
  13226. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13227. const contentType = parsedHeaders['content-type']
  13228. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13229. this.callback = null
  13230. this.res = body
  13231. if (callback !== null) {
  13232. if (this.throwOnError && statusCode >= 400) {
  13233. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13234. { callback, body, contentType, statusCode, statusMessage, headers }
  13235. )
  13236. } else {
  13237. this.runInAsyncScope(callback, null, null, {
  13238. statusCode,
  13239. headers,
  13240. trailers: this.trailers,
  13241. opaque,
  13242. body,
  13243. context
  13244. })
  13245. }
  13246. }
  13247. }
  13248. onData (chunk) {
  13249. const { res } = this
  13250. return res.push(chunk)
  13251. }
  13252. onComplete (trailers) {
  13253. const { res } = this
  13254. removeSignal(this)
  13255. util.parseHeaders(trailers, this.trailers)
  13256. res.push(null)
  13257. }
  13258. onError (err) {
  13259. const { res, callback, body, opaque } = this
  13260. removeSignal(this)
  13261. if (callback) {
  13262. // TODO: Does this need queueMicrotask?
  13263. this.callback = null
  13264. queueMicrotask(() => {
  13265. this.runInAsyncScope(callback, null, err, { opaque })
  13266. })
  13267. }
  13268. if (res) {
  13269. this.res = null
  13270. // Ensure all queued handlers are invoked before destroying res.
  13271. queueMicrotask(() => {
  13272. util.destroy(res, err)
  13273. })
  13274. }
  13275. if (body) {
  13276. this.body = null
  13277. util.destroy(body, err)
  13278. }
  13279. }
  13280. }
  13281. function request (opts, callback) {
  13282. if (callback === undefined) {
  13283. return new Promise((resolve, reject) => {
  13284. request.call(this, opts, (err, data) => {
  13285. return err ? reject(err) : resolve(data)
  13286. })
  13287. })
  13288. }
  13289. try {
  13290. this.dispatch(opts, new RequestHandler(opts, callback))
  13291. } catch (err) {
  13292. if (typeof callback !== 'function') {
  13293. throw err
  13294. }
  13295. const opaque = opts && opts.opaque
  13296. queueMicrotask(() => callback(err, { opaque }))
  13297. }
  13298. }
  13299. module.exports = request
  13300. module.exports.RequestHandler = RequestHandler
  13301. /***/ }),
  13302. /***/ 5395:
  13303. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13304. "use strict";
  13305. const { finished, PassThrough } = __nccwpck_require__(2781)
  13306. const {
  13307. InvalidArgumentError,
  13308. InvalidReturnValueError,
  13309. RequestAbortedError
  13310. } = __nccwpck_require__(8045)
  13311. const util = __nccwpck_require__(3983)
  13312. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13313. const { AsyncResource } = __nccwpck_require__(852)
  13314. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13315. class StreamHandler extends AsyncResource {
  13316. constructor (opts, factory, callback) {
  13317. if (!opts || typeof opts !== 'object') {
  13318. throw new InvalidArgumentError('invalid opts')
  13319. }
  13320. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13321. try {
  13322. if (typeof callback !== 'function') {
  13323. throw new InvalidArgumentError('invalid callback')
  13324. }
  13325. if (typeof factory !== 'function') {
  13326. throw new InvalidArgumentError('invalid factory')
  13327. }
  13328. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13329. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13330. }
  13331. if (method === 'CONNECT') {
  13332. throw new InvalidArgumentError('invalid method')
  13333. }
  13334. if (onInfo && typeof onInfo !== 'function') {
  13335. throw new InvalidArgumentError('invalid onInfo callback')
  13336. }
  13337. super('UNDICI_STREAM')
  13338. } catch (err) {
  13339. if (util.isStream(body)) {
  13340. util.destroy(body.on('error', util.nop), err)
  13341. }
  13342. throw err
  13343. }
  13344. this.responseHeaders = responseHeaders || null
  13345. this.opaque = opaque || null
  13346. this.factory = factory
  13347. this.callback = callback
  13348. this.res = null
  13349. this.abort = null
  13350. this.context = null
  13351. this.trailers = null
  13352. this.body = body
  13353. this.onInfo = onInfo || null
  13354. this.throwOnError = throwOnError || false
  13355. if (util.isStream(body)) {
  13356. body.on('error', (err) => {
  13357. this.onError(err)
  13358. })
  13359. }
  13360. addSignal(this, signal)
  13361. }
  13362. onConnect (abort, context) {
  13363. if (!this.callback) {
  13364. throw new RequestAbortedError()
  13365. }
  13366. this.abort = abort
  13367. this.context = context
  13368. }
  13369. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13370. const { factory, opaque, context, callback, responseHeaders } = this
  13371. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13372. if (statusCode < 200) {
  13373. if (this.onInfo) {
  13374. this.onInfo({ statusCode, headers })
  13375. }
  13376. return
  13377. }
  13378. this.factory = null
  13379. let res
  13380. if (this.throwOnError && statusCode >= 400) {
  13381. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13382. const contentType = parsedHeaders['content-type']
  13383. res = new PassThrough()
  13384. this.callback = null
  13385. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13386. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13387. )
  13388. } else {
  13389. if (factory === null) {
  13390. return
  13391. }
  13392. res = this.runInAsyncScope(factory, null, {
  13393. statusCode,
  13394. headers,
  13395. opaque,
  13396. context
  13397. })
  13398. if (
  13399. !res ||
  13400. typeof res.write !== 'function' ||
  13401. typeof res.end !== 'function' ||
  13402. typeof res.on !== 'function'
  13403. ) {
  13404. throw new InvalidReturnValueError('expected Writable')
  13405. }
  13406. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13407. finished(res, { readable: false }, (err) => {
  13408. const { callback, res, opaque, trailers, abort } = this
  13409. this.res = null
  13410. if (err || !res.readable) {
  13411. util.destroy(res, err)
  13412. }
  13413. this.callback = null
  13414. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13415. if (err) {
  13416. abort()
  13417. }
  13418. })
  13419. }
  13420. res.on('drain', resume)
  13421. this.res = res
  13422. const needDrain = res.writableNeedDrain !== undefined
  13423. ? res.writableNeedDrain
  13424. : res._writableState && res._writableState.needDrain
  13425. return needDrain !== true
  13426. }
  13427. onData (chunk) {
  13428. const { res } = this
  13429. return res ? res.write(chunk) : true
  13430. }
  13431. onComplete (trailers) {
  13432. const { res } = this
  13433. removeSignal(this)
  13434. if (!res) {
  13435. return
  13436. }
  13437. this.trailers = util.parseHeaders(trailers)
  13438. res.end()
  13439. }
  13440. onError (err) {
  13441. const { res, callback, opaque, body } = this
  13442. removeSignal(this)
  13443. this.factory = null
  13444. if (res) {
  13445. this.res = null
  13446. util.destroy(res, err)
  13447. } else if (callback) {
  13448. this.callback = null
  13449. queueMicrotask(() => {
  13450. this.runInAsyncScope(callback, null, err, { opaque })
  13451. })
  13452. }
  13453. if (body) {
  13454. this.body = null
  13455. util.destroy(body, err)
  13456. }
  13457. }
  13458. }
  13459. function stream (opts, factory, callback) {
  13460. if (callback === undefined) {
  13461. return new Promise((resolve, reject) => {
  13462. stream.call(this, opts, factory, (err, data) => {
  13463. return err ? reject(err) : resolve(data)
  13464. })
  13465. })
  13466. }
  13467. try {
  13468. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13469. } catch (err) {
  13470. if (typeof callback !== 'function') {
  13471. throw err
  13472. }
  13473. const opaque = opts && opts.opaque
  13474. queueMicrotask(() => callback(err, { opaque }))
  13475. }
  13476. }
  13477. module.exports = stream
  13478. /***/ }),
  13479. /***/ 6923:
  13480. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13481. "use strict";
  13482. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13483. const { AsyncResource } = __nccwpck_require__(852)
  13484. const util = __nccwpck_require__(3983)
  13485. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13486. const assert = __nccwpck_require__(9491)
  13487. class UpgradeHandler extends AsyncResource {
  13488. constructor (opts, callback) {
  13489. if (!opts || typeof opts !== 'object') {
  13490. throw new InvalidArgumentError('invalid opts')
  13491. }
  13492. if (typeof callback !== 'function') {
  13493. throw new InvalidArgumentError('invalid callback')
  13494. }
  13495. const { signal, opaque, responseHeaders } = opts
  13496. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13497. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13498. }
  13499. super('UNDICI_UPGRADE')
  13500. this.responseHeaders = responseHeaders || null
  13501. this.opaque = opaque || null
  13502. this.callback = callback
  13503. this.abort = null
  13504. this.context = null
  13505. addSignal(this, signal)
  13506. }
  13507. onConnect (abort, context) {
  13508. if (!this.callback) {
  13509. throw new RequestAbortedError()
  13510. }
  13511. this.abort = abort
  13512. this.context = null
  13513. }
  13514. onHeaders () {
  13515. throw new SocketError('bad upgrade', null)
  13516. }
  13517. onUpgrade (statusCode, rawHeaders, socket) {
  13518. const { callback, opaque, context } = this
  13519. assert.strictEqual(statusCode, 101)
  13520. removeSignal(this)
  13521. this.callback = null
  13522. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13523. this.runInAsyncScope(callback, null, null, {
  13524. headers,
  13525. socket,
  13526. opaque,
  13527. context
  13528. })
  13529. }
  13530. onError (err) {
  13531. const { callback, opaque } = this
  13532. removeSignal(this)
  13533. if (callback) {
  13534. this.callback = null
  13535. queueMicrotask(() => {
  13536. this.runInAsyncScope(callback, null, err, { opaque })
  13537. })
  13538. }
  13539. }
  13540. }
  13541. function upgrade (opts, callback) {
  13542. if (callback === undefined) {
  13543. return new Promise((resolve, reject) => {
  13544. upgrade.call(this, opts, (err, data) => {
  13545. return err ? reject(err) : resolve(data)
  13546. })
  13547. })
  13548. }
  13549. try {
  13550. const upgradeHandler = new UpgradeHandler(opts, callback)
  13551. this.dispatch({
  13552. ...opts,
  13553. method: opts.method || 'GET',
  13554. upgrade: opts.protocol || 'Websocket'
  13555. }, upgradeHandler)
  13556. } catch (err) {
  13557. if (typeof callback !== 'function') {
  13558. throw err
  13559. }
  13560. const opaque = opts && opts.opaque
  13561. queueMicrotask(() => callback(err, { opaque }))
  13562. }
  13563. }
  13564. module.exports = upgrade
  13565. /***/ }),
  13566. /***/ 4059:
  13567. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13568. "use strict";
  13569. module.exports.request = __nccwpck_require__(5448)
  13570. module.exports.stream = __nccwpck_require__(5395)
  13571. module.exports.pipeline = __nccwpck_require__(8752)
  13572. module.exports.upgrade = __nccwpck_require__(6923)
  13573. module.exports.connect = __nccwpck_require__(9744)
  13574. /***/ }),
  13575. /***/ 3858:
  13576. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13577. "use strict";
  13578. // Ported from https://github.com/nodejs/undici/pull/907
  13579. const assert = __nccwpck_require__(9491)
  13580. const { Readable } = __nccwpck_require__(2781)
  13581. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13582. const util = __nccwpck_require__(3983)
  13583. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13584. let Blob
  13585. const kConsume = Symbol('kConsume')
  13586. const kReading = Symbol('kReading')
  13587. const kBody = Symbol('kBody')
  13588. const kAbort = Symbol('abort')
  13589. const kContentType = Symbol('kContentType')
  13590. const noop = () => {}
  13591. module.exports = class BodyReadable extends Readable {
  13592. constructor ({
  13593. resume,
  13594. abort,
  13595. contentType = '',
  13596. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13597. }) {
  13598. super({
  13599. autoDestroy: true,
  13600. read: resume,
  13601. highWaterMark
  13602. })
  13603. this._readableState.dataEmitted = false
  13604. this[kAbort] = abort
  13605. this[kConsume] = null
  13606. this[kBody] = null
  13607. this[kContentType] = contentType
  13608. // Is stream being consumed through Readable API?
  13609. // This is an optimization so that we avoid checking
  13610. // for 'data' and 'readable' listeners in the hot path
  13611. // inside push().
  13612. this[kReading] = false
  13613. }
  13614. destroy (err) {
  13615. if (this.destroyed) {
  13616. // Node < 16
  13617. return this
  13618. }
  13619. if (!err && !this._readableState.endEmitted) {
  13620. err = new RequestAbortedError()
  13621. }
  13622. if (err) {
  13623. this[kAbort]()
  13624. }
  13625. return super.destroy(err)
  13626. }
  13627. emit (ev, ...args) {
  13628. if (ev === 'data') {
  13629. // Node < 16.7
  13630. this._readableState.dataEmitted = true
  13631. } else if (ev === 'error') {
  13632. // Node < 16
  13633. this._readableState.errorEmitted = true
  13634. }
  13635. return super.emit(ev, ...args)
  13636. }
  13637. on (ev, ...args) {
  13638. if (ev === 'data' || ev === 'readable') {
  13639. this[kReading] = true
  13640. }
  13641. return super.on(ev, ...args)
  13642. }
  13643. addListener (ev, ...args) {
  13644. return this.on(ev, ...args)
  13645. }
  13646. off (ev, ...args) {
  13647. const ret = super.off(ev, ...args)
  13648. if (ev === 'data' || ev === 'readable') {
  13649. this[kReading] = (
  13650. this.listenerCount('data') > 0 ||
  13651. this.listenerCount('readable') > 0
  13652. )
  13653. }
  13654. return ret
  13655. }
  13656. removeListener (ev, ...args) {
  13657. return this.off(ev, ...args)
  13658. }
  13659. push (chunk) {
  13660. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13661. consumePush(this[kConsume], chunk)
  13662. return this[kReading] ? super.push(chunk) : true
  13663. }
  13664. return super.push(chunk)
  13665. }
  13666. // https://fetch.spec.whatwg.org/#dom-body-text
  13667. async text () {
  13668. return consume(this, 'text')
  13669. }
  13670. // https://fetch.spec.whatwg.org/#dom-body-json
  13671. async json () {
  13672. return consume(this, 'json')
  13673. }
  13674. // https://fetch.spec.whatwg.org/#dom-body-blob
  13675. async blob () {
  13676. return consume(this, 'blob')
  13677. }
  13678. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13679. async arrayBuffer () {
  13680. return consume(this, 'arrayBuffer')
  13681. }
  13682. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13683. async formData () {
  13684. // TODO: Implement.
  13685. throw new NotSupportedError()
  13686. }
  13687. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13688. get bodyUsed () {
  13689. return util.isDisturbed(this)
  13690. }
  13691. // https://fetch.spec.whatwg.org/#dom-body-body
  13692. get body () {
  13693. if (!this[kBody]) {
  13694. this[kBody] = ReadableStreamFrom(this)
  13695. if (this[kConsume]) {
  13696. // TODO: Is this the best way to force a lock?
  13697. this[kBody].getReader() // Ensure stream is locked.
  13698. assert(this[kBody].locked)
  13699. }
  13700. }
  13701. return this[kBody]
  13702. }
  13703. dump (opts) {
  13704. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13705. const signal = opts && opts.signal
  13706. if (signal) {
  13707. try {
  13708. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13709. throw new InvalidArgumentError('signal must be an AbortSignal')
  13710. }
  13711. util.throwIfAborted(signal)
  13712. } catch (err) {
  13713. return Promise.reject(err)
  13714. }
  13715. }
  13716. if (this.closed) {
  13717. return Promise.resolve(null)
  13718. }
  13719. return new Promise((resolve, reject) => {
  13720. const signalListenerCleanup = signal
  13721. ? util.addAbortListener(signal, () => {
  13722. this.destroy()
  13723. })
  13724. : noop
  13725. this
  13726. .on('close', function () {
  13727. signalListenerCleanup()
  13728. if (signal && signal.aborted) {
  13729. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  13730. } else {
  13731. resolve(null)
  13732. }
  13733. })
  13734. .on('error', noop)
  13735. .on('data', function (chunk) {
  13736. limit -= chunk.length
  13737. if (limit <= 0) {
  13738. this.destroy()
  13739. }
  13740. })
  13741. .resume()
  13742. })
  13743. }
  13744. }
  13745. // https://streams.spec.whatwg.org/#readablestream-locked
  13746. function isLocked (self) {
  13747. // Consume is an implicit lock.
  13748. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  13749. }
  13750. // https://fetch.spec.whatwg.org/#body-unusable
  13751. function isUnusable (self) {
  13752. return util.isDisturbed(self) || isLocked(self)
  13753. }
  13754. async function consume (stream, type) {
  13755. if (isUnusable(stream)) {
  13756. throw new TypeError('unusable')
  13757. }
  13758. assert(!stream[kConsume])
  13759. return new Promise((resolve, reject) => {
  13760. stream[kConsume] = {
  13761. type,
  13762. stream,
  13763. resolve,
  13764. reject,
  13765. length: 0,
  13766. body: []
  13767. }
  13768. stream
  13769. .on('error', function (err) {
  13770. consumeFinish(this[kConsume], err)
  13771. })
  13772. .on('close', function () {
  13773. if (this[kConsume].body !== null) {
  13774. consumeFinish(this[kConsume], new RequestAbortedError())
  13775. }
  13776. })
  13777. process.nextTick(consumeStart, stream[kConsume])
  13778. })
  13779. }
  13780. function consumeStart (consume) {
  13781. if (consume.body === null) {
  13782. return
  13783. }
  13784. const { _readableState: state } = consume.stream
  13785. for (const chunk of state.buffer) {
  13786. consumePush(consume, chunk)
  13787. }
  13788. if (state.endEmitted) {
  13789. consumeEnd(this[kConsume])
  13790. } else {
  13791. consume.stream.on('end', function () {
  13792. consumeEnd(this[kConsume])
  13793. })
  13794. }
  13795. consume.stream.resume()
  13796. while (consume.stream.read() != null) {
  13797. // Loop
  13798. }
  13799. }
  13800. function consumeEnd (consume) {
  13801. const { type, body, resolve, stream, length } = consume
  13802. try {
  13803. if (type === 'text') {
  13804. resolve(toUSVString(Buffer.concat(body)))
  13805. } else if (type === 'json') {
  13806. resolve(JSON.parse(Buffer.concat(body)))
  13807. } else if (type === 'arrayBuffer') {
  13808. const dst = new Uint8Array(length)
  13809. let pos = 0
  13810. for (const buf of body) {
  13811. dst.set(buf, pos)
  13812. pos += buf.byteLength
  13813. }
  13814. resolve(dst.buffer)
  13815. } else if (type === 'blob') {
  13816. if (!Blob) {
  13817. Blob = (__nccwpck_require__(4300).Blob)
  13818. }
  13819. resolve(new Blob(body, { type: stream[kContentType] }))
  13820. }
  13821. consumeFinish(consume)
  13822. } catch (err) {
  13823. stream.destroy(err)
  13824. }
  13825. }
  13826. function consumePush (consume, chunk) {
  13827. consume.length += chunk.length
  13828. consume.body.push(chunk)
  13829. }
  13830. function consumeFinish (consume, err) {
  13831. if (consume.body === null) {
  13832. return
  13833. }
  13834. if (err) {
  13835. consume.reject(err)
  13836. } else {
  13837. consume.resolve()
  13838. }
  13839. consume.type = null
  13840. consume.stream = null
  13841. consume.resolve = null
  13842. consume.reject = null
  13843. consume.length = 0
  13844. consume.body = null
  13845. }
  13846. /***/ }),
  13847. /***/ 7474:
  13848. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13849. const assert = __nccwpck_require__(9491)
  13850. const {
  13851. ResponseStatusCodeError
  13852. } = __nccwpck_require__(8045)
  13853. const { toUSVString } = __nccwpck_require__(3983)
  13854. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  13855. assert(body)
  13856. let chunks = []
  13857. let limit = 0
  13858. for await (const chunk of body) {
  13859. chunks.push(chunk)
  13860. limit += chunk.length
  13861. if (limit > 128 * 1024) {
  13862. chunks = null
  13863. break
  13864. }
  13865. }
  13866. if (statusCode === 204 || !contentType || !chunks) {
  13867. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13868. return
  13869. }
  13870. try {
  13871. if (contentType.startsWith('application/json')) {
  13872. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  13873. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13874. return
  13875. }
  13876. if (contentType.startsWith('text/')) {
  13877. const payload = toUSVString(Buffer.concat(chunks))
  13878. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13879. return
  13880. }
  13881. } catch (err) {
  13882. // Process in a fallback if error
  13883. }
  13884. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13885. }
  13886. module.exports = { getResolveErrorBodyCallback }
  13887. /***/ }),
  13888. /***/ 7931:
  13889. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13890. "use strict";
  13891. const {
  13892. BalancedPoolMissingUpstreamError,
  13893. InvalidArgumentError
  13894. } = __nccwpck_require__(8045)
  13895. const {
  13896. PoolBase,
  13897. kClients,
  13898. kNeedDrain,
  13899. kAddClient,
  13900. kRemoveClient,
  13901. kGetDispatcher
  13902. } = __nccwpck_require__(3198)
  13903. const Pool = __nccwpck_require__(4634)
  13904. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  13905. const { parseOrigin } = __nccwpck_require__(3983)
  13906. const kFactory = Symbol('factory')
  13907. const kOptions = Symbol('options')
  13908. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  13909. const kCurrentWeight = Symbol('kCurrentWeight')
  13910. const kIndex = Symbol('kIndex')
  13911. const kWeight = Symbol('kWeight')
  13912. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  13913. const kErrorPenalty = Symbol('kErrorPenalty')
  13914. function getGreatestCommonDivisor (a, b) {
  13915. if (b === 0) return a
  13916. return getGreatestCommonDivisor(b, a % b)
  13917. }
  13918. function defaultFactory (origin, opts) {
  13919. return new Pool(origin, opts)
  13920. }
  13921. class BalancedPool extends PoolBase {
  13922. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  13923. super()
  13924. this[kOptions] = opts
  13925. this[kIndex] = -1
  13926. this[kCurrentWeight] = 0
  13927. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  13928. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  13929. if (!Array.isArray(upstreams)) {
  13930. upstreams = [upstreams]
  13931. }
  13932. if (typeof factory !== 'function') {
  13933. throw new InvalidArgumentError('factory must be a function.')
  13934. }
  13935. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  13936. ? opts.interceptors.BalancedPool
  13937. : []
  13938. this[kFactory] = factory
  13939. for (const upstream of upstreams) {
  13940. this.addUpstream(upstream)
  13941. }
  13942. this._updateBalancedPoolStats()
  13943. }
  13944. addUpstream (upstream) {
  13945. const upstreamOrigin = parseOrigin(upstream).origin
  13946. if (this[kClients].find((pool) => (
  13947. pool[kUrl].origin === upstreamOrigin &&
  13948. pool.closed !== true &&
  13949. pool.destroyed !== true
  13950. ))) {
  13951. return this
  13952. }
  13953. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  13954. this[kAddClient](pool)
  13955. pool.on('connect', () => {
  13956. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  13957. })
  13958. pool.on('connectionError', () => {
  13959. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13960. this._updateBalancedPoolStats()
  13961. })
  13962. pool.on('disconnect', (...args) => {
  13963. const err = args[2]
  13964. if (err && err.code === 'UND_ERR_SOCKET') {
  13965. // decrease the weight of the pool.
  13966. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13967. this._updateBalancedPoolStats()
  13968. }
  13969. })
  13970. for (const client of this[kClients]) {
  13971. client[kWeight] = this[kMaxWeightPerServer]
  13972. }
  13973. this._updateBalancedPoolStats()
  13974. return this
  13975. }
  13976. _updateBalancedPoolStats () {
  13977. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  13978. }
  13979. removeUpstream (upstream) {
  13980. const upstreamOrigin = parseOrigin(upstream).origin
  13981. const pool = this[kClients].find((pool) => (
  13982. pool[kUrl].origin === upstreamOrigin &&
  13983. pool.closed !== true &&
  13984. pool.destroyed !== true
  13985. ))
  13986. if (pool) {
  13987. this[kRemoveClient](pool)
  13988. }
  13989. return this
  13990. }
  13991. get upstreams () {
  13992. return this[kClients]
  13993. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  13994. .map((p) => p[kUrl].origin)
  13995. }
  13996. [kGetDispatcher] () {
  13997. // We validate that pools is greater than 0,
  13998. // otherwise we would have to wait until an upstream
  13999. // is added, which might never happen.
  14000. if (this[kClients].length === 0) {
  14001. throw new BalancedPoolMissingUpstreamError()
  14002. }
  14003. const dispatcher = this[kClients].find(dispatcher => (
  14004. !dispatcher[kNeedDrain] &&
  14005. dispatcher.closed !== true &&
  14006. dispatcher.destroyed !== true
  14007. ))
  14008. if (!dispatcher) {
  14009. return
  14010. }
  14011. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14012. if (allClientsBusy) {
  14013. return
  14014. }
  14015. let counter = 0
  14016. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14017. while (counter++ < this[kClients].length) {
  14018. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14019. const pool = this[kClients][this[kIndex]]
  14020. // find pool index with the largest weight
  14021. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14022. maxWeightIndex = this[kIndex]
  14023. }
  14024. // decrease the current weight every `this[kClients].length`.
  14025. if (this[kIndex] === 0) {
  14026. // Set the current weight to the next lower weight.
  14027. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14028. if (this[kCurrentWeight] <= 0) {
  14029. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14030. }
  14031. }
  14032. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14033. return pool
  14034. }
  14035. }
  14036. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14037. this[kIndex] = maxWeightIndex
  14038. return this[kClients][maxWeightIndex]
  14039. }
  14040. }
  14041. module.exports = BalancedPool
  14042. /***/ }),
  14043. /***/ 6101:
  14044. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14045. "use strict";
  14046. const { kConstruct } = __nccwpck_require__(9174)
  14047. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14048. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14049. const { kHeadersList } = __nccwpck_require__(2785)
  14050. const { webidl } = __nccwpck_require__(1744)
  14051. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14052. const { Request } = __nccwpck_require__(8359)
  14053. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14054. const { fetching } = __nccwpck_require__(4881)
  14055. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14056. const assert = __nccwpck_require__(9491)
  14057. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14058. /**
  14059. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14060. * @typedef {Object} CacheBatchOperation
  14061. * @property {'delete' | 'put'} type
  14062. * @property {any} request
  14063. * @property {any} response
  14064. * @property {import('../../types/cache').CacheQueryOptions} options
  14065. */
  14066. /**
  14067. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14068. * @typedef {[any, any][]} requestResponseList
  14069. */
  14070. class Cache {
  14071. /**
  14072. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14073. * @type {requestResponseList}
  14074. */
  14075. #relevantRequestResponseList
  14076. constructor () {
  14077. if (arguments[0] !== kConstruct) {
  14078. webidl.illegalConstructor()
  14079. }
  14080. this.#relevantRequestResponseList = arguments[1]
  14081. }
  14082. async match (request, options = {}) {
  14083. webidl.brandCheck(this, Cache)
  14084. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14085. request = webidl.converters.RequestInfo(request)
  14086. options = webidl.converters.CacheQueryOptions(options)
  14087. const p = await this.matchAll(request, options)
  14088. if (p.length === 0) {
  14089. return
  14090. }
  14091. return p[0]
  14092. }
  14093. async matchAll (request = undefined, options = {}) {
  14094. webidl.brandCheck(this, Cache)
  14095. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14096. options = webidl.converters.CacheQueryOptions(options)
  14097. // 1.
  14098. let r = null
  14099. // 2.
  14100. if (request !== undefined) {
  14101. if (request instanceof Request) {
  14102. // 2.1.1
  14103. r = request[kState]
  14104. // 2.1.2
  14105. if (r.method !== 'GET' && !options.ignoreMethod) {
  14106. return []
  14107. }
  14108. } else if (typeof request === 'string') {
  14109. // 2.2.1
  14110. r = new Request(request)[kState]
  14111. }
  14112. }
  14113. // 5.
  14114. // 5.1
  14115. const responses = []
  14116. // 5.2
  14117. if (request === undefined) {
  14118. // 5.2.1
  14119. for (const requestResponse of this.#relevantRequestResponseList) {
  14120. responses.push(requestResponse[1])
  14121. }
  14122. } else { // 5.3
  14123. // 5.3.1
  14124. const requestResponses = this.#queryCache(r, options)
  14125. // 5.3.2
  14126. for (const requestResponse of requestResponses) {
  14127. responses.push(requestResponse[1])
  14128. }
  14129. }
  14130. // 5.4
  14131. // We don't implement CORs so we don't need to loop over the responses, yay!
  14132. // 5.5.1
  14133. const responseList = []
  14134. // 5.5.2
  14135. for (const response of responses) {
  14136. // 5.5.2.1
  14137. const responseObject = new Response(response.body?.source ?? null)
  14138. const body = responseObject[kState].body
  14139. responseObject[kState] = response
  14140. responseObject[kState].body = body
  14141. responseObject[kHeaders][kHeadersList] = response.headersList
  14142. responseObject[kHeaders][kGuard] = 'immutable'
  14143. responseList.push(responseObject)
  14144. }
  14145. // 6.
  14146. return Object.freeze(responseList)
  14147. }
  14148. async add (request) {
  14149. webidl.brandCheck(this, Cache)
  14150. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14151. request = webidl.converters.RequestInfo(request)
  14152. // 1.
  14153. const requests = [request]
  14154. // 2.
  14155. const responseArrayPromise = this.addAll(requests)
  14156. // 3.
  14157. return await responseArrayPromise
  14158. }
  14159. async addAll (requests) {
  14160. webidl.brandCheck(this, Cache)
  14161. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14162. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14163. // 1.
  14164. const responsePromises = []
  14165. // 2.
  14166. const requestList = []
  14167. // 3.
  14168. for (const request of requests) {
  14169. if (typeof request === 'string') {
  14170. continue
  14171. }
  14172. // 3.1
  14173. const r = request[kState]
  14174. // 3.2
  14175. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14176. throw webidl.errors.exception({
  14177. header: 'Cache.addAll',
  14178. message: 'Expected http/s scheme when method is not GET.'
  14179. })
  14180. }
  14181. }
  14182. // 4.
  14183. /** @type {ReturnType<typeof fetching>[]} */
  14184. const fetchControllers = []
  14185. // 5.
  14186. for (const request of requests) {
  14187. // 5.1
  14188. const r = new Request(request)[kState]
  14189. // 5.2
  14190. if (!urlIsHttpHttpsScheme(r.url)) {
  14191. throw webidl.errors.exception({
  14192. header: 'Cache.addAll',
  14193. message: 'Expected http/s scheme.'
  14194. })
  14195. }
  14196. // 5.4
  14197. r.initiator = 'fetch'
  14198. r.destination = 'subresource'
  14199. // 5.5
  14200. requestList.push(r)
  14201. // 5.6
  14202. const responsePromise = createDeferredPromise()
  14203. // 5.7
  14204. fetchControllers.push(fetching({
  14205. request: r,
  14206. dispatcher: getGlobalDispatcher(),
  14207. processResponse (response) {
  14208. // 1.
  14209. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14210. responsePromise.reject(webidl.errors.exception({
  14211. header: 'Cache.addAll',
  14212. message: 'Received an invalid status code or the request failed.'
  14213. }))
  14214. } else if (response.headersList.contains('vary')) { // 2.
  14215. // 2.1
  14216. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14217. // 2.2
  14218. for (const fieldValue of fieldValues) {
  14219. // 2.2.1
  14220. if (fieldValue === '*') {
  14221. responsePromise.reject(webidl.errors.exception({
  14222. header: 'Cache.addAll',
  14223. message: 'invalid vary field value'
  14224. }))
  14225. for (const controller of fetchControllers) {
  14226. controller.abort()
  14227. }
  14228. return
  14229. }
  14230. }
  14231. }
  14232. },
  14233. processResponseEndOfBody (response) {
  14234. // 1.
  14235. if (response.aborted) {
  14236. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14237. return
  14238. }
  14239. // 2.
  14240. responsePromise.resolve(response)
  14241. }
  14242. }))
  14243. // 5.8
  14244. responsePromises.push(responsePromise.promise)
  14245. }
  14246. // 6.
  14247. const p = Promise.all(responsePromises)
  14248. // 7.
  14249. const responses = await p
  14250. // 7.1
  14251. const operations = []
  14252. // 7.2
  14253. let index = 0
  14254. // 7.3
  14255. for (const response of responses) {
  14256. // 7.3.1
  14257. /** @type {CacheBatchOperation} */
  14258. const operation = {
  14259. type: 'put', // 7.3.2
  14260. request: requestList[index], // 7.3.3
  14261. response // 7.3.4
  14262. }
  14263. operations.push(operation) // 7.3.5
  14264. index++ // 7.3.6
  14265. }
  14266. // 7.5
  14267. const cacheJobPromise = createDeferredPromise()
  14268. // 7.6.1
  14269. let errorData = null
  14270. // 7.6.2
  14271. try {
  14272. this.#batchCacheOperations(operations)
  14273. } catch (e) {
  14274. errorData = e
  14275. }
  14276. // 7.6.3
  14277. queueMicrotask(() => {
  14278. // 7.6.3.1
  14279. if (errorData === null) {
  14280. cacheJobPromise.resolve(undefined)
  14281. } else {
  14282. // 7.6.3.2
  14283. cacheJobPromise.reject(errorData)
  14284. }
  14285. })
  14286. // 7.7
  14287. return cacheJobPromise.promise
  14288. }
  14289. async put (request, response) {
  14290. webidl.brandCheck(this, Cache)
  14291. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14292. request = webidl.converters.RequestInfo(request)
  14293. response = webidl.converters.Response(response)
  14294. // 1.
  14295. let innerRequest = null
  14296. // 2.
  14297. if (request instanceof Request) {
  14298. innerRequest = request[kState]
  14299. } else { // 3.
  14300. innerRequest = new Request(request)[kState]
  14301. }
  14302. // 4.
  14303. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14304. throw webidl.errors.exception({
  14305. header: 'Cache.put',
  14306. message: 'Expected an http/s scheme when method is not GET'
  14307. })
  14308. }
  14309. // 5.
  14310. const innerResponse = response[kState]
  14311. // 6.
  14312. if (innerResponse.status === 206) {
  14313. throw webidl.errors.exception({
  14314. header: 'Cache.put',
  14315. message: 'Got 206 status'
  14316. })
  14317. }
  14318. // 7.
  14319. if (innerResponse.headersList.contains('vary')) {
  14320. // 7.1.
  14321. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14322. // 7.2.
  14323. for (const fieldValue of fieldValues) {
  14324. // 7.2.1
  14325. if (fieldValue === '*') {
  14326. throw webidl.errors.exception({
  14327. header: 'Cache.put',
  14328. message: 'Got * vary field value'
  14329. })
  14330. }
  14331. }
  14332. }
  14333. // 8.
  14334. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14335. throw webidl.errors.exception({
  14336. header: 'Cache.put',
  14337. message: 'Response body is locked or disturbed'
  14338. })
  14339. }
  14340. // 9.
  14341. const clonedResponse = cloneResponse(innerResponse)
  14342. // 10.
  14343. const bodyReadPromise = createDeferredPromise()
  14344. // 11.
  14345. if (innerResponse.body != null) {
  14346. // 11.1
  14347. const stream = innerResponse.body.stream
  14348. // 11.2
  14349. const reader = stream.getReader()
  14350. // 11.3
  14351. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14352. } else {
  14353. bodyReadPromise.resolve(undefined)
  14354. }
  14355. // 12.
  14356. /** @type {CacheBatchOperation[]} */
  14357. const operations = []
  14358. // 13.
  14359. /** @type {CacheBatchOperation} */
  14360. const operation = {
  14361. type: 'put', // 14.
  14362. request: innerRequest, // 15.
  14363. response: clonedResponse // 16.
  14364. }
  14365. // 17.
  14366. operations.push(operation)
  14367. // 19.
  14368. const bytes = await bodyReadPromise.promise
  14369. if (clonedResponse.body != null) {
  14370. clonedResponse.body.source = bytes
  14371. }
  14372. // 19.1
  14373. const cacheJobPromise = createDeferredPromise()
  14374. // 19.2.1
  14375. let errorData = null
  14376. // 19.2.2
  14377. try {
  14378. this.#batchCacheOperations(operations)
  14379. } catch (e) {
  14380. errorData = e
  14381. }
  14382. // 19.2.3
  14383. queueMicrotask(() => {
  14384. // 19.2.3.1
  14385. if (errorData === null) {
  14386. cacheJobPromise.resolve()
  14387. } else { // 19.2.3.2
  14388. cacheJobPromise.reject(errorData)
  14389. }
  14390. })
  14391. return cacheJobPromise.promise
  14392. }
  14393. async delete (request, options = {}) {
  14394. webidl.brandCheck(this, Cache)
  14395. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14396. request = webidl.converters.RequestInfo(request)
  14397. options = webidl.converters.CacheQueryOptions(options)
  14398. /**
  14399. * @type {Request}
  14400. */
  14401. let r = null
  14402. if (request instanceof Request) {
  14403. r = request[kState]
  14404. if (r.method !== 'GET' && !options.ignoreMethod) {
  14405. return false
  14406. }
  14407. } else {
  14408. assert(typeof request === 'string')
  14409. r = new Request(request)[kState]
  14410. }
  14411. /** @type {CacheBatchOperation[]} */
  14412. const operations = []
  14413. /** @type {CacheBatchOperation} */
  14414. const operation = {
  14415. type: 'delete',
  14416. request: r,
  14417. options
  14418. }
  14419. operations.push(operation)
  14420. const cacheJobPromise = createDeferredPromise()
  14421. let errorData = null
  14422. let requestResponses
  14423. try {
  14424. requestResponses = this.#batchCacheOperations(operations)
  14425. } catch (e) {
  14426. errorData = e
  14427. }
  14428. queueMicrotask(() => {
  14429. if (errorData === null) {
  14430. cacheJobPromise.resolve(!!requestResponses?.length)
  14431. } else {
  14432. cacheJobPromise.reject(errorData)
  14433. }
  14434. })
  14435. return cacheJobPromise.promise
  14436. }
  14437. /**
  14438. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14439. * @param {any} request
  14440. * @param {import('../../types/cache').CacheQueryOptions} options
  14441. * @returns {readonly Request[]}
  14442. */
  14443. async keys (request = undefined, options = {}) {
  14444. webidl.brandCheck(this, Cache)
  14445. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14446. options = webidl.converters.CacheQueryOptions(options)
  14447. // 1.
  14448. let r = null
  14449. // 2.
  14450. if (request !== undefined) {
  14451. // 2.1
  14452. if (request instanceof Request) {
  14453. // 2.1.1
  14454. r = request[kState]
  14455. // 2.1.2
  14456. if (r.method !== 'GET' && !options.ignoreMethod) {
  14457. return []
  14458. }
  14459. } else if (typeof request === 'string') { // 2.2
  14460. r = new Request(request)[kState]
  14461. }
  14462. }
  14463. // 4.
  14464. const promise = createDeferredPromise()
  14465. // 5.
  14466. // 5.1
  14467. const requests = []
  14468. // 5.2
  14469. if (request === undefined) {
  14470. // 5.2.1
  14471. for (const requestResponse of this.#relevantRequestResponseList) {
  14472. // 5.2.1.1
  14473. requests.push(requestResponse[0])
  14474. }
  14475. } else { // 5.3
  14476. // 5.3.1
  14477. const requestResponses = this.#queryCache(r, options)
  14478. // 5.3.2
  14479. for (const requestResponse of requestResponses) {
  14480. // 5.3.2.1
  14481. requests.push(requestResponse[0])
  14482. }
  14483. }
  14484. // 5.4
  14485. queueMicrotask(() => {
  14486. // 5.4.1
  14487. const requestList = []
  14488. // 5.4.2
  14489. for (const request of requests) {
  14490. const requestObject = new Request('https://a')
  14491. requestObject[kState] = request
  14492. requestObject[kHeaders][kHeadersList] = request.headersList
  14493. requestObject[kHeaders][kGuard] = 'immutable'
  14494. requestObject[kRealm] = request.client
  14495. // 5.4.2.1
  14496. requestList.push(requestObject)
  14497. }
  14498. // 5.4.3
  14499. promise.resolve(Object.freeze(requestList))
  14500. })
  14501. return promise.promise
  14502. }
  14503. /**
  14504. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14505. * @param {CacheBatchOperation[]} operations
  14506. * @returns {requestResponseList}
  14507. */
  14508. #batchCacheOperations (operations) {
  14509. // 1.
  14510. const cache = this.#relevantRequestResponseList
  14511. // 2.
  14512. const backupCache = [...cache]
  14513. // 3.
  14514. const addedItems = []
  14515. // 4.1
  14516. const resultList = []
  14517. try {
  14518. // 4.2
  14519. for (const operation of operations) {
  14520. // 4.2.1
  14521. if (operation.type !== 'delete' && operation.type !== 'put') {
  14522. throw webidl.errors.exception({
  14523. header: 'Cache.#batchCacheOperations',
  14524. message: 'operation type does not match "delete" or "put"'
  14525. })
  14526. }
  14527. // 4.2.2
  14528. if (operation.type === 'delete' && operation.response != null) {
  14529. throw webidl.errors.exception({
  14530. header: 'Cache.#batchCacheOperations',
  14531. message: 'delete operation should not have an associated response'
  14532. })
  14533. }
  14534. // 4.2.3
  14535. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14536. throw new DOMException('???', 'InvalidStateError')
  14537. }
  14538. // 4.2.4
  14539. let requestResponses
  14540. // 4.2.5
  14541. if (operation.type === 'delete') {
  14542. // 4.2.5.1
  14543. requestResponses = this.#queryCache(operation.request, operation.options)
  14544. // TODO: the spec is wrong, this is needed to pass WPTs
  14545. if (requestResponses.length === 0) {
  14546. return []
  14547. }
  14548. // 4.2.5.2
  14549. for (const requestResponse of requestResponses) {
  14550. const idx = cache.indexOf(requestResponse)
  14551. assert(idx !== -1)
  14552. // 4.2.5.2.1
  14553. cache.splice(idx, 1)
  14554. }
  14555. } else if (operation.type === 'put') { // 4.2.6
  14556. // 4.2.6.1
  14557. if (operation.response == null) {
  14558. throw webidl.errors.exception({
  14559. header: 'Cache.#batchCacheOperations',
  14560. message: 'put operation should have an associated response'
  14561. })
  14562. }
  14563. // 4.2.6.2
  14564. const r = operation.request
  14565. // 4.2.6.3
  14566. if (!urlIsHttpHttpsScheme(r.url)) {
  14567. throw webidl.errors.exception({
  14568. header: 'Cache.#batchCacheOperations',
  14569. message: 'expected http or https scheme'
  14570. })
  14571. }
  14572. // 4.2.6.4
  14573. if (r.method !== 'GET') {
  14574. throw webidl.errors.exception({
  14575. header: 'Cache.#batchCacheOperations',
  14576. message: 'not get method'
  14577. })
  14578. }
  14579. // 4.2.6.5
  14580. if (operation.options != null) {
  14581. throw webidl.errors.exception({
  14582. header: 'Cache.#batchCacheOperations',
  14583. message: 'options must not be defined'
  14584. })
  14585. }
  14586. // 4.2.6.6
  14587. requestResponses = this.#queryCache(operation.request)
  14588. // 4.2.6.7
  14589. for (const requestResponse of requestResponses) {
  14590. const idx = cache.indexOf(requestResponse)
  14591. assert(idx !== -1)
  14592. // 4.2.6.7.1
  14593. cache.splice(idx, 1)
  14594. }
  14595. // 4.2.6.8
  14596. cache.push([operation.request, operation.response])
  14597. // 4.2.6.10
  14598. addedItems.push([operation.request, operation.response])
  14599. }
  14600. // 4.2.7
  14601. resultList.push([operation.request, operation.response])
  14602. }
  14603. // 4.3
  14604. return resultList
  14605. } catch (e) { // 5.
  14606. // 5.1
  14607. this.#relevantRequestResponseList.length = 0
  14608. // 5.2
  14609. this.#relevantRequestResponseList = backupCache
  14610. // 5.3
  14611. throw e
  14612. }
  14613. }
  14614. /**
  14615. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14616. * @param {any} requestQuery
  14617. * @param {import('../../types/cache').CacheQueryOptions} options
  14618. * @param {requestResponseList} targetStorage
  14619. * @returns {requestResponseList}
  14620. */
  14621. #queryCache (requestQuery, options, targetStorage) {
  14622. /** @type {requestResponseList} */
  14623. const resultList = []
  14624. const storage = targetStorage ?? this.#relevantRequestResponseList
  14625. for (const requestResponse of storage) {
  14626. const [cachedRequest, cachedResponse] = requestResponse
  14627. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14628. resultList.push(requestResponse)
  14629. }
  14630. }
  14631. return resultList
  14632. }
  14633. /**
  14634. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14635. * @param {any} requestQuery
  14636. * @param {any} request
  14637. * @param {any | null} response
  14638. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14639. * @returns {boolean}
  14640. */
  14641. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14642. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14643. // return false
  14644. // }
  14645. const queryURL = new URL(requestQuery.url)
  14646. const cachedURL = new URL(request.url)
  14647. if (options?.ignoreSearch) {
  14648. cachedURL.search = ''
  14649. queryURL.search = ''
  14650. }
  14651. if (!urlEquals(queryURL, cachedURL, true)) {
  14652. return false
  14653. }
  14654. if (
  14655. response == null ||
  14656. options?.ignoreVary ||
  14657. !response.headersList.contains('vary')
  14658. ) {
  14659. return true
  14660. }
  14661. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14662. for (const fieldValue of fieldValues) {
  14663. if (fieldValue === '*') {
  14664. return false
  14665. }
  14666. const requestValue = request.headersList.get(fieldValue)
  14667. const queryValue = requestQuery.headersList.get(fieldValue)
  14668. // If one has the header and the other doesn't, or one has
  14669. // a different value than the other, return false
  14670. if (requestValue !== queryValue) {
  14671. return false
  14672. }
  14673. }
  14674. return true
  14675. }
  14676. }
  14677. Object.defineProperties(Cache.prototype, {
  14678. [Symbol.toStringTag]: {
  14679. value: 'Cache',
  14680. configurable: true
  14681. },
  14682. match: kEnumerableProperty,
  14683. matchAll: kEnumerableProperty,
  14684. add: kEnumerableProperty,
  14685. addAll: kEnumerableProperty,
  14686. put: kEnumerableProperty,
  14687. delete: kEnumerableProperty,
  14688. keys: kEnumerableProperty
  14689. })
  14690. const cacheQueryOptionConverters = [
  14691. {
  14692. key: 'ignoreSearch',
  14693. converter: webidl.converters.boolean,
  14694. defaultValue: false
  14695. },
  14696. {
  14697. key: 'ignoreMethod',
  14698. converter: webidl.converters.boolean,
  14699. defaultValue: false
  14700. },
  14701. {
  14702. key: 'ignoreVary',
  14703. converter: webidl.converters.boolean,
  14704. defaultValue: false
  14705. }
  14706. ]
  14707. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14708. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14709. ...cacheQueryOptionConverters,
  14710. {
  14711. key: 'cacheName',
  14712. converter: webidl.converters.DOMString
  14713. }
  14714. ])
  14715. webidl.converters.Response = webidl.interfaceConverter(Response)
  14716. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14717. webidl.converters.RequestInfo
  14718. )
  14719. module.exports = {
  14720. Cache
  14721. }
  14722. /***/ }),
  14723. /***/ 7907:
  14724. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14725. "use strict";
  14726. const { kConstruct } = __nccwpck_require__(9174)
  14727. const { Cache } = __nccwpck_require__(6101)
  14728. const { webidl } = __nccwpck_require__(1744)
  14729. const { kEnumerableProperty } = __nccwpck_require__(3983)
  14730. class CacheStorage {
  14731. /**
  14732. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  14733. * @type {Map<string, import('./cache').requestResponseList}
  14734. */
  14735. #caches = new Map()
  14736. constructor () {
  14737. if (arguments[0] !== kConstruct) {
  14738. webidl.illegalConstructor()
  14739. }
  14740. }
  14741. async match (request, options = {}) {
  14742. webidl.brandCheck(this, CacheStorage)
  14743. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  14744. request = webidl.converters.RequestInfo(request)
  14745. options = webidl.converters.MultiCacheQueryOptions(options)
  14746. // 1.
  14747. if (options.cacheName != null) {
  14748. // 1.1.1.1
  14749. if (this.#caches.has(options.cacheName)) {
  14750. // 1.1.1.1.1
  14751. const cacheList = this.#caches.get(options.cacheName)
  14752. const cache = new Cache(kConstruct, cacheList)
  14753. return await cache.match(request, options)
  14754. }
  14755. } else { // 2.
  14756. // 2.2
  14757. for (const cacheList of this.#caches.values()) {
  14758. const cache = new Cache(kConstruct, cacheList)
  14759. // 2.2.1.2
  14760. const response = await cache.match(request, options)
  14761. if (response !== undefined) {
  14762. return response
  14763. }
  14764. }
  14765. }
  14766. }
  14767. /**
  14768. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  14769. * @param {string} cacheName
  14770. * @returns {Promise<boolean>}
  14771. */
  14772. async has (cacheName) {
  14773. webidl.brandCheck(this, CacheStorage)
  14774. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  14775. cacheName = webidl.converters.DOMString(cacheName)
  14776. // 2.1.1
  14777. // 2.2
  14778. return this.#caches.has(cacheName)
  14779. }
  14780. /**
  14781. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  14782. * @param {string} cacheName
  14783. * @returns {Promise<Cache>}
  14784. */
  14785. async open (cacheName) {
  14786. webidl.brandCheck(this, CacheStorage)
  14787. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  14788. cacheName = webidl.converters.DOMString(cacheName)
  14789. // 2.1
  14790. if (this.#caches.has(cacheName)) {
  14791. // await caches.open('v1') !== await caches.open('v1')
  14792. // 2.1.1
  14793. const cache = this.#caches.get(cacheName)
  14794. // 2.1.1.1
  14795. return new Cache(kConstruct, cache)
  14796. }
  14797. // 2.2
  14798. const cache = []
  14799. // 2.3
  14800. this.#caches.set(cacheName, cache)
  14801. // 2.4
  14802. return new Cache(kConstruct, cache)
  14803. }
  14804. /**
  14805. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  14806. * @param {string} cacheName
  14807. * @returns {Promise<boolean>}
  14808. */
  14809. async delete (cacheName) {
  14810. webidl.brandCheck(this, CacheStorage)
  14811. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  14812. cacheName = webidl.converters.DOMString(cacheName)
  14813. return this.#caches.delete(cacheName)
  14814. }
  14815. /**
  14816. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  14817. * @returns {string[]}
  14818. */
  14819. async keys () {
  14820. webidl.brandCheck(this, CacheStorage)
  14821. // 2.1
  14822. const keys = this.#caches.keys()
  14823. // 2.2
  14824. return [...keys]
  14825. }
  14826. }
  14827. Object.defineProperties(CacheStorage.prototype, {
  14828. [Symbol.toStringTag]: {
  14829. value: 'CacheStorage',
  14830. configurable: true
  14831. },
  14832. match: kEnumerableProperty,
  14833. has: kEnumerableProperty,
  14834. open: kEnumerableProperty,
  14835. delete: kEnumerableProperty,
  14836. keys: kEnumerableProperty
  14837. })
  14838. module.exports = {
  14839. CacheStorage
  14840. }
  14841. /***/ }),
  14842. /***/ 9174:
  14843. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14844. "use strict";
  14845. module.exports = {
  14846. kConstruct: (__nccwpck_require__(2785).kConstruct)
  14847. }
  14848. /***/ }),
  14849. /***/ 2396:
  14850. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14851. "use strict";
  14852. const assert = __nccwpck_require__(9491)
  14853. const { URLSerializer } = __nccwpck_require__(685)
  14854. const { isValidHeaderName } = __nccwpck_require__(2538)
  14855. /**
  14856. * @see https://url.spec.whatwg.org/#concept-url-equals
  14857. * @param {URL} A
  14858. * @param {URL} B
  14859. * @param {boolean | undefined} excludeFragment
  14860. * @returns {boolean}
  14861. */
  14862. function urlEquals (A, B, excludeFragment = false) {
  14863. const serializedA = URLSerializer(A, excludeFragment)
  14864. const serializedB = URLSerializer(B, excludeFragment)
  14865. return serializedA === serializedB
  14866. }
  14867. /**
  14868. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  14869. * @param {string} header
  14870. */
  14871. function fieldValues (header) {
  14872. assert(header !== null)
  14873. const values = []
  14874. for (let value of header.split(',')) {
  14875. value = value.trim()
  14876. if (!value.length) {
  14877. continue
  14878. } else if (!isValidHeaderName(value)) {
  14879. continue
  14880. }
  14881. values.push(value)
  14882. }
  14883. return values
  14884. }
  14885. module.exports = {
  14886. urlEquals,
  14887. fieldValues
  14888. }
  14889. /***/ }),
  14890. /***/ 3598:
  14891. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14892. "use strict";
  14893. // @ts-check
  14894. /* global WebAssembly */
  14895. const assert = __nccwpck_require__(9491)
  14896. const net = __nccwpck_require__(1808)
  14897. const http = __nccwpck_require__(3685)
  14898. const { pipeline } = __nccwpck_require__(2781)
  14899. const util = __nccwpck_require__(3983)
  14900. const timers = __nccwpck_require__(9459)
  14901. const Request = __nccwpck_require__(2905)
  14902. const DispatcherBase = __nccwpck_require__(4839)
  14903. const {
  14904. RequestContentLengthMismatchError,
  14905. ResponseContentLengthMismatchError,
  14906. InvalidArgumentError,
  14907. RequestAbortedError,
  14908. HeadersTimeoutError,
  14909. HeadersOverflowError,
  14910. SocketError,
  14911. InformationalError,
  14912. BodyTimeoutError,
  14913. HTTPParserError,
  14914. ResponseExceededMaxSizeError,
  14915. ClientDestroyedError
  14916. } = __nccwpck_require__(8045)
  14917. const buildConnector = __nccwpck_require__(2067)
  14918. const {
  14919. kUrl,
  14920. kReset,
  14921. kServerName,
  14922. kClient,
  14923. kBusy,
  14924. kParser,
  14925. kConnect,
  14926. kBlocking,
  14927. kResuming,
  14928. kRunning,
  14929. kPending,
  14930. kSize,
  14931. kWriting,
  14932. kQueue,
  14933. kConnected,
  14934. kConnecting,
  14935. kNeedDrain,
  14936. kNoRef,
  14937. kKeepAliveDefaultTimeout,
  14938. kHostHeader,
  14939. kPendingIdx,
  14940. kRunningIdx,
  14941. kError,
  14942. kPipelining,
  14943. kSocket,
  14944. kKeepAliveTimeoutValue,
  14945. kMaxHeadersSize,
  14946. kKeepAliveMaxTimeout,
  14947. kKeepAliveTimeoutThreshold,
  14948. kHeadersTimeout,
  14949. kBodyTimeout,
  14950. kStrictContentLength,
  14951. kConnector,
  14952. kMaxRedirections,
  14953. kMaxRequests,
  14954. kCounter,
  14955. kClose,
  14956. kDestroy,
  14957. kDispatch,
  14958. kInterceptors,
  14959. kLocalAddress,
  14960. kMaxResponseSize,
  14961. kHTTPConnVersion,
  14962. // HTTP2
  14963. kHost,
  14964. kHTTP2Session,
  14965. kHTTP2SessionState,
  14966. kHTTP2BuildRequest,
  14967. kHTTP2CopyHeaders,
  14968. kHTTP1BuildRequest
  14969. } = __nccwpck_require__(2785)
  14970. /** @type {import('http2')} */
  14971. let http2
  14972. try {
  14973. http2 = __nccwpck_require__(5158)
  14974. } catch {
  14975. // @ts-ignore
  14976. http2 = { constants: {} }
  14977. }
  14978. const {
  14979. constants: {
  14980. HTTP2_HEADER_AUTHORITY,
  14981. HTTP2_HEADER_METHOD,
  14982. HTTP2_HEADER_PATH,
  14983. HTTP2_HEADER_SCHEME,
  14984. HTTP2_HEADER_CONTENT_LENGTH,
  14985. HTTP2_HEADER_EXPECT,
  14986. HTTP2_HEADER_STATUS
  14987. }
  14988. } = http2
  14989. // Experimental
  14990. let h2ExperimentalWarned = false
  14991. const FastBuffer = Buffer[Symbol.species]
  14992. const kClosedResolve = Symbol('kClosedResolve')
  14993. const channels = {}
  14994. try {
  14995. const diagnosticsChannel = __nccwpck_require__(7643)
  14996. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  14997. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  14998. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  14999. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15000. } catch {
  15001. channels.sendHeaders = { hasSubscribers: false }
  15002. channels.beforeConnect = { hasSubscribers: false }
  15003. channels.connectError = { hasSubscribers: false }
  15004. channels.connected = { hasSubscribers: false }
  15005. }
  15006. /**
  15007. * @type {import('../types/client').default}
  15008. */
  15009. class Client extends DispatcherBase {
  15010. /**
  15011. *
  15012. * @param {string|URL} url
  15013. * @param {import('../types/client').Client.Options} options
  15014. */
  15015. constructor (url, {
  15016. interceptors,
  15017. maxHeaderSize,
  15018. headersTimeout,
  15019. socketTimeout,
  15020. requestTimeout,
  15021. connectTimeout,
  15022. bodyTimeout,
  15023. idleTimeout,
  15024. keepAlive,
  15025. keepAliveTimeout,
  15026. maxKeepAliveTimeout,
  15027. keepAliveMaxTimeout,
  15028. keepAliveTimeoutThreshold,
  15029. socketPath,
  15030. pipelining,
  15031. tls,
  15032. strictContentLength,
  15033. maxCachedSessions,
  15034. maxRedirections,
  15035. connect,
  15036. maxRequestsPerClient,
  15037. localAddress,
  15038. maxResponseSize,
  15039. autoSelectFamily,
  15040. autoSelectFamilyAttemptTimeout,
  15041. // h2
  15042. allowH2,
  15043. maxConcurrentStreams
  15044. } = {}) {
  15045. super()
  15046. if (keepAlive !== undefined) {
  15047. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15048. }
  15049. if (socketTimeout !== undefined) {
  15050. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15051. }
  15052. if (requestTimeout !== undefined) {
  15053. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15054. }
  15055. if (idleTimeout !== undefined) {
  15056. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15057. }
  15058. if (maxKeepAliveTimeout !== undefined) {
  15059. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15060. }
  15061. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15062. throw new InvalidArgumentError('invalid maxHeaderSize')
  15063. }
  15064. if (socketPath != null && typeof socketPath !== 'string') {
  15065. throw new InvalidArgumentError('invalid socketPath')
  15066. }
  15067. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15068. throw new InvalidArgumentError('invalid connectTimeout')
  15069. }
  15070. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15071. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15072. }
  15073. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15074. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15075. }
  15076. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15077. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15078. }
  15079. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15080. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15081. }
  15082. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15083. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15084. }
  15085. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15086. throw new InvalidArgumentError('connect must be a function or an object')
  15087. }
  15088. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15089. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15090. }
  15091. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15092. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15093. }
  15094. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15095. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15096. }
  15097. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15098. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15099. }
  15100. if (
  15101. autoSelectFamilyAttemptTimeout != null &&
  15102. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15103. ) {
  15104. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15105. }
  15106. // h2
  15107. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15108. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15109. }
  15110. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15111. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15112. }
  15113. if (typeof connect !== 'function') {
  15114. connect = buildConnector({
  15115. ...tls,
  15116. maxCachedSessions,
  15117. allowH2,
  15118. socketPath,
  15119. timeout: connectTimeout,
  15120. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15121. ...connect
  15122. })
  15123. }
  15124. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15125. ? interceptors.Client
  15126. : [createRedirectInterceptor({ maxRedirections })]
  15127. this[kUrl] = util.parseOrigin(url)
  15128. this[kConnector] = connect
  15129. this[kSocket] = null
  15130. this[kPipelining] = pipelining != null ? pipelining : 1
  15131. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15132. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15133. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15134. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15135. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15136. this[kServerName] = null
  15137. this[kLocalAddress] = localAddress != null ? localAddress : null
  15138. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15139. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15140. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15141. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15142. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15143. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15144. this[kMaxRedirections] = maxRedirections
  15145. this[kMaxRequests] = maxRequestsPerClient
  15146. this[kClosedResolve] = null
  15147. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15148. this[kHTTPConnVersion] = 'h1'
  15149. // HTTP/2
  15150. this[kHTTP2Session] = null
  15151. this[kHTTP2SessionState] = !allowH2
  15152. ? null
  15153. : {
  15154. // streams: null, // Fixed queue of streams - For future support of `push`
  15155. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15156. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15157. }
  15158. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15159. // kQueue is built up of 3 sections separated by
  15160. // the kRunningIdx and kPendingIdx indices.
  15161. // | complete | running | pending |
  15162. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15163. // kRunningIdx points to the first running element.
  15164. // kPendingIdx points to the first pending element.
  15165. // This implements a fast queue with an amortized
  15166. // time of O(1).
  15167. this[kQueue] = []
  15168. this[kRunningIdx] = 0
  15169. this[kPendingIdx] = 0
  15170. }
  15171. get pipelining () {
  15172. return this[kPipelining]
  15173. }
  15174. set pipelining (value) {
  15175. this[kPipelining] = value
  15176. resume(this, true)
  15177. }
  15178. get [kPending] () {
  15179. return this[kQueue].length - this[kPendingIdx]
  15180. }
  15181. get [kRunning] () {
  15182. return this[kPendingIdx] - this[kRunningIdx]
  15183. }
  15184. get [kSize] () {
  15185. return this[kQueue].length - this[kRunningIdx]
  15186. }
  15187. get [kConnected] () {
  15188. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15189. }
  15190. get [kBusy] () {
  15191. const socket = this[kSocket]
  15192. return (
  15193. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15194. (this[kSize] >= (this[kPipelining] || 1)) ||
  15195. this[kPending] > 0
  15196. )
  15197. }
  15198. /* istanbul ignore: only used for test */
  15199. [kConnect] (cb) {
  15200. connect(this)
  15201. this.once('connect', cb)
  15202. }
  15203. [kDispatch] (opts, handler) {
  15204. const origin = opts.origin || this[kUrl].origin
  15205. const request = this[kHTTPConnVersion] === 'h2'
  15206. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15207. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15208. this[kQueue].push(request)
  15209. if (this[kResuming]) {
  15210. // Do nothing.
  15211. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15212. // Wait a tick in case stream/iterator is ended in the same tick.
  15213. this[kResuming] = 1
  15214. process.nextTick(resume, this)
  15215. } else {
  15216. resume(this, true)
  15217. }
  15218. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15219. this[kNeedDrain] = 2
  15220. }
  15221. return this[kNeedDrain] < 2
  15222. }
  15223. async [kClose] () {
  15224. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15225. // request and close each stream.
  15226. return new Promise((resolve) => {
  15227. if (!this[kSize]) {
  15228. resolve(null)
  15229. } else {
  15230. this[kClosedResolve] = resolve
  15231. }
  15232. })
  15233. }
  15234. async [kDestroy] (err) {
  15235. return new Promise((resolve) => {
  15236. const requests = this[kQueue].splice(this[kPendingIdx])
  15237. for (let i = 0; i < requests.length; i++) {
  15238. const request = requests[i]
  15239. errorRequest(this, request, err)
  15240. }
  15241. const callback = () => {
  15242. if (this[kClosedResolve]) {
  15243. // TODO (fix): Should we error here with ClientDestroyedError?
  15244. this[kClosedResolve]()
  15245. this[kClosedResolve] = null
  15246. }
  15247. resolve()
  15248. }
  15249. if (this[kHTTP2Session] != null) {
  15250. util.destroy(this[kHTTP2Session], err)
  15251. this[kHTTP2Session] = null
  15252. this[kHTTP2SessionState] = null
  15253. }
  15254. if (!this[kSocket]) {
  15255. queueMicrotask(callback)
  15256. } else {
  15257. util.destroy(this[kSocket].on('close', callback), err)
  15258. }
  15259. resume(this)
  15260. })
  15261. }
  15262. }
  15263. function onHttp2SessionError (err) {
  15264. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15265. this[kSocket][kError] = err
  15266. onError(this[kClient], err)
  15267. }
  15268. function onHttp2FrameError (type, code, id) {
  15269. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15270. if (id === 0) {
  15271. this[kSocket][kError] = err
  15272. onError(this[kClient], err)
  15273. }
  15274. }
  15275. function onHttp2SessionEnd () {
  15276. util.destroy(this, new SocketError('other side closed'))
  15277. util.destroy(this[kSocket], new SocketError('other side closed'))
  15278. }
  15279. function onHTTP2GoAway (code) {
  15280. const client = this[kClient]
  15281. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15282. client[kSocket] = null
  15283. client[kHTTP2Session] = null
  15284. if (client.destroyed) {
  15285. assert(this[kPending] === 0)
  15286. // Fail entire queue.
  15287. const requests = client[kQueue].splice(client[kRunningIdx])
  15288. for (let i = 0; i < requests.length; i++) {
  15289. const request = requests[i]
  15290. errorRequest(this, request, err)
  15291. }
  15292. } else if (client[kRunning] > 0) {
  15293. // Fail head of pipeline.
  15294. const request = client[kQueue][client[kRunningIdx]]
  15295. client[kQueue][client[kRunningIdx]++] = null
  15296. errorRequest(client, request, err)
  15297. }
  15298. client[kPendingIdx] = client[kRunningIdx]
  15299. assert(client[kRunning] === 0)
  15300. client.emit('disconnect',
  15301. client[kUrl],
  15302. [client],
  15303. err
  15304. )
  15305. resume(client)
  15306. }
  15307. const constants = __nccwpck_require__(953)
  15308. const createRedirectInterceptor = __nccwpck_require__(8861)
  15309. const EMPTY_BUF = Buffer.alloc(0)
  15310. async function lazyllhttp () {
  15311. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15312. let mod
  15313. try {
  15314. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15315. } catch (e) {
  15316. /* istanbul ignore next */
  15317. // We could check if the error was caused by the simd option not
  15318. // being enabled, but the occurring of this other error
  15319. // * https://github.com/emscripten-core/emscripten/issues/11495
  15320. // got me to remove that check to avoid breaking Node 12.
  15321. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15322. }
  15323. return await WebAssembly.instantiate(mod, {
  15324. env: {
  15325. /* eslint-disable camelcase */
  15326. wasm_on_url: (p, at, len) => {
  15327. /* istanbul ignore next */
  15328. return 0
  15329. },
  15330. wasm_on_status: (p, at, len) => {
  15331. assert.strictEqual(currentParser.ptr, p)
  15332. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15333. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15334. },
  15335. wasm_on_message_begin: (p) => {
  15336. assert.strictEqual(currentParser.ptr, p)
  15337. return currentParser.onMessageBegin() || 0
  15338. },
  15339. wasm_on_header_field: (p, at, len) => {
  15340. assert.strictEqual(currentParser.ptr, p)
  15341. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15342. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15343. },
  15344. wasm_on_header_value: (p, at, len) => {
  15345. assert.strictEqual(currentParser.ptr, p)
  15346. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15347. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15348. },
  15349. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15350. assert.strictEqual(currentParser.ptr, p)
  15351. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15352. },
  15353. wasm_on_body: (p, at, len) => {
  15354. assert.strictEqual(currentParser.ptr, p)
  15355. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15356. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15357. },
  15358. wasm_on_message_complete: (p) => {
  15359. assert.strictEqual(currentParser.ptr, p)
  15360. return currentParser.onMessageComplete() || 0
  15361. }
  15362. /* eslint-enable camelcase */
  15363. }
  15364. })
  15365. }
  15366. let llhttpInstance = null
  15367. let llhttpPromise = lazyllhttp()
  15368. llhttpPromise.catch()
  15369. let currentParser = null
  15370. let currentBufferRef = null
  15371. let currentBufferSize = 0
  15372. let currentBufferPtr = null
  15373. const TIMEOUT_HEADERS = 1
  15374. const TIMEOUT_BODY = 2
  15375. const TIMEOUT_IDLE = 3
  15376. class Parser {
  15377. constructor (client, socket, { exports }) {
  15378. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15379. this.llhttp = exports
  15380. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15381. this.client = client
  15382. this.socket = socket
  15383. this.timeout = null
  15384. this.timeoutValue = null
  15385. this.timeoutType = null
  15386. this.statusCode = null
  15387. this.statusText = ''
  15388. this.upgrade = false
  15389. this.headers = []
  15390. this.headersSize = 0
  15391. this.headersMaxSize = client[kMaxHeadersSize]
  15392. this.shouldKeepAlive = false
  15393. this.paused = false
  15394. this.resume = this.resume.bind(this)
  15395. this.bytesRead = 0
  15396. this.keepAlive = ''
  15397. this.contentLength = ''
  15398. this.connection = ''
  15399. this.maxResponseSize = client[kMaxResponseSize]
  15400. }
  15401. setTimeout (value, type) {
  15402. this.timeoutType = type
  15403. if (value !== this.timeoutValue) {
  15404. timers.clearTimeout(this.timeout)
  15405. if (value) {
  15406. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15407. // istanbul ignore else: only for jest
  15408. if (this.timeout.unref) {
  15409. this.timeout.unref()
  15410. }
  15411. } else {
  15412. this.timeout = null
  15413. }
  15414. this.timeoutValue = value
  15415. } else if (this.timeout) {
  15416. // istanbul ignore else: only for jest
  15417. if (this.timeout.refresh) {
  15418. this.timeout.refresh()
  15419. }
  15420. }
  15421. }
  15422. resume () {
  15423. if (this.socket.destroyed || !this.paused) {
  15424. return
  15425. }
  15426. assert(this.ptr != null)
  15427. assert(currentParser == null)
  15428. this.llhttp.llhttp_resume(this.ptr)
  15429. assert(this.timeoutType === TIMEOUT_BODY)
  15430. if (this.timeout) {
  15431. // istanbul ignore else: only for jest
  15432. if (this.timeout.refresh) {
  15433. this.timeout.refresh()
  15434. }
  15435. }
  15436. this.paused = false
  15437. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15438. this.readMore()
  15439. }
  15440. readMore () {
  15441. while (!this.paused && this.ptr) {
  15442. const chunk = this.socket.read()
  15443. if (chunk === null) {
  15444. break
  15445. }
  15446. this.execute(chunk)
  15447. }
  15448. }
  15449. execute (data) {
  15450. assert(this.ptr != null)
  15451. assert(currentParser == null)
  15452. assert(!this.paused)
  15453. const { socket, llhttp } = this
  15454. if (data.length > currentBufferSize) {
  15455. if (currentBufferPtr) {
  15456. llhttp.free(currentBufferPtr)
  15457. }
  15458. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15459. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15460. }
  15461. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15462. // Call `execute` on the wasm parser.
  15463. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15464. // and finally the length of bytes to parse.
  15465. // The return value is an error code or `constants.ERROR.OK`.
  15466. try {
  15467. let ret
  15468. try {
  15469. currentBufferRef = data
  15470. currentParser = this
  15471. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15472. /* eslint-disable-next-line no-useless-catch */
  15473. } catch (err) {
  15474. /* istanbul ignore next: difficult to make a test case for */
  15475. throw err
  15476. } finally {
  15477. currentParser = null
  15478. currentBufferRef = null
  15479. }
  15480. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15481. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15482. this.onUpgrade(data.slice(offset))
  15483. } else if (ret === constants.ERROR.PAUSED) {
  15484. this.paused = true
  15485. socket.unshift(data.slice(offset))
  15486. } else if (ret !== constants.ERROR.OK) {
  15487. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15488. let message = ''
  15489. /* istanbul ignore else: difficult to make a test case for */
  15490. if (ptr) {
  15491. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15492. message =
  15493. 'Response does not match the HTTP/1.1 protocol (' +
  15494. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15495. ')'
  15496. }
  15497. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15498. }
  15499. } catch (err) {
  15500. util.destroy(socket, err)
  15501. }
  15502. }
  15503. destroy () {
  15504. assert(this.ptr != null)
  15505. assert(currentParser == null)
  15506. this.llhttp.llhttp_free(this.ptr)
  15507. this.ptr = null
  15508. timers.clearTimeout(this.timeout)
  15509. this.timeout = null
  15510. this.timeoutValue = null
  15511. this.timeoutType = null
  15512. this.paused = false
  15513. }
  15514. onStatus (buf) {
  15515. this.statusText = buf.toString()
  15516. }
  15517. onMessageBegin () {
  15518. const { socket, client } = this
  15519. /* istanbul ignore next: difficult to make a test case for */
  15520. if (socket.destroyed) {
  15521. return -1
  15522. }
  15523. const request = client[kQueue][client[kRunningIdx]]
  15524. if (!request) {
  15525. return -1
  15526. }
  15527. }
  15528. onHeaderField (buf) {
  15529. const len = this.headers.length
  15530. if ((len & 1) === 0) {
  15531. this.headers.push(buf)
  15532. } else {
  15533. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15534. }
  15535. this.trackHeader(buf.length)
  15536. }
  15537. onHeaderValue (buf) {
  15538. let len = this.headers.length
  15539. if ((len & 1) === 1) {
  15540. this.headers.push(buf)
  15541. len += 1
  15542. } else {
  15543. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15544. }
  15545. const key = this.headers[len - 2]
  15546. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15547. this.keepAlive += buf.toString()
  15548. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15549. this.connection += buf.toString()
  15550. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15551. this.contentLength += buf.toString()
  15552. }
  15553. this.trackHeader(buf.length)
  15554. }
  15555. trackHeader (len) {
  15556. this.headersSize += len
  15557. if (this.headersSize >= this.headersMaxSize) {
  15558. util.destroy(this.socket, new HeadersOverflowError())
  15559. }
  15560. }
  15561. onUpgrade (head) {
  15562. const { upgrade, client, socket, headers, statusCode } = this
  15563. assert(upgrade)
  15564. const request = client[kQueue][client[kRunningIdx]]
  15565. assert(request)
  15566. assert(!socket.destroyed)
  15567. assert(socket === client[kSocket])
  15568. assert(!this.paused)
  15569. assert(request.upgrade || request.method === 'CONNECT')
  15570. this.statusCode = null
  15571. this.statusText = ''
  15572. this.shouldKeepAlive = null
  15573. assert(this.headers.length % 2 === 0)
  15574. this.headers = []
  15575. this.headersSize = 0
  15576. socket.unshift(head)
  15577. socket[kParser].destroy()
  15578. socket[kParser] = null
  15579. socket[kClient] = null
  15580. socket[kError] = null
  15581. socket
  15582. .removeListener('error', onSocketError)
  15583. .removeListener('readable', onSocketReadable)
  15584. .removeListener('end', onSocketEnd)
  15585. .removeListener('close', onSocketClose)
  15586. client[kSocket] = null
  15587. client[kQueue][client[kRunningIdx]++] = null
  15588. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15589. try {
  15590. request.onUpgrade(statusCode, headers, socket)
  15591. } catch (err) {
  15592. util.destroy(socket, err)
  15593. }
  15594. resume(client)
  15595. }
  15596. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15597. const { client, socket, headers, statusText } = this
  15598. /* istanbul ignore next: difficult to make a test case for */
  15599. if (socket.destroyed) {
  15600. return -1
  15601. }
  15602. const request = client[kQueue][client[kRunningIdx]]
  15603. /* istanbul ignore next: difficult to make a test case for */
  15604. if (!request) {
  15605. return -1
  15606. }
  15607. assert(!this.upgrade)
  15608. assert(this.statusCode < 200)
  15609. if (statusCode === 100) {
  15610. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15611. return -1
  15612. }
  15613. /* this can only happen if server is misbehaving */
  15614. if (upgrade && !request.upgrade) {
  15615. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15616. return -1
  15617. }
  15618. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15619. this.statusCode = statusCode
  15620. this.shouldKeepAlive = (
  15621. shouldKeepAlive ||
  15622. // Override llhttp value which does not allow keepAlive for HEAD.
  15623. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15624. )
  15625. if (this.statusCode >= 200) {
  15626. const bodyTimeout = request.bodyTimeout != null
  15627. ? request.bodyTimeout
  15628. : client[kBodyTimeout]
  15629. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15630. } else if (this.timeout) {
  15631. // istanbul ignore else: only for jest
  15632. if (this.timeout.refresh) {
  15633. this.timeout.refresh()
  15634. }
  15635. }
  15636. if (request.method === 'CONNECT') {
  15637. assert(client[kRunning] === 1)
  15638. this.upgrade = true
  15639. return 2
  15640. }
  15641. if (upgrade) {
  15642. assert(client[kRunning] === 1)
  15643. this.upgrade = true
  15644. return 2
  15645. }
  15646. assert(this.headers.length % 2 === 0)
  15647. this.headers = []
  15648. this.headersSize = 0
  15649. if (this.shouldKeepAlive && client[kPipelining]) {
  15650. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15651. if (keepAliveTimeout != null) {
  15652. const timeout = Math.min(
  15653. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15654. client[kKeepAliveMaxTimeout]
  15655. )
  15656. if (timeout <= 0) {
  15657. socket[kReset] = true
  15658. } else {
  15659. client[kKeepAliveTimeoutValue] = timeout
  15660. }
  15661. } else {
  15662. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15663. }
  15664. } else {
  15665. // Stop more requests from being dispatched.
  15666. socket[kReset] = true
  15667. }
  15668. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15669. if (request.aborted) {
  15670. return -1
  15671. }
  15672. if (request.method === 'HEAD') {
  15673. return 1
  15674. }
  15675. if (statusCode < 200) {
  15676. return 1
  15677. }
  15678. if (socket[kBlocking]) {
  15679. socket[kBlocking] = false
  15680. resume(client)
  15681. }
  15682. return pause ? constants.ERROR.PAUSED : 0
  15683. }
  15684. onBody (buf) {
  15685. const { client, socket, statusCode, maxResponseSize } = this
  15686. if (socket.destroyed) {
  15687. return -1
  15688. }
  15689. const request = client[kQueue][client[kRunningIdx]]
  15690. assert(request)
  15691. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15692. if (this.timeout) {
  15693. // istanbul ignore else: only for jest
  15694. if (this.timeout.refresh) {
  15695. this.timeout.refresh()
  15696. }
  15697. }
  15698. assert(statusCode >= 200)
  15699. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15700. util.destroy(socket, new ResponseExceededMaxSizeError())
  15701. return -1
  15702. }
  15703. this.bytesRead += buf.length
  15704. if (request.onData(buf) === false) {
  15705. return constants.ERROR.PAUSED
  15706. }
  15707. }
  15708. onMessageComplete () {
  15709. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15710. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15711. return -1
  15712. }
  15713. if (upgrade) {
  15714. return
  15715. }
  15716. const request = client[kQueue][client[kRunningIdx]]
  15717. assert(request)
  15718. assert(statusCode >= 100)
  15719. this.statusCode = null
  15720. this.statusText = ''
  15721. this.bytesRead = 0
  15722. this.contentLength = ''
  15723. this.keepAlive = ''
  15724. this.connection = ''
  15725. assert(this.headers.length % 2 === 0)
  15726. this.headers = []
  15727. this.headersSize = 0
  15728. if (statusCode < 200) {
  15729. return
  15730. }
  15731. /* istanbul ignore next: should be handled by llhttp? */
  15732. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  15733. util.destroy(socket, new ResponseContentLengthMismatchError())
  15734. return -1
  15735. }
  15736. request.onComplete(headers)
  15737. client[kQueue][client[kRunningIdx]++] = null
  15738. if (socket[kWriting]) {
  15739. assert.strictEqual(client[kRunning], 0)
  15740. // Response completed before request.
  15741. util.destroy(socket, new InformationalError('reset'))
  15742. return constants.ERROR.PAUSED
  15743. } else if (!shouldKeepAlive) {
  15744. util.destroy(socket, new InformationalError('reset'))
  15745. return constants.ERROR.PAUSED
  15746. } else if (socket[kReset] && client[kRunning] === 0) {
  15747. // Destroy socket once all requests have completed.
  15748. // The request at the tail of the pipeline is the one
  15749. // that requested reset and no further requests should
  15750. // have been queued since then.
  15751. util.destroy(socket, new InformationalError('reset'))
  15752. return constants.ERROR.PAUSED
  15753. } else if (client[kPipelining] === 1) {
  15754. // We must wait a full event loop cycle to reuse this socket to make sure
  15755. // that non-spec compliant servers are not closing the connection even if they
  15756. // said they won't.
  15757. setImmediate(resume, client)
  15758. } else {
  15759. resume(client)
  15760. }
  15761. }
  15762. }
  15763. function onParserTimeout (parser) {
  15764. const { socket, timeoutType, client } = parser
  15765. /* istanbul ignore else */
  15766. if (timeoutType === TIMEOUT_HEADERS) {
  15767. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  15768. assert(!parser.paused, 'cannot be paused while waiting for headers')
  15769. util.destroy(socket, new HeadersTimeoutError())
  15770. }
  15771. } else if (timeoutType === TIMEOUT_BODY) {
  15772. if (!parser.paused) {
  15773. util.destroy(socket, new BodyTimeoutError())
  15774. }
  15775. } else if (timeoutType === TIMEOUT_IDLE) {
  15776. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  15777. util.destroy(socket, new InformationalError('socket idle timeout'))
  15778. }
  15779. }
  15780. function onSocketReadable () {
  15781. const { [kParser]: parser } = this
  15782. if (parser) {
  15783. parser.readMore()
  15784. }
  15785. }
  15786. function onSocketError (err) {
  15787. const { [kClient]: client, [kParser]: parser } = this
  15788. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15789. if (client[kHTTPConnVersion] !== 'h2') {
  15790. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  15791. // to the user.
  15792. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  15793. // We treat all incoming data so for as a valid response.
  15794. parser.onMessageComplete()
  15795. return
  15796. }
  15797. }
  15798. this[kError] = err
  15799. onError(this[kClient], err)
  15800. }
  15801. function onError (client, err) {
  15802. if (
  15803. client[kRunning] === 0 &&
  15804. err.code !== 'UND_ERR_INFO' &&
  15805. err.code !== 'UND_ERR_SOCKET'
  15806. ) {
  15807. // Error is not caused by running request and not a recoverable
  15808. // socket error.
  15809. assert(client[kPendingIdx] === client[kRunningIdx])
  15810. const requests = client[kQueue].splice(client[kRunningIdx])
  15811. for (let i = 0; i < requests.length; i++) {
  15812. const request = requests[i]
  15813. errorRequest(client, request, err)
  15814. }
  15815. assert(client[kSize] === 0)
  15816. }
  15817. }
  15818. function onSocketEnd () {
  15819. const { [kParser]: parser, [kClient]: client } = this
  15820. if (client[kHTTPConnVersion] !== 'h2') {
  15821. if (parser.statusCode && !parser.shouldKeepAlive) {
  15822. // We treat all incoming data so far as a valid response.
  15823. parser.onMessageComplete()
  15824. return
  15825. }
  15826. }
  15827. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  15828. }
  15829. function onSocketClose () {
  15830. const { [kClient]: client, [kParser]: parser } = this
  15831. if (client[kHTTPConnVersion] === 'h1' && parser) {
  15832. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  15833. // We treat all incoming data so far as a valid response.
  15834. parser.onMessageComplete()
  15835. }
  15836. this[kParser].destroy()
  15837. this[kParser] = null
  15838. }
  15839. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  15840. client[kSocket] = null
  15841. if (client.destroyed) {
  15842. assert(client[kPending] === 0)
  15843. // Fail entire queue.
  15844. const requests = client[kQueue].splice(client[kRunningIdx])
  15845. for (let i = 0; i < requests.length; i++) {
  15846. const request = requests[i]
  15847. errorRequest(client, request, err)
  15848. }
  15849. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  15850. // Fail head of pipeline.
  15851. const request = client[kQueue][client[kRunningIdx]]
  15852. client[kQueue][client[kRunningIdx]++] = null
  15853. errorRequest(client, request, err)
  15854. }
  15855. client[kPendingIdx] = client[kRunningIdx]
  15856. assert(client[kRunning] === 0)
  15857. client.emit('disconnect', client[kUrl], [client], err)
  15858. resume(client)
  15859. }
  15860. async function connect (client) {
  15861. assert(!client[kConnecting])
  15862. assert(!client[kSocket])
  15863. let { host, hostname, protocol, port } = client[kUrl]
  15864. // Resolve ipv6
  15865. if (hostname[0] === '[') {
  15866. const idx = hostname.indexOf(']')
  15867. assert(idx !== -1)
  15868. const ip = hostname.substring(1, idx)
  15869. assert(net.isIP(ip))
  15870. hostname = ip
  15871. }
  15872. client[kConnecting] = true
  15873. if (channels.beforeConnect.hasSubscribers) {
  15874. channels.beforeConnect.publish({
  15875. connectParams: {
  15876. host,
  15877. hostname,
  15878. protocol,
  15879. port,
  15880. servername: client[kServerName],
  15881. localAddress: client[kLocalAddress]
  15882. },
  15883. connector: client[kConnector]
  15884. })
  15885. }
  15886. try {
  15887. const socket = await new Promise((resolve, reject) => {
  15888. client[kConnector]({
  15889. host,
  15890. hostname,
  15891. protocol,
  15892. port,
  15893. servername: client[kServerName],
  15894. localAddress: client[kLocalAddress]
  15895. }, (err, socket) => {
  15896. if (err) {
  15897. reject(err)
  15898. } else {
  15899. resolve(socket)
  15900. }
  15901. })
  15902. })
  15903. if (client.destroyed) {
  15904. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  15905. return
  15906. }
  15907. client[kConnecting] = false
  15908. assert(socket)
  15909. const isH2 = socket.alpnProtocol === 'h2'
  15910. if (isH2) {
  15911. if (!h2ExperimentalWarned) {
  15912. h2ExperimentalWarned = true
  15913. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  15914. code: 'UNDICI-H2'
  15915. })
  15916. }
  15917. const session = http2.connect(client[kUrl], {
  15918. createConnection: () => socket,
  15919. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  15920. })
  15921. client[kHTTPConnVersion] = 'h2'
  15922. session[kClient] = client
  15923. session[kSocket] = socket
  15924. session.on('error', onHttp2SessionError)
  15925. session.on('frameError', onHttp2FrameError)
  15926. session.on('end', onHttp2SessionEnd)
  15927. session.on('goaway', onHTTP2GoAway)
  15928. session.on('close', onSocketClose)
  15929. session.unref()
  15930. client[kHTTP2Session] = session
  15931. socket[kHTTP2Session] = session
  15932. } else {
  15933. if (!llhttpInstance) {
  15934. llhttpInstance = await llhttpPromise
  15935. llhttpPromise = null
  15936. }
  15937. socket[kNoRef] = false
  15938. socket[kWriting] = false
  15939. socket[kReset] = false
  15940. socket[kBlocking] = false
  15941. socket[kParser] = new Parser(client, socket, llhttpInstance)
  15942. }
  15943. socket[kCounter] = 0
  15944. socket[kMaxRequests] = client[kMaxRequests]
  15945. socket[kClient] = client
  15946. socket[kError] = null
  15947. socket
  15948. .on('error', onSocketError)
  15949. .on('readable', onSocketReadable)
  15950. .on('end', onSocketEnd)
  15951. .on('close', onSocketClose)
  15952. client[kSocket] = socket
  15953. if (channels.connected.hasSubscribers) {
  15954. channels.connected.publish({
  15955. connectParams: {
  15956. host,
  15957. hostname,
  15958. protocol,
  15959. port,
  15960. servername: client[kServerName],
  15961. localAddress: client[kLocalAddress]
  15962. },
  15963. connector: client[kConnector],
  15964. socket
  15965. })
  15966. }
  15967. client.emit('connect', client[kUrl], [client])
  15968. } catch (err) {
  15969. if (client.destroyed) {
  15970. return
  15971. }
  15972. client[kConnecting] = false
  15973. if (channels.connectError.hasSubscribers) {
  15974. channels.connectError.publish({
  15975. connectParams: {
  15976. host,
  15977. hostname,
  15978. protocol,
  15979. port,
  15980. servername: client[kServerName],
  15981. localAddress: client[kLocalAddress]
  15982. },
  15983. connector: client[kConnector],
  15984. error: err
  15985. })
  15986. }
  15987. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  15988. assert(client[kRunning] === 0)
  15989. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  15990. const request = client[kQueue][client[kPendingIdx]++]
  15991. errorRequest(client, request, err)
  15992. }
  15993. } else {
  15994. onError(client, err)
  15995. }
  15996. client.emit('connectionError', client[kUrl], [client], err)
  15997. }
  15998. resume(client)
  15999. }
  16000. function emitDrain (client) {
  16001. client[kNeedDrain] = 0
  16002. client.emit('drain', client[kUrl], [client])
  16003. }
  16004. function resume (client, sync) {
  16005. if (client[kResuming] === 2) {
  16006. return
  16007. }
  16008. client[kResuming] = 2
  16009. _resume(client, sync)
  16010. client[kResuming] = 0
  16011. if (client[kRunningIdx] > 256) {
  16012. client[kQueue].splice(0, client[kRunningIdx])
  16013. client[kPendingIdx] -= client[kRunningIdx]
  16014. client[kRunningIdx] = 0
  16015. }
  16016. }
  16017. function _resume (client, sync) {
  16018. while (true) {
  16019. if (client.destroyed) {
  16020. assert(client[kPending] === 0)
  16021. return
  16022. }
  16023. if (client[kClosedResolve] && !client[kSize]) {
  16024. client[kClosedResolve]()
  16025. client[kClosedResolve] = null
  16026. return
  16027. }
  16028. const socket = client[kSocket]
  16029. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16030. if (client[kSize] === 0) {
  16031. if (!socket[kNoRef] && socket.unref) {
  16032. socket.unref()
  16033. socket[kNoRef] = true
  16034. }
  16035. } else if (socket[kNoRef] && socket.ref) {
  16036. socket.ref()
  16037. socket[kNoRef] = false
  16038. }
  16039. if (client[kSize] === 0) {
  16040. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16041. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16042. }
  16043. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16044. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16045. const request = client[kQueue][client[kRunningIdx]]
  16046. const headersTimeout = request.headersTimeout != null
  16047. ? request.headersTimeout
  16048. : client[kHeadersTimeout]
  16049. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16050. }
  16051. }
  16052. }
  16053. if (client[kBusy]) {
  16054. client[kNeedDrain] = 2
  16055. } else if (client[kNeedDrain] === 2) {
  16056. if (sync) {
  16057. client[kNeedDrain] = 1
  16058. process.nextTick(emitDrain, client)
  16059. } else {
  16060. emitDrain(client)
  16061. }
  16062. continue
  16063. }
  16064. if (client[kPending] === 0) {
  16065. return
  16066. }
  16067. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16068. return
  16069. }
  16070. const request = client[kQueue][client[kPendingIdx]]
  16071. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16072. if (client[kRunning] > 0) {
  16073. return
  16074. }
  16075. client[kServerName] = request.servername
  16076. if (socket && socket.servername !== request.servername) {
  16077. util.destroy(socket, new InformationalError('servername changed'))
  16078. return
  16079. }
  16080. }
  16081. if (client[kConnecting]) {
  16082. return
  16083. }
  16084. if (!socket && !client[kHTTP2Session]) {
  16085. connect(client)
  16086. return
  16087. }
  16088. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16089. return
  16090. }
  16091. if (client[kRunning] > 0 && !request.idempotent) {
  16092. // Non-idempotent request cannot be retried.
  16093. // Ensure that no other requests are inflight and
  16094. // could cause failure.
  16095. return
  16096. }
  16097. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16098. // Don't dispatch an upgrade until all preceding requests have completed.
  16099. // A misbehaving server might upgrade the connection before all pipelined
  16100. // request has completed.
  16101. return
  16102. }
  16103. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16104. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16105. // Request with stream or iterator body can error while other requests
  16106. // are inflight and indirectly error those as well.
  16107. // Ensure this doesn't happen by waiting for inflight
  16108. // to complete before dispatching.
  16109. // Request with stream or iterator body cannot be retried.
  16110. // Ensure that no other requests are inflight and
  16111. // could cause failure.
  16112. return
  16113. }
  16114. if (!request.aborted && write(client, request)) {
  16115. client[kPendingIdx]++
  16116. } else {
  16117. client[kQueue].splice(client[kPendingIdx], 1)
  16118. }
  16119. }
  16120. }
  16121. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16122. function shouldSendContentLength (method) {
  16123. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16124. }
  16125. function write (client, request) {
  16126. if (client[kHTTPConnVersion] === 'h2') {
  16127. writeH2(client, client[kHTTP2Session], request)
  16128. return
  16129. }
  16130. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16131. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16132. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16133. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16134. // Sending a payload body on a request that does not
  16135. // expect it can cause undefined behavior on some
  16136. // servers and corrupt connection state. Do not
  16137. // re-use the connection for further requests.
  16138. const expectsPayload = (
  16139. method === 'PUT' ||
  16140. method === 'POST' ||
  16141. method === 'PATCH'
  16142. )
  16143. if (body && typeof body.read === 'function') {
  16144. // Try to read EOF in order to get length.
  16145. body.read(0)
  16146. }
  16147. const bodyLength = util.bodyLength(body)
  16148. let contentLength = bodyLength
  16149. if (contentLength === null) {
  16150. contentLength = request.contentLength
  16151. }
  16152. if (contentLength === 0 && !expectsPayload) {
  16153. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16154. // A user agent SHOULD NOT send a Content-Length header field when
  16155. // the request message does not contain a payload body and the method
  16156. // semantics do not anticipate such a body.
  16157. contentLength = null
  16158. }
  16159. // https://github.com/nodejs/undici/issues/2046
  16160. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16161. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16162. if (client[kStrictContentLength]) {
  16163. errorRequest(client, request, new RequestContentLengthMismatchError())
  16164. return false
  16165. }
  16166. process.emitWarning(new RequestContentLengthMismatchError())
  16167. }
  16168. const socket = client[kSocket]
  16169. try {
  16170. request.onConnect((err) => {
  16171. if (request.aborted || request.completed) {
  16172. return
  16173. }
  16174. errorRequest(client, request, err || new RequestAbortedError())
  16175. util.destroy(socket, new InformationalError('aborted'))
  16176. })
  16177. } catch (err) {
  16178. errorRequest(client, request, err)
  16179. }
  16180. if (request.aborted) {
  16181. return false
  16182. }
  16183. if (method === 'HEAD') {
  16184. // https://github.com/mcollina/undici/issues/258
  16185. // Close after a HEAD request to interop with misbehaving servers
  16186. // that may send a body in the response.
  16187. socket[kReset] = true
  16188. }
  16189. if (upgrade || method === 'CONNECT') {
  16190. // On CONNECT or upgrade, block pipeline from dispatching further
  16191. // requests on this connection.
  16192. socket[kReset] = true
  16193. }
  16194. if (reset != null) {
  16195. socket[kReset] = reset
  16196. }
  16197. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16198. socket[kReset] = true
  16199. }
  16200. if (blocking) {
  16201. socket[kBlocking] = true
  16202. }
  16203. let header = `${method} ${path} HTTP/1.1\r\n`
  16204. if (typeof host === 'string') {
  16205. header += `host: ${host}\r\n`
  16206. } else {
  16207. header += client[kHostHeader]
  16208. }
  16209. if (upgrade) {
  16210. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16211. } else if (client[kPipelining] && !socket[kReset]) {
  16212. header += 'connection: keep-alive\r\n'
  16213. } else {
  16214. header += 'connection: close\r\n'
  16215. }
  16216. if (headers) {
  16217. header += headers
  16218. }
  16219. if (channels.sendHeaders.hasSubscribers) {
  16220. channels.sendHeaders.publish({ request, headers: header, socket })
  16221. }
  16222. /* istanbul ignore else: assertion */
  16223. if (!body || bodyLength === 0) {
  16224. if (contentLength === 0) {
  16225. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16226. } else {
  16227. assert(contentLength === null, 'no body must not have content length')
  16228. socket.write(`${header}\r\n`, 'latin1')
  16229. }
  16230. request.onRequestSent()
  16231. } else if (util.isBuffer(body)) {
  16232. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16233. socket.cork()
  16234. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16235. socket.write(body)
  16236. socket.uncork()
  16237. request.onBodySent(body)
  16238. request.onRequestSent()
  16239. if (!expectsPayload) {
  16240. socket[kReset] = true
  16241. }
  16242. } else if (util.isBlobLike(body)) {
  16243. if (typeof body.stream === 'function') {
  16244. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16245. } else {
  16246. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16247. }
  16248. } else if (util.isStream(body)) {
  16249. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16250. } else if (util.isIterable(body)) {
  16251. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16252. } else {
  16253. assert(false)
  16254. }
  16255. return true
  16256. }
  16257. function writeH2 (client, session, request) {
  16258. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16259. let headers
  16260. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16261. else headers = reqHeaders
  16262. if (upgrade) {
  16263. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16264. return false
  16265. }
  16266. try {
  16267. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16268. request.onConnect((err) => {
  16269. if (request.aborted || request.completed) {
  16270. return
  16271. }
  16272. errorRequest(client, request, err || new RequestAbortedError())
  16273. })
  16274. } catch (err) {
  16275. errorRequest(client, request, err)
  16276. }
  16277. if (request.aborted) {
  16278. return false
  16279. }
  16280. /** @type {import('node:http2').ClientHttp2Stream} */
  16281. let stream
  16282. const h2State = client[kHTTP2SessionState]
  16283. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16284. headers[HTTP2_HEADER_METHOD] = method
  16285. if (method === 'CONNECT') {
  16286. session.ref()
  16287. // we are already connected, streams are pending, first request
  16288. // will create a new stream. We trigger a request to create the stream and wait until
  16289. // `ready` event is triggered
  16290. // We disabled endStream to allow the user to write to the stream
  16291. stream = session.request(headers, { endStream: false, signal })
  16292. if (stream.id && !stream.pending) {
  16293. request.onUpgrade(null, null, stream)
  16294. ++h2State.openStreams
  16295. } else {
  16296. stream.once('ready', () => {
  16297. request.onUpgrade(null, null, stream)
  16298. ++h2State.openStreams
  16299. })
  16300. }
  16301. stream.once('close', () => {
  16302. h2State.openStreams -= 1
  16303. // TODO(HTTP/2): unref only if current streams count is 0
  16304. if (h2State.openStreams === 0) session.unref()
  16305. })
  16306. return true
  16307. }
  16308. // https://tools.ietf.org/html/rfc7540#section-8.3
  16309. // :path and :scheme headers must be omited when sending CONNECT
  16310. headers[HTTP2_HEADER_PATH] = path
  16311. headers[HTTP2_HEADER_SCHEME] = 'https'
  16312. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16313. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16314. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16315. // Sending a payload body on a request that does not
  16316. // expect it can cause undefined behavior on some
  16317. // servers and corrupt connection state. Do not
  16318. // re-use the connection for further requests.
  16319. const expectsPayload = (
  16320. method === 'PUT' ||
  16321. method === 'POST' ||
  16322. method === 'PATCH'
  16323. )
  16324. if (body && typeof body.read === 'function') {
  16325. // Try to read EOF in order to get length.
  16326. body.read(0)
  16327. }
  16328. let contentLength = util.bodyLength(body)
  16329. if (contentLength == null) {
  16330. contentLength = request.contentLength
  16331. }
  16332. if (contentLength === 0 || !expectsPayload) {
  16333. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16334. // A user agent SHOULD NOT send a Content-Length header field when
  16335. // the request message does not contain a payload body and the method
  16336. // semantics do not anticipate such a body.
  16337. contentLength = null
  16338. }
  16339. // https://github.com/nodejs/undici/issues/2046
  16340. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16341. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16342. if (client[kStrictContentLength]) {
  16343. errorRequest(client, request, new RequestContentLengthMismatchError())
  16344. return false
  16345. }
  16346. process.emitWarning(new RequestContentLengthMismatchError())
  16347. }
  16348. if (contentLength != null) {
  16349. assert(body, 'no body must not have content length')
  16350. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16351. }
  16352. session.ref()
  16353. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16354. if (expectContinue) {
  16355. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16356. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16357. stream.once('continue', writeBodyH2)
  16358. } else {
  16359. stream = session.request(headers, {
  16360. endStream: shouldEndStream,
  16361. signal
  16362. })
  16363. writeBodyH2()
  16364. }
  16365. // Increment counter as we have new several streams open
  16366. ++h2State.openStreams
  16367. stream.once('response', headers => {
  16368. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16369. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16370. stream.pause()
  16371. }
  16372. })
  16373. stream.once('end', () => {
  16374. request.onComplete([])
  16375. })
  16376. stream.on('data', (chunk) => {
  16377. if (request.onData(chunk) === false) {
  16378. stream.pause()
  16379. }
  16380. })
  16381. stream.once('close', () => {
  16382. h2State.openStreams -= 1
  16383. // TODO(HTTP/2): unref only if current streams count is 0
  16384. if (h2State.openStreams === 0) {
  16385. session.unref()
  16386. }
  16387. })
  16388. stream.once('error', function (err) {
  16389. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16390. h2State.streams -= 1
  16391. util.destroy(stream, err)
  16392. }
  16393. })
  16394. stream.once('frameError', (type, code) => {
  16395. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16396. errorRequest(client, request, err)
  16397. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16398. h2State.streams -= 1
  16399. util.destroy(stream, err)
  16400. }
  16401. })
  16402. // stream.on('aborted', () => {
  16403. // // TODO(HTTP/2): Support aborted
  16404. // })
  16405. // stream.on('timeout', () => {
  16406. // // TODO(HTTP/2): Support timeout
  16407. // })
  16408. // stream.on('push', headers => {
  16409. // // TODO(HTTP/2): Suppor push
  16410. // })
  16411. // stream.on('trailers', headers => {
  16412. // // TODO(HTTP/2): Support trailers
  16413. // })
  16414. return true
  16415. function writeBodyH2 () {
  16416. /* istanbul ignore else: assertion */
  16417. if (!body) {
  16418. request.onRequestSent()
  16419. } else if (util.isBuffer(body)) {
  16420. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16421. stream.cork()
  16422. stream.write(body)
  16423. stream.uncork()
  16424. stream.end()
  16425. request.onBodySent(body)
  16426. request.onRequestSent()
  16427. } else if (util.isBlobLike(body)) {
  16428. if (typeof body.stream === 'function') {
  16429. writeIterable({
  16430. client,
  16431. request,
  16432. contentLength,
  16433. h2stream: stream,
  16434. expectsPayload,
  16435. body: body.stream(),
  16436. socket: client[kSocket],
  16437. header: ''
  16438. })
  16439. } else {
  16440. writeBlob({
  16441. body,
  16442. client,
  16443. request,
  16444. contentLength,
  16445. expectsPayload,
  16446. h2stream: stream,
  16447. header: '',
  16448. socket: client[kSocket]
  16449. })
  16450. }
  16451. } else if (util.isStream(body)) {
  16452. writeStream({
  16453. body,
  16454. client,
  16455. request,
  16456. contentLength,
  16457. expectsPayload,
  16458. socket: client[kSocket],
  16459. h2stream: stream,
  16460. header: ''
  16461. })
  16462. } else if (util.isIterable(body)) {
  16463. writeIterable({
  16464. body,
  16465. client,
  16466. request,
  16467. contentLength,
  16468. expectsPayload,
  16469. header: '',
  16470. h2stream: stream,
  16471. socket: client[kSocket]
  16472. })
  16473. } else {
  16474. assert(false)
  16475. }
  16476. }
  16477. }
  16478. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16479. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16480. if (client[kHTTPConnVersion] === 'h2') {
  16481. // For HTTP/2, is enough to pipe the stream
  16482. const pipe = pipeline(
  16483. body,
  16484. h2stream,
  16485. (err) => {
  16486. if (err) {
  16487. util.destroy(body, err)
  16488. util.destroy(h2stream, err)
  16489. } else {
  16490. request.onRequestSent()
  16491. }
  16492. }
  16493. )
  16494. pipe.on('data', onPipeData)
  16495. pipe.once('end', () => {
  16496. pipe.removeListener('data', onPipeData)
  16497. util.destroy(pipe)
  16498. })
  16499. function onPipeData (chunk) {
  16500. request.onBodySent(chunk)
  16501. }
  16502. return
  16503. }
  16504. let finished = false
  16505. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16506. const onData = function (chunk) {
  16507. if (finished) {
  16508. return
  16509. }
  16510. try {
  16511. if (!writer.write(chunk) && this.pause) {
  16512. this.pause()
  16513. }
  16514. } catch (err) {
  16515. util.destroy(this, err)
  16516. }
  16517. }
  16518. const onDrain = function () {
  16519. if (finished) {
  16520. return
  16521. }
  16522. if (body.resume) {
  16523. body.resume()
  16524. }
  16525. }
  16526. const onAbort = function () {
  16527. if (finished) {
  16528. return
  16529. }
  16530. const err = new RequestAbortedError()
  16531. queueMicrotask(() => onFinished(err))
  16532. }
  16533. const onFinished = function (err) {
  16534. if (finished) {
  16535. return
  16536. }
  16537. finished = true
  16538. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16539. socket
  16540. .off('drain', onDrain)
  16541. .off('error', onFinished)
  16542. body
  16543. .removeListener('data', onData)
  16544. .removeListener('end', onFinished)
  16545. .removeListener('error', onFinished)
  16546. .removeListener('close', onAbort)
  16547. if (!err) {
  16548. try {
  16549. writer.end()
  16550. } catch (er) {
  16551. err = er
  16552. }
  16553. }
  16554. writer.destroy(err)
  16555. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16556. util.destroy(body, err)
  16557. } else {
  16558. util.destroy(body)
  16559. }
  16560. }
  16561. body
  16562. .on('data', onData)
  16563. .on('end', onFinished)
  16564. .on('error', onFinished)
  16565. .on('close', onAbort)
  16566. if (body.resume) {
  16567. body.resume()
  16568. }
  16569. socket
  16570. .on('drain', onDrain)
  16571. .on('error', onFinished)
  16572. }
  16573. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16574. assert(contentLength === body.size, 'blob body must have content length')
  16575. const isH2 = client[kHTTPConnVersion] === 'h2'
  16576. try {
  16577. if (contentLength != null && contentLength !== body.size) {
  16578. throw new RequestContentLengthMismatchError()
  16579. }
  16580. const buffer = Buffer.from(await body.arrayBuffer())
  16581. if (isH2) {
  16582. h2stream.cork()
  16583. h2stream.write(buffer)
  16584. h2stream.uncork()
  16585. } else {
  16586. socket.cork()
  16587. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16588. socket.write(buffer)
  16589. socket.uncork()
  16590. }
  16591. request.onBodySent(buffer)
  16592. request.onRequestSent()
  16593. if (!expectsPayload) {
  16594. socket[kReset] = true
  16595. }
  16596. resume(client)
  16597. } catch (err) {
  16598. util.destroy(isH2 ? h2stream : socket, err)
  16599. }
  16600. }
  16601. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16602. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16603. let callback = null
  16604. function onDrain () {
  16605. if (callback) {
  16606. const cb = callback
  16607. callback = null
  16608. cb()
  16609. }
  16610. }
  16611. const waitForDrain = () => new Promise((resolve, reject) => {
  16612. assert(callback === null)
  16613. if (socket[kError]) {
  16614. reject(socket[kError])
  16615. } else {
  16616. callback = resolve
  16617. }
  16618. })
  16619. if (client[kHTTPConnVersion] === 'h2') {
  16620. h2stream
  16621. .on('close', onDrain)
  16622. .on('drain', onDrain)
  16623. try {
  16624. // It's up to the user to somehow abort the async iterable.
  16625. for await (const chunk of body) {
  16626. if (socket[kError]) {
  16627. throw socket[kError]
  16628. }
  16629. const res = h2stream.write(chunk)
  16630. request.onBodySent(chunk)
  16631. if (!res) {
  16632. await waitForDrain()
  16633. }
  16634. }
  16635. } catch (err) {
  16636. h2stream.destroy(err)
  16637. } finally {
  16638. request.onRequestSent()
  16639. h2stream.end()
  16640. h2stream
  16641. .off('close', onDrain)
  16642. .off('drain', onDrain)
  16643. }
  16644. return
  16645. }
  16646. socket
  16647. .on('close', onDrain)
  16648. .on('drain', onDrain)
  16649. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16650. try {
  16651. // It's up to the user to somehow abort the async iterable.
  16652. for await (const chunk of body) {
  16653. if (socket[kError]) {
  16654. throw socket[kError]
  16655. }
  16656. if (!writer.write(chunk)) {
  16657. await waitForDrain()
  16658. }
  16659. }
  16660. writer.end()
  16661. } catch (err) {
  16662. writer.destroy(err)
  16663. } finally {
  16664. socket
  16665. .off('close', onDrain)
  16666. .off('drain', onDrain)
  16667. }
  16668. }
  16669. class AsyncWriter {
  16670. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16671. this.socket = socket
  16672. this.request = request
  16673. this.contentLength = contentLength
  16674. this.client = client
  16675. this.bytesWritten = 0
  16676. this.expectsPayload = expectsPayload
  16677. this.header = header
  16678. socket[kWriting] = true
  16679. }
  16680. write (chunk) {
  16681. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16682. if (socket[kError]) {
  16683. throw socket[kError]
  16684. }
  16685. if (socket.destroyed) {
  16686. return false
  16687. }
  16688. const len = Buffer.byteLength(chunk)
  16689. if (!len) {
  16690. return true
  16691. }
  16692. // We should defer writing chunks.
  16693. if (contentLength !== null && bytesWritten + len > contentLength) {
  16694. if (client[kStrictContentLength]) {
  16695. throw new RequestContentLengthMismatchError()
  16696. }
  16697. process.emitWarning(new RequestContentLengthMismatchError())
  16698. }
  16699. socket.cork()
  16700. if (bytesWritten === 0) {
  16701. if (!expectsPayload) {
  16702. socket[kReset] = true
  16703. }
  16704. if (contentLength === null) {
  16705. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16706. } else {
  16707. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16708. }
  16709. }
  16710. if (contentLength === null) {
  16711. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16712. }
  16713. this.bytesWritten += len
  16714. const ret = socket.write(chunk)
  16715. socket.uncork()
  16716. request.onBodySent(chunk)
  16717. if (!ret) {
  16718. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16719. // istanbul ignore else: only for jest
  16720. if (socket[kParser].timeout.refresh) {
  16721. socket[kParser].timeout.refresh()
  16722. }
  16723. }
  16724. }
  16725. return ret
  16726. }
  16727. end () {
  16728. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  16729. request.onRequestSent()
  16730. socket[kWriting] = false
  16731. if (socket[kError]) {
  16732. throw socket[kError]
  16733. }
  16734. if (socket.destroyed) {
  16735. return
  16736. }
  16737. if (bytesWritten === 0) {
  16738. if (expectsPayload) {
  16739. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16740. // A user agent SHOULD send a Content-Length in a request message when
  16741. // no Transfer-Encoding is sent and the request method defines a meaning
  16742. // for an enclosed payload body.
  16743. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16744. } else {
  16745. socket.write(`${header}\r\n`, 'latin1')
  16746. }
  16747. } else if (contentLength === null) {
  16748. socket.write('\r\n0\r\n\r\n', 'latin1')
  16749. }
  16750. if (contentLength !== null && bytesWritten !== contentLength) {
  16751. if (client[kStrictContentLength]) {
  16752. throw new RequestContentLengthMismatchError()
  16753. } else {
  16754. process.emitWarning(new RequestContentLengthMismatchError())
  16755. }
  16756. }
  16757. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16758. // istanbul ignore else: only for jest
  16759. if (socket[kParser].timeout.refresh) {
  16760. socket[kParser].timeout.refresh()
  16761. }
  16762. }
  16763. resume(client)
  16764. }
  16765. destroy (err) {
  16766. const { socket, client } = this
  16767. socket[kWriting] = false
  16768. if (err) {
  16769. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  16770. util.destroy(socket, err)
  16771. }
  16772. }
  16773. }
  16774. function errorRequest (client, request, err) {
  16775. try {
  16776. request.onError(err)
  16777. assert(request.aborted)
  16778. } catch (err) {
  16779. client.emit('error', err)
  16780. }
  16781. }
  16782. module.exports = Client
  16783. /***/ }),
  16784. /***/ 6436:
  16785. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16786. "use strict";
  16787. /* istanbul ignore file: only for Node 12 */
  16788. const { kConnected, kSize } = __nccwpck_require__(2785)
  16789. class CompatWeakRef {
  16790. constructor (value) {
  16791. this.value = value
  16792. }
  16793. deref () {
  16794. return this.value[kConnected] === 0 && this.value[kSize] === 0
  16795. ? undefined
  16796. : this.value
  16797. }
  16798. }
  16799. class CompatFinalizer {
  16800. constructor (finalizer) {
  16801. this.finalizer = finalizer
  16802. }
  16803. register (dispatcher, key) {
  16804. if (dispatcher.on) {
  16805. dispatcher.on('disconnect', () => {
  16806. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  16807. this.finalizer(key)
  16808. }
  16809. })
  16810. }
  16811. }
  16812. }
  16813. module.exports = function () {
  16814. // FIXME: remove workaround when the Node bug is fixed
  16815. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  16816. if (process.env.NODE_V8_COVERAGE) {
  16817. return {
  16818. WeakRef: CompatWeakRef,
  16819. FinalizationRegistry: CompatFinalizer
  16820. }
  16821. }
  16822. return {
  16823. WeakRef: global.WeakRef || CompatWeakRef,
  16824. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  16825. }
  16826. }
  16827. /***/ }),
  16828. /***/ 663:
  16829. /***/ ((module) => {
  16830. "use strict";
  16831. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  16832. const maxAttributeValueSize = 1024
  16833. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  16834. const maxNameValuePairSize = 4096
  16835. module.exports = {
  16836. maxAttributeValueSize,
  16837. maxNameValuePairSize
  16838. }
  16839. /***/ }),
  16840. /***/ 1724:
  16841. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16842. "use strict";
  16843. const { parseSetCookie } = __nccwpck_require__(4408)
  16844. const { stringify, getHeadersList } = __nccwpck_require__(3121)
  16845. const { webidl } = __nccwpck_require__(1744)
  16846. const { Headers } = __nccwpck_require__(554)
  16847. /**
  16848. * @typedef {Object} Cookie
  16849. * @property {string} name
  16850. * @property {string} value
  16851. * @property {Date|number|undefined} expires
  16852. * @property {number|undefined} maxAge
  16853. * @property {string|undefined} domain
  16854. * @property {string|undefined} path
  16855. * @property {boolean|undefined} secure
  16856. * @property {boolean|undefined} httpOnly
  16857. * @property {'Strict'|'Lax'|'None'} sameSite
  16858. * @property {string[]} unparsed
  16859. */
  16860. /**
  16861. * @param {Headers} headers
  16862. * @returns {Record<string, string>}
  16863. */
  16864. function getCookies (headers) {
  16865. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  16866. webidl.brandCheck(headers, Headers, { strict: false })
  16867. const cookie = headers.get('cookie')
  16868. const out = {}
  16869. if (!cookie) {
  16870. return out
  16871. }
  16872. for (const piece of cookie.split(';')) {
  16873. const [name, ...value] = piece.split('=')
  16874. out[name.trim()] = value.join('=')
  16875. }
  16876. return out
  16877. }
  16878. /**
  16879. * @param {Headers} headers
  16880. * @param {string} name
  16881. * @param {{ path?: string, domain?: string }|undefined} attributes
  16882. * @returns {void}
  16883. */
  16884. function deleteCookie (headers, name, attributes) {
  16885. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  16886. webidl.brandCheck(headers, Headers, { strict: false })
  16887. name = webidl.converters.DOMString(name)
  16888. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  16889. // Matches behavior of
  16890. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  16891. setCookie(headers, {
  16892. name,
  16893. value: '',
  16894. expires: new Date(0),
  16895. ...attributes
  16896. })
  16897. }
  16898. /**
  16899. * @param {Headers} headers
  16900. * @returns {Cookie[]}
  16901. */
  16902. function getSetCookies (headers) {
  16903. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  16904. webidl.brandCheck(headers, Headers, { strict: false })
  16905. const cookies = getHeadersList(headers).cookies
  16906. if (!cookies) {
  16907. return []
  16908. }
  16909. // In older versions of undici, cookies is a list of name:value.
  16910. return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
  16911. }
  16912. /**
  16913. * @param {Headers} headers
  16914. * @param {Cookie} cookie
  16915. * @returns {void}
  16916. */
  16917. function setCookie (headers, cookie) {
  16918. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  16919. webidl.brandCheck(headers, Headers, { strict: false })
  16920. cookie = webidl.converters.Cookie(cookie)
  16921. const str = stringify(cookie)
  16922. if (str) {
  16923. headers.append('Set-Cookie', stringify(cookie))
  16924. }
  16925. }
  16926. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  16927. {
  16928. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16929. key: 'path',
  16930. defaultValue: null
  16931. },
  16932. {
  16933. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16934. key: 'domain',
  16935. defaultValue: null
  16936. }
  16937. ])
  16938. webidl.converters.Cookie = webidl.dictionaryConverter([
  16939. {
  16940. converter: webidl.converters.DOMString,
  16941. key: 'name'
  16942. },
  16943. {
  16944. converter: webidl.converters.DOMString,
  16945. key: 'value'
  16946. },
  16947. {
  16948. converter: webidl.nullableConverter((value) => {
  16949. if (typeof value === 'number') {
  16950. return webidl.converters['unsigned long long'](value)
  16951. }
  16952. return new Date(value)
  16953. }),
  16954. key: 'expires',
  16955. defaultValue: null
  16956. },
  16957. {
  16958. converter: webidl.nullableConverter(webidl.converters['long long']),
  16959. key: 'maxAge',
  16960. defaultValue: null
  16961. },
  16962. {
  16963. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16964. key: 'domain',
  16965. defaultValue: null
  16966. },
  16967. {
  16968. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16969. key: 'path',
  16970. defaultValue: null
  16971. },
  16972. {
  16973. converter: webidl.nullableConverter(webidl.converters.boolean),
  16974. key: 'secure',
  16975. defaultValue: null
  16976. },
  16977. {
  16978. converter: webidl.nullableConverter(webidl.converters.boolean),
  16979. key: 'httpOnly',
  16980. defaultValue: null
  16981. },
  16982. {
  16983. converter: webidl.converters.USVString,
  16984. key: 'sameSite',
  16985. allowedValues: ['Strict', 'Lax', 'None']
  16986. },
  16987. {
  16988. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  16989. key: 'unparsed',
  16990. defaultValue: []
  16991. }
  16992. ])
  16993. module.exports = {
  16994. getCookies,
  16995. deleteCookie,
  16996. getSetCookies,
  16997. setCookie
  16998. }
  16999. /***/ }),
  17000. /***/ 4408:
  17001. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17002. "use strict";
  17003. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17004. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17005. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17006. const assert = __nccwpck_require__(9491)
  17007. /**
  17008. * @description Parses the field-value attributes of a set-cookie header string.
  17009. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17010. * @param {string} header
  17011. * @returns if the header is invalid, null will be returned
  17012. */
  17013. function parseSetCookie (header) {
  17014. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17015. // character (CTL characters excluding HTAB): Abort these steps and
  17016. // ignore the set-cookie-string entirely.
  17017. if (isCTLExcludingHtab(header)) {
  17018. return null
  17019. }
  17020. let nameValuePair = ''
  17021. let unparsedAttributes = ''
  17022. let name = ''
  17023. let value = ''
  17024. // 2. If the set-cookie-string contains a %x3B (";") character:
  17025. if (header.includes(';')) {
  17026. // 1. The name-value-pair string consists of the characters up to,
  17027. // but not including, the first %x3B (";"), and the unparsed-
  17028. // attributes consist of the remainder of the set-cookie-string
  17029. // (including the %x3B (";") in question).
  17030. const position = { position: 0 }
  17031. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17032. unparsedAttributes = header.slice(position.position)
  17033. } else {
  17034. // Otherwise:
  17035. // 1. The name-value-pair string consists of all the characters
  17036. // contained in the set-cookie-string, and the unparsed-
  17037. // attributes is the empty string.
  17038. nameValuePair = header
  17039. }
  17040. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17041. // the name string is empty, and the value string is the value of
  17042. // name-value-pair.
  17043. if (!nameValuePair.includes('=')) {
  17044. value = nameValuePair
  17045. } else {
  17046. // Otherwise, the name string consists of the characters up to, but
  17047. // not including, the first %x3D ("=") character, and the (possibly
  17048. // empty) value string consists of the characters after the first
  17049. // %x3D ("=") character.
  17050. const position = { position: 0 }
  17051. name = collectASequenceOfCodePointsFast(
  17052. '=',
  17053. nameValuePair,
  17054. position
  17055. )
  17056. value = nameValuePair.slice(position.position + 1)
  17057. }
  17058. // 4. Remove any leading or trailing WSP characters from the name
  17059. // string and the value string.
  17060. name = name.trim()
  17061. value = value.trim()
  17062. // 5. If the sum of the lengths of the name string and the value string
  17063. // is more than 4096 octets, abort these steps and ignore the set-
  17064. // cookie-string entirely.
  17065. if (name.length + value.length > maxNameValuePairSize) {
  17066. return null
  17067. }
  17068. // 6. The cookie-name is the name string, and the cookie-value is the
  17069. // value string.
  17070. return {
  17071. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17072. }
  17073. }
  17074. /**
  17075. * Parses the remaining attributes of a set-cookie header
  17076. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17077. * @param {string} unparsedAttributes
  17078. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17079. */
  17080. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17081. // 1. If the unparsed-attributes string is empty, skip the rest of
  17082. // these steps.
  17083. if (unparsedAttributes.length === 0) {
  17084. return cookieAttributeList
  17085. }
  17086. // 2. Discard the first character of the unparsed-attributes (which
  17087. // will be a %x3B (";") character).
  17088. assert(unparsedAttributes[0] === ';')
  17089. unparsedAttributes = unparsedAttributes.slice(1)
  17090. let cookieAv = ''
  17091. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17092. // character:
  17093. if (unparsedAttributes.includes(';')) {
  17094. // 1. Consume the characters of the unparsed-attributes up to, but
  17095. // not including, the first %x3B (";") character.
  17096. cookieAv = collectASequenceOfCodePointsFast(
  17097. ';',
  17098. unparsedAttributes,
  17099. { position: 0 }
  17100. )
  17101. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17102. } else {
  17103. // Otherwise:
  17104. // 1. Consume the remainder of the unparsed-attributes.
  17105. cookieAv = unparsedAttributes
  17106. unparsedAttributes = ''
  17107. }
  17108. // Let the cookie-av string be the characters consumed in this step.
  17109. let attributeName = ''
  17110. let attributeValue = ''
  17111. // 4. If the cookie-av string contains a %x3D ("=") character:
  17112. if (cookieAv.includes('=')) {
  17113. // 1. The (possibly empty) attribute-name string consists of the
  17114. // characters up to, but not including, the first %x3D ("=")
  17115. // character, and the (possibly empty) attribute-value string
  17116. // consists of the characters after the first %x3D ("=")
  17117. // character.
  17118. const position = { position: 0 }
  17119. attributeName = collectASequenceOfCodePointsFast(
  17120. '=',
  17121. cookieAv,
  17122. position
  17123. )
  17124. attributeValue = cookieAv.slice(position.position + 1)
  17125. } else {
  17126. // Otherwise:
  17127. // 1. The attribute-name string consists of the entire cookie-av
  17128. // string, and the attribute-value string is empty.
  17129. attributeName = cookieAv
  17130. }
  17131. // 5. Remove any leading or trailing WSP characters from the attribute-
  17132. // name string and the attribute-value string.
  17133. attributeName = attributeName.trim()
  17134. attributeValue = attributeValue.trim()
  17135. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17136. // cookie-av string and return to Step 1 of this algorithm.
  17137. if (attributeValue.length > maxAttributeValueSize) {
  17138. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17139. }
  17140. // 7. Process the attribute-name and attribute-value according to the
  17141. // requirements in the following subsections. (Notice that
  17142. // attributes with unrecognized attribute-names are ignored.)
  17143. const attributeNameLowercase = attributeName.toLowerCase()
  17144. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17145. // If the attribute-name case-insensitively matches the string
  17146. // "Expires", the user agent MUST process the cookie-av as follows.
  17147. if (attributeNameLowercase === 'expires') {
  17148. // 1. Let the expiry-time be the result of parsing the attribute-value
  17149. // as cookie-date (see Section 5.1.1).
  17150. const expiryTime = new Date(attributeValue)
  17151. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17152. // the cookie-av.
  17153. cookieAttributeList.expires = expiryTime
  17154. } else if (attributeNameLowercase === 'max-age') {
  17155. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17156. // If the attribute-name case-insensitively matches the string "Max-
  17157. // Age", the user agent MUST process the cookie-av as follows.
  17158. // 1. If the first character of the attribute-value is not a DIGIT or a
  17159. // "-" character, ignore the cookie-av.
  17160. const charCode = attributeValue.charCodeAt(0)
  17161. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17162. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17163. }
  17164. // 2. If the remainder of attribute-value contains a non-DIGIT
  17165. // character, ignore the cookie-av.
  17166. if (!/^\d+$/.test(attributeValue)) {
  17167. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17168. }
  17169. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17170. const deltaSeconds = Number(attributeValue)
  17171. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17172. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17173. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17174. // age-limit.
  17175. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17176. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17177. // time be the earliest representable date and time. Otherwise, let
  17178. // the expiry-time be the current date and time plus delta-seconds
  17179. // seconds.
  17180. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17181. // 7. Append an attribute to the cookie-attribute-list with an
  17182. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17183. cookieAttributeList.maxAge = deltaSeconds
  17184. } else if (attributeNameLowercase === 'domain') {
  17185. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17186. // If the attribute-name case-insensitively matches the string "Domain",
  17187. // the user agent MUST process the cookie-av as follows.
  17188. // 1. Let cookie-domain be the attribute-value.
  17189. let cookieDomain = attributeValue
  17190. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17191. // cookie-domain without its leading %x2E (".").
  17192. if (cookieDomain[0] === '.') {
  17193. cookieDomain = cookieDomain.slice(1)
  17194. }
  17195. // 3. Convert the cookie-domain to lower case.
  17196. cookieDomain = cookieDomain.toLowerCase()
  17197. // 4. Append an attribute to the cookie-attribute-list with an
  17198. // attribute-name of Domain and an attribute-value of cookie-domain.
  17199. cookieAttributeList.domain = cookieDomain
  17200. } else if (attributeNameLowercase === 'path') {
  17201. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17202. // If the attribute-name case-insensitively matches the string "Path",
  17203. // the user agent MUST process the cookie-av as follows.
  17204. // 1. If the attribute-value is empty or if the first character of the
  17205. // attribute-value is not %x2F ("/"):
  17206. let cookiePath = ''
  17207. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17208. // 1. Let cookie-path be the default-path.
  17209. cookiePath = '/'
  17210. } else {
  17211. // Otherwise:
  17212. // 1. Let cookie-path be the attribute-value.
  17213. cookiePath = attributeValue
  17214. }
  17215. // 2. Append an attribute to the cookie-attribute-list with an
  17216. // attribute-name of Path and an attribute-value of cookie-path.
  17217. cookieAttributeList.path = cookiePath
  17218. } else if (attributeNameLowercase === 'secure') {
  17219. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17220. // If the attribute-name case-insensitively matches the string "Secure",
  17221. // the user agent MUST append an attribute to the cookie-attribute-list
  17222. // with an attribute-name of Secure and an empty attribute-value.
  17223. cookieAttributeList.secure = true
  17224. } else if (attributeNameLowercase === 'httponly') {
  17225. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17226. // If the attribute-name case-insensitively matches the string
  17227. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17228. // attribute-list with an attribute-name of HttpOnly and an empty
  17229. // attribute-value.
  17230. cookieAttributeList.httpOnly = true
  17231. } else if (attributeNameLowercase === 'samesite') {
  17232. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17233. // If the attribute-name case-insensitively matches the string
  17234. // "SameSite", the user agent MUST process the cookie-av as follows:
  17235. // 1. Let enforcement be "Default".
  17236. let enforcement = 'Default'
  17237. const attributeValueLowercase = attributeValue.toLowerCase()
  17238. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17239. // "None", set enforcement to "None".
  17240. if (attributeValueLowercase.includes('none')) {
  17241. enforcement = 'None'
  17242. }
  17243. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17244. // "Strict", set enforcement to "Strict".
  17245. if (attributeValueLowercase.includes('strict')) {
  17246. enforcement = 'Strict'
  17247. }
  17248. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17249. // "Lax", set enforcement to "Lax".
  17250. if (attributeValueLowercase.includes('lax')) {
  17251. enforcement = 'Lax'
  17252. }
  17253. // 5. Append an attribute to the cookie-attribute-list with an
  17254. // attribute-name of "SameSite" and an attribute-value of
  17255. // enforcement.
  17256. cookieAttributeList.sameSite = enforcement
  17257. } else {
  17258. cookieAttributeList.unparsed ??= []
  17259. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17260. }
  17261. // 8. Return to Step 1 of this algorithm.
  17262. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17263. }
  17264. module.exports = {
  17265. parseSetCookie,
  17266. parseUnparsedAttributes
  17267. }
  17268. /***/ }),
  17269. /***/ 3121:
  17270. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17271. "use strict";
  17272. const assert = __nccwpck_require__(9491)
  17273. const { kHeadersList } = __nccwpck_require__(2785)
  17274. function isCTLExcludingHtab (value) {
  17275. if (value.length === 0) {
  17276. return false
  17277. }
  17278. for (const char of value) {
  17279. const code = char.charCodeAt(0)
  17280. if (
  17281. (code >= 0x00 || code <= 0x08) ||
  17282. (code >= 0x0A || code <= 0x1F) ||
  17283. code === 0x7F
  17284. ) {
  17285. return false
  17286. }
  17287. }
  17288. }
  17289. /**
  17290. CHAR = <any US-ASCII character (octets 0 - 127)>
  17291. token = 1*<any CHAR except CTLs or separators>
  17292. separators = "(" | ")" | "<" | ">" | "@"
  17293. | "," | ";" | ":" | "\" | <">
  17294. | "/" | "[" | "]" | "?" | "="
  17295. | "{" | "}" | SP | HT
  17296. * @param {string} name
  17297. */
  17298. function validateCookieName (name) {
  17299. for (const char of name) {
  17300. const code = char.charCodeAt(0)
  17301. if (
  17302. (code <= 0x20 || code > 0x7F) ||
  17303. char === '(' ||
  17304. char === ')' ||
  17305. char === '>' ||
  17306. char === '<' ||
  17307. char === '@' ||
  17308. char === ',' ||
  17309. char === ';' ||
  17310. char === ':' ||
  17311. char === '\\' ||
  17312. char === '"' ||
  17313. char === '/' ||
  17314. char === '[' ||
  17315. char === ']' ||
  17316. char === '?' ||
  17317. char === '=' ||
  17318. char === '{' ||
  17319. char === '}'
  17320. ) {
  17321. throw new Error('Invalid cookie name')
  17322. }
  17323. }
  17324. }
  17325. /**
  17326. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17327. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17328. ; US-ASCII characters excluding CTLs,
  17329. ; whitespace DQUOTE, comma, semicolon,
  17330. ; and backslash
  17331. * @param {string} value
  17332. */
  17333. function validateCookieValue (value) {
  17334. for (const char of value) {
  17335. const code = char.charCodeAt(0)
  17336. if (
  17337. code < 0x21 || // exclude CTLs (0-31)
  17338. code === 0x22 ||
  17339. code === 0x2C ||
  17340. code === 0x3B ||
  17341. code === 0x5C ||
  17342. code > 0x7E // non-ascii
  17343. ) {
  17344. throw new Error('Invalid header value')
  17345. }
  17346. }
  17347. }
  17348. /**
  17349. * path-value = <any CHAR except CTLs or ";">
  17350. * @param {string} path
  17351. */
  17352. function validateCookiePath (path) {
  17353. for (const char of path) {
  17354. const code = char.charCodeAt(0)
  17355. if (code < 0x21 || char === ';') {
  17356. throw new Error('Invalid cookie path')
  17357. }
  17358. }
  17359. }
  17360. /**
  17361. * I have no idea why these values aren't allowed to be honest,
  17362. * but Deno tests these. - Khafra
  17363. * @param {string} domain
  17364. */
  17365. function validateCookieDomain (domain) {
  17366. if (
  17367. domain.startsWith('-') ||
  17368. domain.endsWith('.') ||
  17369. domain.endsWith('-')
  17370. ) {
  17371. throw new Error('Invalid cookie domain')
  17372. }
  17373. }
  17374. /**
  17375. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17376. * @param {number|Date} date
  17377. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17378. ; fixed length/zone/capitalization subset of the format
  17379. ; see Section 3.3 of [RFC5322]
  17380. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17381. / %x54.75.65 ; "Tue", case-sensitive
  17382. / %x57.65.64 ; "Wed", case-sensitive
  17383. / %x54.68.75 ; "Thu", case-sensitive
  17384. / %x46.72.69 ; "Fri", case-sensitive
  17385. / %x53.61.74 ; "Sat", case-sensitive
  17386. / %x53.75.6E ; "Sun", case-sensitive
  17387. date1 = day SP month SP year
  17388. ; e.g., 02 Jun 1982
  17389. day = 2DIGIT
  17390. month = %x4A.61.6E ; "Jan", case-sensitive
  17391. / %x46.65.62 ; "Feb", case-sensitive
  17392. / %x4D.61.72 ; "Mar", case-sensitive
  17393. / %x41.70.72 ; "Apr", case-sensitive
  17394. / %x4D.61.79 ; "May", case-sensitive
  17395. / %x4A.75.6E ; "Jun", case-sensitive
  17396. / %x4A.75.6C ; "Jul", case-sensitive
  17397. / %x41.75.67 ; "Aug", case-sensitive
  17398. / %x53.65.70 ; "Sep", case-sensitive
  17399. / %x4F.63.74 ; "Oct", case-sensitive
  17400. / %x4E.6F.76 ; "Nov", case-sensitive
  17401. / %x44.65.63 ; "Dec", case-sensitive
  17402. year = 4DIGIT
  17403. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17404. time-of-day = hour ":" minute ":" second
  17405. ; 00:00:00 - 23:59:60 (leap second)
  17406. hour = 2DIGIT
  17407. minute = 2DIGIT
  17408. second = 2DIGIT
  17409. */
  17410. function toIMFDate (date) {
  17411. if (typeof date === 'number') {
  17412. date = new Date(date)
  17413. }
  17414. const days = [
  17415. 'Sun', 'Mon', 'Tue', 'Wed',
  17416. 'Thu', 'Fri', 'Sat'
  17417. ]
  17418. const months = [
  17419. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17420. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17421. ]
  17422. const dayName = days[date.getUTCDay()]
  17423. const day = date.getUTCDate().toString().padStart(2, '0')
  17424. const month = months[date.getUTCMonth()]
  17425. const year = date.getUTCFullYear()
  17426. const hour = date.getUTCHours().toString().padStart(2, '0')
  17427. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17428. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17429. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17430. }
  17431. /**
  17432. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17433. ; In practice, both expires-av and max-age-av
  17434. ; are limited to dates representable by the
  17435. ; user agent.
  17436. * @param {number} maxAge
  17437. */
  17438. function validateCookieMaxAge (maxAge) {
  17439. if (maxAge < 0) {
  17440. throw new Error('Invalid cookie max-age')
  17441. }
  17442. }
  17443. /**
  17444. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17445. * @param {import('./index').Cookie} cookie
  17446. */
  17447. function stringify (cookie) {
  17448. if (cookie.name.length === 0) {
  17449. return null
  17450. }
  17451. validateCookieName(cookie.name)
  17452. validateCookieValue(cookie.value)
  17453. const out = [`${cookie.name}=${cookie.value}`]
  17454. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17455. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17456. if (cookie.name.startsWith('__Secure-')) {
  17457. cookie.secure = true
  17458. }
  17459. if (cookie.name.startsWith('__Host-')) {
  17460. cookie.secure = true
  17461. cookie.domain = null
  17462. cookie.path = '/'
  17463. }
  17464. if (cookie.secure) {
  17465. out.push('Secure')
  17466. }
  17467. if (cookie.httpOnly) {
  17468. out.push('HttpOnly')
  17469. }
  17470. if (typeof cookie.maxAge === 'number') {
  17471. validateCookieMaxAge(cookie.maxAge)
  17472. out.push(`Max-Age=${cookie.maxAge}`)
  17473. }
  17474. if (cookie.domain) {
  17475. validateCookieDomain(cookie.domain)
  17476. out.push(`Domain=${cookie.domain}`)
  17477. }
  17478. if (cookie.path) {
  17479. validateCookiePath(cookie.path)
  17480. out.push(`Path=${cookie.path}`)
  17481. }
  17482. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17483. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17484. }
  17485. if (cookie.sameSite) {
  17486. out.push(`SameSite=${cookie.sameSite}`)
  17487. }
  17488. for (const part of cookie.unparsed) {
  17489. if (!part.includes('=')) {
  17490. throw new Error('Invalid unparsed')
  17491. }
  17492. const [key, ...value] = part.split('=')
  17493. out.push(`${key.trim()}=${value.join('=')}`)
  17494. }
  17495. return out.join('; ')
  17496. }
  17497. let kHeadersListNode
  17498. function getHeadersList (headers) {
  17499. if (headers[kHeadersList]) {
  17500. return headers[kHeadersList]
  17501. }
  17502. if (!kHeadersListNode) {
  17503. kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
  17504. (symbol) => symbol.description === 'headers list'
  17505. )
  17506. assert(kHeadersListNode, 'Headers cannot be parsed')
  17507. }
  17508. const headersList = headers[kHeadersListNode]
  17509. assert(headersList)
  17510. return headersList
  17511. }
  17512. module.exports = {
  17513. isCTLExcludingHtab,
  17514. stringify,
  17515. getHeadersList
  17516. }
  17517. /***/ }),
  17518. /***/ 2067:
  17519. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17520. "use strict";
  17521. const net = __nccwpck_require__(1808)
  17522. const assert = __nccwpck_require__(9491)
  17523. const util = __nccwpck_require__(3983)
  17524. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17525. let tls // include tls conditionally since it is not always available
  17526. // TODO: session re-use does not wait for the first
  17527. // connection to resolve the session and might therefore
  17528. // resolve the same servername multiple times even when
  17529. // re-use is enabled.
  17530. let SessionCache
  17531. // FIXME: remove workaround when the Node bug is fixed
  17532. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17533. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17534. SessionCache = class WeakSessionCache {
  17535. constructor (maxCachedSessions) {
  17536. this._maxCachedSessions = maxCachedSessions
  17537. this._sessionCache = new Map()
  17538. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17539. if (this._sessionCache.size < this._maxCachedSessions) {
  17540. return
  17541. }
  17542. const ref = this._sessionCache.get(key)
  17543. if (ref !== undefined && ref.deref() === undefined) {
  17544. this._sessionCache.delete(key)
  17545. }
  17546. })
  17547. }
  17548. get (sessionKey) {
  17549. const ref = this._sessionCache.get(sessionKey)
  17550. return ref ? ref.deref() : null
  17551. }
  17552. set (sessionKey, session) {
  17553. if (this._maxCachedSessions === 0) {
  17554. return
  17555. }
  17556. this._sessionCache.set(sessionKey, new WeakRef(session))
  17557. this._sessionRegistry.register(session, sessionKey)
  17558. }
  17559. }
  17560. } else {
  17561. SessionCache = class SimpleSessionCache {
  17562. constructor (maxCachedSessions) {
  17563. this._maxCachedSessions = maxCachedSessions
  17564. this._sessionCache = new Map()
  17565. }
  17566. get (sessionKey) {
  17567. return this._sessionCache.get(sessionKey)
  17568. }
  17569. set (sessionKey, session) {
  17570. if (this._maxCachedSessions === 0) {
  17571. return
  17572. }
  17573. if (this._sessionCache.size >= this._maxCachedSessions) {
  17574. // remove the oldest session
  17575. const { value: oldestKey } = this._sessionCache.keys().next()
  17576. this._sessionCache.delete(oldestKey)
  17577. }
  17578. this._sessionCache.set(sessionKey, session)
  17579. }
  17580. }
  17581. }
  17582. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17583. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17584. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17585. }
  17586. const options = { path: socketPath, ...opts }
  17587. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17588. timeout = timeout == null ? 10e3 : timeout
  17589. allowH2 = allowH2 != null ? allowH2 : false
  17590. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17591. let socket
  17592. if (protocol === 'https:') {
  17593. if (!tls) {
  17594. tls = __nccwpck_require__(4404)
  17595. }
  17596. servername = servername || options.servername || util.getServerName(host) || null
  17597. const sessionKey = servername || hostname
  17598. const session = sessionCache.get(sessionKey) || null
  17599. assert(sessionKey)
  17600. socket = tls.connect({
  17601. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17602. ...options,
  17603. servername,
  17604. session,
  17605. localAddress,
  17606. // TODO(HTTP/2): Add support for h2c
  17607. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17608. socket: httpSocket, // upgrade socket connection
  17609. port: port || 443,
  17610. host: hostname
  17611. })
  17612. socket
  17613. .on('session', function (session) {
  17614. // TODO (fix): Can a session become invalid once established? Don't think so?
  17615. sessionCache.set(sessionKey, session)
  17616. })
  17617. } else {
  17618. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17619. socket = net.connect({
  17620. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17621. ...options,
  17622. localAddress,
  17623. port: port || 80,
  17624. host: hostname
  17625. })
  17626. }
  17627. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17628. if (options.keepAlive == null || options.keepAlive) {
  17629. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17630. socket.setKeepAlive(true, keepAliveInitialDelay)
  17631. }
  17632. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17633. socket
  17634. .setNoDelay(true)
  17635. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17636. cancelTimeout()
  17637. if (callback) {
  17638. const cb = callback
  17639. callback = null
  17640. cb(null, this)
  17641. }
  17642. })
  17643. .on('error', function (err) {
  17644. cancelTimeout()
  17645. if (callback) {
  17646. const cb = callback
  17647. callback = null
  17648. cb(err)
  17649. }
  17650. })
  17651. return socket
  17652. }
  17653. }
  17654. function setupTimeout (onConnectTimeout, timeout) {
  17655. if (!timeout) {
  17656. return () => {}
  17657. }
  17658. let s1 = null
  17659. let s2 = null
  17660. const timeoutId = setTimeout(() => {
  17661. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17662. s1 = setImmediate(() => {
  17663. if (process.platform === 'win32') {
  17664. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17665. s2 = setImmediate(() => onConnectTimeout())
  17666. } else {
  17667. onConnectTimeout()
  17668. }
  17669. })
  17670. }, timeout)
  17671. return () => {
  17672. clearTimeout(timeoutId)
  17673. clearImmediate(s1)
  17674. clearImmediate(s2)
  17675. }
  17676. }
  17677. function onConnectTimeout (socket) {
  17678. util.destroy(socket, new ConnectTimeoutError())
  17679. }
  17680. module.exports = buildConnector
  17681. /***/ }),
  17682. /***/ 4462:
  17683. /***/ ((module) => {
  17684. "use strict";
  17685. /** @type {Record<string, string | undefined>} */
  17686. const headerNameLowerCasedRecord = {}
  17687. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17688. const wellknownHeaderNames = [
  17689. 'Accept',
  17690. 'Accept-Encoding',
  17691. 'Accept-Language',
  17692. 'Accept-Ranges',
  17693. 'Access-Control-Allow-Credentials',
  17694. 'Access-Control-Allow-Headers',
  17695. 'Access-Control-Allow-Methods',
  17696. 'Access-Control-Allow-Origin',
  17697. 'Access-Control-Expose-Headers',
  17698. 'Access-Control-Max-Age',
  17699. 'Access-Control-Request-Headers',
  17700. 'Access-Control-Request-Method',
  17701. 'Age',
  17702. 'Allow',
  17703. 'Alt-Svc',
  17704. 'Alt-Used',
  17705. 'Authorization',
  17706. 'Cache-Control',
  17707. 'Clear-Site-Data',
  17708. 'Connection',
  17709. 'Content-Disposition',
  17710. 'Content-Encoding',
  17711. 'Content-Language',
  17712. 'Content-Length',
  17713. 'Content-Location',
  17714. 'Content-Range',
  17715. 'Content-Security-Policy',
  17716. 'Content-Security-Policy-Report-Only',
  17717. 'Content-Type',
  17718. 'Cookie',
  17719. 'Cross-Origin-Embedder-Policy',
  17720. 'Cross-Origin-Opener-Policy',
  17721. 'Cross-Origin-Resource-Policy',
  17722. 'Date',
  17723. 'Device-Memory',
  17724. 'Downlink',
  17725. 'ECT',
  17726. 'ETag',
  17727. 'Expect',
  17728. 'Expect-CT',
  17729. 'Expires',
  17730. 'Forwarded',
  17731. 'From',
  17732. 'Host',
  17733. 'If-Match',
  17734. 'If-Modified-Since',
  17735. 'If-None-Match',
  17736. 'If-Range',
  17737. 'If-Unmodified-Since',
  17738. 'Keep-Alive',
  17739. 'Last-Modified',
  17740. 'Link',
  17741. 'Location',
  17742. 'Max-Forwards',
  17743. 'Origin',
  17744. 'Permissions-Policy',
  17745. 'Pragma',
  17746. 'Proxy-Authenticate',
  17747. 'Proxy-Authorization',
  17748. 'RTT',
  17749. 'Range',
  17750. 'Referer',
  17751. 'Referrer-Policy',
  17752. 'Refresh',
  17753. 'Retry-After',
  17754. 'Sec-WebSocket-Accept',
  17755. 'Sec-WebSocket-Extensions',
  17756. 'Sec-WebSocket-Key',
  17757. 'Sec-WebSocket-Protocol',
  17758. 'Sec-WebSocket-Version',
  17759. 'Server',
  17760. 'Server-Timing',
  17761. 'Service-Worker-Allowed',
  17762. 'Service-Worker-Navigation-Preload',
  17763. 'Set-Cookie',
  17764. 'SourceMap',
  17765. 'Strict-Transport-Security',
  17766. 'Supports-Loading-Mode',
  17767. 'TE',
  17768. 'Timing-Allow-Origin',
  17769. 'Trailer',
  17770. 'Transfer-Encoding',
  17771. 'Upgrade',
  17772. 'Upgrade-Insecure-Requests',
  17773. 'User-Agent',
  17774. 'Vary',
  17775. 'Via',
  17776. 'WWW-Authenticate',
  17777. 'X-Content-Type-Options',
  17778. 'X-DNS-Prefetch-Control',
  17779. 'X-Frame-Options',
  17780. 'X-Permitted-Cross-Domain-Policies',
  17781. 'X-Powered-By',
  17782. 'X-Requested-With',
  17783. 'X-XSS-Protection'
  17784. ]
  17785. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  17786. const key = wellknownHeaderNames[i]
  17787. const lowerCasedKey = key.toLowerCase()
  17788. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  17789. lowerCasedKey
  17790. }
  17791. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  17792. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  17793. module.exports = {
  17794. wellknownHeaderNames,
  17795. headerNameLowerCasedRecord
  17796. }
  17797. /***/ }),
  17798. /***/ 8045:
  17799. /***/ ((module) => {
  17800. "use strict";
  17801. class UndiciError extends Error {
  17802. constructor (message) {
  17803. super(message)
  17804. this.name = 'UndiciError'
  17805. this.code = 'UND_ERR'
  17806. }
  17807. }
  17808. class ConnectTimeoutError extends UndiciError {
  17809. constructor (message) {
  17810. super(message)
  17811. Error.captureStackTrace(this, ConnectTimeoutError)
  17812. this.name = 'ConnectTimeoutError'
  17813. this.message = message || 'Connect Timeout Error'
  17814. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  17815. }
  17816. }
  17817. class HeadersTimeoutError extends UndiciError {
  17818. constructor (message) {
  17819. super(message)
  17820. Error.captureStackTrace(this, HeadersTimeoutError)
  17821. this.name = 'HeadersTimeoutError'
  17822. this.message = message || 'Headers Timeout Error'
  17823. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  17824. }
  17825. }
  17826. class HeadersOverflowError extends UndiciError {
  17827. constructor (message) {
  17828. super(message)
  17829. Error.captureStackTrace(this, HeadersOverflowError)
  17830. this.name = 'HeadersOverflowError'
  17831. this.message = message || 'Headers Overflow Error'
  17832. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  17833. }
  17834. }
  17835. class BodyTimeoutError extends UndiciError {
  17836. constructor (message) {
  17837. super(message)
  17838. Error.captureStackTrace(this, BodyTimeoutError)
  17839. this.name = 'BodyTimeoutError'
  17840. this.message = message || 'Body Timeout Error'
  17841. this.code = 'UND_ERR_BODY_TIMEOUT'
  17842. }
  17843. }
  17844. class ResponseStatusCodeError extends UndiciError {
  17845. constructor (message, statusCode, headers, body) {
  17846. super(message)
  17847. Error.captureStackTrace(this, ResponseStatusCodeError)
  17848. this.name = 'ResponseStatusCodeError'
  17849. this.message = message || 'Response Status Code Error'
  17850. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  17851. this.body = body
  17852. this.status = statusCode
  17853. this.statusCode = statusCode
  17854. this.headers = headers
  17855. }
  17856. }
  17857. class InvalidArgumentError extends UndiciError {
  17858. constructor (message) {
  17859. super(message)
  17860. Error.captureStackTrace(this, InvalidArgumentError)
  17861. this.name = 'InvalidArgumentError'
  17862. this.message = message || 'Invalid Argument Error'
  17863. this.code = 'UND_ERR_INVALID_ARG'
  17864. }
  17865. }
  17866. class InvalidReturnValueError extends UndiciError {
  17867. constructor (message) {
  17868. super(message)
  17869. Error.captureStackTrace(this, InvalidReturnValueError)
  17870. this.name = 'InvalidReturnValueError'
  17871. this.message = message || 'Invalid Return Value Error'
  17872. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  17873. }
  17874. }
  17875. class RequestAbortedError extends UndiciError {
  17876. constructor (message) {
  17877. super(message)
  17878. Error.captureStackTrace(this, RequestAbortedError)
  17879. this.name = 'AbortError'
  17880. this.message = message || 'Request aborted'
  17881. this.code = 'UND_ERR_ABORTED'
  17882. }
  17883. }
  17884. class InformationalError extends UndiciError {
  17885. constructor (message) {
  17886. super(message)
  17887. Error.captureStackTrace(this, InformationalError)
  17888. this.name = 'InformationalError'
  17889. this.message = message || 'Request information'
  17890. this.code = 'UND_ERR_INFO'
  17891. }
  17892. }
  17893. class RequestContentLengthMismatchError extends UndiciError {
  17894. constructor (message) {
  17895. super(message)
  17896. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  17897. this.name = 'RequestContentLengthMismatchError'
  17898. this.message = message || 'Request body length does not match content-length header'
  17899. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  17900. }
  17901. }
  17902. class ResponseContentLengthMismatchError extends UndiciError {
  17903. constructor (message) {
  17904. super(message)
  17905. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  17906. this.name = 'ResponseContentLengthMismatchError'
  17907. this.message = message || 'Response body length does not match content-length header'
  17908. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  17909. }
  17910. }
  17911. class ClientDestroyedError extends UndiciError {
  17912. constructor (message) {
  17913. super(message)
  17914. Error.captureStackTrace(this, ClientDestroyedError)
  17915. this.name = 'ClientDestroyedError'
  17916. this.message = message || 'The client is destroyed'
  17917. this.code = 'UND_ERR_DESTROYED'
  17918. }
  17919. }
  17920. class ClientClosedError extends UndiciError {
  17921. constructor (message) {
  17922. super(message)
  17923. Error.captureStackTrace(this, ClientClosedError)
  17924. this.name = 'ClientClosedError'
  17925. this.message = message || 'The client is closed'
  17926. this.code = 'UND_ERR_CLOSED'
  17927. }
  17928. }
  17929. class SocketError extends UndiciError {
  17930. constructor (message, socket) {
  17931. super(message)
  17932. Error.captureStackTrace(this, SocketError)
  17933. this.name = 'SocketError'
  17934. this.message = message || 'Socket error'
  17935. this.code = 'UND_ERR_SOCKET'
  17936. this.socket = socket
  17937. }
  17938. }
  17939. class NotSupportedError extends UndiciError {
  17940. constructor (message) {
  17941. super(message)
  17942. Error.captureStackTrace(this, NotSupportedError)
  17943. this.name = 'NotSupportedError'
  17944. this.message = message || 'Not supported error'
  17945. this.code = 'UND_ERR_NOT_SUPPORTED'
  17946. }
  17947. }
  17948. class BalancedPoolMissingUpstreamError extends UndiciError {
  17949. constructor (message) {
  17950. super(message)
  17951. Error.captureStackTrace(this, NotSupportedError)
  17952. this.name = 'MissingUpstreamError'
  17953. this.message = message || 'No upstream has been added to the BalancedPool'
  17954. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  17955. }
  17956. }
  17957. class HTTPParserError extends Error {
  17958. constructor (message, code, data) {
  17959. super(message)
  17960. Error.captureStackTrace(this, HTTPParserError)
  17961. this.name = 'HTTPParserError'
  17962. this.code = code ? `HPE_${code}` : undefined
  17963. this.data = data ? data.toString() : undefined
  17964. }
  17965. }
  17966. class ResponseExceededMaxSizeError extends UndiciError {
  17967. constructor (message) {
  17968. super(message)
  17969. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  17970. this.name = 'ResponseExceededMaxSizeError'
  17971. this.message = message || 'Response content exceeded max size'
  17972. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  17973. }
  17974. }
  17975. class RequestRetryError extends UndiciError {
  17976. constructor (message, code, { headers, data }) {
  17977. super(message)
  17978. Error.captureStackTrace(this, RequestRetryError)
  17979. this.name = 'RequestRetryError'
  17980. this.message = message || 'Request retry error'
  17981. this.code = 'UND_ERR_REQ_RETRY'
  17982. this.statusCode = code
  17983. this.data = data
  17984. this.headers = headers
  17985. }
  17986. }
  17987. module.exports = {
  17988. HTTPParserError,
  17989. UndiciError,
  17990. HeadersTimeoutError,
  17991. HeadersOverflowError,
  17992. BodyTimeoutError,
  17993. RequestContentLengthMismatchError,
  17994. ConnectTimeoutError,
  17995. ResponseStatusCodeError,
  17996. InvalidArgumentError,
  17997. InvalidReturnValueError,
  17998. RequestAbortedError,
  17999. ClientDestroyedError,
  18000. ClientClosedError,
  18001. InformationalError,
  18002. SocketError,
  18003. NotSupportedError,
  18004. ResponseContentLengthMismatchError,
  18005. BalancedPoolMissingUpstreamError,
  18006. ResponseExceededMaxSizeError,
  18007. RequestRetryError
  18008. }
  18009. /***/ }),
  18010. /***/ 2905:
  18011. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18012. "use strict";
  18013. const {
  18014. InvalidArgumentError,
  18015. NotSupportedError
  18016. } = __nccwpck_require__(8045)
  18017. const assert = __nccwpck_require__(9491)
  18018. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18019. const util = __nccwpck_require__(3983)
  18020. // tokenRegExp and headerCharRegex have been lifted from
  18021. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18022. /**
  18023. * Verifies that the given val is a valid HTTP token
  18024. * per the rules defined in RFC 7230
  18025. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18026. */
  18027. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18028. /**
  18029. * Matches if val contains an invalid field-vchar
  18030. * field-value = *( field-content / obs-fold )
  18031. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18032. * field-vchar = VCHAR / obs-text
  18033. */
  18034. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18035. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18036. const invalidPathRegex = /[^\u0021-\u00ff]/
  18037. const kHandler = Symbol('handler')
  18038. const channels = {}
  18039. let extractBody
  18040. try {
  18041. const diagnosticsChannel = __nccwpck_require__(7643)
  18042. channels.create = diagnosticsChannel.channel('undici:request:create')
  18043. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18044. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18045. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18046. channels.error = diagnosticsChannel.channel('undici:request:error')
  18047. } catch {
  18048. channels.create = { hasSubscribers: false }
  18049. channels.bodySent = { hasSubscribers: false }
  18050. channels.headers = { hasSubscribers: false }
  18051. channels.trailers = { hasSubscribers: false }
  18052. channels.error = { hasSubscribers: false }
  18053. }
  18054. class Request {
  18055. constructor (origin, {
  18056. path,
  18057. method,
  18058. body,
  18059. headers,
  18060. query,
  18061. idempotent,
  18062. blocking,
  18063. upgrade,
  18064. headersTimeout,
  18065. bodyTimeout,
  18066. reset,
  18067. throwOnError,
  18068. expectContinue
  18069. }, handler) {
  18070. if (typeof path !== 'string') {
  18071. throw new InvalidArgumentError('path must be a string')
  18072. } else if (
  18073. path[0] !== '/' &&
  18074. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18075. method !== 'CONNECT'
  18076. ) {
  18077. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18078. } else if (invalidPathRegex.exec(path) !== null) {
  18079. throw new InvalidArgumentError('invalid request path')
  18080. }
  18081. if (typeof method !== 'string') {
  18082. throw new InvalidArgumentError('method must be a string')
  18083. } else if (tokenRegExp.exec(method) === null) {
  18084. throw new InvalidArgumentError('invalid request method')
  18085. }
  18086. if (upgrade && typeof upgrade !== 'string') {
  18087. throw new InvalidArgumentError('upgrade must be a string')
  18088. }
  18089. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18090. throw new InvalidArgumentError('invalid headersTimeout')
  18091. }
  18092. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18093. throw new InvalidArgumentError('invalid bodyTimeout')
  18094. }
  18095. if (reset != null && typeof reset !== 'boolean') {
  18096. throw new InvalidArgumentError('invalid reset')
  18097. }
  18098. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18099. throw new InvalidArgumentError('invalid expectContinue')
  18100. }
  18101. this.headersTimeout = headersTimeout
  18102. this.bodyTimeout = bodyTimeout
  18103. this.throwOnError = throwOnError === true
  18104. this.method = method
  18105. this.abort = null
  18106. if (body == null) {
  18107. this.body = null
  18108. } else if (util.isStream(body)) {
  18109. this.body = body
  18110. const rState = this.body._readableState
  18111. if (!rState || !rState.autoDestroy) {
  18112. this.endHandler = function autoDestroy () {
  18113. util.destroy(this)
  18114. }
  18115. this.body.on('end', this.endHandler)
  18116. }
  18117. this.errorHandler = err => {
  18118. if (this.abort) {
  18119. this.abort(err)
  18120. } else {
  18121. this.error = err
  18122. }
  18123. }
  18124. this.body.on('error', this.errorHandler)
  18125. } else if (util.isBuffer(body)) {
  18126. this.body = body.byteLength ? body : null
  18127. } else if (ArrayBuffer.isView(body)) {
  18128. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18129. } else if (body instanceof ArrayBuffer) {
  18130. this.body = body.byteLength ? Buffer.from(body) : null
  18131. } else if (typeof body === 'string') {
  18132. this.body = body.length ? Buffer.from(body) : null
  18133. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18134. this.body = body
  18135. } else {
  18136. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18137. }
  18138. this.completed = false
  18139. this.aborted = false
  18140. this.upgrade = upgrade || null
  18141. this.path = query ? util.buildURL(path, query) : path
  18142. this.origin = origin
  18143. this.idempotent = idempotent == null
  18144. ? method === 'HEAD' || method === 'GET'
  18145. : idempotent
  18146. this.blocking = blocking == null ? false : blocking
  18147. this.reset = reset == null ? null : reset
  18148. this.host = null
  18149. this.contentLength = null
  18150. this.contentType = null
  18151. this.headers = ''
  18152. // Only for H2
  18153. this.expectContinue = expectContinue != null ? expectContinue : false
  18154. if (Array.isArray(headers)) {
  18155. if (headers.length % 2 !== 0) {
  18156. throw new InvalidArgumentError('headers array must be even')
  18157. }
  18158. for (let i = 0; i < headers.length; i += 2) {
  18159. processHeader(this, headers[i], headers[i + 1])
  18160. }
  18161. } else if (headers && typeof headers === 'object') {
  18162. const keys = Object.keys(headers)
  18163. for (let i = 0; i < keys.length; i++) {
  18164. const key = keys[i]
  18165. processHeader(this, key, headers[key])
  18166. }
  18167. } else if (headers != null) {
  18168. throw new InvalidArgumentError('headers must be an object or an array')
  18169. }
  18170. if (util.isFormDataLike(this.body)) {
  18171. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18172. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18173. }
  18174. if (!extractBody) {
  18175. extractBody = (__nccwpck_require__(9990).extractBody)
  18176. }
  18177. const [bodyStream, contentType] = extractBody(body)
  18178. if (this.contentType == null) {
  18179. this.contentType = contentType
  18180. this.headers += `content-type: ${contentType}\r\n`
  18181. }
  18182. this.body = bodyStream.stream
  18183. this.contentLength = bodyStream.length
  18184. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18185. this.contentType = body.type
  18186. this.headers += `content-type: ${body.type}\r\n`
  18187. }
  18188. util.validateHandler(handler, method, upgrade)
  18189. this.servername = util.getServerName(this.host)
  18190. this[kHandler] = handler
  18191. if (channels.create.hasSubscribers) {
  18192. channels.create.publish({ request: this })
  18193. }
  18194. }
  18195. onBodySent (chunk) {
  18196. if (this[kHandler].onBodySent) {
  18197. try {
  18198. return this[kHandler].onBodySent(chunk)
  18199. } catch (err) {
  18200. this.abort(err)
  18201. }
  18202. }
  18203. }
  18204. onRequestSent () {
  18205. if (channels.bodySent.hasSubscribers) {
  18206. channels.bodySent.publish({ request: this })
  18207. }
  18208. if (this[kHandler].onRequestSent) {
  18209. try {
  18210. return this[kHandler].onRequestSent()
  18211. } catch (err) {
  18212. this.abort(err)
  18213. }
  18214. }
  18215. }
  18216. onConnect (abort) {
  18217. assert(!this.aborted)
  18218. assert(!this.completed)
  18219. if (this.error) {
  18220. abort(this.error)
  18221. } else {
  18222. this.abort = abort
  18223. return this[kHandler].onConnect(abort)
  18224. }
  18225. }
  18226. onHeaders (statusCode, headers, resume, statusText) {
  18227. assert(!this.aborted)
  18228. assert(!this.completed)
  18229. if (channels.headers.hasSubscribers) {
  18230. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18231. }
  18232. try {
  18233. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18234. } catch (err) {
  18235. this.abort(err)
  18236. }
  18237. }
  18238. onData (chunk) {
  18239. assert(!this.aborted)
  18240. assert(!this.completed)
  18241. try {
  18242. return this[kHandler].onData(chunk)
  18243. } catch (err) {
  18244. this.abort(err)
  18245. return false
  18246. }
  18247. }
  18248. onUpgrade (statusCode, headers, socket) {
  18249. assert(!this.aborted)
  18250. assert(!this.completed)
  18251. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18252. }
  18253. onComplete (trailers) {
  18254. this.onFinally()
  18255. assert(!this.aborted)
  18256. this.completed = true
  18257. if (channels.trailers.hasSubscribers) {
  18258. channels.trailers.publish({ request: this, trailers })
  18259. }
  18260. try {
  18261. return this[kHandler].onComplete(trailers)
  18262. } catch (err) {
  18263. // TODO (fix): This might be a bad idea?
  18264. this.onError(err)
  18265. }
  18266. }
  18267. onError (error) {
  18268. this.onFinally()
  18269. if (channels.error.hasSubscribers) {
  18270. channels.error.publish({ request: this, error })
  18271. }
  18272. if (this.aborted) {
  18273. return
  18274. }
  18275. this.aborted = true
  18276. return this[kHandler].onError(error)
  18277. }
  18278. onFinally () {
  18279. if (this.errorHandler) {
  18280. this.body.off('error', this.errorHandler)
  18281. this.errorHandler = null
  18282. }
  18283. if (this.endHandler) {
  18284. this.body.off('end', this.endHandler)
  18285. this.endHandler = null
  18286. }
  18287. }
  18288. // TODO: adjust to support H2
  18289. addHeader (key, value) {
  18290. processHeader(this, key, value)
  18291. return this
  18292. }
  18293. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18294. // TODO: Migrate header parsing here, to make Requests
  18295. // HTTP agnostic
  18296. return new Request(origin, opts, handler)
  18297. }
  18298. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18299. const headers = opts.headers
  18300. opts = { ...opts, headers: null }
  18301. const request = new Request(origin, opts, handler)
  18302. request.headers = {}
  18303. if (Array.isArray(headers)) {
  18304. if (headers.length % 2 !== 0) {
  18305. throw new InvalidArgumentError('headers array must be even')
  18306. }
  18307. for (let i = 0; i < headers.length; i += 2) {
  18308. processHeader(request, headers[i], headers[i + 1], true)
  18309. }
  18310. } else if (headers && typeof headers === 'object') {
  18311. const keys = Object.keys(headers)
  18312. for (let i = 0; i < keys.length; i++) {
  18313. const key = keys[i]
  18314. processHeader(request, key, headers[key], true)
  18315. }
  18316. } else if (headers != null) {
  18317. throw new InvalidArgumentError('headers must be an object or an array')
  18318. }
  18319. return request
  18320. }
  18321. static [kHTTP2CopyHeaders] (raw) {
  18322. const rawHeaders = raw.split('\r\n')
  18323. const headers = {}
  18324. for (const header of rawHeaders) {
  18325. const [key, value] = header.split(': ')
  18326. if (value == null || value.length === 0) continue
  18327. if (headers[key]) headers[key] += `,${value}`
  18328. else headers[key] = value
  18329. }
  18330. return headers
  18331. }
  18332. }
  18333. function processHeaderValue (key, val, skipAppend) {
  18334. if (val && typeof val === 'object') {
  18335. throw new InvalidArgumentError(`invalid ${key} header`)
  18336. }
  18337. val = val != null ? `${val}` : ''
  18338. if (headerCharRegex.exec(val) !== null) {
  18339. throw new InvalidArgumentError(`invalid ${key} header`)
  18340. }
  18341. return skipAppend ? val : `${key}: ${val}\r\n`
  18342. }
  18343. function processHeader (request, key, val, skipAppend = false) {
  18344. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18345. throw new InvalidArgumentError(`invalid ${key} header`)
  18346. } else if (val === undefined) {
  18347. return
  18348. }
  18349. if (
  18350. request.host === null &&
  18351. key.length === 4 &&
  18352. key.toLowerCase() === 'host'
  18353. ) {
  18354. if (headerCharRegex.exec(val) !== null) {
  18355. throw new InvalidArgumentError(`invalid ${key} header`)
  18356. }
  18357. // Consumed by Client
  18358. request.host = val
  18359. } else if (
  18360. request.contentLength === null &&
  18361. key.length === 14 &&
  18362. key.toLowerCase() === 'content-length'
  18363. ) {
  18364. request.contentLength = parseInt(val, 10)
  18365. if (!Number.isFinite(request.contentLength)) {
  18366. throw new InvalidArgumentError('invalid content-length header')
  18367. }
  18368. } else if (
  18369. request.contentType === null &&
  18370. key.length === 12 &&
  18371. key.toLowerCase() === 'content-type'
  18372. ) {
  18373. request.contentType = val
  18374. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18375. else request.headers += processHeaderValue(key, val)
  18376. } else if (
  18377. key.length === 17 &&
  18378. key.toLowerCase() === 'transfer-encoding'
  18379. ) {
  18380. throw new InvalidArgumentError('invalid transfer-encoding header')
  18381. } else if (
  18382. key.length === 10 &&
  18383. key.toLowerCase() === 'connection'
  18384. ) {
  18385. const value = typeof val === 'string' ? val.toLowerCase() : null
  18386. if (value !== 'close' && value !== 'keep-alive') {
  18387. throw new InvalidArgumentError('invalid connection header')
  18388. } else if (value === 'close') {
  18389. request.reset = true
  18390. }
  18391. } else if (
  18392. key.length === 10 &&
  18393. key.toLowerCase() === 'keep-alive'
  18394. ) {
  18395. throw new InvalidArgumentError('invalid keep-alive header')
  18396. } else if (
  18397. key.length === 7 &&
  18398. key.toLowerCase() === 'upgrade'
  18399. ) {
  18400. throw new InvalidArgumentError('invalid upgrade header')
  18401. } else if (
  18402. key.length === 6 &&
  18403. key.toLowerCase() === 'expect'
  18404. ) {
  18405. throw new NotSupportedError('expect header not supported')
  18406. } else if (tokenRegExp.exec(key) === null) {
  18407. throw new InvalidArgumentError('invalid header key')
  18408. } else {
  18409. if (Array.isArray(val)) {
  18410. for (let i = 0; i < val.length; i++) {
  18411. if (skipAppend) {
  18412. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18413. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18414. } else {
  18415. request.headers += processHeaderValue(key, val[i])
  18416. }
  18417. }
  18418. } else {
  18419. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18420. else request.headers += processHeaderValue(key, val)
  18421. }
  18422. }
  18423. }
  18424. module.exports = Request
  18425. /***/ }),
  18426. /***/ 2785:
  18427. /***/ ((module) => {
  18428. module.exports = {
  18429. kClose: Symbol('close'),
  18430. kDestroy: Symbol('destroy'),
  18431. kDispatch: Symbol('dispatch'),
  18432. kUrl: Symbol('url'),
  18433. kWriting: Symbol('writing'),
  18434. kResuming: Symbol('resuming'),
  18435. kQueue: Symbol('queue'),
  18436. kConnect: Symbol('connect'),
  18437. kConnecting: Symbol('connecting'),
  18438. kHeadersList: Symbol('headers list'),
  18439. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18440. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18441. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18442. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18443. kKeepAlive: Symbol('keep alive'),
  18444. kHeadersTimeout: Symbol('headers timeout'),
  18445. kBodyTimeout: Symbol('body timeout'),
  18446. kServerName: Symbol('server name'),
  18447. kLocalAddress: Symbol('local address'),
  18448. kHost: Symbol('host'),
  18449. kNoRef: Symbol('no ref'),
  18450. kBodyUsed: Symbol('used'),
  18451. kRunning: Symbol('running'),
  18452. kBlocking: Symbol('blocking'),
  18453. kPending: Symbol('pending'),
  18454. kSize: Symbol('size'),
  18455. kBusy: Symbol('busy'),
  18456. kQueued: Symbol('queued'),
  18457. kFree: Symbol('free'),
  18458. kConnected: Symbol('connected'),
  18459. kClosed: Symbol('closed'),
  18460. kNeedDrain: Symbol('need drain'),
  18461. kReset: Symbol('reset'),
  18462. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18463. kMaxHeadersSize: Symbol('max headers size'),
  18464. kRunningIdx: Symbol('running index'),
  18465. kPendingIdx: Symbol('pending index'),
  18466. kError: Symbol('error'),
  18467. kClients: Symbol('clients'),
  18468. kClient: Symbol('client'),
  18469. kParser: Symbol('parser'),
  18470. kOnDestroyed: Symbol('destroy callbacks'),
  18471. kPipelining: Symbol('pipelining'),
  18472. kSocket: Symbol('socket'),
  18473. kHostHeader: Symbol('host header'),
  18474. kConnector: Symbol('connector'),
  18475. kStrictContentLength: Symbol('strict content length'),
  18476. kMaxRedirections: Symbol('maxRedirections'),
  18477. kMaxRequests: Symbol('maxRequestsPerClient'),
  18478. kProxy: Symbol('proxy agent options'),
  18479. kCounter: Symbol('socket request counter'),
  18480. kInterceptors: Symbol('dispatch interceptors'),
  18481. kMaxResponseSize: Symbol('max response size'),
  18482. kHTTP2Session: Symbol('http2Session'),
  18483. kHTTP2SessionState: Symbol('http2Session state'),
  18484. kHTTP2BuildRequest: Symbol('http2 build request'),
  18485. kHTTP1BuildRequest: Symbol('http1 build request'),
  18486. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18487. kHTTPConnVersion: Symbol('http connection version'),
  18488. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18489. kConstruct: Symbol('constructable')
  18490. }
  18491. /***/ }),
  18492. /***/ 3983:
  18493. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18494. "use strict";
  18495. const assert = __nccwpck_require__(9491)
  18496. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18497. const { IncomingMessage } = __nccwpck_require__(3685)
  18498. const stream = __nccwpck_require__(2781)
  18499. const net = __nccwpck_require__(1808)
  18500. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18501. const { Blob } = __nccwpck_require__(4300)
  18502. const nodeUtil = __nccwpck_require__(3837)
  18503. const { stringify } = __nccwpck_require__(3477)
  18504. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18505. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18506. function nop () {}
  18507. function isStream (obj) {
  18508. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18509. }
  18510. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18511. function isBlobLike (object) {
  18512. return (Blob && object instanceof Blob) || (
  18513. object &&
  18514. typeof object === 'object' &&
  18515. (typeof object.stream === 'function' ||
  18516. typeof object.arrayBuffer === 'function') &&
  18517. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18518. )
  18519. }
  18520. function buildURL (url, queryParams) {
  18521. if (url.includes('?') || url.includes('#')) {
  18522. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18523. }
  18524. const stringified = stringify(queryParams)
  18525. if (stringified) {
  18526. url += '?' + stringified
  18527. }
  18528. return url
  18529. }
  18530. function parseURL (url) {
  18531. if (typeof url === 'string') {
  18532. url = new URL(url)
  18533. if (!/^https?:/.test(url.origin || url.protocol)) {
  18534. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18535. }
  18536. return url
  18537. }
  18538. if (!url || typeof url !== 'object') {
  18539. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18540. }
  18541. if (!/^https?:/.test(url.origin || url.protocol)) {
  18542. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18543. }
  18544. if (!(url instanceof URL)) {
  18545. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18546. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18547. }
  18548. if (url.path != null && typeof url.path !== 'string') {
  18549. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18550. }
  18551. if (url.pathname != null && typeof url.pathname !== 'string') {
  18552. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18553. }
  18554. if (url.hostname != null && typeof url.hostname !== 'string') {
  18555. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18556. }
  18557. if (url.origin != null && typeof url.origin !== 'string') {
  18558. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18559. }
  18560. const port = url.port != null
  18561. ? url.port
  18562. : (url.protocol === 'https:' ? 443 : 80)
  18563. let origin = url.origin != null
  18564. ? url.origin
  18565. : `${url.protocol}//${url.hostname}:${port}`
  18566. let path = url.path != null
  18567. ? url.path
  18568. : `${url.pathname || ''}${url.search || ''}`
  18569. if (origin.endsWith('/')) {
  18570. origin = origin.substring(0, origin.length - 1)
  18571. }
  18572. if (path && !path.startsWith('/')) {
  18573. path = `/${path}`
  18574. }
  18575. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18576. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18577. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18578. // If first parameter is an absolute URL, a given second param will be ignored.
  18579. url = new URL(origin + path)
  18580. }
  18581. return url
  18582. }
  18583. function parseOrigin (url) {
  18584. url = parseURL(url)
  18585. if (url.pathname !== '/' || url.search || url.hash) {
  18586. throw new InvalidArgumentError('invalid url')
  18587. }
  18588. return url
  18589. }
  18590. function getHostname (host) {
  18591. if (host[0] === '[') {
  18592. const idx = host.indexOf(']')
  18593. assert(idx !== -1)
  18594. return host.substring(1, idx)
  18595. }
  18596. const idx = host.indexOf(':')
  18597. if (idx === -1) return host
  18598. return host.substring(0, idx)
  18599. }
  18600. // IP addresses are not valid server names per RFC6066
  18601. // > Currently, the only server names supported are DNS hostnames
  18602. function getServerName (host) {
  18603. if (!host) {
  18604. return null
  18605. }
  18606. assert.strictEqual(typeof host, 'string')
  18607. const servername = getHostname(host)
  18608. if (net.isIP(servername)) {
  18609. return ''
  18610. }
  18611. return servername
  18612. }
  18613. function deepClone (obj) {
  18614. return JSON.parse(JSON.stringify(obj))
  18615. }
  18616. function isAsyncIterable (obj) {
  18617. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18618. }
  18619. function isIterable (obj) {
  18620. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18621. }
  18622. function bodyLength (body) {
  18623. if (body == null) {
  18624. return 0
  18625. } else if (isStream(body)) {
  18626. const state = body._readableState
  18627. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18628. ? state.length
  18629. : null
  18630. } else if (isBlobLike(body)) {
  18631. return body.size != null ? body.size : null
  18632. } else if (isBuffer(body)) {
  18633. return body.byteLength
  18634. }
  18635. return null
  18636. }
  18637. function isDestroyed (stream) {
  18638. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18639. }
  18640. function isReadableAborted (stream) {
  18641. const state = stream && stream._readableState
  18642. return isDestroyed(stream) && state && !state.endEmitted
  18643. }
  18644. function destroy (stream, err) {
  18645. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18646. return
  18647. }
  18648. if (typeof stream.destroy === 'function') {
  18649. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18650. // See: https://github.com/nodejs/node/pull/38505/files
  18651. stream.socket = null
  18652. }
  18653. stream.destroy(err)
  18654. } else if (err) {
  18655. process.nextTick((stream, err) => {
  18656. stream.emit('error', err)
  18657. }, stream, err)
  18658. }
  18659. if (stream.destroyed !== true) {
  18660. stream[kDestroyed] = true
  18661. }
  18662. }
  18663. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18664. function parseKeepAliveTimeout (val) {
  18665. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18666. return m ? parseInt(m[1], 10) * 1000 : null
  18667. }
  18668. /**
  18669. * Retrieves a header name and returns its lowercase value.
  18670. * @param {string | Buffer} value Header name
  18671. * @returns {string}
  18672. */
  18673. function headerNameToString (value) {
  18674. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18675. }
  18676. function parseHeaders (headers, obj = {}) {
  18677. // For H2 support
  18678. if (!Array.isArray(headers)) return headers
  18679. for (let i = 0; i < headers.length; i += 2) {
  18680. const key = headers[i].toString().toLowerCase()
  18681. let val = obj[key]
  18682. if (!val) {
  18683. if (Array.isArray(headers[i + 1])) {
  18684. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18685. } else {
  18686. obj[key] = headers[i + 1].toString('utf8')
  18687. }
  18688. } else {
  18689. if (!Array.isArray(val)) {
  18690. val = [val]
  18691. obj[key] = val
  18692. }
  18693. val.push(headers[i + 1].toString('utf8'))
  18694. }
  18695. }
  18696. // See https://github.com/nodejs/node/pull/46528
  18697. if ('content-length' in obj && 'content-disposition' in obj) {
  18698. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18699. }
  18700. return obj
  18701. }
  18702. function parseRawHeaders (headers) {
  18703. const ret = []
  18704. let hasContentLength = false
  18705. let contentDispositionIdx = -1
  18706. for (let n = 0; n < headers.length; n += 2) {
  18707. const key = headers[n + 0].toString()
  18708. const val = headers[n + 1].toString('utf8')
  18709. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18710. ret.push(key, val)
  18711. hasContentLength = true
  18712. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18713. contentDispositionIdx = ret.push(key, val) - 1
  18714. } else {
  18715. ret.push(key, val)
  18716. }
  18717. }
  18718. // See https://github.com/nodejs/node/pull/46528
  18719. if (hasContentLength && contentDispositionIdx !== -1) {
  18720. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18721. }
  18722. return ret
  18723. }
  18724. function isBuffer (buffer) {
  18725. // See, https://github.com/mcollina/undici/pull/319
  18726. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18727. }
  18728. function validateHandler (handler, method, upgrade) {
  18729. if (!handler || typeof handler !== 'object') {
  18730. throw new InvalidArgumentError('handler must be an object')
  18731. }
  18732. if (typeof handler.onConnect !== 'function') {
  18733. throw new InvalidArgumentError('invalid onConnect method')
  18734. }
  18735. if (typeof handler.onError !== 'function') {
  18736. throw new InvalidArgumentError('invalid onError method')
  18737. }
  18738. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  18739. throw new InvalidArgumentError('invalid onBodySent method')
  18740. }
  18741. if (upgrade || method === 'CONNECT') {
  18742. if (typeof handler.onUpgrade !== 'function') {
  18743. throw new InvalidArgumentError('invalid onUpgrade method')
  18744. }
  18745. } else {
  18746. if (typeof handler.onHeaders !== 'function') {
  18747. throw new InvalidArgumentError('invalid onHeaders method')
  18748. }
  18749. if (typeof handler.onData !== 'function') {
  18750. throw new InvalidArgumentError('invalid onData method')
  18751. }
  18752. if (typeof handler.onComplete !== 'function') {
  18753. throw new InvalidArgumentError('invalid onComplete method')
  18754. }
  18755. }
  18756. }
  18757. // A body is disturbed if it has been read from and it cannot
  18758. // be re-used without losing state or data.
  18759. function isDisturbed (body) {
  18760. return !!(body && (
  18761. stream.isDisturbed
  18762. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  18763. : body[kBodyUsed] ||
  18764. body.readableDidRead ||
  18765. (body._readableState && body._readableState.dataEmitted) ||
  18766. isReadableAborted(body)
  18767. ))
  18768. }
  18769. function isErrored (body) {
  18770. return !!(body && (
  18771. stream.isErrored
  18772. ? stream.isErrored(body)
  18773. : /state: 'errored'/.test(nodeUtil.inspect(body)
  18774. )))
  18775. }
  18776. function isReadable (body) {
  18777. return !!(body && (
  18778. stream.isReadable
  18779. ? stream.isReadable(body)
  18780. : /state: 'readable'/.test(nodeUtil.inspect(body)
  18781. )))
  18782. }
  18783. function getSocketInfo (socket) {
  18784. return {
  18785. localAddress: socket.localAddress,
  18786. localPort: socket.localPort,
  18787. remoteAddress: socket.remoteAddress,
  18788. remotePort: socket.remotePort,
  18789. remoteFamily: socket.remoteFamily,
  18790. timeout: socket.timeout,
  18791. bytesWritten: socket.bytesWritten,
  18792. bytesRead: socket.bytesRead
  18793. }
  18794. }
  18795. async function * convertIterableToBuffer (iterable) {
  18796. for await (const chunk of iterable) {
  18797. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  18798. }
  18799. }
  18800. let ReadableStream
  18801. function ReadableStreamFrom (iterable) {
  18802. if (!ReadableStream) {
  18803. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  18804. }
  18805. if (ReadableStream.from) {
  18806. return ReadableStream.from(convertIterableToBuffer(iterable))
  18807. }
  18808. let iterator
  18809. return new ReadableStream(
  18810. {
  18811. async start () {
  18812. iterator = iterable[Symbol.asyncIterator]()
  18813. },
  18814. async pull (controller) {
  18815. const { done, value } = await iterator.next()
  18816. if (done) {
  18817. queueMicrotask(() => {
  18818. controller.close()
  18819. })
  18820. } else {
  18821. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  18822. controller.enqueue(new Uint8Array(buf))
  18823. }
  18824. return controller.desiredSize > 0
  18825. },
  18826. async cancel (reason) {
  18827. await iterator.return()
  18828. }
  18829. },
  18830. 0
  18831. )
  18832. }
  18833. // The chunk should be a FormData instance and contains
  18834. // all the required methods.
  18835. function isFormDataLike (object) {
  18836. return (
  18837. object &&
  18838. typeof object === 'object' &&
  18839. typeof object.append === 'function' &&
  18840. typeof object.delete === 'function' &&
  18841. typeof object.get === 'function' &&
  18842. typeof object.getAll === 'function' &&
  18843. typeof object.has === 'function' &&
  18844. typeof object.set === 'function' &&
  18845. object[Symbol.toStringTag] === 'FormData'
  18846. )
  18847. }
  18848. function throwIfAborted (signal) {
  18849. if (!signal) { return }
  18850. if (typeof signal.throwIfAborted === 'function') {
  18851. signal.throwIfAborted()
  18852. } else {
  18853. if (signal.aborted) {
  18854. // DOMException not available < v17.0.0
  18855. const err = new Error('The operation was aborted')
  18856. err.name = 'AbortError'
  18857. throw err
  18858. }
  18859. }
  18860. }
  18861. function addAbortListener (signal, listener) {
  18862. if ('addEventListener' in signal) {
  18863. signal.addEventListener('abort', listener, { once: true })
  18864. return () => signal.removeEventListener('abort', listener)
  18865. }
  18866. signal.addListener('abort', listener)
  18867. return () => signal.removeListener('abort', listener)
  18868. }
  18869. const hasToWellFormed = !!String.prototype.toWellFormed
  18870. /**
  18871. * @param {string} val
  18872. */
  18873. function toUSVString (val) {
  18874. if (hasToWellFormed) {
  18875. return `${val}`.toWellFormed()
  18876. } else if (nodeUtil.toUSVString) {
  18877. return nodeUtil.toUSVString(val)
  18878. }
  18879. return `${val}`
  18880. }
  18881. // Parsed accordingly to RFC 9110
  18882. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  18883. function parseRangeHeader (range) {
  18884. if (range == null || range === '') return { start: 0, end: null, size: null }
  18885. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  18886. return m
  18887. ? {
  18888. start: parseInt(m[1]),
  18889. end: m[2] ? parseInt(m[2]) : null,
  18890. size: m[3] ? parseInt(m[3]) : null
  18891. }
  18892. : null
  18893. }
  18894. const kEnumerableProperty = Object.create(null)
  18895. kEnumerableProperty.enumerable = true
  18896. module.exports = {
  18897. kEnumerableProperty,
  18898. nop,
  18899. isDisturbed,
  18900. isErrored,
  18901. isReadable,
  18902. toUSVString,
  18903. isReadableAborted,
  18904. isBlobLike,
  18905. parseOrigin,
  18906. parseURL,
  18907. getServerName,
  18908. isStream,
  18909. isIterable,
  18910. isAsyncIterable,
  18911. isDestroyed,
  18912. headerNameToString,
  18913. parseRawHeaders,
  18914. parseHeaders,
  18915. parseKeepAliveTimeout,
  18916. destroy,
  18917. bodyLength,
  18918. deepClone,
  18919. ReadableStreamFrom,
  18920. isBuffer,
  18921. validateHandler,
  18922. getSocketInfo,
  18923. isFormDataLike,
  18924. buildURL,
  18925. throwIfAborted,
  18926. addAbortListener,
  18927. parseRangeHeader,
  18928. nodeMajor,
  18929. nodeMinor,
  18930. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  18931. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  18932. }
  18933. /***/ }),
  18934. /***/ 4839:
  18935. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18936. "use strict";
  18937. const Dispatcher = __nccwpck_require__(412)
  18938. const {
  18939. ClientDestroyedError,
  18940. ClientClosedError,
  18941. InvalidArgumentError
  18942. } = __nccwpck_require__(8045)
  18943. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  18944. const kDestroyed = Symbol('destroyed')
  18945. const kClosed = Symbol('closed')
  18946. const kOnDestroyed = Symbol('onDestroyed')
  18947. const kOnClosed = Symbol('onClosed')
  18948. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  18949. class DispatcherBase extends Dispatcher {
  18950. constructor () {
  18951. super()
  18952. this[kDestroyed] = false
  18953. this[kOnDestroyed] = null
  18954. this[kClosed] = false
  18955. this[kOnClosed] = []
  18956. }
  18957. get destroyed () {
  18958. return this[kDestroyed]
  18959. }
  18960. get closed () {
  18961. return this[kClosed]
  18962. }
  18963. get interceptors () {
  18964. return this[kInterceptors]
  18965. }
  18966. set interceptors (newInterceptors) {
  18967. if (newInterceptors) {
  18968. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  18969. const interceptor = this[kInterceptors][i]
  18970. if (typeof interceptor !== 'function') {
  18971. throw new InvalidArgumentError('interceptor must be an function')
  18972. }
  18973. }
  18974. }
  18975. this[kInterceptors] = newInterceptors
  18976. }
  18977. close (callback) {
  18978. if (callback === undefined) {
  18979. return new Promise((resolve, reject) => {
  18980. this.close((err, data) => {
  18981. return err ? reject(err) : resolve(data)
  18982. })
  18983. })
  18984. }
  18985. if (typeof callback !== 'function') {
  18986. throw new InvalidArgumentError('invalid callback')
  18987. }
  18988. if (this[kDestroyed]) {
  18989. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  18990. return
  18991. }
  18992. if (this[kClosed]) {
  18993. if (this[kOnClosed]) {
  18994. this[kOnClosed].push(callback)
  18995. } else {
  18996. queueMicrotask(() => callback(null, null))
  18997. }
  18998. return
  18999. }
  19000. this[kClosed] = true
  19001. this[kOnClosed].push(callback)
  19002. const onClosed = () => {
  19003. const callbacks = this[kOnClosed]
  19004. this[kOnClosed] = null
  19005. for (let i = 0; i < callbacks.length; i++) {
  19006. callbacks[i](null, null)
  19007. }
  19008. }
  19009. // Should not error.
  19010. this[kClose]()
  19011. .then(() => this.destroy())
  19012. .then(() => {
  19013. queueMicrotask(onClosed)
  19014. })
  19015. }
  19016. destroy (err, callback) {
  19017. if (typeof err === 'function') {
  19018. callback = err
  19019. err = null
  19020. }
  19021. if (callback === undefined) {
  19022. return new Promise((resolve, reject) => {
  19023. this.destroy(err, (err, data) => {
  19024. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19025. })
  19026. })
  19027. }
  19028. if (typeof callback !== 'function') {
  19029. throw new InvalidArgumentError('invalid callback')
  19030. }
  19031. if (this[kDestroyed]) {
  19032. if (this[kOnDestroyed]) {
  19033. this[kOnDestroyed].push(callback)
  19034. } else {
  19035. queueMicrotask(() => callback(null, null))
  19036. }
  19037. return
  19038. }
  19039. if (!err) {
  19040. err = new ClientDestroyedError()
  19041. }
  19042. this[kDestroyed] = true
  19043. this[kOnDestroyed] = this[kOnDestroyed] || []
  19044. this[kOnDestroyed].push(callback)
  19045. const onDestroyed = () => {
  19046. const callbacks = this[kOnDestroyed]
  19047. this[kOnDestroyed] = null
  19048. for (let i = 0; i < callbacks.length; i++) {
  19049. callbacks[i](null, null)
  19050. }
  19051. }
  19052. // Should not error.
  19053. this[kDestroy](err).then(() => {
  19054. queueMicrotask(onDestroyed)
  19055. })
  19056. }
  19057. [kInterceptedDispatch] (opts, handler) {
  19058. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19059. this[kInterceptedDispatch] = this[kDispatch]
  19060. return this[kDispatch](opts, handler)
  19061. }
  19062. let dispatch = this[kDispatch].bind(this)
  19063. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19064. dispatch = this[kInterceptors][i](dispatch)
  19065. }
  19066. this[kInterceptedDispatch] = dispatch
  19067. return dispatch(opts, handler)
  19068. }
  19069. dispatch (opts, handler) {
  19070. if (!handler || typeof handler !== 'object') {
  19071. throw new InvalidArgumentError('handler must be an object')
  19072. }
  19073. try {
  19074. if (!opts || typeof opts !== 'object') {
  19075. throw new InvalidArgumentError('opts must be an object.')
  19076. }
  19077. if (this[kDestroyed] || this[kOnDestroyed]) {
  19078. throw new ClientDestroyedError()
  19079. }
  19080. if (this[kClosed]) {
  19081. throw new ClientClosedError()
  19082. }
  19083. return this[kInterceptedDispatch](opts, handler)
  19084. } catch (err) {
  19085. if (typeof handler.onError !== 'function') {
  19086. throw new InvalidArgumentError('invalid onError method')
  19087. }
  19088. handler.onError(err)
  19089. return false
  19090. }
  19091. }
  19092. }
  19093. module.exports = DispatcherBase
  19094. /***/ }),
  19095. /***/ 412:
  19096. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19097. "use strict";
  19098. const EventEmitter = __nccwpck_require__(2361)
  19099. class Dispatcher extends EventEmitter {
  19100. dispatch () {
  19101. throw new Error('not implemented')
  19102. }
  19103. close () {
  19104. throw new Error('not implemented')
  19105. }
  19106. destroy () {
  19107. throw new Error('not implemented')
  19108. }
  19109. }
  19110. module.exports = Dispatcher
  19111. /***/ }),
  19112. /***/ 9990:
  19113. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19114. "use strict";
  19115. const Busboy = __nccwpck_require__(727)
  19116. const util = __nccwpck_require__(3983)
  19117. const {
  19118. ReadableStreamFrom,
  19119. isBlobLike,
  19120. isReadableStreamLike,
  19121. readableStreamClose,
  19122. createDeferredPromise,
  19123. fullyReadBody
  19124. } = __nccwpck_require__(2538)
  19125. const { FormData } = __nccwpck_require__(2015)
  19126. const { kState } = __nccwpck_require__(5861)
  19127. const { webidl } = __nccwpck_require__(1744)
  19128. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19129. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19130. const { kBodyUsed } = __nccwpck_require__(2785)
  19131. const assert = __nccwpck_require__(9491)
  19132. const { isErrored } = __nccwpck_require__(3983)
  19133. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19134. const { File: UndiciFile } = __nccwpck_require__(8511)
  19135. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19136. let ReadableStream = globalThis.ReadableStream
  19137. /** @type {globalThis['File']} */
  19138. const File = NativeFile ?? UndiciFile
  19139. const textEncoder = new TextEncoder()
  19140. const textDecoder = new TextDecoder()
  19141. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19142. function extractBody (object, keepalive = false) {
  19143. if (!ReadableStream) {
  19144. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19145. }
  19146. // 1. Let stream be null.
  19147. let stream = null
  19148. // 2. If object is a ReadableStream object, then set stream to object.
  19149. if (object instanceof ReadableStream) {
  19150. stream = object
  19151. } else if (isBlobLike(object)) {
  19152. // 3. Otherwise, if object is a Blob object, set stream to the
  19153. // result of running object’s get stream.
  19154. stream = object.stream()
  19155. } else {
  19156. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19157. // up stream.
  19158. stream = new ReadableStream({
  19159. async pull (controller) {
  19160. controller.enqueue(
  19161. typeof source === 'string' ? textEncoder.encode(source) : source
  19162. )
  19163. queueMicrotask(() => readableStreamClose(controller))
  19164. },
  19165. start () {},
  19166. type: undefined
  19167. })
  19168. }
  19169. // 5. Assert: stream is a ReadableStream object.
  19170. assert(isReadableStreamLike(stream))
  19171. // 6. Let action be null.
  19172. let action = null
  19173. // 7. Let source be null.
  19174. let source = null
  19175. // 8. Let length be null.
  19176. let length = null
  19177. // 9. Let type be null.
  19178. let type = null
  19179. // 10. Switch on object:
  19180. if (typeof object === 'string') {
  19181. // Set source to the UTF-8 encoding of object.
  19182. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19183. source = object
  19184. // Set type to `text/plain;charset=UTF-8`.
  19185. type = 'text/plain;charset=UTF-8'
  19186. } else if (object instanceof URLSearchParams) {
  19187. // URLSearchParams
  19188. // spec says to run application/x-www-form-urlencoded on body.list
  19189. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19190. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19191. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19192. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19193. source = object.toString()
  19194. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19195. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19196. } else if (isArrayBuffer(object)) {
  19197. // BufferSource/ArrayBuffer
  19198. // Set source to a copy of the bytes held by object.
  19199. source = new Uint8Array(object.slice())
  19200. } else if (ArrayBuffer.isView(object)) {
  19201. // BufferSource/ArrayBufferView
  19202. // Set source to a copy of the bytes held by object.
  19203. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19204. } else if (util.isFormDataLike(object)) {
  19205. const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
  19206. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19207. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19208. const escape = (str) =>
  19209. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19210. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19211. // Set action to this step: run the multipart/form-data
  19212. // encoding algorithm, with object’s entry list and UTF-8.
  19213. // - This ensures that the body is immutable and can't be changed afterwords
  19214. // - That the content-length is calculated in advance.
  19215. // - And that all parts are pre-encoded and ready to be sent.
  19216. const blobParts = []
  19217. const rn = new Uint8Array([13, 10]) // '\r\n'
  19218. length = 0
  19219. let hasUnknownSizeValue = false
  19220. for (const [name, value] of object) {
  19221. if (typeof value === 'string') {
  19222. const chunk = textEncoder.encode(prefix +
  19223. `; name="${escape(normalizeLinefeeds(name))}"` +
  19224. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19225. blobParts.push(chunk)
  19226. length += chunk.byteLength
  19227. } else {
  19228. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19229. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19230. `Content-Type: ${
  19231. value.type || 'application/octet-stream'
  19232. }\r\n\r\n`)
  19233. blobParts.push(chunk, value, rn)
  19234. if (typeof value.size === 'number') {
  19235. length += chunk.byteLength + value.size + rn.byteLength
  19236. } else {
  19237. hasUnknownSizeValue = true
  19238. }
  19239. }
  19240. }
  19241. const chunk = textEncoder.encode(`--${boundary}--`)
  19242. blobParts.push(chunk)
  19243. length += chunk.byteLength
  19244. if (hasUnknownSizeValue) {
  19245. length = null
  19246. }
  19247. // Set source to object.
  19248. source = object
  19249. action = async function * () {
  19250. for (const part of blobParts) {
  19251. if (part.stream) {
  19252. yield * part.stream()
  19253. } else {
  19254. yield part
  19255. }
  19256. }
  19257. }
  19258. // Set type to `multipart/form-data; boundary=`,
  19259. // followed by the multipart/form-data boundary string generated
  19260. // by the multipart/form-data encoding algorithm.
  19261. type = 'multipart/form-data; boundary=' + boundary
  19262. } else if (isBlobLike(object)) {
  19263. // Blob
  19264. // Set source to object.
  19265. source = object
  19266. // Set length to object’s size.
  19267. length = object.size
  19268. // If object’s type attribute is not the empty byte sequence, set
  19269. // type to its value.
  19270. if (object.type) {
  19271. type = object.type
  19272. }
  19273. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19274. // If keepalive is true, then throw a TypeError.
  19275. if (keepalive) {
  19276. throw new TypeError('keepalive')
  19277. }
  19278. // If object is disturbed or locked, then throw a TypeError.
  19279. if (util.isDisturbed(object) || object.locked) {
  19280. throw new TypeError(
  19281. 'Response body object should not be disturbed or locked'
  19282. )
  19283. }
  19284. stream =
  19285. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19286. }
  19287. // 11. If source is a byte sequence, then set action to a
  19288. // step that returns source and length to source’s length.
  19289. if (typeof source === 'string' || util.isBuffer(source)) {
  19290. length = Buffer.byteLength(source)
  19291. }
  19292. // 12. If action is non-null, then run these steps in in parallel:
  19293. if (action != null) {
  19294. // Run action.
  19295. let iterator
  19296. stream = new ReadableStream({
  19297. async start () {
  19298. iterator = action(object)[Symbol.asyncIterator]()
  19299. },
  19300. async pull (controller) {
  19301. const { value, done } = await iterator.next()
  19302. if (done) {
  19303. // When running action is done, close stream.
  19304. queueMicrotask(() => {
  19305. controller.close()
  19306. })
  19307. } else {
  19308. // Whenever one or more bytes are available and stream is not errored,
  19309. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19310. // bytes into stream.
  19311. if (!isErrored(stream)) {
  19312. controller.enqueue(new Uint8Array(value))
  19313. }
  19314. }
  19315. return controller.desiredSize > 0
  19316. },
  19317. async cancel (reason) {
  19318. await iterator.return()
  19319. },
  19320. type: undefined
  19321. })
  19322. }
  19323. // 13. Let body be a body whose stream is stream, source is source,
  19324. // and length is length.
  19325. const body = { stream, source, length }
  19326. // 14. Return (body, type).
  19327. return [body, type]
  19328. }
  19329. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19330. function safelyExtractBody (object, keepalive = false) {
  19331. if (!ReadableStream) {
  19332. // istanbul ignore next
  19333. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19334. }
  19335. // To safely extract a body and a `Content-Type` value from
  19336. // a byte sequence or BodyInit object object, run these steps:
  19337. // 1. If object is a ReadableStream object, then:
  19338. if (object instanceof ReadableStream) {
  19339. // Assert: object is neither disturbed nor locked.
  19340. // istanbul ignore next
  19341. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19342. // istanbul ignore next
  19343. assert(!object.locked, 'The stream is locked.')
  19344. }
  19345. // 2. Return the results of extracting object.
  19346. return extractBody(object, keepalive)
  19347. }
  19348. function cloneBody (body) {
  19349. // To clone a body body, run these steps:
  19350. // https://fetch.spec.whatwg.org/#concept-body-clone
  19351. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19352. const [out1, out2] = body.stream.tee()
  19353. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19354. // This, for whatever reasons, unrefs out2Clone which allows
  19355. // the process to exit by itself.
  19356. const [, finalClone] = out2Clone.tee()
  19357. // 2. Set body’s stream to out1.
  19358. body.stream = out1
  19359. // 3. Return a body whose stream is out2 and other members are copied from body.
  19360. return {
  19361. stream: finalClone,
  19362. length: body.length,
  19363. source: body.source
  19364. }
  19365. }
  19366. async function * consumeBody (body) {
  19367. if (body) {
  19368. if (isUint8Array(body)) {
  19369. yield body
  19370. } else {
  19371. const stream = body.stream
  19372. if (util.isDisturbed(stream)) {
  19373. throw new TypeError('The body has already been consumed.')
  19374. }
  19375. if (stream.locked) {
  19376. throw new TypeError('The stream is locked.')
  19377. }
  19378. // Compat.
  19379. stream[kBodyUsed] = true
  19380. yield * stream
  19381. }
  19382. }
  19383. }
  19384. function throwIfAborted (state) {
  19385. if (state.aborted) {
  19386. throw new DOMException('The operation was aborted.', 'AbortError')
  19387. }
  19388. }
  19389. function bodyMixinMethods (instance) {
  19390. const methods = {
  19391. blob () {
  19392. // The blob() method steps are to return the result of
  19393. // running consume body with this and the following step
  19394. // given a byte sequence bytes: return a Blob whose
  19395. // contents are bytes and whose type attribute is this’s
  19396. // MIME type.
  19397. return specConsumeBody(this, (bytes) => {
  19398. let mimeType = bodyMimeType(this)
  19399. if (mimeType === 'failure') {
  19400. mimeType = ''
  19401. } else if (mimeType) {
  19402. mimeType = serializeAMimeType(mimeType)
  19403. }
  19404. // Return a Blob whose contents are bytes and type attribute
  19405. // is mimeType.
  19406. return new Blob([bytes], { type: mimeType })
  19407. }, instance)
  19408. },
  19409. arrayBuffer () {
  19410. // The arrayBuffer() method steps are to return the result
  19411. // of running consume body with this and the following step
  19412. // given a byte sequence bytes: return a new ArrayBuffer
  19413. // whose contents are bytes.
  19414. return specConsumeBody(this, (bytes) => {
  19415. return new Uint8Array(bytes).buffer
  19416. }, instance)
  19417. },
  19418. text () {
  19419. // The text() method steps are to return the result of running
  19420. // consume body with this and UTF-8 decode.
  19421. return specConsumeBody(this, utf8DecodeBytes, instance)
  19422. },
  19423. json () {
  19424. // The json() method steps are to return the result of running
  19425. // consume body with this and parse JSON from bytes.
  19426. return specConsumeBody(this, parseJSONFromBytes, instance)
  19427. },
  19428. async formData () {
  19429. webidl.brandCheck(this, instance)
  19430. throwIfAborted(this[kState])
  19431. const contentType = this.headers.get('Content-Type')
  19432. // If mimeType’s essence is "multipart/form-data", then:
  19433. if (/multipart\/form-data/.test(contentType)) {
  19434. const headers = {}
  19435. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19436. const responseFormData = new FormData()
  19437. let busboy
  19438. try {
  19439. busboy = new Busboy({
  19440. headers,
  19441. preservePath: true
  19442. })
  19443. } catch (err) {
  19444. throw new DOMException(`${err}`, 'AbortError')
  19445. }
  19446. busboy.on('field', (name, value) => {
  19447. responseFormData.append(name, value)
  19448. })
  19449. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19450. const chunks = []
  19451. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19452. let base64chunk = ''
  19453. value.on('data', (chunk) => {
  19454. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19455. const end = base64chunk.length - base64chunk.length % 4
  19456. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19457. base64chunk = base64chunk.slice(end)
  19458. })
  19459. value.on('end', () => {
  19460. chunks.push(Buffer.from(base64chunk, 'base64'))
  19461. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19462. })
  19463. } else {
  19464. value.on('data', (chunk) => {
  19465. chunks.push(chunk)
  19466. })
  19467. value.on('end', () => {
  19468. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19469. })
  19470. }
  19471. })
  19472. const busboyResolve = new Promise((resolve, reject) => {
  19473. busboy.on('finish', resolve)
  19474. busboy.on('error', (err) => reject(new TypeError(err)))
  19475. })
  19476. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19477. busboy.end()
  19478. await busboyResolve
  19479. return responseFormData
  19480. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19481. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19482. // 1. Let entries be the result of parsing bytes.
  19483. let entries
  19484. try {
  19485. let text = ''
  19486. // application/x-www-form-urlencoded parser will keep the BOM.
  19487. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19488. // Note that streaming decoder is stateful and cannot be reused
  19489. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19490. for await (const chunk of consumeBody(this[kState].body)) {
  19491. if (!isUint8Array(chunk)) {
  19492. throw new TypeError('Expected Uint8Array chunk')
  19493. }
  19494. text += streamingDecoder.decode(chunk, { stream: true })
  19495. }
  19496. text += streamingDecoder.decode()
  19497. entries = new URLSearchParams(text)
  19498. } catch (err) {
  19499. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19500. // 2. If entries is failure, then throw a TypeError.
  19501. throw Object.assign(new TypeError(), { cause: err })
  19502. }
  19503. // 3. Return a new FormData object whose entries are entries.
  19504. const formData = new FormData()
  19505. for (const [name, value] of entries) {
  19506. formData.append(name, value)
  19507. }
  19508. return formData
  19509. } else {
  19510. // Wait a tick before checking if the request has been aborted.
  19511. // Otherwise, a TypeError can be thrown when an AbortError should.
  19512. await Promise.resolve()
  19513. throwIfAborted(this[kState])
  19514. // Otherwise, throw a TypeError.
  19515. throw webidl.errors.exception({
  19516. header: `${instance.name}.formData`,
  19517. message: 'Could not parse content as FormData.'
  19518. })
  19519. }
  19520. }
  19521. }
  19522. return methods
  19523. }
  19524. function mixinBody (prototype) {
  19525. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19526. }
  19527. /**
  19528. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19529. * @param {Response|Request} object
  19530. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19531. * @param {Response|Request} instance
  19532. */
  19533. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19534. webidl.brandCheck(object, instance)
  19535. throwIfAborted(object[kState])
  19536. // 1. If object is unusable, then return a promise rejected
  19537. // with a TypeError.
  19538. if (bodyUnusable(object[kState].body)) {
  19539. throw new TypeError('Body is unusable')
  19540. }
  19541. // 2. Let promise be a new promise.
  19542. const promise = createDeferredPromise()
  19543. // 3. Let errorSteps given error be to reject promise with error.
  19544. const errorSteps = (error) => promise.reject(error)
  19545. // 4. Let successSteps given a byte sequence data be to resolve
  19546. // promise with the result of running convertBytesToJSValue
  19547. // with data. If that threw an exception, then run errorSteps
  19548. // with that exception.
  19549. const successSteps = (data) => {
  19550. try {
  19551. promise.resolve(convertBytesToJSValue(data))
  19552. } catch (e) {
  19553. errorSteps(e)
  19554. }
  19555. }
  19556. // 5. If object’s body is null, then run successSteps with an
  19557. // empty byte sequence.
  19558. if (object[kState].body == null) {
  19559. successSteps(new Uint8Array())
  19560. return promise.promise
  19561. }
  19562. // 6. Otherwise, fully read object’s body given successSteps,
  19563. // errorSteps, and object’s relevant global object.
  19564. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19565. // 7. Return promise.
  19566. return promise.promise
  19567. }
  19568. // https://fetch.spec.whatwg.org/#body-unusable
  19569. function bodyUnusable (body) {
  19570. // An object including the Body interface mixin is
  19571. // said to be unusable if its body is non-null and
  19572. // its body’s stream is disturbed or locked.
  19573. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19574. }
  19575. /**
  19576. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19577. * @param {Buffer} buffer
  19578. */
  19579. function utf8DecodeBytes (buffer) {
  19580. if (buffer.length === 0) {
  19581. return ''
  19582. }
  19583. // 1. Let buffer be the result of peeking three bytes from
  19584. // ioQueue, converted to a byte sequence.
  19585. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19586. // bytes from ioQueue. (Do nothing with those bytes.)
  19587. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19588. buffer = buffer.subarray(3)
  19589. }
  19590. // 3. Process a queue with an instance of UTF-8’s
  19591. // decoder, ioQueue, output, and "replacement".
  19592. const output = textDecoder.decode(buffer)
  19593. // 4. Return output.
  19594. return output
  19595. }
  19596. /**
  19597. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19598. * @param {Uint8Array} bytes
  19599. */
  19600. function parseJSONFromBytes (bytes) {
  19601. return JSON.parse(utf8DecodeBytes(bytes))
  19602. }
  19603. /**
  19604. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19605. * @param {import('./response').Response|import('./request').Request} object
  19606. */
  19607. function bodyMimeType (object) {
  19608. const { headersList } = object[kState]
  19609. const contentType = headersList.get('content-type')
  19610. if (contentType === null) {
  19611. return 'failure'
  19612. }
  19613. return parseMIMEType(contentType)
  19614. }
  19615. module.exports = {
  19616. extractBody,
  19617. safelyExtractBody,
  19618. cloneBody,
  19619. mixinBody
  19620. }
  19621. /***/ }),
  19622. /***/ 1037:
  19623. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19624. "use strict";
  19625. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19626. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19627. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19628. const nullBodyStatus = [101, 204, 205, 304]
  19629. const redirectStatus = [301, 302, 303, 307, 308]
  19630. const redirectStatusSet = new Set(redirectStatus)
  19631. // https://fetch.spec.whatwg.org/#block-bad-port
  19632. const badPorts = [
  19633. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19634. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19635. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19636. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19637. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19638. '10080'
  19639. ]
  19640. const badPortsSet = new Set(badPorts)
  19641. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19642. const referrerPolicy = [
  19643. '',
  19644. 'no-referrer',
  19645. 'no-referrer-when-downgrade',
  19646. 'same-origin',
  19647. 'origin',
  19648. 'strict-origin',
  19649. 'origin-when-cross-origin',
  19650. 'strict-origin-when-cross-origin',
  19651. 'unsafe-url'
  19652. ]
  19653. const referrerPolicySet = new Set(referrerPolicy)
  19654. const requestRedirect = ['follow', 'manual', 'error']
  19655. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19656. const safeMethodsSet = new Set(safeMethods)
  19657. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19658. const requestCredentials = ['omit', 'same-origin', 'include']
  19659. const requestCache = [
  19660. 'default',
  19661. 'no-store',
  19662. 'reload',
  19663. 'no-cache',
  19664. 'force-cache',
  19665. 'only-if-cached'
  19666. ]
  19667. // https://fetch.spec.whatwg.org/#request-body-header-name
  19668. const requestBodyHeader = [
  19669. 'content-encoding',
  19670. 'content-language',
  19671. 'content-location',
  19672. 'content-type',
  19673. // See https://github.com/nodejs/undici/issues/2021
  19674. // 'Content-Length' is a forbidden header name, which is typically
  19675. // removed in the Headers implementation. However, undici doesn't
  19676. // filter out headers, so we add it here.
  19677. 'content-length'
  19678. ]
  19679. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19680. const requestDuplex = [
  19681. 'half'
  19682. ]
  19683. // http://fetch.spec.whatwg.org/#forbidden-method
  19684. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19685. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19686. const subresource = [
  19687. 'audio',
  19688. 'audioworklet',
  19689. 'font',
  19690. 'image',
  19691. 'manifest',
  19692. 'paintworklet',
  19693. 'script',
  19694. 'style',
  19695. 'track',
  19696. 'video',
  19697. 'xslt',
  19698. ''
  19699. ]
  19700. const subresourceSet = new Set(subresource)
  19701. /** @type {globalThis['DOMException']} */
  19702. const DOMException = globalThis.DOMException ?? (() => {
  19703. // DOMException was only made a global in Node v17.0.0,
  19704. // but fetch supports >= v16.8.
  19705. try {
  19706. atob('~')
  19707. } catch (err) {
  19708. return Object.getPrototypeOf(err).constructor
  19709. }
  19710. })()
  19711. let channel
  19712. /** @type {globalThis['structuredClone']} */
  19713. const structuredClone =
  19714. globalThis.structuredClone ??
  19715. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19716. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19717. function structuredClone (value, options = undefined) {
  19718. if (arguments.length === 0) {
  19719. throw new TypeError('missing argument')
  19720. }
  19721. if (!channel) {
  19722. channel = new MessageChannel()
  19723. }
  19724. channel.port1.unref()
  19725. channel.port2.unref()
  19726. channel.port1.postMessage(value, options?.transfer)
  19727. return receiveMessageOnPort(channel.port2).message
  19728. }
  19729. module.exports = {
  19730. DOMException,
  19731. structuredClone,
  19732. subresource,
  19733. forbiddenMethods,
  19734. requestBodyHeader,
  19735. referrerPolicy,
  19736. requestRedirect,
  19737. requestMode,
  19738. requestCredentials,
  19739. requestCache,
  19740. redirectStatus,
  19741. corsSafeListedMethods,
  19742. nullBodyStatus,
  19743. safeMethods,
  19744. badPorts,
  19745. requestDuplex,
  19746. subresourceSet,
  19747. badPortsSet,
  19748. redirectStatusSet,
  19749. corsSafeListedMethodsSet,
  19750. safeMethodsSet,
  19751. forbiddenMethodsSet,
  19752. referrerPolicySet
  19753. }
  19754. /***/ }),
  19755. /***/ 685:
  19756. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19757. const assert = __nccwpck_require__(9491)
  19758. const { atob } = __nccwpck_require__(4300)
  19759. const { isomorphicDecode } = __nccwpck_require__(2538)
  19760. const encoder = new TextEncoder()
  19761. /**
  19762. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  19763. */
  19764. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  19765. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  19766. /**
  19767. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  19768. */
  19769. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  19770. // https://fetch.spec.whatwg.org/#data-url-processor
  19771. /** @param {URL} dataURL */
  19772. function dataURLProcessor (dataURL) {
  19773. // 1. Assert: dataURL’s scheme is "data".
  19774. assert(dataURL.protocol === 'data:')
  19775. // 2. Let input be the result of running the URL
  19776. // serializer on dataURL with exclude fragment
  19777. // set to true.
  19778. let input = URLSerializer(dataURL, true)
  19779. // 3. Remove the leading "data:" string from input.
  19780. input = input.slice(5)
  19781. // 4. Let position point at the start of input.
  19782. const position = { position: 0 }
  19783. // 5. Let mimeType be the result of collecting a
  19784. // sequence of code points that are not equal
  19785. // to U+002C (,), given position.
  19786. let mimeType = collectASequenceOfCodePointsFast(
  19787. ',',
  19788. input,
  19789. position
  19790. )
  19791. // 6. Strip leading and trailing ASCII whitespace
  19792. // from mimeType.
  19793. // Undici implementation note: we need to store the
  19794. // length because if the mimetype has spaces removed,
  19795. // the wrong amount will be sliced from the input in
  19796. // step #9
  19797. const mimeTypeLength = mimeType.length
  19798. mimeType = removeASCIIWhitespace(mimeType, true, true)
  19799. // 7. If position is past the end of input, then
  19800. // return failure
  19801. if (position.position >= input.length) {
  19802. return 'failure'
  19803. }
  19804. // 8. Advance position by 1.
  19805. position.position++
  19806. // 9. Let encodedBody be the remainder of input.
  19807. const encodedBody = input.slice(mimeTypeLength + 1)
  19808. // 10. Let body be the percent-decoding of encodedBody.
  19809. let body = stringPercentDecode(encodedBody)
  19810. // 11. If mimeType ends with U+003B (;), followed by
  19811. // zero or more U+0020 SPACE, followed by an ASCII
  19812. // case-insensitive match for "base64", then:
  19813. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  19814. // 1. Let stringBody be the isomorphic decode of body.
  19815. const stringBody = isomorphicDecode(body)
  19816. // 2. Set body to the forgiving-base64 decode of
  19817. // stringBody.
  19818. body = forgivingBase64(stringBody)
  19819. // 3. If body is failure, then return failure.
  19820. if (body === 'failure') {
  19821. return 'failure'
  19822. }
  19823. // 4. Remove the last 6 code points from mimeType.
  19824. mimeType = mimeType.slice(0, -6)
  19825. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  19826. // if any.
  19827. mimeType = mimeType.replace(/(\u0020)+$/, '')
  19828. // 6. Remove the last U+003B (;) code point from mimeType.
  19829. mimeType = mimeType.slice(0, -1)
  19830. }
  19831. // 12. If mimeType starts with U+003B (;), then prepend
  19832. // "text/plain" to mimeType.
  19833. if (mimeType.startsWith(';')) {
  19834. mimeType = 'text/plain' + mimeType
  19835. }
  19836. // 13. Let mimeTypeRecord be the result of parsing
  19837. // mimeType.
  19838. let mimeTypeRecord = parseMIMEType(mimeType)
  19839. // 14. If mimeTypeRecord is failure, then set
  19840. // mimeTypeRecord to text/plain;charset=US-ASCII.
  19841. if (mimeTypeRecord === 'failure') {
  19842. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  19843. }
  19844. // 15. Return a new data: URL struct whose MIME
  19845. // type is mimeTypeRecord and body is body.
  19846. // https://fetch.spec.whatwg.org/#data-url-struct
  19847. return { mimeType: mimeTypeRecord, body }
  19848. }
  19849. // https://url.spec.whatwg.org/#concept-url-serializer
  19850. /**
  19851. * @param {URL} url
  19852. * @param {boolean} excludeFragment
  19853. */
  19854. function URLSerializer (url, excludeFragment = false) {
  19855. if (!excludeFragment) {
  19856. return url.href
  19857. }
  19858. const href = url.href
  19859. const hashLength = url.hash.length
  19860. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  19861. }
  19862. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  19863. /**
  19864. * @param {(char: string) => boolean} condition
  19865. * @param {string} input
  19866. * @param {{ position: number }} position
  19867. */
  19868. function collectASequenceOfCodePoints (condition, input, position) {
  19869. // 1. Let result be the empty string.
  19870. let result = ''
  19871. // 2. While position doesn’t point past the end of input and the
  19872. // code point at position within input meets the condition condition:
  19873. while (position.position < input.length && condition(input[position.position])) {
  19874. // 1. Append that code point to the end of result.
  19875. result += input[position.position]
  19876. // 2. Advance position by 1.
  19877. position.position++
  19878. }
  19879. // 3. Return result.
  19880. return result
  19881. }
  19882. /**
  19883. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  19884. * @param {string} char
  19885. * @param {string} input
  19886. * @param {{ position: number }} position
  19887. */
  19888. function collectASequenceOfCodePointsFast (char, input, position) {
  19889. const idx = input.indexOf(char, position.position)
  19890. const start = position.position
  19891. if (idx === -1) {
  19892. position.position = input.length
  19893. return input.slice(start)
  19894. }
  19895. position.position = idx
  19896. return input.slice(start, position.position)
  19897. }
  19898. // https://url.spec.whatwg.org/#string-percent-decode
  19899. /** @param {string} input */
  19900. function stringPercentDecode (input) {
  19901. // 1. Let bytes be the UTF-8 encoding of input.
  19902. const bytes = encoder.encode(input)
  19903. // 2. Return the percent-decoding of bytes.
  19904. return percentDecode(bytes)
  19905. }
  19906. // https://url.spec.whatwg.org/#percent-decode
  19907. /** @param {Uint8Array} input */
  19908. function percentDecode (input) {
  19909. // 1. Let output be an empty byte sequence.
  19910. /** @type {number[]} */
  19911. const output = []
  19912. // 2. For each byte byte in input:
  19913. for (let i = 0; i < input.length; i++) {
  19914. const byte = input[i]
  19915. // 1. If byte is not 0x25 (%), then append byte to output.
  19916. if (byte !== 0x25) {
  19917. output.push(byte)
  19918. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  19919. // after byte in input are not in the ranges
  19920. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  19921. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  19922. // to output.
  19923. } else if (
  19924. byte === 0x25 &&
  19925. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  19926. ) {
  19927. output.push(0x25)
  19928. // 3. Otherwise:
  19929. } else {
  19930. // 1. Let bytePoint be the two bytes after byte in input,
  19931. // decoded, and then interpreted as hexadecimal number.
  19932. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  19933. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  19934. // 2. Append a byte whose value is bytePoint to output.
  19935. output.push(bytePoint)
  19936. // 3. Skip the next two bytes in input.
  19937. i += 2
  19938. }
  19939. }
  19940. // 3. Return output.
  19941. return Uint8Array.from(output)
  19942. }
  19943. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  19944. /** @param {string} input */
  19945. function parseMIMEType (input) {
  19946. // 1. Remove any leading and trailing HTTP whitespace
  19947. // from input.
  19948. input = removeHTTPWhitespace(input, true, true)
  19949. // 2. Let position be a position variable for input,
  19950. // initially pointing at the start of input.
  19951. const position = { position: 0 }
  19952. // 3. Let type be the result of collecting a sequence
  19953. // of code points that are not U+002F (/) from
  19954. // input, given position.
  19955. const type = collectASequenceOfCodePointsFast(
  19956. '/',
  19957. input,
  19958. position
  19959. )
  19960. // 4. If type is the empty string or does not solely
  19961. // contain HTTP token code points, then return failure.
  19962. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  19963. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  19964. return 'failure'
  19965. }
  19966. // 5. If position is past the end of input, then return
  19967. // failure
  19968. if (position.position > input.length) {
  19969. return 'failure'
  19970. }
  19971. // 6. Advance position by 1. (This skips past U+002F (/).)
  19972. position.position++
  19973. // 7. Let subtype be the result of collecting a sequence of
  19974. // code points that are not U+003B (;) from input, given
  19975. // position.
  19976. let subtype = collectASequenceOfCodePointsFast(
  19977. ';',
  19978. input,
  19979. position
  19980. )
  19981. // 8. Remove any trailing HTTP whitespace from subtype.
  19982. subtype = removeHTTPWhitespace(subtype, false, true)
  19983. // 9. If subtype is the empty string or does not solely
  19984. // contain HTTP token code points, then return failure.
  19985. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  19986. return 'failure'
  19987. }
  19988. const typeLowercase = type.toLowerCase()
  19989. const subtypeLowercase = subtype.toLowerCase()
  19990. // 10. Let mimeType be a new MIME type record whose type
  19991. // is type, in ASCII lowercase, and subtype is subtype,
  19992. // in ASCII lowercase.
  19993. // https://mimesniff.spec.whatwg.org/#mime-type
  19994. const mimeType = {
  19995. type: typeLowercase,
  19996. subtype: subtypeLowercase,
  19997. /** @type {Map<string, string>} */
  19998. parameters: new Map(),
  19999. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20000. essence: `${typeLowercase}/${subtypeLowercase}`
  20001. }
  20002. // 11. While position is not past the end of input:
  20003. while (position.position < input.length) {
  20004. // 1. Advance position by 1. (This skips past U+003B (;).)
  20005. position.position++
  20006. // 2. Collect a sequence of code points that are HTTP
  20007. // whitespace from input given position.
  20008. collectASequenceOfCodePoints(
  20009. // https://fetch.spec.whatwg.org/#http-whitespace
  20010. char => HTTP_WHITESPACE_REGEX.test(char),
  20011. input,
  20012. position
  20013. )
  20014. // 3. Let parameterName be the result of collecting a
  20015. // sequence of code points that are not U+003B (;)
  20016. // or U+003D (=) from input, given position.
  20017. let parameterName = collectASequenceOfCodePoints(
  20018. (char) => char !== ';' && char !== '=',
  20019. input,
  20020. position
  20021. )
  20022. // 4. Set parameterName to parameterName, in ASCII
  20023. // lowercase.
  20024. parameterName = parameterName.toLowerCase()
  20025. // 5. If position is not past the end of input, then:
  20026. if (position.position < input.length) {
  20027. // 1. If the code point at position within input is
  20028. // U+003B (;), then continue.
  20029. if (input[position.position] === ';') {
  20030. continue
  20031. }
  20032. // 2. Advance position by 1. (This skips past U+003D (=).)
  20033. position.position++
  20034. }
  20035. // 6. If position is past the end of input, then break.
  20036. if (position.position > input.length) {
  20037. break
  20038. }
  20039. // 7. Let parameterValue be null.
  20040. let parameterValue = null
  20041. // 8. If the code point at position within input is
  20042. // U+0022 ("), then:
  20043. if (input[position.position] === '"') {
  20044. // 1. Set parameterValue to the result of collecting
  20045. // an HTTP quoted string from input, given position
  20046. // and the extract-value flag.
  20047. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20048. // 2. Collect a sequence of code points that are not
  20049. // U+003B (;) from input, given position.
  20050. collectASequenceOfCodePointsFast(
  20051. ';',
  20052. input,
  20053. position
  20054. )
  20055. // 9. Otherwise:
  20056. } else {
  20057. // 1. Set parameterValue to the result of collecting
  20058. // a sequence of code points that are not U+003B (;)
  20059. // from input, given position.
  20060. parameterValue = collectASequenceOfCodePointsFast(
  20061. ';',
  20062. input,
  20063. position
  20064. )
  20065. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20066. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20067. // 3. If parameterValue is the empty string, then continue.
  20068. if (parameterValue.length === 0) {
  20069. continue
  20070. }
  20071. }
  20072. // 10. If all of the following are true
  20073. // - parameterName is not the empty string
  20074. // - parameterName solely contains HTTP token code points
  20075. // - parameterValue solely contains HTTP quoted-string token code points
  20076. // - mimeType’s parameters[parameterName] does not exist
  20077. // then set mimeType’s parameters[parameterName] to parameterValue.
  20078. if (
  20079. parameterName.length !== 0 &&
  20080. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20081. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20082. !mimeType.parameters.has(parameterName)
  20083. ) {
  20084. mimeType.parameters.set(parameterName, parameterValue)
  20085. }
  20086. }
  20087. // 12. Return mimeType.
  20088. return mimeType
  20089. }
  20090. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20091. /** @param {string} data */
  20092. function forgivingBase64 (data) {
  20093. // 1. Remove all ASCII whitespace from data.
  20094. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20095. // 2. If data’s code point length divides by 4 leaving
  20096. // no remainder, then:
  20097. if (data.length % 4 === 0) {
  20098. // 1. If data ends with one or two U+003D (=) code points,
  20099. // then remove them from data.
  20100. data = data.replace(/=?=$/, '')
  20101. }
  20102. // 3. If data’s code point length divides by 4 leaving
  20103. // a remainder of 1, then return failure.
  20104. if (data.length % 4 === 1) {
  20105. return 'failure'
  20106. }
  20107. // 4. If data contains a code point that is not one of
  20108. // U+002B (+)
  20109. // U+002F (/)
  20110. // ASCII alphanumeric
  20111. // then return failure.
  20112. if (/[^+/0-9A-Za-z]/.test(data)) {
  20113. return 'failure'
  20114. }
  20115. const binary = atob(data)
  20116. const bytes = new Uint8Array(binary.length)
  20117. for (let byte = 0; byte < binary.length; byte++) {
  20118. bytes[byte] = binary.charCodeAt(byte)
  20119. }
  20120. return bytes
  20121. }
  20122. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20123. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20124. /**
  20125. * @param {string} input
  20126. * @param {{ position: number }} position
  20127. * @param {boolean?} extractValue
  20128. */
  20129. function collectAnHTTPQuotedString (input, position, extractValue) {
  20130. // 1. Let positionStart be position.
  20131. const positionStart = position.position
  20132. // 2. Let value be the empty string.
  20133. let value = ''
  20134. // 3. Assert: the code point at position within input
  20135. // is U+0022 (").
  20136. assert(input[position.position] === '"')
  20137. // 4. Advance position by 1.
  20138. position.position++
  20139. // 5. While true:
  20140. while (true) {
  20141. // 1. Append the result of collecting a sequence of code points
  20142. // that are not U+0022 (") or U+005C (\) from input, given
  20143. // position, to value.
  20144. value += collectASequenceOfCodePoints(
  20145. (char) => char !== '"' && char !== '\\',
  20146. input,
  20147. position
  20148. )
  20149. // 2. If position is past the end of input, then break.
  20150. if (position.position >= input.length) {
  20151. break
  20152. }
  20153. // 3. Let quoteOrBackslash be the code point at position within
  20154. // input.
  20155. const quoteOrBackslash = input[position.position]
  20156. // 4. Advance position by 1.
  20157. position.position++
  20158. // 5. If quoteOrBackslash is U+005C (\), then:
  20159. if (quoteOrBackslash === '\\') {
  20160. // 1. If position is past the end of input, then append
  20161. // U+005C (\) to value and break.
  20162. if (position.position >= input.length) {
  20163. value += '\\'
  20164. break
  20165. }
  20166. // 2. Append the code point at position within input to value.
  20167. value += input[position.position]
  20168. // 3. Advance position by 1.
  20169. position.position++
  20170. // 6. Otherwise:
  20171. } else {
  20172. // 1. Assert: quoteOrBackslash is U+0022 (").
  20173. assert(quoteOrBackslash === '"')
  20174. // 2. Break.
  20175. break
  20176. }
  20177. }
  20178. // 6. If the extract-value flag is set, then return value.
  20179. if (extractValue) {
  20180. return value
  20181. }
  20182. // 7. Return the code points from positionStart to position,
  20183. // inclusive, within input.
  20184. return input.slice(positionStart, position.position)
  20185. }
  20186. /**
  20187. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20188. */
  20189. function serializeAMimeType (mimeType) {
  20190. assert(mimeType !== 'failure')
  20191. const { parameters, essence } = mimeType
  20192. // 1. Let serialization be the concatenation of mimeType’s
  20193. // type, U+002F (/), and mimeType’s subtype.
  20194. let serialization = essence
  20195. // 2. For each name → value of mimeType’s parameters:
  20196. for (let [name, value] of parameters.entries()) {
  20197. // 1. Append U+003B (;) to serialization.
  20198. serialization += ';'
  20199. // 2. Append name to serialization.
  20200. serialization += name
  20201. // 3. Append U+003D (=) to serialization.
  20202. serialization += '='
  20203. // 4. If value does not solely contain HTTP token code
  20204. // points or value is the empty string, then:
  20205. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20206. // 1. Precede each occurence of U+0022 (") or
  20207. // U+005C (\) in value with U+005C (\).
  20208. value = value.replace(/(\\|")/g, '\\$1')
  20209. // 2. Prepend U+0022 (") to value.
  20210. value = '"' + value
  20211. // 3. Append U+0022 (") to value.
  20212. value += '"'
  20213. }
  20214. // 5. Append value to serialization.
  20215. serialization += value
  20216. }
  20217. // 3. Return serialization.
  20218. return serialization
  20219. }
  20220. /**
  20221. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20222. * @param {string} char
  20223. */
  20224. function isHTTPWhiteSpace (char) {
  20225. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20226. }
  20227. /**
  20228. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20229. * @param {string} str
  20230. */
  20231. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20232. let lead = 0
  20233. let trail = str.length - 1
  20234. if (leading) {
  20235. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20236. }
  20237. if (trailing) {
  20238. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20239. }
  20240. return str.slice(lead, trail + 1)
  20241. }
  20242. /**
  20243. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20244. * @param {string} char
  20245. */
  20246. function isASCIIWhitespace (char) {
  20247. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20248. }
  20249. /**
  20250. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20251. */
  20252. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20253. let lead = 0
  20254. let trail = str.length - 1
  20255. if (leading) {
  20256. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20257. }
  20258. if (trailing) {
  20259. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20260. }
  20261. return str.slice(lead, trail + 1)
  20262. }
  20263. module.exports = {
  20264. dataURLProcessor,
  20265. URLSerializer,
  20266. collectASequenceOfCodePoints,
  20267. collectASequenceOfCodePointsFast,
  20268. stringPercentDecode,
  20269. parseMIMEType,
  20270. collectAnHTTPQuotedString,
  20271. serializeAMimeType
  20272. }
  20273. /***/ }),
  20274. /***/ 8511:
  20275. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20276. "use strict";
  20277. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20278. const { types } = __nccwpck_require__(3837)
  20279. const { kState } = __nccwpck_require__(5861)
  20280. const { isBlobLike } = __nccwpck_require__(2538)
  20281. const { webidl } = __nccwpck_require__(1744)
  20282. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20283. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20284. const encoder = new TextEncoder()
  20285. class File extends Blob {
  20286. constructor (fileBits, fileName, options = {}) {
  20287. // The File constructor is invoked with two or three parameters, depending
  20288. // on whether the optional dictionary parameter is used. When the File()
  20289. // constructor is invoked, user agents must run the following steps:
  20290. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20291. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20292. fileName = webidl.converters.USVString(fileName)
  20293. options = webidl.converters.FilePropertyBag(options)
  20294. // 1. Let bytes be the result of processing blob parts given fileBits and
  20295. // options.
  20296. // Note: Blob handles this for us
  20297. // 2. Let n be the fileName argument to the constructor.
  20298. const n = fileName
  20299. // 3. Process FilePropertyBag dictionary argument by running the following
  20300. // substeps:
  20301. // 1. If the type member is provided and is not the empty string, let t
  20302. // be set to the type dictionary member. If t contains any characters
  20303. // outside the range U+0020 to U+007E, then set t to the empty string
  20304. // and return from these substeps.
  20305. // 2. Convert every character in t to ASCII lowercase.
  20306. let t = options.type
  20307. let d
  20308. // eslint-disable-next-line no-labels
  20309. substep: {
  20310. if (t) {
  20311. t = parseMIMEType(t)
  20312. if (t === 'failure') {
  20313. t = ''
  20314. // eslint-disable-next-line no-labels
  20315. break substep
  20316. }
  20317. t = serializeAMimeType(t).toLowerCase()
  20318. }
  20319. // 3. If the lastModified member is provided, let d be set to the
  20320. // lastModified dictionary member. If it is not provided, set d to the
  20321. // current date and time represented as the number of milliseconds since
  20322. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20323. d = options.lastModified
  20324. }
  20325. // 4. Return a new File object F such that:
  20326. // F refers to the bytes byte sequence.
  20327. // F.size is set to the number of total bytes in bytes.
  20328. // F.name is set to n.
  20329. // F.type is set to t.
  20330. // F.lastModified is set to d.
  20331. super(processBlobParts(fileBits, options), { type: t })
  20332. this[kState] = {
  20333. name: n,
  20334. lastModified: d,
  20335. type: t
  20336. }
  20337. }
  20338. get name () {
  20339. webidl.brandCheck(this, File)
  20340. return this[kState].name
  20341. }
  20342. get lastModified () {
  20343. webidl.brandCheck(this, File)
  20344. return this[kState].lastModified
  20345. }
  20346. get type () {
  20347. webidl.brandCheck(this, File)
  20348. return this[kState].type
  20349. }
  20350. }
  20351. class FileLike {
  20352. constructor (blobLike, fileName, options = {}) {
  20353. // TODO: argument idl type check
  20354. // The File constructor is invoked with two or three parameters, depending
  20355. // on whether the optional dictionary parameter is used. When the File()
  20356. // constructor is invoked, user agents must run the following steps:
  20357. // 1. Let bytes be the result of processing blob parts given fileBits and
  20358. // options.
  20359. // 2. Let n be the fileName argument to the constructor.
  20360. const n = fileName
  20361. // 3. Process FilePropertyBag dictionary argument by running the following
  20362. // substeps:
  20363. // 1. If the type member is provided and is not the empty string, let t
  20364. // be set to the type dictionary member. If t contains any characters
  20365. // outside the range U+0020 to U+007E, then set t to the empty string
  20366. // and return from these substeps.
  20367. // TODO
  20368. const t = options.type
  20369. // 2. Convert every character in t to ASCII lowercase.
  20370. // TODO
  20371. // 3. If the lastModified member is provided, let d be set to the
  20372. // lastModified dictionary member. If it is not provided, set d to the
  20373. // current date and time represented as the number of milliseconds since
  20374. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20375. const d = options.lastModified ?? Date.now()
  20376. // 4. Return a new File object F such that:
  20377. // F refers to the bytes byte sequence.
  20378. // F.size is set to the number of total bytes in bytes.
  20379. // F.name is set to n.
  20380. // F.type is set to t.
  20381. // F.lastModified is set to d.
  20382. this[kState] = {
  20383. blobLike,
  20384. name: n,
  20385. type: t,
  20386. lastModified: d
  20387. }
  20388. }
  20389. stream (...args) {
  20390. webidl.brandCheck(this, FileLike)
  20391. return this[kState].blobLike.stream(...args)
  20392. }
  20393. arrayBuffer (...args) {
  20394. webidl.brandCheck(this, FileLike)
  20395. return this[kState].blobLike.arrayBuffer(...args)
  20396. }
  20397. slice (...args) {
  20398. webidl.brandCheck(this, FileLike)
  20399. return this[kState].blobLike.slice(...args)
  20400. }
  20401. text (...args) {
  20402. webidl.brandCheck(this, FileLike)
  20403. return this[kState].blobLike.text(...args)
  20404. }
  20405. get size () {
  20406. webidl.brandCheck(this, FileLike)
  20407. return this[kState].blobLike.size
  20408. }
  20409. get type () {
  20410. webidl.brandCheck(this, FileLike)
  20411. return this[kState].blobLike.type
  20412. }
  20413. get name () {
  20414. webidl.brandCheck(this, FileLike)
  20415. return this[kState].name
  20416. }
  20417. get lastModified () {
  20418. webidl.brandCheck(this, FileLike)
  20419. return this[kState].lastModified
  20420. }
  20421. get [Symbol.toStringTag] () {
  20422. return 'File'
  20423. }
  20424. }
  20425. Object.defineProperties(File.prototype, {
  20426. [Symbol.toStringTag]: {
  20427. value: 'File',
  20428. configurable: true
  20429. },
  20430. name: kEnumerableProperty,
  20431. lastModified: kEnumerableProperty
  20432. })
  20433. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20434. webidl.converters.BlobPart = function (V, opts) {
  20435. if (webidl.util.Type(V) === 'Object') {
  20436. if (isBlobLike(V)) {
  20437. return webidl.converters.Blob(V, { strict: false })
  20438. }
  20439. if (
  20440. ArrayBuffer.isView(V) ||
  20441. types.isAnyArrayBuffer(V)
  20442. ) {
  20443. return webidl.converters.BufferSource(V, opts)
  20444. }
  20445. }
  20446. return webidl.converters.USVString(V, opts)
  20447. }
  20448. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20449. webidl.converters.BlobPart
  20450. )
  20451. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20452. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20453. {
  20454. key: 'lastModified',
  20455. converter: webidl.converters['long long'],
  20456. get defaultValue () {
  20457. return Date.now()
  20458. }
  20459. },
  20460. {
  20461. key: 'type',
  20462. converter: webidl.converters.DOMString,
  20463. defaultValue: ''
  20464. },
  20465. {
  20466. key: 'endings',
  20467. converter: (value) => {
  20468. value = webidl.converters.DOMString(value)
  20469. value = value.toLowerCase()
  20470. if (value !== 'native') {
  20471. value = 'transparent'
  20472. }
  20473. return value
  20474. },
  20475. defaultValue: 'transparent'
  20476. }
  20477. ])
  20478. /**
  20479. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20480. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20481. * @param {{ type: string, endings: string }} options
  20482. */
  20483. function processBlobParts (parts, options) {
  20484. // 1. Let bytes be an empty sequence of bytes.
  20485. /** @type {NodeJS.TypedArray[]} */
  20486. const bytes = []
  20487. // 2. For each element in parts:
  20488. for (const element of parts) {
  20489. // 1. If element is a USVString, run the following substeps:
  20490. if (typeof element === 'string') {
  20491. // 1. Let s be element.
  20492. let s = element
  20493. // 2. If the endings member of options is "native", set s
  20494. // to the result of converting line endings to native
  20495. // of element.
  20496. if (options.endings === 'native') {
  20497. s = convertLineEndingsNative(s)
  20498. }
  20499. // 3. Append the result of UTF-8 encoding s to bytes.
  20500. bytes.push(encoder.encode(s))
  20501. } else if (
  20502. types.isAnyArrayBuffer(element) ||
  20503. types.isTypedArray(element)
  20504. ) {
  20505. // 2. If element is a BufferSource, get a copy of the
  20506. // bytes held by the buffer source, and append those
  20507. // bytes to bytes.
  20508. if (!element.buffer) { // ArrayBuffer
  20509. bytes.push(new Uint8Array(element))
  20510. } else {
  20511. bytes.push(
  20512. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20513. )
  20514. }
  20515. } else if (isBlobLike(element)) {
  20516. // 3. If element is a Blob, append the bytes it represents
  20517. // to bytes.
  20518. bytes.push(element)
  20519. }
  20520. }
  20521. // 3. Return bytes.
  20522. return bytes
  20523. }
  20524. /**
  20525. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20526. * @param {string} s
  20527. */
  20528. function convertLineEndingsNative (s) {
  20529. // 1. Let native line ending be be the code point U+000A LF.
  20530. let nativeLineEnding = '\n'
  20531. // 2. If the underlying platform’s conventions are to
  20532. // represent newlines as a carriage return and line feed
  20533. // sequence, set native line ending to the code point
  20534. // U+000D CR followed by the code point U+000A LF.
  20535. if (process.platform === 'win32') {
  20536. nativeLineEnding = '\r\n'
  20537. }
  20538. return s.replace(/\r?\n/g, nativeLineEnding)
  20539. }
  20540. // If this function is moved to ./util.js, some tools (such as
  20541. // rollup) will warn about circular dependencies. See:
  20542. // https://github.com/nodejs/undici/issues/1629
  20543. function isFileLike (object) {
  20544. return (
  20545. (NativeFile && object instanceof NativeFile) ||
  20546. object instanceof File || (
  20547. object &&
  20548. (typeof object.stream === 'function' ||
  20549. typeof object.arrayBuffer === 'function') &&
  20550. object[Symbol.toStringTag] === 'File'
  20551. )
  20552. )
  20553. }
  20554. module.exports = { File, FileLike, isFileLike }
  20555. /***/ }),
  20556. /***/ 2015:
  20557. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20558. "use strict";
  20559. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20560. const { kState } = __nccwpck_require__(5861)
  20561. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20562. const { webidl } = __nccwpck_require__(1744)
  20563. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20564. /** @type {globalThis['File']} */
  20565. const File = NativeFile ?? UndiciFile
  20566. // https://xhr.spec.whatwg.org/#formdata
  20567. class FormData {
  20568. constructor (form) {
  20569. if (form !== undefined) {
  20570. throw webidl.errors.conversionFailed({
  20571. prefix: 'FormData constructor',
  20572. argument: 'Argument 1',
  20573. types: ['undefined']
  20574. })
  20575. }
  20576. this[kState] = []
  20577. }
  20578. append (name, value, filename = undefined) {
  20579. webidl.brandCheck(this, FormData)
  20580. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20581. if (arguments.length === 3 && !isBlobLike(value)) {
  20582. throw new TypeError(
  20583. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20584. )
  20585. }
  20586. // 1. Let value be value if given; otherwise blobValue.
  20587. name = webidl.converters.USVString(name)
  20588. value = isBlobLike(value)
  20589. ? webidl.converters.Blob(value, { strict: false })
  20590. : webidl.converters.USVString(value)
  20591. filename = arguments.length === 3
  20592. ? webidl.converters.USVString(filename)
  20593. : undefined
  20594. // 2. Let entry be the result of creating an entry with
  20595. // name, value, and filename if given.
  20596. const entry = makeEntry(name, value, filename)
  20597. // 3. Append entry to this’s entry list.
  20598. this[kState].push(entry)
  20599. }
  20600. delete (name) {
  20601. webidl.brandCheck(this, FormData)
  20602. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20603. name = webidl.converters.USVString(name)
  20604. // The delete(name) method steps are to remove all entries whose name
  20605. // is name from this’s entry list.
  20606. this[kState] = this[kState].filter(entry => entry.name !== name)
  20607. }
  20608. get (name) {
  20609. webidl.brandCheck(this, FormData)
  20610. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20611. name = webidl.converters.USVString(name)
  20612. // 1. If there is no entry whose name is name in this’s entry list,
  20613. // then return null.
  20614. const idx = this[kState].findIndex((entry) => entry.name === name)
  20615. if (idx === -1) {
  20616. return null
  20617. }
  20618. // 2. Return the value of the first entry whose name is name from
  20619. // this’s entry list.
  20620. return this[kState][idx].value
  20621. }
  20622. getAll (name) {
  20623. webidl.brandCheck(this, FormData)
  20624. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20625. name = webidl.converters.USVString(name)
  20626. // 1. If there is no entry whose name is name in this’s entry list,
  20627. // then return the empty list.
  20628. // 2. Return the values of all entries whose name is name, in order,
  20629. // from this’s entry list.
  20630. return this[kState]
  20631. .filter((entry) => entry.name === name)
  20632. .map((entry) => entry.value)
  20633. }
  20634. has (name) {
  20635. webidl.brandCheck(this, FormData)
  20636. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20637. name = webidl.converters.USVString(name)
  20638. // The has(name) method steps are to return true if there is an entry
  20639. // whose name is name in this’s entry list; otherwise false.
  20640. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20641. }
  20642. set (name, value, filename = undefined) {
  20643. webidl.brandCheck(this, FormData)
  20644. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20645. if (arguments.length === 3 && !isBlobLike(value)) {
  20646. throw new TypeError(
  20647. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20648. )
  20649. }
  20650. // The set(name, value) and set(name, blobValue, filename) method steps
  20651. // are:
  20652. // 1. Let value be value if given; otherwise blobValue.
  20653. name = webidl.converters.USVString(name)
  20654. value = isBlobLike(value)
  20655. ? webidl.converters.Blob(value, { strict: false })
  20656. : webidl.converters.USVString(value)
  20657. filename = arguments.length === 3
  20658. ? toUSVString(filename)
  20659. : undefined
  20660. // 2. Let entry be the result of creating an entry with name, value, and
  20661. // filename if given.
  20662. const entry = makeEntry(name, value, filename)
  20663. // 3. If there are entries in this’s entry list whose name is name, then
  20664. // replace the first such entry with entry and remove the others.
  20665. const idx = this[kState].findIndex((entry) => entry.name === name)
  20666. if (idx !== -1) {
  20667. this[kState] = [
  20668. ...this[kState].slice(0, idx),
  20669. entry,
  20670. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20671. ]
  20672. } else {
  20673. // 4. Otherwise, append entry to this’s entry list.
  20674. this[kState].push(entry)
  20675. }
  20676. }
  20677. entries () {
  20678. webidl.brandCheck(this, FormData)
  20679. return makeIterator(
  20680. () => this[kState].map(pair => [pair.name, pair.value]),
  20681. 'FormData',
  20682. 'key+value'
  20683. )
  20684. }
  20685. keys () {
  20686. webidl.brandCheck(this, FormData)
  20687. return makeIterator(
  20688. () => this[kState].map(pair => [pair.name, pair.value]),
  20689. 'FormData',
  20690. 'key'
  20691. )
  20692. }
  20693. values () {
  20694. webidl.brandCheck(this, FormData)
  20695. return makeIterator(
  20696. () => this[kState].map(pair => [pair.name, pair.value]),
  20697. 'FormData',
  20698. 'value'
  20699. )
  20700. }
  20701. /**
  20702. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20703. * @param {unknown} thisArg
  20704. */
  20705. forEach (callbackFn, thisArg = globalThis) {
  20706. webidl.brandCheck(this, FormData)
  20707. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20708. if (typeof callbackFn !== 'function') {
  20709. throw new TypeError(
  20710. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20711. )
  20712. }
  20713. for (const [key, value] of this) {
  20714. callbackFn.apply(thisArg, [value, key, this])
  20715. }
  20716. }
  20717. }
  20718. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20719. Object.defineProperties(FormData.prototype, {
  20720. [Symbol.toStringTag]: {
  20721. value: 'FormData',
  20722. configurable: true
  20723. }
  20724. })
  20725. /**
  20726. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  20727. * @param {string} name
  20728. * @param {string|Blob} value
  20729. * @param {?string} filename
  20730. * @returns
  20731. */
  20732. function makeEntry (name, value, filename) {
  20733. // 1. Set name to the result of converting name into a scalar value string.
  20734. // "To convert a string into a scalar value string, replace any surrogates
  20735. // with U+FFFD."
  20736. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  20737. name = Buffer.from(name).toString('utf8')
  20738. // 2. If value is a string, then set value to the result of converting
  20739. // value into a scalar value string.
  20740. if (typeof value === 'string') {
  20741. value = Buffer.from(value).toString('utf8')
  20742. } else {
  20743. // 3. Otherwise:
  20744. // 1. If value is not a File object, then set value to a new File object,
  20745. // representing the same bytes, whose name attribute value is "blob"
  20746. if (!isFileLike(value)) {
  20747. value = value instanceof Blob
  20748. ? new File([value], 'blob', { type: value.type })
  20749. : new FileLike(value, 'blob', { type: value.type })
  20750. }
  20751. // 2. If filename is given, then set value to a new File object,
  20752. // representing the same bytes, whose name attribute is filename.
  20753. if (filename !== undefined) {
  20754. /** @type {FilePropertyBag} */
  20755. const options = {
  20756. type: value.type,
  20757. lastModified: value.lastModified
  20758. }
  20759. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  20760. ? new File([value], filename, options)
  20761. : new FileLike(value, filename, options)
  20762. }
  20763. }
  20764. // 4. Return an entry whose name is name and whose value is value.
  20765. return { name, value }
  20766. }
  20767. module.exports = { FormData }
  20768. /***/ }),
  20769. /***/ 1246:
  20770. /***/ ((module) => {
  20771. "use strict";
  20772. // In case of breaking changes, increase the version
  20773. // number to avoid conflicts.
  20774. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  20775. function getGlobalOrigin () {
  20776. return globalThis[globalOrigin]
  20777. }
  20778. function setGlobalOrigin (newOrigin) {
  20779. if (newOrigin === undefined) {
  20780. Object.defineProperty(globalThis, globalOrigin, {
  20781. value: undefined,
  20782. writable: true,
  20783. enumerable: false,
  20784. configurable: false
  20785. })
  20786. return
  20787. }
  20788. const parsedURL = new URL(newOrigin)
  20789. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  20790. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  20791. }
  20792. Object.defineProperty(globalThis, globalOrigin, {
  20793. value: parsedURL,
  20794. writable: true,
  20795. enumerable: false,
  20796. configurable: false
  20797. })
  20798. }
  20799. module.exports = {
  20800. getGlobalOrigin,
  20801. setGlobalOrigin
  20802. }
  20803. /***/ }),
  20804. /***/ 554:
  20805. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20806. "use strict";
  20807. // https://github.com/Ethan-Arrowood/undici-fetch
  20808. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  20809. const { kGuard } = __nccwpck_require__(5861)
  20810. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20811. const {
  20812. makeIterator,
  20813. isValidHeaderName,
  20814. isValidHeaderValue
  20815. } = __nccwpck_require__(2538)
  20816. const { webidl } = __nccwpck_require__(1744)
  20817. const assert = __nccwpck_require__(9491)
  20818. const kHeadersMap = Symbol('headers map')
  20819. const kHeadersSortedMap = Symbol('headers map sorted')
  20820. /**
  20821. * @param {number} code
  20822. */
  20823. function isHTTPWhiteSpaceCharCode (code) {
  20824. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  20825. }
  20826. /**
  20827. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  20828. * @param {string} potentialValue
  20829. */
  20830. function headerValueNormalize (potentialValue) {
  20831. // To normalize a byte sequence potentialValue, remove
  20832. // any leading and trailing HTTP whitespace bytes from
  20833. // potentialValue.
  20834. let i = 0; let j = potentialValue.length
  20835. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  20836. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  20837. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  20838. }
  20839. function fill (headers, object) {
  20840. // To fill a Headers object headers with a given object object, run these steps:
  20841. // 1. If object is a sequence, then for each header in object:
  20842. // Note: webidl conversion to array has already been done.
  20843. if (Array.isArray(object)) {
  20844. for (let i = 0; i < object.length; ++i) {
  20845. const header = object[i]
  20846. // 1. If header does not contain exactly two items, then throw a TypeError.
  20847. if (header.length !== 2) {
  20848. throw webidl.errors.exception({
  20849. header: 'Headers constructor',
  20850. message: `expected name/value pair to be length 2, found ${header.length}.`
  20851. })
  20852. }
  20853. // 2. Append (header’s first item, header’s second item) to headers.
  20854. appendHeader(headers, header[0], header[1])
  20855. }
  20856. } else if (typeof object === 'object' && object !== null) {
  20857. // Note: null should throw
  20858. // 2. Otherwise, object is a record, then for each key → value in object,
  20859. // append (key, value) to headers
  20860. const keys = Object.keys(object)
  20861. for (let i = 0; i < keys.length; ++i) {
  20862. appendHeader(headers, keys[i], object[keys[i]])
  20863. }
  20864. } else {
  20865. throw webidl.errors.conversionFailed({
  20866. prefix: 'Headers constructor',
  20867. argument: 'Argument 1',
  20868. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  20869. })
  20870. }
  20871. }
  20872. /**
  20873. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  20874. */
  20875. function appendHeader (headers, name, value) {
  20876. // 1. Normalize value.
  20877. value = headerValueNormalize(value)
  20878. // 2. If name is not a header name or value is not a
  20879. // header value, then throw a TypeError.
  20880. if (!isValidHeaderName(name)) {
  20881. throw webidl.errors.invalidArgument({
  20882. prefix: 'Headers.append',
  20883. value: name,
  20884. type: 'header name'
  20885. })
  20886. } else if (!isValidHeaderValue(value)) {
  20887. throw webidl.errors.invalidArgument({
  20888. prefix: 'Headers.append',
  20889. value,
  20890. type: 'header value'
  20891. })
  20892. }
  20893. // 3. If headers’s guard is "immutable", then throw a TypeError.
  20894. // 4. Otherwise, if headers’s guard is "request" and name is a
  20895. // forbidden header name, return.
  20896. // Note: undici does not implement forbidden header names
  20897. if (headers[kGuard] === 'immutable') {
  20898. throw new TypeError('immutable')
  20899. } else if (headers[kGuard] === 'request-no-cors') {
  20900. // 5. Otherwise, if headers’s guard is "request-no-cors":
  20901. // TODO
  20902. }
  20903. // 6. Otherwise, if headers’s guard is "response" and name is a
  20904. // forbidden response-header name, return.
  20905. // 7. Append (name, value) to headers’s header list.
  20906. return headers[kHeadersList].append(name, value)
  20907. // 8. If headers’s guard is "request-no-cors", then remove
  20908. // privileged no-CORS request headers from headers
  20909. }
  20910. class HeadersList {
  20911. /** @type {[string, string][]|null} */
  20912. cookies = null
  20913. constructor (init) {
  20914. if (init instanceof HeadersList) {
  20915. this[kHeadersMap] = new Map(init[kHeadersMap])
  20916. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  20917. this.cookies = init.cookies === null ? null : [...init.cookies]
  20918. } else {
  20919. this[kHeadersMap] = new Map(init)
  20920. this[kHeadersSortedMap] = null
  20921. }
  20922. }
  20923. // https://fetch.spec.whatwg.org/#header-list-contains
  20924. contains (name) {
  20925. // A header list list contains a header name name if list
  20926. // contains a header whose name is a byte-case-insensitive
  20927. // match for name.
  20928. name = name.toLowerCase()
  20929. return this[kHeadersMap].has(name)
  20930. }
  20931. clear () {
  20932. this[kHeadersMap].clear()
  20933. this[kHeadersSortedMap] = null
  20934. this.cookies = null
  20935. }
  20936. // https://fetch.spec.whatwg.org/#concept-header-list-append
  20937. append (name, value) {
  20938. this[kHeadersSortedMap] = null
  20939. // 1. If list contains name, then set name to the first such
  20940. // header’s name.
  20941. const lowercaseName = name.toLowerCase()
  20942. const exists = this[kHeadersMap].get(lowercaseName)
  20943. // 2. Append (name, value) to list.
  20944. if (exists) {
  20945. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  20946. this[kHeadersMap].set(lowercaseName, {
  20947. name: exists.name,
  20948. value: `${exists.value}${delimiter}${value}`
  20949. })
  20950. } else {
  20951. this[kHeadersMap].set(lowercaseName, { name, value })
  20952. }
  20953. if (lowercaseName === 'set-cookie') {
  20954. this.cookies ??= []
  20955. this.cookies.push(value)
  20956. }
  20957. }
  20958. // https://fetch.spec.whatwg.org/#concept-header-list-set
  20959. set (name, value) {
  20960. this[kHeadersSortedMap] = null
  20961. const lowercaseName = name.toLowerCase()
  20962. if (lowercaseName === 'set-cookie') {
  20963. this.cookies = [value]
  20964. }
  20965. // 1. If list contains name, then set the value of
  20966. // the first such header to value and remove the
  20967. // others.
  20968. // 2. Otherwise, append header (name, value) to list.
  20969. this[kHeadersMap].set(lowercaseName, { name, value })
  20970. }
  20971. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  20972. delete (name) {
  20973. this[kHeadersSortedMap] = null
  20974. name = name.toLowerCase()
  20975. if (name === 'set-cookie') {
  20976. this.cookies = null
  20977. }
  20978. this[kHeadersMap].delete(name)
  20979. }
  20980. // https://fetch.spec.whatwg.org/#concept-header-list-get
  20981. get (name) {
  20982. const value = this[kHeadersMap].get(name.toLowerCase())
  20983. // 1. If list does not contain name, then return null.
  20984. // 2. Return the values of all headers in list whose name
  20985. // is a byte-case-insensitive match for name,
  20986. // separated from each other by 0x2C 0x20, in order.
  20987. return value === undefined ? null : value.value
  20988. }
  20989. * [Symbol.iterator] () {
  20990. // use the lowercased name
  20991. for (const [name, { value }] of this[kHeadersMap]) {
  20992. yield [name, value]
  20993. }
  20994. }
  20995. get entries () {
  20996. const headers = {}
  20997. if (this[kHeadersMap].size) {
  20998. for (const { name, value } of this[kHeadersMap].values()) {
  20999. headers[name] = value
  21000. }
  21001. }
  21002. return headers
  21003. }
  21004. }
  21005. // https://fetch.spec.whatwg.org/#headers-class
  21006. class Headers {
  21007. constructor (init = undefined) {
  21008. if (init === kConstruct) {
  21009. return
  21010. }
  21011. this[kHeadersList] = new HeadersList()
  21012. // The new Headers(init) constructor steps are:
  21013. // 1. Set this’s guard to "none".
  21014. this[kGuard] = 'none'
  21015. // 2. If init is given, then fill this with init.
  21016. if (init !== undefined) {
  21017. init = webidl.converters.HeadersInit(init)
  21018. fill(this, init)
  21019. }
  21020. }
  21021. // https://fetch.spec.whatwg.org/#dom-headers-append
  21022. append (name, value) {
  21023. webidl.brandCheck(this, Headers)
  21024. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21025. name = webidl.converters.ByteString(name)
  21026. value = webidl.converters.ByteString(value)
  21027. return appendHeader(this, name, value)
  21028. }
  21029. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21030. delete (name) {
  21031. webidl.brandCheck(this, Headers)
  21032. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21033. name = webidl.converters.ByteString(name)
  21034. // 1. If name is not a header name, then throw a TypeError.
  21035. if (!isValidHeaderName(name)) {
  21036. throw webidl.errors.invalidArgument({
  21037. prefix: 'Headers.delete',
  21038. value: name,
  21039. type: 'header name'
  21040. })
  21041. }
  21042. // 2. If this’s guard is "immutable", then throw a TypeError.
  21043. // 3. Otherwise, if this’s guard is "request" and name is a
  21044. // forbidden header name, return.
  21045. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21046. // is not a no-CORS-safelisted request-header name, and
  21047. // name is not a privileged no-CORS request-header name,
  21048. // return.
  21049. // 5. Otherwise, if this’s guard is "response" and name is
  21050. // a forbidden response-header name, return.
  21051. // Note: undici does not implement forbidden header names
  21052. if (this[kGuard] === 'immutable') {
  21053. throw new TypeError('immutable')
  21054. } else if (this[kGuard] === 'request-no-cors') {
  21055. // TODO
  21056. }
  21057. // 6. If this’s header list does not contain name, then
  21058. // return.
  21059. if (!this[kHeadersList].contains(name)) {
  21060. return
  21061. }
  21062. // 7. Delete name from this’s header list.
  21063. // 8. If this’s guard is "request-no-cors", then remove
  21064. // privileged no-CORS request headers from this.
  21065. this[kHeadersList].delete(name)
  21066. }
  21067. // https://fetch.spec.whatwg.org/#dom-headers-get
  21068. get (name) {
  21069. webidl.brandCheck(this, Headers)
  21070. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21071. name = webidl.converters.ByteString(name)
  21072. // 1. If name is not a header name, then throw a TypeError.
  21073. if (!isValidHeaderName(name)) {
  21074. throw webidl.errors.invalidArgument({
  21075. prefix: 'Headers.get',
  21076. value: name,
  21077. type: 'header name'
  21078. })
  21079. }
  21080. // 2. Return the result of getting name from this’s header
  21081. // list.
  21082. return this[kHeadersList].get(name)
  21083. }
  21084. // https://fetch.spec.whatwg.org/#dom-headers-has
  21085. has (name) {
  21086. webidl.brandCheck(this, Headers)
  21087. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21088. name = webidl.converters.ByteString(name)
  21089. // 1. If name is not a header name, then throw a TypeError.
  21090. if (!isValidHeaderName(name)) {
  21091. throw webidl.errors.invalidArgument({
  21092. prefix: 'Headers.has',
  21093. value: name,
  21094. type: 'header name'
  21095. })
  21096. }
  21097. // 2. Return true if this’s header list contains name;
  21098. // otherwise false.
  21099. return this[kHeadersList].contains(name)
  21100. }
  21101. // https://fetch.spec.whatwg.org/#dom-headers-set
  21102. set (name, value) {
  21103. webidl.brandCheck(this, Headers)
  21104. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21105. name = webidl.converters.ByteString(name)
  21106. value = webidl.converters.ByteString(value)
  21107. // 1. Normalize value.
  21108. value = headerValueNormalize(value)
  21109. // 2. If name is not a header name or value is not a
  21110. // header value, then throw a TypeError.
  21111. if (!isValidHeaderName(name)) {
  21112. throw webidl.errors.invalidArgument({
  21113. prefix: 'Headers.set',
  21114. value: name,
  21115. type: 'header name'
  21116. })
  21117. } else if (!isValidHeaderValue(value)) {
  21118. throw webidl.errors.invalidArgument({
  21119. prefix: 'Headers.set',
  21120. value,
  21121. type: 'header value'
  21122. })
  21123. }
  21124. // 3. If this’s guard is "immutable", then throw a TypeError.
  21125. // 4. Otherwise, if this’s guard is "request" and name is a
  21126. // forbidden header name, return.
  21127. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21128. // name/value is not a no-CORS-safelisted request-header,
  21129. // return.
  21130. // 6. Otherwise, if this’s guard is "response" and name is a
  21131. // forbidden response-header name, return.
  21132. // Note: undici does not implement forbidden header names
  21133. if (this[kGuard] === 'immutable') {
  21134. throw new TypeError('immutable')
  21135. } else if (this[kGuard] === 'request-no-cors') {
  21136. // TODO
  21137. }
  21138. // 7. Set (name, value) in this’s header list.
  21139. // 8. If this’s guard is "request-no-cors", then remove
  21140. // privileged no-CORS request headers from this
  21141. this[kHeadersList].set(name, value)
  21142. }
  21143. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21144. getSetCookie () {
  21145. webidl.brandCheck(this, Headers)
  21146. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21147. // 2. Return the values of all headers in this’s header list whose name is
  21148. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21149. const list = this[kHeadersList].cookies
  21150. if (list) {
  21151. return [...list]
  21152. }
  21153. return []
  21154. }
  21155. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21156. get [kHeadersSortedMap] () {
  21157. if (this[kHeadersList][kHeadersSortedMap]) {
  21158. return this[kHeadersList][kHeadersSortedMap]
  21159. }
  21160. // 1. Let headers be an empty list of headers with the key being the name
  21161. // and value the value.
  21162. const headers = []
  21163. // 2. Let names be the result of convert header names to a sorted-lowercase
  21164. // set with all the names of the headers in list.
  21165. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21166. const cookies = this[kHeadersList].cookies
  21167. // 3. For each name of names:
  21168. for (let i = 0; i < names.length; ++i) {
  21169. const [name, value] = names[i]
  21170. // 1. If name is `set-cookie`, then:
  21171. if (name === 'set-cookie') {
  21172. // 1. Let values be a list of all values of headers in list whose name
  21173. // is a byte-case-insensitive match for name, in order.
  21174. // 2. For each value of values:
  21175. // 1. Append (name, value) to headers.
  21176. for (let j = 0; j < cookies.length; ++j) {
  21177. headers.push([name, cookies[j]])
  21178. }
  21179. } else {
  21180. // 2. Otherwise:
  21181. // 1. Let value be the result of getting name from list.
  21182. // 2. Assert: value is non-null.
  21183. assert(value !== null)
  21184. // 3. Append (name, value) to headers.
  21185. headers.push([name, value])
  21186. }
  21187. }
  21188. this[kHeadersList][kHeadersSortedMap] = headers
  21189. // 4. Return headers.
  21190. return headers
  21191. }
  21192. keys () {
  21193. webidl.brandCheck(this, Headers)
  21194. if (this[kGuard] === 'immutable') {
  21195. const value = this[kHeadersSortedMap]
  21196. return makeIterator(() => value, 'Headers',
  21197. 'key')
  21198. }
  21199. return makeIterator(
  21200. () => [...this[kHeadersSortedMap].values()],
  21201. 'Headers',
  21202. 'key'
  21203. )
  21204. }
  21205. values () {
  21206. webidl.brandCheck(this, Headers)
  21207. if (this[kGuard] === 'immutable') {
  21208. const value = this[kHeadersSortedMap]
  21209. return makeIterator(() => value, 'Headers',
  21210. 'value')
  21211. }
  21212. return makeIterator(
  21213. () => [...this[kHeadersSortedMap].values()],
  21214. 'Headers',
  21215. 'value'
  21216. )
  21217. }
  21218. entries () {
  21219. webidl.brandCheck(this, Headers)
  21220. if (this[kGuard] === 'immutable') {
  21221. const value = this[kHeadersSortedMap]
  21222. return makeIterator(() => value, 'Headers',
  21223. 'key+value')
  21224. }
  21225. return makeIterator(
  21226. () => [...this[kHeadersSortedMap].values()],
  21227. 'Headers',
  21228. 'key+value'
  21229. )
  21230. }
  21231. /**
  21232. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21233. * @param {unknown} thisArg
  21234. */
  21235. forEach (callbackFn, thisArg = globalThis) {
  21236. webidl.brandCheck(this, Headers)
  21237. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21238. if (typeof callbackFn !== 'function') {
  21239. throw new TypeError(
  21240. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21241. )
  21242. }
  21243. for (const [key, value] of this) {
  21244. callbackFn.apply(thisArg, [value, key, this])
  21245. }
  21246. }
  21247. [Symbol.for('nodejs.util.inspect.custom')] () {
  21248. webidl.brandCheck(this, Headers)
  21249. return this[kHeadersList]
  21250. }
  21251. }
  21252. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21253. Object.defineProperties(Headers.prototype, {
  21254. append: kEnumerableProperty,
  21255. delete: kEnumerableProperty,
  21256. get: kEnumerableProperty,
  21257. has: kEnumerableProperty,
  21258. set: kEnumerableProperty,
  21259. getSetCookie: kEnumerableProperty,
  21260. keys: kEnumerableProperty,
  21261. values: kEnumerableProperty,
  21262. entries: kEnumerableProperty,
  21263. forEach: kEnumerableProperty,
  21264. [Symbol.iterator]: { enumerable: false },
  21265. [Symbol.toStringTag]: {
  21266. value: 'Headers',
  21267. configurable: true
  21268. }
  21269. })
  21270. webidl.converters.HeadersInit = function (V) {
  21271. if (webidl.util.Type(V) === 'Object') {
  21272. if (V[Symbol.iterator]) {
  21273. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21274. }
  21275. return webidl.converters['record<ByteString, ByteString>'](V)
  21276. }
  21277. throw webidl.errors.conversionFailed({
  21278. prefix: 'Headers constructor',
  21279. argument: 'Argument 1',
  21280. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21281. })
  21282. }
  21283. module.exports = {
  21284. fill,
  21285. Headers,
  21286. HeadersList
  21287. }
  21288. /***/ }),
  21289. /***/ 4881:
  21290. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21291. "use strict";
  21292. // https://github.com/Ethan-Arrowood/undici-fetch
  21293. const {
  21294. Response,
  21295. makeNetworkError,
  21296. makeAppropriateNetworkError,
  21297. filterResponse,
  21298. makeResponse
  21299. } = __nccwpck_require__(7823)
  21300. const { Headers } = __nccwpck_require__(554)
  21301. const { Request, makeRequest } = __nccwpck_require__(8359)
  21302. const zlib = __nccwpck_require__(9796)
  21303. const {
  21304. bytesMatch,
  21305. makePolicyContainer,
  21306. clonePolicyContainer,
  21307. requestBadPort,
  21308. TAOCheck,
  21309. appendRequestOriginHeader,
  21310. responseLocationURL,
  21311. requestCurrentURL,
  21312. setRequestReferrerPolicyOnRedirect,
  21313. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21314. createOpaqueTimingInfo,
  21315. appendFetchMetadata,
  21316. corsCheck,
  21317. crossOriginResourcePolicyCheck,
  21318. determineRequestsReferrer,
  21319. coarsenedSharedCurrentTime,
  21320. createDeferredPromise,
  21321. isBlobLike,
  21322. sameOrigin,
  21323. isCancelled,
  21324. isAborted,
  21325. isErrorLike,
  21326. fullyReadBody,
  21327. readableStreamClose,
  21328. isomorphicEncode,
  21329. urlIsLocal,
  21330. urlIsHttpHttpsScheme,
  21331. urlHasHttpsScheme
  21332. } = __nccwpck_require__(2538)
  21333. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21334. const assert = __nccwpck_require__(9491)
  21335. const { safelyExtractBody } = __nccwpck_require__(9990)
  21336. const {
  21337. redirectStatusSet,
  21338. nullBodyStatus,
  21339. safeMethodsSet,
  21340. requestBodyHeader,
  21341. subresourceSet,
  21342. DOMException
  21343. } = __nccwpck_require__(1037)
  21344. const { kHeadersList } = __nccwpck_require__(2785)
  21345. const EE = __nccwpck_require__(2361)
  21346. const { Readable, pipeline } = __nccwpck_require__(2781)
  21347. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21348. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21349. const { TransformStream } = __nccwpck_require__(5356)
  21350. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21351. const { webidl } = __nccwpck_require__(1744)
  21352. const { STATUS_CODES } = __nccwpck_require__(3685)
  21353. const GET_OR_HEAD = ['GET', 'HEAD']
  21354. /** @type {import('buffer').resolveObjectURL} */
  21355. let resolveObjectURL
  21356. let ReadableStream = globalThis.ReadableStream
  21357. class Fetch extends EE {
  21358. constructor (dispatcher) {
  21359. super()
  21360. this.dispatcher = dispatcher
  21361. this.connection = null
  21362. this.dump = false
  21363. this.state = 'ongoing'
  21364. // 2 terminated listeners get added per request,
  21365. // but only 1 gets removed. If there are 20 redirects,
  21366. // 21 listeners will be added.
  21367. // See https://github.com/nodejs/undici/issues/1711
  21368. // TODO (fix): Find and fix root cause for leaked listener.
  21369. this.setMaxListeners(21)
  21370. }
  21371. terminate (reason) {
  21372. if (this.state !== 'ongoing') {
  21373. return
  21374. }
  21375. this.state = 'terminated'
  21376. this.connection?.destroy(reason)
  21377. this.emit('terminated', reason)
  21378. }
  21379. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21380. abort (error) {
  21381. if (this.state !== 'ongoing') {
  21382. return
  21383. }
  21384. // 1. Set controller’s state to "aborted".
  21385. this.state = 'aborted'
  21386. // 2. Let fallbackError be an "AbortError" DOMException.
  21387. // 3. Set error to fallbackError if it is not given.
  21388. if (!error) {
  21389. error = new DOMException('The operation was aborted.', 'AbortError')
  21390. }
  21391. // 4. Let serializedError be StructuredSerialize(error).
  21392. // If that threw an exception, catch it, and let
  21393. // serializedError be StructuredSerialize(fallbackError).
  21394. // 5. Set controller’s serialized abort reason to serializedError.
  21395. this.serializedAbortReason = error
  21396. this.connection?.destroy(error)
  21397. this.emit('terminated', error)
  21398. }
  21399. }
  21400. // https://fetch.spec.whatwg.org/#fetch-method
  21401. function fetch (input, init = {}) {
  21402. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21403. // 1. Let p be a new promise.
  21404. const p = createDeferredPromise()
  21405. // 2. Let requestObject be the result of invoking the initial value of
  21406. // Request as constructor with input and init as arguments. If this throws
  21407. // an exception, reject p with it and return p.
  21408. let requestObject
  21409. try {
  21410. requestObject = new Request(input, init)
  21411. } catch (e) {
  21412. p.reject(e)
  21413. return p.promise
  21414. }
  21415. // 3. Let request be requestObject’s request.
  21416. const request = requestObject[kState]
  21417. // 4. If requestObject’s signal’s aborted flag is set, then:
  21418. if (requestObject.signal.aborted) {
  21419. // 1. Abort the fetch() call with p, request, null, and
  21420. // requestObject’s signal’s abort reason.
  21421. abortFetch(p, request, null, requestObject.signal.reason)
  21422. // 2. Return p.
  21423. return p.promise
  21424. }
  21425. // 5. Let globalObject be request’s client’s global object.
  21426. const globalObject = request.client.globalObject
  21427. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21428. // request’s service-workers mode to "none".
  21429. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21430. request.serviceWorkers = 'none'
  21431. }
  21432. // 7. Let responseObject be null.
  21433. let responseObject = null
  21434. // 8. Let relevantRealm be this’s relevant Realm.
  21435. const relevantRealm = null
  21436. // 9. Let locallyAborted be false.
  21437. let locallyAborted = false
  21438. // 10. Let controller be null.
  21439. let controller = null
  21440. // 11. Add the following abort steps to requestObject’s signal:
  21441. addAbortListener(
  21442. requestObject.signal,
  21443. () => {
  21444. // 1. Set locallyAborted to true.
  21445. locallyAborted = true
  21446. // 2. Assert: controller is non-null.
  21447. assert(controller != null)
  21448. // 3. Abort controller with requestObject’s signal’s abort reason.
  21449. controller.abort(requestObject.signal.reason)
  21450. // 4. Abort the fetch() call with p, request, responseObject,
  21451. // and requestObject’s signal’s abort reason.
  21452. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21453. }
  21454. )
  21455. // 12. Let handleFetchDone given response response be to finalize and
  21456. // report timing with response, globalObject, and "fetch".
  21457. const handleFetchDone = (response) =>
  21458. finalizeAndReportTiming(response, 'fetch')
  21459. // 13. Set controller to the result of calling fetch given request,
  21460. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21461. // given response being these substeps:
  21462. const processResponse = (response) => {
  21463. // 1. If locallyAborted is true, terminate these substeps.
  21464. if (locallyAborted) {
  21465. return Promise.resolve()
  21466. }
  21467. // 2. If response’s aborted flag is set, then:
  21468. if (response.aborted) {
  21469. // 1. Let deserializedError be the result of deserialize a serialized
  21470. // abort reason given controller’s serialized abort reason and
  21471. // relevantRealm.
  21472. // 2. Abort the fetch() call with p, request, responseObject, and
  21473. // deserializedError.
  21474. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21475. return Promise.resolve()
  21476. }
  21477. // 3. If response is a network error, then reject p with a TypeError
  21478. // and terminate these substeps.
  21479. if (response.type === 'error') {
  21480. p.reject(
  21481. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21482. )
  21483. return Promise.resolve()
  21484. }
  21485. // 4. Set responseObject to the result of creating a Response object,
  21486. // given response, "immutable", and relevantRealm.
  21487. responseObject = new Response()
  21488. responseObject[kState] = response
  21489. responseObject[kRealm] = relevantRealm
  21490. responseObject[kHeaders][kHeadersList] = response.headersList
  21491. responseObject[kHeaders][kGuard] = 'immutable'
  21492. responseObject[kHeaders][kRealm] = relevantRealm
  21493. // 5. Resolve p with responseObject.
  21494. p.resolve(responseObject)
  21495. }
  21496. controller = fetching({
  21497. request,
  21498. processResponseEndOfBody: handleFetchDone,
  21499. processResponse,
  21500. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21501. })
  21502. // 14. Return p.
  21503. return p.promise
  21504. }
  21505. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21506. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21507. // 1. If response is an aborted network error, then return.
  21508. if (response.type === 'error' && response.aborted) {
  21509. return
  21510. }
  21511. // 2. If response’s URL list is null or empty, then return.
  21512. if (!response.urlList?.length) {
  21513. return
  21514. }
  21515. // 3. Let originalURL be response’s URL list[0].
  21516. const originalURL = response.urlList[0]
  21517. // 4. Let timingInfo be response’s timing info.
  21518. let timingInfo = response.timingInfo
  21519. // 5. Let cacheState be response’s cache state.
  21520. let cacheState = response.cacheState
  21521. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21522. if (!urlIsHttpHttpsScheme(originalURL)) {
  21523. return
  21524. }
  21525. // 7. If timingInfo is null, then return.
  21526. if (timingInfo === null) {
  21527. return
  21528. }
  21529. // 8. If response’s timing allow passed flag is not set, then:
  21530. if (!response.timingAllowPassed) {
  21531. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21532. timingInfo = createOpaqueTimingInfo({
  21533. startTime: timingInfo.startTime
  21534. })
  21535. // 2. Set cacheState to the empty string.
  21536. cacheState = ''
  21537. }
  21538. // 9. Set timingInfo’s end time to the coarsened shared current time
  21539. // given global’s relevant settings object’s cross-origin isolated
  21540. // capability.
  21541. // TODO: given global’s relevant settings object’s cross-origin isolated
  21542. // capability?
  21543. timingInfo.endTime = coarsenedSharedCurrentTime()
  21544. // 10. Set response’s timing info to timingInfo.
  21545. response.timingInfo = timingInfo
  21546. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21547. // global, and cacheState.
  21548. markResourceTiming(
  21549. timingInfo,
  21550. originalURL,
  21551. initiatorType,
  21552. globalThis,
  21553. cacheState
  21554. )
  21555. }
  21556. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21557. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21558. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21559. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21560. }
  21561. }
  21562. // https://fetch.spec.whatwg.org/#abort-fetch
  21563. function abortFetch (p, request, responseObject, error) {
  21564. // Note: AbortSignal.reason was added in node v17.2.0
  21565. // which would give us an undefined error to reject with.
  21566. // Remove this once node v16 is no longer supported.
  21567. if (!error) {
  21568. error = new DOMException('The operation was aborted.', 'AbortError')
  21569. }
  21570. // 1. Reject promise with error.
  21571. p.reject(error)
  21572. // 2. If request’s body is not null and is readable, then cancel request’s
  21573. // body with error.
  21574. if (request.body != null && isReadable(request.body?.stream)) {
  21575. request.body.stream.cancel(error).catch((err) => {
  21576. if (err.code === 'ERR_INVALID_STATE') {
  21577. // Node bug?
  21578. return
  21579. }
  21580. throw err
  21581. })
  21582. }
  21583. // 3. If responseObject is null, then return.
  21584. if (responseObject == null) {
  21585. return
  21586. }
  21587. // 4. Let response be responseObject’s response.
  21588. const response = responseObject[kState]
  21589. // 5. If response’s body is not null and is readable, then error response’s
  21590. // body with error.
  21591. if (response.body != null && isReadable(response.body?.stream)) {
  21592. response.body.stream.cancel(error).catch((err) => {
  21593. if (err.code === 'ERR_INVALID_STATE') {
  21594. // Node bug?
  21595. return
  21596. }
  21597. throw err
  21598. })
  21599. }
  21600. }
  21601. // https://fetch.spec.whatwg.org/#fetching
  21602. function fetching ({
  21603. request,
  21604. processRequestBodyChunkLength,
  21605. processRequestEndOfBody,
  21606. processResponse,
  21607. processResponseEndOfBody,
  21608. processResponseConsumeBody,
  21609. useParallelQueue = false,
  21610. dispatcher // undici
  21611. }) {
  21612. // 1. Let taskDestination be null.
  21613. let taskDestination = null
  21614. // 2. Let crossOriginIsolatedCapability be false.
  21615. let crossOriginIsolatedCapability = false
  21616. // 3. If request’s client is non-null, then:
  21617. if (request.client != null) {
  21618. // 1. Set taskDestination to request’s client’s global object.
  21619. taskDestination = request.client.globalObject
  21620. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21621. // isolated capability.
  21622. crossOriginIsolatedCapability =
  21623. request.client.crossOriginIsolatedCapability
  21624. }
  21625. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21626. // starting a new parallel queue.
  21627. // TODO
  21628. // 5. Let timingInfo be a new fetch timing info whose start time and
  21629. // post-redirect start time are the coarsened shared current time given
  21630. // crossOriginIsolatedCapability.
  21631. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21632. const timingInfo = createOpaqueTimingInfo({
  21633. startTime: currenTime
  21634. })
  21635. // 6. Let fetchParams be a new fetch params whose
  21636. // request is request,
  21637. // timing info is timingInfo,
  21638. // process request body chunk length is processRequestBodyChunkLength,
  21639. // process request end-of-body is processRequestEndOfBody,
  21640. // process response is processResponse,
  21641. // process response consume body is processResponseConsumeBody,
  21642. // process response end-of-body is processResponseEndOfBody,
  21643. // task destination is taskDestination,
  21644. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21645. const fetchParams = {
  21646. controller: new Fetch(dispatcher),
  21647. request,
  21648. timingInfo,
  21649. processRequestBodyChunkLength,
  21650. processRequestEndOfBody,
  21651. processResponse,
  21652. processResponseConsumeBody,
  21653. processResponseEndOfBody,
  21654. taskDestination,
  21655. crossOriginIsolatedCapability
  21656. }
  21657. // 7. If request’s body is a byte sequence, then set request’s body to
  21658. // request’s body as a body.
  21659. // NOTE: Since fetching is only called from fetch, body should already be
  21660. // extracted.
  21661. assert(!request.body || request.body.stream)
  21662. // 8. If request’s window is "client", then set request’s window to request’s
  21663. // client, if request’s client’s global object is a Window object; otherwise
  21664. // "no-window".
  21665. if (request.window === 'client') {
  21666. // TODO: What if request.client is null?
  21667. request.window =
  21668. request.client?.globalObject?.constructor?.name === 'Window'
  21669. ? request.client
  21670. : 'no-window'
  21671. }
  21672. // 9. If request’s origin is "client", then set request’s origin to request’s
  21673. // client’s origin.
  21674. if (request.origin === 'client') {
  21675. // TODO: What if request.client is null?
  21676. request.origin = request.client?.origin
  21677. }
  21678. // 10. If all of the following conditions are true:
  21679. // TODO
  21680. // 11. If request’s policy container is "client", then:
  21681. if (request.policyContainer === 'client') {
  21682. // 1. If request’s client is non-null, then set request’s policy
  21683. // container to a clone of request’s client’s policy container. [HTML]
  21684. if (request.client != null) {
  21685. request.policyContainer = clonePolicyContainer(
  21686. request.client.policyContainer
  21687. )
  21688. } else {
  21689. // 2. Otherwise, set request’s policy container to a new policy
  21690. // container.
  21691. request.policyContainer = makePolicyContainer()
  21692. }
  21693. }
  21694. // 12. If request’s header list does not contain `Accept`, then:
  21695. if (!request.headersList.contains('accept')) {
  21696. // 1. Let value be `*/*`.
  21697. const value = '*/*'
  21698. // 2. A user agent should set value to the first matching statement, if
  21699. // any, switching on request’s destination:
  21700. // "document"
  21701. // "frame"
  21702. // "iframe"
  21703. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21704. // "image"
  21705. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21706. // "style"
  21707. // `text/css,*/*;q=0.1`
  21708. // TODO
  21709. // 3. Append `Accept`/value to request’s header list.
  21710. request.headersList.append('accept', value)
  21711. }
  21712. // 13. If request’s header list does not contain `Accept-Language`, then
  21713. // user agents should append `Accept-Language`/an appropriate value to
  21714. // request’s header list.
  21715. if (!request.headersList.contains('accept-language')) {
  21716. request.headersList.append('accept-language', '*')
  21717. }
  21718. // 14. If request’s priority is null, then use request’s initiator and
  21719. // destination appropriately in setting request’s priority to a
  21720. // user-agent-defined object.
  21721. if (request.priority === null) {
  21722. // TODO
  21723. }
  21724. // 15. If request is a subresource request, then:
  21725. if (subresourceSet.has(request.destination)) {
  21726. // TODO
  21727. }
  21728. // 16. Run main fetch given fetchParams.
  21729. mainFetch(fetchParams)
  21730. .catch(err => {
  21731. fetchParams.controller.terminate(err)
  21732. })
  21733. // 17. Return fetchParam's controller
  21734. return fetchParams.controller
  21735. }
  21736. // https://fetch.spec.whatwg.org/#concept-main-fetch
  21737. async function mainFetch (fetchParams, recursive = false) {
  21738. // 1. Let request be fetchParams’s request.
  21739. const request = fetchParams.request
  21740. // 2. Let response be null.
  21741. let response = null
  21742. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  21743. // not local, then set response to a network error.
  21744. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  21745. response = makeNetworkError('local URLs only')
  21746. }
  21747. // 4. Run report Content Security Policy violations for request.
  21748. // TODO
  21749. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  21750. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  21751. // 6. If should request be blocked due to a bad port, should fetching request
  21752. // be blocked as mixed content, or should request be blocked by Content
  21753. // Security Policy returns blocked, then set response to a network error.
  21754. if (requestBadPort(request) === 'blocked') {
  21755. response = makeNetworkError('bad port')
  21756. }
  21757. // TODO: should fetching request be blocked as mixed content?
  21758. // TODO: should request be blocked by Content Security Policy?
  21759. // 7. If request’s referrer policy is the empty string, then set request’s
  21760. // referrer policy to request’s policy container’s referrer policy.
  21761. if (request.referrerPolicy === '') {
  21762. request.referrerPolicy = request.policyContainer.referrerPolicy
  21763. }
  21764. // 8. If request’s referrer is not "no-referrer", then set request’s
  21765. // referrer to the result of invoking determine request’s referrer.
  21766. if (request.referrer !== 'no-referrer') {
  21767. request.referrer = determineRequestsReferrer(request)
  21768. }
  21769. // 9. Set request’s current URL’s scheme to "https" if all of the following
  21770. // conditions are true:
  21771. // - request’s current URL’s scheme is "http"
  21772. // - request’s current URL’s host is a domain
  21773. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  21774. // Matching results in either a superdomain match with an asserted
  21775. // includeSubDomains directive or a congruent match (with or without an
  21776. // asserted includeSubDomains directive). [HSTS]
  21777. // TODO
  21778. // 10. If recursive is false, then run the remaining steps in parallel.
  21779. // TODO
  21780. // 11. If response is null, then set response to the result of running
  21781. // the steps corresponding to the first matching statement:
  21782. if (response === null) {
  21783. response = await (async () => {
  21784. const currentURL = requestCurrentURL(request)
  21785. if (
  21786. // - request’s current URL’s origin is same origin with request’s origin,
  21787. // and request’s response tainting is "basic"
  21788. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  21789. // request’s current URL’s scheme is "data"
  21790. (currentURL.protocol === 'data:') ||
  21791. // - request’s mode is "navigate" or "websocket"
  21792. (request.mode === 'navigate' || request.mode === 'websocket')
  21793. ) {
  21794. // 1. Set request’s response tainting to "basic".
  21795. request.responseTainting = 'basic'
  21796. // 2. Return the result of running scheme fetch given fetchParams.
  21797. return await schemeFetch(fetchParams)
  21798. }
  21799. // request’s mode is "same-origin"
  21800. if (request.mode === 'same-origin') {
  21801. // 1. Return a network error.
  21802. return makeNetworkError('request mode cannot be "same-origin"')
  21803. }
  21804. // request’s mode is "no-cors"
  21805. if (request.mode === 'no-cors') {
  21806. // 1. If request’s redirect mode is not "follow", then return a network
  21807. // error.
  21808. if (request.redirect !== 'follow') {
  21809. return makeNetworkError(
  21810. 'redirect mode cannot be "follow" for "no-cors" request'
  21811. )
  21812. }
  21813. // 2. Set request’s response tainting to "opaque".
  21814. request.responseTainting = 'opaque'
  21815. // 3. Return the result of running scheme fetch given fetchParams.
  21816. return await schemeFetch(fetchParams)
  21817. }
  21818. // request’s current URL’s scheme is not an HTTP(S) scheme
  21819. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  21820. // Return a network error.
  21821. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  21822. }
  21823. // - request’s use-CORS-preflight flag is set
  21824. // - request’s unsafe-request flag is set and either request’s method is
  21825. // not a CORS-safelisted method or CORS-unsafe request-header names with
  21826. // request’s header list is not empty
  21827. // 1. Set request’s response tainting to "cors".
  21828. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  21829. // given fetchParams and true.
  21830. // 3. If corsWithPreflightResponse is a network error, then clear cache
  21831. // entries using request.
  21832. // 4. Return corsWithPreflightResponse.
  21833. // TODO
  21834. // Otherwise
  21835. // 1. Set request’s response tainting to "cors".
  21836. request.responseTainting = 'cors'
  21837. // 2. Return the result of running HTTP fetch given fetchParams.
  21838. return await httpFetch(fetchParams)
  21839. })()
  21840. }
  21841. // 12. If recursive is true, then return response.
  21842. if (recursive) {
  21843. return response
  21844. }
  21845. // 13. If response is not a network error and response is not a filtered
  21846. // response, then:
  21847. if (response.status !== 0 && !response.internalResponse) {
  21848. // If request’s response tainting is "cors", then:
  21849. if (request.responseTainting === 'cors') {
  21850. // 1. Let headerNames be the result of extracting header list values
  21851. // given `Access-Control-Expose-Headers` and response’s header list.
  21852. // TODO
  21853. // 2. If request’s credentials mode is not "include" and headerNames
  21854. // contains `*`, then set response’s CORS-exposed header-name list to
  21855. // all unique header names in response’s header list.
  21856. // TODO
  21857. // 3. Otherwise, if headerNames is not null or failure, then set
  21858. // response’s CORS-exposed header-name list to headerNames.
  21859. // TODO
  21860. }
  21861. // Set response to the following filtered response with response as its
  21862. // internal response, depending on request’s response tainting:
  21863. if (request.responseTainting === 'basic') {
  21864. response = filterResponse(response, 'basic')
  21865. } else if (request.responseTainting === 'cors') {
  21866. response = filterResponse(response, 'cors')
  21867. } else if (request.responseTainting === 'opaque') {
  21868. response = filterResponse(response, 'opaque')
  21869. } else {
  21870. assert(false)
  21871. }
  21872. }
  21873. // 14. Let internalResponse be response, if response is a network error,
  21874. // and response’s internal response otherwise.
  21875. let internalResponse =
  21876. response.status === 0 ? response : response.internalResponse
  21877. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  21878. // request’s URL list.
  21879. if (internalResponse.urlList.length === 0) {
  21880. internalResponse.urlList.push(...request.urlList)
  21881. }
  21882. // 16. If request’s timing allow failed flag is unset, then set
  21883. // internalResponse’s timing allow passed flag.
  21884. if (!request.timingAllowFailed) {
  21885. response.timingAllowPassed = true
  21886. }
  21887. // 17. If response is not a network error and any of the following returns
  21888. // blocked
  21889. // - should internalResponse to request be blocked as mixed content
  21890. // - should internalResponse to request be blocked by Content Security Policy
  21891. // - should internalResponse to request be blocked due to its MIME type
  21892. // - should internalResponse to request be blocked due to nosniff
  21893. // TODO
  21894. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  21895. // internalResponse’s range-requested flag is set, and request’s header
  21896. // list does not contain `Range`, then set response and internalResponse
  21897. // to a network error.
  21898. if (
  21899. response.type === 'opaque' &&
  21900. internalResponse.status === 206 &&
  21901. internalResponse.rangeRequested &&
  21902. !request.headers.contains('range')
  21903. ) {
  21904. response = internalResponse = makeNetworkError()
  21905. }
  21906. // 19. If response is not a network error and either request’s method is
  21907. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  21908. // set internalResponse’s body to null and disregard any enqueuing toward
  21909. // it (if any).
  21910. if (
  21911. response.status !== 0 &&
  21912. (request.method === 'HEAD' ||
  21913. request.method === 'CONNECT' ||
  21914. nullBodyStatus.includes(internalResponse.status))
  21915. ) {
  21916. internalResponse.body = null
  21917. fetchParams.controller.dump = true
  21918. }
  21919. // 20. If request’s integrity metadata is not the empty string, then:
  21920. if (request.integrity) {
  21921. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  21922. // and a network error.
  21923. const processBodyError = (reason) =>
  21924. fetchFinale(fetchParams, makeNetworkError(reason))
  21925. // 2. If request’s response tainting is "opaque", or response’s body is null,
  21926. // then run processBodyError and abort these steps.
  21927. if (request.responseTainting === 'opaque' || response.body == null) {
  21928. processBodyError(response.error)
  21929. return
  21930. }
  21931. // 3. Let processBody given bytes be these steps:
  21932. const processBody = (bytes) => {
  21933. // 1. If bytes do not match request’s integrity metadata,
  21934. // then run processBodyError and abort these steps. [SRI]
  21935. if (!bytesMatch(bytes, request.integrity)) {
  21936. processBodyError('integrity mismatch')
  21937. return
  21938. }
  21939. // 2. Set response’s body to bytes as a body.
  21940. response.body = safelyExtractBody(bytes)[0]
  21941. // 3. Run fetch finale given fetchParams and response.
  21942. fetchFinale(fetchParams, response)
  21943. }
  21944. // 4. Fully read response’s body given processBody and processBodyError.
  21945. await fullyReadBody(response.body, processBody, processBodyError)
  21946. } else {
  21947. // 21. Otherwise, run fetch finale given fetchParams and response.
  21948. fetchFinale(fetchParams, response)
  21949. }
  21950. }
  21951. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  21952. // given a fetch params fetchParams
  21953. function schemeFetch (fetchParams) {
  21954. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  21955. // cancelled state, we do not want this condition to trigger *unless* there have been
  21956. // no redirects. See https://github.com/nodejs/undici/issues/1776
  21957. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  21958. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  21959. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  21960. }
  21961. // 2. Let request be fetchParams’s request.
  21962. const { request } = fetchParams
  21963. const { protocol: scheme } = requestCurrentURL(request)
  21964. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  21965. switch (scheme) {
  21966. case 'about:': {
  21967. // If request’s current URL’s path is the string "blank", then return a new response
  21968. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  21969. // and body is the empty byte sequence as a body.
  21970. // Otherwise, return a network error.
  21971. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  21972. }
  21973. case 'blob:': {
  21974. if (!resolveObjectURL) {
  21975. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  21976. }
  21977. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  21978. const blobURLEntry = requestCurrentURL(request)
  21979. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  21980. // Buffer.resolveObjectURL does not ignore URL queries.
  21981. if (blobURLEntry.search.length !== 0) {
  21982. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  21983. }
  21984. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  21985. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  21986. // object is not a Blob object, then return a network error.
  21987. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  21988. return Promise.resolve(makeNetworkError('invalid method'))
  21989. }
  21990. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  21991. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  21992. // 4. Let body be bodyWithType’s body.
  21993. const body = bodyWithType[0]
  21994. // 5. Let length be body’s length, serialized and isomorphic encoded.
  21995. const length = isomorphicEncode(`${body.length}`)
  21996. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  21997. const type = bodyWithType[1] ?? ''
  21998. // 7. Return a new response whose status message is `OK`, header list is
  21999. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22000. const response = makeResponse({
  22001. statusText: 'OK',
  22002. headersList: [
  22003. ['content-length', { name: 'Content-Length', value: length }],
  22004. ['content-type', { name: 'Content-Type', value: type }]
  22005. ]
  22006. })
  22007. response.body = body
  22008. return Promise.resolve(response)
  22009. }
  22010. case 'data:': {
  22011. // 1. Let dataURLStruct be the result of running the
  22012. // data: URL processor on request’s current URL.
  22013. const currentURL = requestCurrentURL(request)
  22014. const dataURLStruct = dataURLProcessor(currentURL)
  22015. // 2. If dataURLStruct is failure, then return a
  22016. // network error.
  22017. if (dataURLStruct === 'failure') {
  22018. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22019. }
  22020. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22021. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22022. // 4. Return a response whose status message is `OK`,
  22023. // header list is « (`Content-Type`, mimeType) »,
  22024. // and body is dataURLStruct’s body as a body.
  22025. return Promise.resolve(makeResponse({
  22026. statusText: 'OK',
  22027. headersList: [
  22028. ['content-type', { name: 'Content-Type', value: mimeType }]
  22029. ],
  22030. body: safelyExtractBody(dataURLStruct.body)[0]
  22031. }))
  22032. }
  22033. case 'file:': {
  22034. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22035. // When in doubt, return a network error.
  22036. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22037. }
  22038. case 'http:':
  22039. case 'https:': {
  22040. // Return the result of running HTTP fetch given fetchParams.
  22041. return httpFetch(fetchParams)
  22042. .catch((err) => makeNetworkError(err))
  22043. }
  22044. default: {
  22045. return Promise.resolve(makeNetworkError('unknown scheme'))
  22046. }
  22047. }
  22048. }
  22049. // https://fetch.spec.whatwg.org/#finalize-response
  22050. function finalizeResponse (fetchParams, response) {
  22051. // 1. Set fetchParams’s request’s done flag.
  22052. fetchParams.request.done = true
  22053. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22054. // task to run fetchParams’s process response done given response, with
  22055. // fetchParams’s task destination.
  22056. if (fetchParams.processResponseDone != null) {
  22057. queueMicrotask(() => fetchParams.processResponseDone(response))
  22058. }
  22059. }
  22060. // https://fetch.spec.whatwg.org/#fetch-finale
  22061. function fetchFinale (fetchParams, response) {
  22062. // 1. If response is a network error, then:
  22063. if (response.type === 'error') {
  22064. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22065. response.urlList = [fetchParams.request.urlList[0]]
  22066. // 2. Set response’s timing info to the result of creating an opaque timing
  22067. // info for fetchParams’s timing info.
  22068. response.timingInfo = createOpaqueTimingInfo({
  22069. startTime: fetchParams.timingInfo.startTime
  22070. })
  22071. }
  22072. // 2. Let processResponseEndOfBody be the following steps:
  22073. const processResponseEndOfBody = () => {
  22074. // 1. Set fetchParams’s request’s done flag.
  22075. fetchParams.request.done = true
  22076. // If fetchParams’s process response end-of-body is not null,
  22077. // then queue a fetch task to run fetchParams’s process response
  22078. // end-of-body given response with fetchParams’s task destination.
  22079. if (fetchParams.processResponseEndOfBody != null) {
  22080. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22081. }
  22082. }
  22083. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22084. // to run fetchParams’s process response given response, with fetchParams’s
  22085. // task destination.
  22086. if (fetchParams.processResponse != null) {
  22087. queueMicrotask(() => fetchParams.processResponse(response))
  22088. }
  22089. // 4. If response’s body is null, then run processResponseEndOfBody.
  22090. if (response.body == null) {
  22091. processResponseEndOfBody()
  22092. } else {
  22093. // 5. Otherwise:
  22094. // 1. Let transformStream be a new a TransformStream.
  22095. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22096. // enqueues chunk in transformStream.
  22097. const identityTransformAlgorithm = (chunk, controller) => {
  22098. controller.enqueue(chunk)
  22099. }
  22100. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22101. // and flushAlgorithm set to processResponseEndOfBody.
  22102. const transformStream = new TransformStream({
  22103. start () {},
  22104. transform: identityTransformAlgorithm,
  22105. flush: processResponseEndOfBody
  22106. }, {
  22107. size () {
  22108. return 1
  22109. }
  22110. }, {
  22111. size () {
  22112. return 1
  22113. }
  22114. })
  22115. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22116. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22117. }
  22118. // 6. If fetchParams’s process response consume body is non-null, then:
  22119. if (fetchParams.processResponseConsumeBody != null) {
  22120. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22121. // process response consume body given response and nullOrBytes.
  22122. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22123. // 2. Let processBodyError be this step: run fetchParams’s process
  22124. // response consume body given response and failure.
  22125. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22126. // 3. If response’s body is null, then queue a fetch task to run processBody
  22127. // given null, with fetchParams’s task destination.
  22128. if (response.body == null) {
  22129. queueMicrotask(() => processBody(null))
  22130. } else {
  22131. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22132. // and fetchParams’s task destination.
  22133. return fullyReadBody(response.body, processBody, processBodyError)
  22134. }
  22135. return Promise.resolve()
  22136. }
  22137. }
  22138. // https://fetch.spec.whatwg.org/#http-fetch
  22139. async function httpFetch (fetchParams) {
  22140. // 1. Let request be fetchParams’s request.
  22141. const request = fetchParams.request
  22142. // 2. Let response be null.
  22143. let response = null
  22144. // 3. Let actualResponse be null.
  22145. let actualResponse = null
  22146. // 4. Let timingInfo be fetchParams’s timing info.
  22147. const timingInfo = fetchParams.timingInfo
  22148. // 5. If request’s service-workers mode is "all", then:
  22149. if (request.serviceWorkers === 'all') {
  22150. // TODO
  22151. }
  22152. // 6. If response is null, then:
  22153. if (response === null) {
  22154. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22155. // TODO
  22156. // 2. If request’s redirect mode is "follow", then set request’s
  22157. // service-workers mode to "none".
  22158. if (request.redirect === 'follow') {
  22159. request.serviceWorkers = 'none'
  22160. }
  22161. // 3. Set response and actualResponse to the result of running
  22162. // HTTP-network-or-cache fetch given fetchParams.
  22163. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22164. // 4. If request’s response tainting is "cors" and a CORS check
  22165. // for request and response returns failure, then return a network error.
  22166. if (
  22167. request.responseTainting === 'cors' &&
  22168. corsCheck(request, response) === 'failure'
  22169. ) {
  22170. return makeNetworkError('cors failure')
  22171. }
  22172. // 5. If the TAO check for request and response returns failure, then set
  22173. // request’s timing allow failed flag.
  22174. if (TAOCheck(request, response) === 'failure') {
  22175. request.timingAllowFailed = true
  22176. }
  22177. }
  22178. // 7. If either request’s response tainting or response’s type
  22179. // is "opaque", and the cross-origin resource policy check with
  22180. // request’s origin, request’s client, request’s destination,
  22181. // and actualResponse returns blocked, then return a network error.
  22182. if (
  22183. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22184. crossOriginResourcePolicyCheck(
  22185. request.origin,
  22186. request.client,
  22187. request.destination,
  22188. actualResponse
  22189. ) === 'blocked'
  22190. ) {
  22191. return makeNetworkError('blocked')
  22192. }
  22193. // 8. If actualResponse’s status is a redirect status, then:
  22194. if (redirectStatusSet.has(actualResponse.status)) {
  22195. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22196. // and the connection uses HTTP/2, then user agents may, and are even
  22197. // encouraged to, transmit an RST_STREAM frame.
  22198. // See, https://github.com/whatwg/fetch/issues/1288
  22199. if (request.redirect !== 'manual') {
  22200. fetchParams.controller.connection.destroy()
  22201. }
  22202. // 2. Switch on request’s redirect mode:
  22203. if (request.redirect === 'error') {
  22204. // Set response to a network error.
  22205. response = makeNetworkError('unexpected redirect')
  22206. } else if (request.redirect === 'manual') {
  22207. // Set response to an opaque-redirect filtered response whose internal
  22208. // response is actualResponse.
  22209. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22210. // but that doesn't make sense server side.
  22211. // See https://github.com/nodejs/undici/issues/1193.
  22212. response = actualResponse
  22213. } else if (request.redirect === 'follow') {
  22214. // Set response to the result of running HTTP-redirect fetch given
  22215. // fetchParams and response.
  22216. response = await httpRedirectFetch(fetchParams, response)
  22217. } else {
  22218. assert(false)
  22219. }
  22220. }
  22221. // 9. Set response’s timing info to timingInfo.
  22222. response.timingInfo = timingInfo
  22223. // 10. Return response.
  22224. return response
  22225. }
  22226. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22227. function httpRedirectFetch (fetchParams, response) {
  22228. // 1. Let request be fetchParams’s request.
  22229. const request = fetchParams.request
  22230. // 2. Let actualResponse be response, if response is not a filtered response,
  22231. // and response’s internal response otherwise.
  22232. const actualResponse = response.internalResponse
  22233. ? response.internalResponse
  22234. : response
  22235. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22236. // URL’s fragment.
  22237. let locationURL
  22238. try {
  22239. locationURL = responseLocationURL(
  22240. actualResponse,
  22241. requestCurrentURL(request).hash
  22242. )
  22243. // 4. If locationURL is null, then return response.
  22244. if (locationURL == null) {
  22245. return response
  22246. }
  22247. } catch (err) {
  22248. // 5. If locationURL is failure, then return a network error.
  22249. return Promise.resolve(makeNetworkError(err))
  22250. }
  22251. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22252. // error.
  22253. if (!urlIsHttpHttpsScheme(locationURL)) {
  22254. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22255. }
  22256. // 7. If request’s redirect count is 20, then return a network error.
  22257. if (request.redirectCount === 20) {
  22258. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22259. }
  22260. // 8. Increase request’s redirect count by 1.
  22261. request.redirectCount += 1
  22262. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22263. // request’s origin is not same origin with locationURL’s origin, then return
  22264. // a network error.
  22265. if (
  22266. request.mode === 'cors' &&
  22267. (locationURL.username || locationURL.password) &&
  22268. !sameOrigin(request, locationURL)
  22269. ) {
  22270. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22271. }
  22272. // 10. If request’s response tainting is "cors" and locationURL includes
  22273. // credentials, then return a network error.
  22274. if (
  22275. request.responseTainting === 'cors' &&
  22276. (locationURL.username || locationURL.password)
  22277. ) {
  22278. return Promise.resolve(makeNetworkError(
  22279. 'URL cannot contain credentials for request mode "cors"'
  22280. ))
  22281. }
  22282. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22283. // and request’s body’s source is null, then return a network error.
  22284. if (
  22285. actualResponse.status !== 303 &&
  22286. request.body != null &&
  22287. request.body.source == null
  22288. ) {
  22289. return Promise.resolve(makeNetworkError())
  22290. }
  22291. // 12. If one of the following is true
  22292. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22293. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22294. if (
  22295. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22296. (actualResponse.status === 303 &&
  22297. !GET_OR_HEAD.includes(request.method))
  22298. ) {
  22299. // then:
  22300. // 1. Set request’s method to `GET` and request’s body to null.
  22301. request.method = 'GET'
  22302. request.body = null
  22303. // 2. For each headerName of request-body-header name, delete headerName from
  22304. // request’s header list.
  22305. for (const headerName of requestBodyHeader) {
  22306. request.headersList.delete(headerName)
  22307. }
  22308. }
  22309. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22310. // origin, then for each headerName of CORS non-wildcard request-header name,
  22311. // delete headerName from request’s header list.
  22312. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22313. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22314. request.headersList.delete('authorization')
  22315. // https://fetch.spec.whatwg.org/#authentication-entries
  22316. request.headersList.delete('proxy-authorization', true)
  22317. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22318. request.headersList.delete('cookie')
  22319. request.headersList.delete('host')
  22320. }
  22321. // 14. If request’s body is non-null, then set request’s body to the first return
  22322. // value of safely extracting request’s body’s source.
  22323. if (request.body != null) {
  22324. assert(request.body.source != null)
  22325. request.body = safelyExtractBody(request.body.source)[0]
  22326. }
  22327. // 15. Let timingInfo be fetchParams’s timing info.
  22328. const timingInfo = fetchParams.timingInfo
  22329. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22330. // coarsened shared current time given fetchParams’s cross-origin isolated
  22331. // capability.
  22332. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22333. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22334. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22335. // redirect start time to timingInfo’s start time.
  22336. if (timingInfo.redirectStartTime === 0) {
  22337. timingInfo.redirectStartTime = timingInfo.startTime
  22338. }
  22339. // 18. Append locationURL to request’s URL list.
  22340. request.urlList.push(locationURL)
  22341. // 19. Invoke set request’s referrer policy on redirect on request and
  22342. // actualResponse.
  22343. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22344. // 20. Return the result of running main fetch given fetchParams and true.
  22345. return mainFetch(fetchParams, true)
  22346. }
  22347. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22348. async function httpNetworkOrCacheFetch (
  22349. fetchParams,
  22350. isAuthenticationFetch = false,
  22351. isNewConnectionFetch = false
  22352. ) {
  22353. // 1. Let request be fetchParams’s request.
  22354. const request = fetchParams.request
  22355. // 2. Let httpFetchParams be null.
  22356. let httpFetchParams = null
  22357. // 3. Let httpRequest be null.
  22358. let httpRequest = null
  22359. // 4. Let response be null.
  22360. let response = null
  22361. // 5. Let storedResponse be null.
  22362. // TODO: cache
  22363. // 6. Let httpCache be null.
  22364. const httpCache = null
  22365. // 7. Let the revalidatingFlag be unset.
  22366. const revalidatingFlag = false
  22367. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22368. // 1. If request’s window is "no-window" and request’s redirect mode is
  22369. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22370. // request.
  22371. if (request.window === 'no-window' && request.redirect === 'error') {
  22372. httpFetchParams = fetchParams
  22373. httpRequest = request
  22374. } else {
  22375. // Otherwise:
  22376. // 1. Set httpRequest to a clone of request.
  22377. httpRequest = makeRequest(request)
  22378. // 2. Set httpFetchParams to a copy of fetchParams.
  22379. httpFetchParams = { ...fetchParams }
  22380. // 3. Set httpFetchParams’s request to httpRequest.
  22381. httpFetchParams.request = httpRequest
  22382. }
  22383. // 3. Let includeCredentials be true if one of
  22384. const includeCredentials =
  22385. request.credentials === 'include' ||
  22386. (request.credentials === 'same-origin' &&
  22387. request.responseTainting === 'basic')
  22388. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22389. // body is non-null; otherwise null.
  22390. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22391. // 5. Let contentLengthHeaderValue be null.
  22392. let contentLengthHeaderValue = null
  22393. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22394. // `PUT`, then set contentLengthHeaderValue to `0`.
  22395. if (
  22396. httpRequest.body == null &&
  22397. ['POST', 'PUT'].includes(httpRequest.method)
  22398. ) {
  22399. contentLengthHeaderValue = '0'
  22400. }
  22401. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22402. // contentLength, serialized and isomorphic encoded.
  22403. if (contentLength != null) {
  22404. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22405. }
  22406. // 8. If contentLengthHeaderValue is non-null, then append
  22407. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22408. // list.
  22409. if (contentLengthHeaderValue != null) {
  22410. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22411. }
  22412. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22413. // contentLengthHeaderValue) to httpRequest’s header list.
  22414. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22415. // then:
  22416. if (contentLength != null && httpRequest.keepalive) {
  22417. // NOTE: keepalive is a noop outside of browser context.
  22418. }
  22419. // 11. If httpRequest’s referrer is a URL, then append
  22420. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22421. // to httpRequest’s header list.
  22422. if (httpRequest.referrer instanceof URL) {
  22423. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22424. }
  22425. // 12. Append a request `Origin` header for httpRequest.
  22426. appendRequestOriginHeader(httpRequest)
  22427. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22428. appendFetchMetadata(httpRequest)
  22429. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22430. // user agents should append `User-Agent`/default `User-Agent` value to
  22431. // httpRequest’s header list.
  22432. if (!httpRequest.headersList.contains('user-agent')) {
  22433. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22434. }
  22435. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22436. // list contains `If-Modified-Since`, `If-None-Match`,
  22437. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22438. // httpRequest’s cache mode to "no-store".
  22439. if (
  22440. httpRequest.cache === 'default' &&
  22441. (httpRequest.headersList.contains('if-modified-since') ||
  22442. httpRequest.headersList.contains('if-none-match') ||
  22443. httpRequest.headersList.contains('if-unmodified-since') ||
  22444. httpRequest.headersList.contains('if-match') ||
  22445. httpRequest.headersList.contains('if-range'))
  22446. ) {
  22447. httpRequest.cache = 'no-store'
  22448. }
  22449. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22450. // no-cache cache-control header modification flag is unset, and
  22451. // httpRequest’s header list does not contain `Cache-Control`, then append
  22452. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22453. if (
  22454. httpRequest.cache === 'no-cache' &&
  22455. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22456. !httpRequest.headersList.contains('cache-control')
  22457. ) {
  22458. httpRequest.headersList.append('cache-control', 'max-age=0')
  22459. }
  22460. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22461. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22462. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22463. // `Pragma`/`no-cache` to httpRequest’s header list.
  22464. if (!httpRequest.headersList.contains('pragma')) {
  22465. httpRequest.headersList.append('pragma', 'no-cache')
  22466. }
  22467. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22468. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22469. if (!httpRequest.headersList.contains('cache-control')) {
  22470. httpRequest.headersList.append('cache-control', 'no-cache')
  22471. }
  22472. }
  22473. // 18. If httpRequest’s header list contains `Range`, then append
  22474. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22475. if (httpRequest.headersList.contains('range')) {
  22476. httpRequest.headersList.append('accept-encoding', 'identity')
  22477. }
  22478. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22479. // header if httpRequest’s header list contains that header’s name.
  22480. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22481. if (!httpRequest.headersList.contains('accept-encoding')) {
  22482. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22483. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22484. } else {
  22485. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22486. }
  22487. }
  22488. httpRequest.headersList.delete('host')
  22489. // 20. If includeCredentials is true, then:
  22490. if (includeCredentials) {
  22491. // 1. If the user agent is not configured to block cookies for httpRequest
  22492. // (see section 7 of [COOKIES]), then:
  22493. // TODO: credentials
  22494. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22495. // TODO: credentials
  22496. }
  22497. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22498. // TODO: proxy-authentication
  22499. // 22. Set httpCache to the result of determining the HTTP cache
  22500. // partition, given httpRequest.
  22501. // TODO: cache
  22502. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22503. // "no-store".
  22504. if (httpCache == null) {
  22505. httpRequest.cache = 'no-store'
  22506. }
  22507. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22508. // then:
  22509. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22510. // TODO: cache
  22511. }
  22512. // 9. If aborted, then return the appropriate network error for fetchParams.
  22513. // TODO
  22514. // 10. If response is null, then:
  22515. if (response == null) {
  22516. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22517. // network error.
  22518. if (httpRequest.mode === 'only-if-cached') {
  22519. return makeNetworkError('only if cached')
  22520. }
  22521. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22522. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22523. const forwardResponse = await httpNetworkFetch(
  22524. httpFetchParams,
  22525. includeCredentials,
  22526. isNewConnectionFetch
  22527. )
  22528. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22529. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22530. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22531. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22532. if (
  22533. !safeMethodsSet.has(httpRequest.method) &&
  22534. forwardResponse.status >= 200 &&
  22535. forwardResponse.status <= 399
  22536. ) {
  22537. // TODO: cache
  22538. }
  22539. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22540. // then:
  22541. if (revalidatingFlag && forwardResponse.status === 304) {
  22542. // TODO: cache
  22543. }
  22544. // 5. If response is null, then:
  22545. if (response == null) {
  22546. // 1. Set response to forwardResponse.
  22547. response = forwardResponse
  22548. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22549. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22550. // TODO: cache
  22551. }
  22552. }
  22553. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22554. response.urlList = [...httpRequest.urlList]
  22555. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22556. // range-requested flag.
  22557. if (httpRequest.headersList.contains('range')) {
  22558. response.rangeRequested = true
  22559. }
  22560. // 13. Set response’s request-includes-credentials to includeCredentials.
  22561. response.requestIncludesCredentials = includeCredentials
  22562. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22563. // "cors", includeCredentials is true, and request’s window is an environment
  22564. // settings object, then:
  22565. // TODO
  22566. // 15. If response’s status is 407, then:
  22567. if (response.status === 407) {
  22568. // 1. If request’s window is "no-window", then return a network error.
  22569. if (request.window === 'no-window') {
  22570. return makeNetworkError()
  22571. }
  22572. // 2. ???
  22573. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22574. if (isCancelled(fetchParams)) {
  22575. return makeAppropriateNetworkError(fetchParams)
  22576. }
  22577. // 4. Prompt the end user as appropriate in request’s window and store
  22578. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22579. // TODO: Invoke some kind of callback?
  22580. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22581. // fetchParams.
  22582. // TODO
  22583. return makeNetworkError('proxy authentication required')
  22584. }
  22585. // 16. If all of the following are true
  22586. if (
  22587. // response’s status is 421
  22588. response.status === 421 &&
  22589. // isNewConnectionFetch is false
  22590. !isNewConnectionFetch &&
  22591. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22592. (request.body == null || request.body.source != null)
  22593. ) {
  22594. // then:
  22595. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22596. if (isCancelled(fetchParams)) {
  22597. return makeAppropriateNetworkError(fetchParams)
  22598. }
  22599. // 2. Set response to the result of running HTTP-network-or-cache
  22600. // fetch given fetchParams, isAuthenticationFetch, and true.
  22601. // TODO (spec): The spec doesn't specify this but we need to cancel
  22602. // the active response before we can start a new one.
  22603. // https://github.com/whatwg/fetch/issues/1293
  22604. fetchParams.controller.connection.destroy()
  22605. response = await httpNetworkOrCacheFetch(
  22606. fetchParams,
  22607. isAuthenticationFetch,
  22608. true
  22609. )
  22610. }
  22611. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22612. if (isAuthenticationFetch) {
  22613. // TODO
  22614. }
  22615. // 18. Return response.
  22616. return response
  22617. }
  22618. // https://fetch.spec.whatwg.org/#http-network-fetch
  22619. async function httpNetworkFetch (
  22620. fetchParams,
  22621. includeCredentials = false,
  22622. forceNewConnection = false
  22623. ) {
  22624. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22625. fetchParams.controller.connection = {
  22626. abort: null,
  22627. destroyed: false,
  22628. destroy (err) {
  22629. if (!this.destroyed) {
  22630. this.destroyed = true
  22631. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22632. }
  22633. }
  22634. }
  22635. // 1. Let request be fetchParams’s request.
  22636. const request = fetchParams.request
  22637. // 2. Let response be null.
  22638. let response = null
  22639. // 3. Let timingInfo be fetchParams’s timing info.
  22640. const timingInfo = fetchParams.timingInfo
  22641. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22642. // given request.
  22643. // TODO: cache
  22644. const httpCache = null
  22645. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22646. if (httpCache == null) {
  22647. request.cache = 'no-store'
  22648. }
  22649. // 6. Let networkPartitionKey be the result of determining the network
  22650. // partition key given request.
  22651. // TODO
  22652. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22653. // "no".
  22654. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22655. // 8. Switch on request’s mode:
  22656. if (request.mode === 'websocket') {
  22657. // Let connection be the result of obtaining a WebSocket connection,
  22658. // given request’s current URL.
  22659. // TODO
  22660. } else {
  22661. // Let connection be the result of obtaining a connection, given
  22662. // networkPartitionKey, request’s current URL’s origin,
  22663. // includeCredentials, and forceNewConnection.
  22664. // TODO
  22665. }
  22666. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22667. // 1. If connection is failure, then return a network error.
  22668. // 2. Set timingInfo’s final connection timing info to the result of
  22669. // calling clamp and coarsen connection timing info with connection’s
  22670. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22671. // cross-origin isolated capability.
  22672. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22673. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22674. // `chunked`) to request’s header list.
  22675. // 4. Set timingInfo’s final network-request start time to the coarsened
  22676. // shared current time given fetchParams’s cross-origin isolated
  22677. // capability.
  22678. // 5. Set response to the result of making an HTTP request over connection
  22679. // using request with the following caveats:
  22680. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22681. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22682. // - If request’s body is non-null, and request’s body’s source is null,
  22683. // then the user agent may have a buffer of up to 64 kibibytes and store
  22684. // a part of request’s body in that buffer. If the user agent reads from
  22685. // request’s body beyond that buffer’s size and the user agent needs to
  22686. // resend request, then instead return a network error.
  22687. // - Set timingInfo’s final network-response start time to the coarsened
  22688. // shared current time given fetchParams’s cross-origin isolated capability,
  22689. // immediately after the user agent’s HTTP parser receives the first byte
  22690. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22691. // line for HTTP/1.x).
  22692. // - Wait until all the headers are transmitted.
  22693. // - Any responses whose status is in the range 100 to 199, inclusive,
  22694. // and is not 101, are to be ignored, except for the purposes of setting
  22695. // timingInfo’s final network-response start time above.
  22696. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22697. // response is transferred via HTTP/1.0 or older, then return a network
  22698. // error.
  22699. // - If the HTTP request results in a TLS client certificate dialog, then:
  22700. // 1. If request’s window is an environment settings object, make the
  22701. // dialog available in request’s window.
  22702. // 2. Otherwise, return a network error.
  22703. // To transmit request’s body body, run these steps:
  22704. let requestBody = null
  22705. // 1. If body is null and fetchParams’s process request end-of-body is
  22706. // non-null, then queue a fetch task given fetchParams’s process request
  22707. // end-of-body and fetchParams’s task destination.
  22708. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22709. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22710. } else if (request.body != null) {
  22711. // 2. Otherwise, if body is non-null:
  22712. // 1. Let processBodyChunk given bytes be these steps:
  22713. const processBodyChunk = async function * (bytes) {
  22714. // 1. If the ongoing fetch is terminated, then abort these steps.
  22715. if (isCancelled(fetchParams)) {
  22716. return
  22717. }
  22718. // 2. Run this step in parallel: transmit bytes.
  22719. yield bytes
  22720. // 3. If fetchParams’s process request body is non-null, then run
  22721. // fetchParams’s process request body given bytes’s length.
  22722. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  22723. }
  22724. // 2. Let processEndOfBody be these steps:
  22725. const processEndOfBody = () => {
  22726. // 1. If fetchParams is canceled, then abort these steps.
  22727. if (isCancelled(fetchParams)) {
  22728. return
  22729. }
  22730. // 2. If fetchParams’s process request end-of-body is non-null,
  22731. // then run fetchParams’s process request end-of-body.
  22732. if (fetchParams.processRequestEndOfBody) {
  22733. fetchParams.processRequestEndOfBody()
  22734. }
  22735. }
  22736. // 3. Let processBodyError given e be these steps:
  22737. const processBodyError = (e) => {
  22738. // 1. If fetchParams is canceled, then abort these steps.
  22739. if (isCancelled(fetchParams)) {
  22740. return
  22741. }
  22742. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  22743. if (e.name === 'AbortError') {
  22744. fetchParams.controller.abort()
  22745. } else {
  22746. fetchParams.controller.terminate(e)
  22747. }
  22748. }
  22749. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  22750. // processBodyError, and fetchParams’s task destination.
  22751. requestBody = (async function * () {
  22752. try {
  22753. for await (const bytes of request.body.stream) {
  22754. yield * processBodyChunk(bytes)
  22755. }
  22756. processEndOfBody()
  22757. } catch (err) {
  22758. processBodyError(err)
  22759. }
  22760. })()
  22761. }
  22762. try {
  22763. // socket is only provided for websockets
  22764. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  22765. if (socket) {
  22766. response = makeResponse({ status, statusText, headersList, socket })
  22767. } else {
  22768. const iterator = body[Symbol.asyncIterator]()
  22769. fetchParams.controller.next = () => iterator.next()
  22770. response = makeResponse({ status, statusText, headersList })
  22771. }
  22772. } catch (err) {
  22773. // 10. If aborted, then:
  22774. if (err.name === 'AbortError') {
  22775. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22776. fetchParams.controller.connection.destroy()
  22777. // 2. Return the appropriate network error for fetchParams.
  22778. return makeAppropriateNetworkError(fetchParams, err)
  22779. }
  22780. return makeNetworkError(err)
  22781. }
  22782. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  22783. // if it is suspended.
  22784. const pullAlgorithm = () => {
  22785. fetchParams.controller.resume()
  22786. }
  22787. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  22788. // controller with reason, given reason.
  22789. const cancelAlgorithm = (reason) => {
  22790. fetchParams.controller.abort(reason)
  22791. }
  22792. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  22793. // the user agent.
  22794. // TODO
  22795. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  22796. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  22797. // TODO
  22798. // 15. Let stream be a new ReadableStream.
  22799. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  22800. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  22801. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  22802. if (!ReadableStream) {
  22803. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  22804. }
  22805. const stream = new ReadableStream(
  22806. {
  22807. async start (controller) {
  22808. fetchParams.controller.controller = controller
  22809. },
  22810. async pull (controller) {
  22811. await pullAlgorithm(controller)
  22812. },
  22813. async cancel (reason) {
  22814. await cancelAlgorithm(reason)
  22815. }
  22816. },
  22817. {
  22818. highWaterMark: 0,
  22819. size () {
  22820. return 1
  22821. }
  22822. }
  22823. )
  22824. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  22825. // 1. Set response’s body to a new body whose stream is stream.
  22826. response.body = { stream }
  22827. // 2. If response is not a network error and request’s cache mode is
  22828. // not "no-store", then update response in httpCache for request.
  22829. // TODO
  22830. // 3. If includeCredentials is true and the user agent is not configured
  22831. // to block cookies for request (see section 7 of [COOKIES]), then run the
  22832. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  22833. // the value of each header whose name is a byte-case-insensitive match for
  22834. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  22835. // TODO
  22836. // 18. If aborted, then:
  22837. // TODO
  22838. // 19. Run these steps in parallel:
  22839. // 1. Run these steps, but abort when fetchParams is canceled:
  22840. fetchParams.controller.on('terminated', onAborted)
  22841. fetchParams.controller.resume = async () => {
  22842. // 1. While true
  22843. while (true) {
  22844. // 1-3. See onData...
  22845. // 4. Set bytes to the result of handling content codings given
  22846. // codings and bytes.
  22847. let bytes
  22848. let isFailure
  22849. try {
  22850. const { done, value } = await fetchParams.controller.next()
  22851. if (isAborted(fetchParams)) {
  22852. break
  22853. }
  22854. bytes = done ? undefined : value
  22855. } catch (err) {
  22856. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  22857. // zlib doesn't like empty streams.
  22858. bytes = undefined
  22859. } else {
  22860. bytes = err
  22861. // err may be propagated from the result of calling readablestream.cancel,
  22862. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  22863. isFailure = true
  22864. }
  22865. }
  22866. if (bytes === undefined) {
  22867. // 2. Otherwise, if the bytes transmission for response’s message
  22868. // body is done normally and stream is readable, then close
  22869. // stream, finalize response for fetchParams and response, and
  22870. // abort these in-parallel steps.
  22871. readableStreamClose(fetchParams.controller.controller)
  22872. finalizeResponse(fetchParams, response)
  22873. return
  22874. }
  22875. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  22876. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  22877. // 6. If bytes is failure, then terminate fetchParams’s controller.
  22878. if (isFailure) {
  22879. fetchParams.controller.terminate(bytes)
  22880. return
  22881. }
  22882. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  22883. // into stream.
  22884. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  22885. // 8. If stream is errored, then terminate the ongoing fetch.
  22886. if (isErrored(stream)) {
  22887. fetchParams.controller.terminate()
  22888. return
  22889. }
  22890. // 9. If stream doesn’t need more data ask the user agent to suspend
  22891. // the ongoing fetch.
  22892. if (!fetchParams.controller.controller.desiredSize) {
  22893. return
  22894. }
  22895. }
  22896. }
  22897. // 2. If aborted, then:
  22898. function onAborted (reason) {
  22899. // 2. If fetchParams is aborted, then:
  22900. if (isAborted(fetchParams)) {
  22901. // 1. Set response’s aborted flag.
  22902. response.aborted = true
  22903. // 2. If stream is readable, then error stream with the result of
  22904. // deserialize a serialized abort reason given fetchParams’s
  22905. // controller’s serialized abort reason and an
  22906. // implementation-defined realm.
  22907. if (isReadable(stream)) {
  22908. fetchParams.controller.controller.error(
  22909. fetchParams.controller.serializedAbortReason
  22910. )
  22911. }
  22912. } else {
  22913. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  22914. if (isReadable(stream)) {
  22915. fetchParams.controller.controller.error(new TypeError('terminated', {
  22916. cause: isErrorLike(reason) ? reason : undefined
  22917. }))
  22918. }
  22919. }
  22920. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22921. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  22922. fetchParams.controller.connection.destroy()
  22923. }
  22924. // 20. Return response.
  22925. return response
  22926. async function dispatch ({ body }) {
  22927. const url = requestCurrentURL(request)
  22928. /** @type {import('../..').Agent} */
  22929. const agent = fetchParams.controller.dispatcher
  22930. return new Promise((resolve, reject) => agent.dispatch(
  22931. {
  22932. path: url.pathname + url.search,
  22933. origin: url.origin,
  22934. method: request.method,
  22935. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  22936. headers: request.headersList.entries,
  22937. maxRedirections: 0,
  22938. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  22939. },
  22940. {
  22941. body: null,
  22942. abort: null,
  22943. onConnect (abort) {
  22944. // TODO (fix): Do we need connection here?
  22945. const { connection } = fetchParams.controller
  22946. if (connection.destroyed) {
  22947. abort(new DOMException('The operation was aborted.', 'AbortError'))
  22948. } else {
  22949. fetchParams.controller.on('terminated', abort)
  22950. this.abort = connection.abort = abort
  22951. }
  22952. },
  22953. onHeaders (status, headersList, resume, statusText) {
  22954. if (status < 200) {
  22955. return
  22956. }
  22957. let codings = []
  22958. let location = ''
  22959. const headers = new Headers()
  22960. // For H2, the headers are a plain JS object
  22961. // We distinguish between them and iterate accordingly
  22962. if (Array.isArray(headersList)) {
  22963. for (let n = 0; n < headersList.length; n += 2) {
  22964. const key = headersList[n + 0].toString('latin1')
  22965. const val = headersList[n + 1].toString('latin1')
  22966. if (key.toLowerCase() === 'content-encoding') {
  22967. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22968. // "All content-coding values are case-insensitive..."
  22969. codings = val.toLowerCase().split(',').map((x) => x.trim())
  22970. } else if (key.toLowerCase() === 'location') {
  22971. location = val
  22972. }
  22973. headers[kHeadersList].append(key, val)
  22974. }
  22975. } else {
  22976. const keys = Object.keys(headersList)
  22977. for (const key of keys) {
  22978. const val = headersList[key]
  22979. if (key.toLowerCase() === 'content-encoding') {
  22980. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22981. // "All content-coding values are case-insensitive..."
  22982. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  22983. } else if (key.toLowerCase() === 'location') {
  22984. location = val
  22985. }
  22986. headers[kHeadersList].append(key, val)
  22987. }
  22988. }
  22989. this.body = new Readable({ read: resume })
  22990. const decoders = []
  22991. const willFollow = request.redirect === 'follow' &&
  22992. location &&
  22993. redirectStatusSet.has(status)
  22994. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  22995. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  22996. for (const coding of codings) {
  22997. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  22998. if (coding === 'x-gzip' || coding === 'gzip') {
  22999. decoders.push(zlib.createGunzip({
  23000. // Be less strict when decoding compressed responses, since sometimes
  23001. // servers send slightly invalid responses that are still accepted
  23002. // by common browsers.
  23003. // Always using Z_SYNC_FLUSH is what cURL does.
  23004. flush: zlib.constants.Z_SYNC_FLUSH,
  23005. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23006. }))
  23007. } else if (coding === 'deflate') {
  23008. decoders.push(zlib.createInflate())
  23009. } else if (coding === 'br') {
  23010. decoders.push(zlib.createBrotliDecompress())
  23011. } else {
  23012. decoders.length = 0
  23013. break
  23014. }
  23015. }
  23016. }
  23017. resolve({
  23018. status,
  23019. statusText,
  23020. headersList: headers[kHeadersList],
  23021. body: decoders.length
  23022. ? pipeline(this.body, ...decoders, () => { })
  23023. : this.body.on('error', () => {})
  23024. })
  23025. return true
  23026. },
  23027. onData (chunk) {
  23028. if (fetchParams.controller.dump) {
  23029. return
  23030. }
  23031. // 1. If one or more bytes have been transmitted from response’s
  23032. // message body, then:
  23033. // 1. Let bytes be the transmitted bytes.
  23034. const bytes = chunk
  23035. // 2. Let codings be the result of extracting header list values
  23036. // given `Content-Encoding` and response’s header list.
  23037. // See pullAlgorithm.
  23038. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23039. timingInfo.encodedBodySize += bytes.byteLength
  23040. // 4. See pullAlgorithm...
  23041. return this.body.push(bytes)
  23042. },
  23043. onComplete () {
  23044. if (this.abort) {
  23045. fetchParams.controller.off('terminated', this.abort)
  23046. }
  23047. fetchParams.controller.ended = true
  23048. this.body.push(null)
  23049. },
  23050. onError (error) {
  23051. if (this.abort) {
  23052. fetchParams.controller.off('terminated', this.abort)
  23053. }
  23054. this.body?.destroy(error)
  23055. fetchParams.controller.terminate(error)
  23056. reject(error)
  23057. },
  23058. onUpgrade (status, headersList, socket) {
  23059. if (status !== 101) {
  23060. return
  23061. }
  23062. const headers = new Headers()
  23063. for (let n = 0; n < headersList.length; n += 2) {
  23064. const key = headersList[n + 0].toString('latin1')
  23065. const val = headersList[n + 1].toString('latin1')
  23066. headers[kHeadersList].append(key, val)
  23067. }
  23068. resolve({
  23069. status,
  23070. statusText: STATUS_CODES[status],
  23071. headersList: headers[kHeadersList],
  23072. socket
  23073. })
  23074. return true
  23075. }
  23076. }
  23077. ))
  23078. }
  23079. }
  23080. module.exports = {
  23081. fetch,
  23082. Fetch,
  23083. fetching,
  23084. finalizeAndReportTiming
  23085. }
  23086. /***/ }),
  23087. /***/ 8359:
  23088. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23089. "use strict";
  23090. /* globals AbortController */
  23091. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23092. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23093. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23094. const util = __nccwpck_require__(3983)
  23095. const {
  23096. isValidHTTPToken,
  23097. sameOrigin,
  23098. normalizeMethod,
  23099. makePolicyContainer,
  23100. normalizeMethodRecord
  23101. } = __nccwpck_require__(2538)
  23102. const {
  23103. forbiddenMethodsSet,
  23104. corsSafeListedMethodsSet,
  23105. referrerPolicy,
  23106. requestRedirect,
  23107. requestMode,
  23108. requestCredentials,
  23109. requestCache,
  23110. requestDuplex
  23111. } = __nccwpck_require__(1037)
  23112. const { kEnumerableProperty } = util
  23113. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23114. const { webidl } = __nccwpck_require__(1744)
  23115. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23116. const { URLSerializer } = __nccwpck_require__(685)
  23117. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23118. const assert = __nccwpck_require__(9491)
  23119. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23120. let TransformStream = globalThis.TransformStream
  23121. const kAbortController = Symbol('abortController')
  23122. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23123. signal.removeEventListener('abort', abort)
  23124. })
  23125. // https://fetch.spec.whatwg.org/#request-class
  23126. class Request {
  23127. // https://fetch.spec.whatwg.org/#dom-request
  23128. constructor (input, init = {}) {
  23129. if (input === kConstruct) {
  23130. return
  23131. }
  23132. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23133. input = webidl.converters.RequestInfo(input)
  23134. init = webidl.converters.RequestInit(init)
  23135. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23136. this[kRealm] = {
  23137. settingsObject: {
  23138. baseUrl: getGlobalOrigin(),
  23139. get origin () {
  23140. return this.baseUrl?.origin
  23141. },
  23142. policyContainer: makePolicyContainer()
  23143. }
  23144. }
  23145. // 1. Let request be null.
  23146. let request = null
  23147. // 2. Let fallbackMode be null.
  23148. let fallbackMode = null
  23149. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23150. const baseUrl = this[kRealm].settingsObject.baseUrl
  23151. // 4. Let signal be null.
  23152. let signal = null
  23153. // 5. If input is a string, then:
  23154. if (typeof input === 'string') {
  23155. // 1. Let parsedURL be the result of parsing input with baseURL.
  23156. // 2. If parsedURL is failure, then throw a TypeError.
  23157. let parsedURL
  23158. try {
  23159. parsedURL = new URL(input, baseUrl)
  23160. } catch (err) {
  23161. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23162. }
  23163. // 3. If parsedURL includes credentials, then throw a TypeError.
  23164. if (parsedURL.username || parsedURL.password) {
  23165. throw new TypeError(
  23166. 'Request cannot be constructed from a URL that includes credentials: ' +
  23167. input
  23168. )
  23169. }
  23170. // 4. Set request to a new request whose URL is parsedURL.
  23171. request = makeRequest({ urlList: [parsedURL] })
  23172. // 5. Set fallbackMode to "cors".
  23173. fallbackMode = 'cors'
  23174. } else {
  23175. // 6. Otherwise:
  23176. // 7. Assert: input is a Request object.
  23177. assert(input instanceof Request)
  23178. // 8. Set request to input’s request.
  23179. request = input[kState]
  23180. // 9. Set signal to input’s signal.
  23181. signal = input[kSignal]
  23182. }
  23183. // 7. Let origin be this’s relevant settings object’s origin.
  23184. const origin = this[kRealm].settingsObject.origin
  23185. // 8. Let window be "client".
  23186. let window = 'client'
  23187. // 9. If request’s window is an environment settings object and its origin
  23188. // is same origin with origin, then set window to request’s window.
  23189. if (
  23190. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23191. sameOrigin(request.window, origin)
  23192. ) {
  23193. window = request.window
  23194. }
  23195. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23196. if (init.window != null) {
  23197. throw new TypeError(`'window' option '${window}' must be null`)
  23198. }
  23199. // 11. If init["window"] exists, then set window to "no-window".
  23200. if ('window' in init) {
  23201. window = 'no-window'
  23202. }
  23203. // 12. Set request to a new request with the following properties:
  23204. request = makeRequest({
  23205. // URL request’s URL.
  23206. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23207. // method request’s method.
  23208. method: request.method,
  23209. // header list A copy of request’s header list.
  23210. // undici implementation note: headersList is cloned in makeRequest
  23211. headersList: request.headersList,
  23212. // unsafe-request flag Set.
  23213. unsafeRequest: request.unsafeRequest,
  23214. // client This’s relevant settings object.
  23215. client: this[kRealm].settingsObject,
  23216. // window window.
  23217. window,
  23218. // priority request’s priority.
  23219. priority: request.priority,
  23220. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23221. // being handled by a service worker. In this scenario a request can have an origin that is different
  23222. // from the current client.
  23223. origin: request.origin,
  23224. // referrer request’s referrer.
  23225. referrer: request.referrer,
  23226. // referrer policy request’s referrer policy.
  23227. referrerPolicy: request.referrerPolicy,
  23228. // mode request’s mode.
  23229. mode: request.mode,
  23230. // credentials mode request’s credentials mode.
  23231. credentials: request.credentials,
  23232. // cache mode request’s cache mode.
  23233. cache: request.cache,
  23234. // redirect mode request’s redirect mode.
  23235. redirect: request.redirect,
  23236. // integrity metadata request’s integrity metadata.
  23237. integrity: request.integrity,
  23238. // keepalive request’s keepalive.
  23239. keepalive: request.keepalive,
  23240. // reload-navigation flag request’s reload-navigation flag.
  23241. reloadNavigation: request.reloadNavigation,
  23242. // history-navigation flag request’s history-navigation flag.
  23243. historyNavigation: request.historyNavigation,
  23244. // URL list A clone of request’s URL list.
  23245. urlList: [...request.urlList]
  23246. })
  23247. const initHasKey = Object.keys(init).length !== 0
  23248. // 13. If init is not empty, then:
  23249. if (initHasKey) {
  23250. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23251. if (request.mode === 'navigate') {
  23252. request.mode = 'same-origin'
  23253. }
  23254. // 2. Unset request’s reload-navigation flag.
  23255. request.reloadNavigation = false
  23256. // 3. Unset request’s history-navigation flag.
  23257. request.historyNavigation = false
  23258. // 4. Set request’s origin to "client".
  23259. request.origin = 'client'
  23260. // 5. Set request’s referrer to "client"
  23261. request.referrer = 'client'
  23262. // 6. Set request’s referrer policy to the empty string.
  23263. request.referrerPolicy = ''
  23264. // 7. Set request’s URL to request’s current URL.
  23265. request.url = request.urlList[request.urlList.length - 1]
  23266. // 8. Set request’s URL list to « request’s URL ».
  23267. request.urlList = [request.url]
  23268. }
  23269. // 14. If init["referrer"] exists, then:
  23270. if (init.referrer !== undefined) {
  23271. // 1. Let referrer be init["referrer"].
  23272. const referrer = init.referrer
  23273. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23274. if (referrer === '') {
  23275. request.referrer = 'no-referrer'
  23276. } else {
  23277. // 1. Let parsedReferrer be the result of parsing referrer with
  23278. // baseURL.
  23279. // 2. If parsedReferrer is failure, then throw a TypeError.
  23280. let parsedReferrer
  23281. try {
  23282. parsedReferrer = new URL(referrer, baseUrl)
  23283. } catch (err) {
  23284. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23285. }
  23286. // 3. If one of the following is true
  23287. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23288. // - parsedReferrer’s origin is not same origin with origin
  23289. // then set request’s referrer to "client".
  23290. if (
  23291. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23292. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23293. ) {
  23294. request.referrer = 'client'
  23295. } else {
  23296. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23297. request.referrer = parsedReferrer
  23298. }
  23299. }
  23300. }
  23301. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23302. // to it.
  23303. if (init.referrerPolicy !== undefined) {
  23304. request.referrerPolicy = init.referrerPolicy
  23305. }
  23306. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23307. let mode
  23308. if (init.mode !== undefined) {
  23309. mode = init.mode
  23310. } else {
  23311. mode = fallbackMode
  23312. }
  23313. // 17. If mode is "navigate", then throw a TypeError.
  23314. if (mode === 'navigate') {
  23315. throw webidl.errors.exception({
  23316. header: 'Request constructor',
  23317. message: 'invalid request mode navigate.'
  23318. })
  23319. }
  23320. // 18. If mode is non-null, set request’s mode to mode.
  23321. if (mode != null) {
  23322. request.mode = mode
  23323. }
  23324. // 19. If init["credentials"] exists, then set request’s credentials mode
  23325. // to it.
  23326. if (init.credentials !== undefined) {
  23327. request.credentials = init.credentials
  23328. }
  23329. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23330. if (init.cache !== undefined) {
  23331. request.cache = init.cache
  23332. }
  23333. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23334. // not "same-origin", then throw a TypeError.
  23335. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23336. throw new TypeError(
  23337. "'only-if-cached' can be set only with 'same-origin' mode"
  23338. )
  23339. }
  23340. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23341. if (init.redirect !== undefined) {
  23342. request.redirect = init.redirect
  23343. }
  23344. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23345. if (init.integrity != null) {
  23346. request.integrity = String(init.integrity)
  23347. }
  23348. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23349. if (init.keepalive !== undefined) {
  23350. request.keepalive = Boolean(init.keepalive)
  23351. }
  23352. // 25. If init["method"] exists, then:
  23353. if (init.method !== undefined) {
  23354. // 1. Let method be init["method"].
  23355. let method = init.method
  23356. // 2. If method is not a method or method is a forbidden method, then
  23357. // throw a TypeError.
  23358. if (!isValidHTTPToken(method)) {
  23359. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23360. }
  23361. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23362. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23363. }
  23364. // 3. Normalize method.
  23365. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23366. // 4. Set request’s method to method.
  23367. request.method = method
  23368. }
  23369. // 26. If init["signal"] exists, then set signal to it.
  23370. if (init.signal !== undefined) {
  23371. signal = init.signal
  23372. }
  23373. // 27. Set this’s request to request.
  23374. this[kState] = request
  23375. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23376. // Realm.
  23377. // TODO: could this be simplified with AbortSignal.any
  23378. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23379. const ac = new AbortController()
  23380. this[kSignal] = ac.signal
  23381. this[kSignal][kRealm] = this[kRealm]
  23382. // 29. If signal is not null, then make this’s signal follow signal.
  23383. if (signal != null) {
  23384. if (
  23385. !signal ||
  23386. typeof signal.aborted !== 'boolean' ||
  23387. typeof signal.addEventListener !== 'function'
  23388. ) {
  23389. throw new TypeError(
  23390. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23391. )
  23392. }
  23393. if (signal.aborted) {
  23394. ac.abort(signal.reason)
  23395. } else {
  23396. // Keep a strong ref to ac while request object
  23397. // is alive. This is needed to prevent AbortController
  23398. // from being prematurely garbage collected.
  23399. // See, https://github.com/nodejs/undici/issues/1926.
  23400. this[kAbortController] = ac
  23401. const acRef = new WeakRef(ac)
  23402. const abort = function () {
  23403. const ac = acRef.deref()
  23404. if (ac !== undefined) {
  23405. ac.abort(this.reason)
  23406. }
  23407. }
  23408. // Third-party AbortControllers may not work with these.
  23409. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23410. try {
  23411. // If the max amount of listeners is equal to the default, increase it
  23412. // This is only available in node >= v19.9.0
  23413. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23414. setMaxListeners(100, signal)
  23415. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23416. setMaxListeners(100, signal)
  23417. }
  23418. } catch {}
  23419. util.addAbortListener(signal, abort)
  23420. requestFinalizer.register(ac, { signal, abort })
  23421. }
  23422. }
  23423. // 30. Set this’s headers to a new Headers object with this’s relevant
  23424. // Realm, whose header list is request’s header list and guard is
  23425. // "request".
  23426. this[kHeaders] = new Headers(kConstruct)
  23427. this[kHeaders][kHeadersList] = request.headersList
  23428. this[kHeaders][kGuard] = 'request'
  23429. this[kHeaders][kRealm] = this[kRealm]
  23430. // 31. If this’s request’s mode is "no-cors", then:
  23431. if (mode === 'no-cors') {
  23432. // 1. If this’s request’s method is not a CORS-safelisted method,
  23433. // then throw a TypeError.
  23434. if (!corsSafeListedMethodsSet.has(request.method)) {
  23435. throw new TypeError(
  23436. `'${request.method} is unsupported in no-cors mode.`
  23437. )
  23438. }
  23439. // 2. Set this’s headers’s guard to "request-no-cors".
  23440. this[kHeaders][kGuard] = 'request-no-cors'
  23441. }
  23442. // 32. If init is not empty, then:
  23443. if (initHasKey) {
  23444. /** @type {HeadersList} */
  23445. const headersList = this[kHeaders][kHeadersList]
  23446. // 1. Let headers be a copy of this’s headers and its associated header
  23447. // list.
  23448. // 2. If init["headers"] exists, then set headers to init["headers"].
  23449. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23450. // 3. Empty this’s headers’s header list.
  23451. headersList.clear()
  23452. // 4. If headers is a Headers object, then for each header in its header
  23453. // list, append header’s name/header’s value to this’s headers.
  23454. if (headers instanceof HeadersList) {
  23455. for (const [key, val] of headers) {
  23456. headersList.append(key, val)
  23457. }
  23458. // Note: Copy the `set-cookie` meta-data.
  23459. headersList.cookies = headers.cookies
  23460. } else {
  23461. // 5. Otherwise, fill this’s headers with headers.
  23462. fillHeaders(this[kHeaders], headers)
  23463. }
  23464. }
  23465. // 33. Let inputBody be input’s request’s body if input is a Request
  23466. // object; otherwise null.
  23467. const inputBody = input instanceof Request ? input[kState].body : null
  23468. // 34. If either init["body"] exists and is non-null or inputBody is
  23469. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23470. // TypeError.
  23471. if (
  23472. (init.body != null || inputBody != null) &&
  23473. (request.method === 'GET' || request.method === 'HEAD')
  23474. ) {
  23475. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23476. }
  23477. // 35. Let initBody be null.
  23478. let initBody = null
  23479. // 36. If init["body"] exists and is non-null, then:
  23480. if (init.body != null) {
  23481. // 1. Let Content-Type be null.
  23482. // 2. Set initBody and Content-Type to the result of extracting
  23483. // init["body"], with keepalive set to request’s keepalive.
  23484. const [extractedBody, contentType] = extractBody(
  23485. init.body,
  23486. request.keepalive
  23487. )
  23488. initBody = extractedBody
  23489. // 3, If Content-Type is non-null and this’s headers’s header list does
  23490. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23491. // this’s headers.
  23492. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23493. this[kHeaders].append('content-type', contentType)
  23494. }
  23495. }
  23496. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23497. // inputBody.
  23498. const inputOrInitBody = initBody ?? inputBody
  23499. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23500. // null, then:
  23501. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23502. // 1. If initBody is non-null and init["duplex"] does not exist,
  23503. // then throw a TypeError.
  23504. if (initBody != null && init.duplex == null) {
  23505. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23506. }
  23507. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23508. // then throw a TypeError.
  23509. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23510. throw new TypeError(
  23511. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23512. )
  23513. }
  23514. // 3. Set this’s request’s use-CORS-preflight flag.
  23515. request.useCORSPreflightFlag = true
  23516. }
  23517. // 39. Let finalBody be inputOrInitBody.
  23518. let finalBody = inputOrInitBody
  23519. // 40. If initBody is null and inputBody is non-null, then:
  23520. if (initBody == null && inputBody != null) {
  23521. // 1. If input is unusable, then throw a TypeError.
  23522. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23523. throw new TypeError(
  23524. 'Cannot construct a Request with a Request object that has already been used.'
  23525. )
  23526. }
  23527. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23528. if (!TransformStream) {
  23529. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23530. }
  23531. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23532. const identityTransform = new TransformStream()
  23533. inputBody.stream.pipeThrough(identityTransform)
  23534. finalBody = {
  23535. source: inputBody.source,
  23536. length: inputBody.length,
  23537. stream: identityTransform.readable
  23538. }
  23539. }
  23540. // 41. Set this’s request’s body to finalBody.
  23541. this[kState].body = finalBody
  23542. }
  23543. // Returns request’s HTTP method, which is "GET" by default.
  23544. get method () {
  23545. webidl.brandCheck(this, Request)
  23546. // The method getter steps are to return this’s request’s method.
  23547. return this[kState].method
  23548. }
  23549. // Returns the URL of request as a string.
  23550. get url () {
  23551. webidl.brandCheck(this, Request)
  23552. // The url getter steps are to return this’s request’s URL, serialized.
  23553. return URLSerializer(this[kState].url)
  23554. }
  23555. // Returns a Headers object consisting of the headers associated with request.
  23556. // Note that headers added in the network layer by the user agent will not
  23557. // be accounted for in this object, e.g., the "Host" header.
  23558. get headers () {
  23559. webidl.brandCheck(this, Request)
  23560. // The headers getter steps are to return this’s headers.
  23561. return this[kHeaders]
  23562. }
  23563. // Returns the kind of resource requested by request, e.g., "document"
  23564. // or "script".
  23565. get destination () {
  23566. webidl.brandCheck(this, Request)
  23567. // The destination getter are to return this’s request’s destination.
  23568. return this[kState].destination
  23569. }
  23570. // Returns the referrer of request. Its value can be a same-origin URL if
  23571. // explicitly set in init, the empty string to indicate no referrer, and
  23572. // "about:client" when defaulting to the global’s default. This is used
  23573. // during fetching to determine the value of the `Referer` header of the
  23574. // request being made.
  23575. get referrer () {
  23576. webidl.brandCheck(this, Request)
  23577. // 1. If this’s request’s referrer is "no-referrer", then return the
  23578. // empty string.
  23579. if (this[kState].referrer === 'no-referrer') {
  23580. return ''
  23581. }
  23582. // 2. If this’s request’s referrer is "client", then return
  23583. // "about:client".
  23584. if (this[kState].referrer === 'client') {
  23585. return 'about:client'
  23586. }
  23587. // Return this’s request’s referrer, serialized.
  23588. return this[kState].referrer.toString()
  23589. }
  23590. // Returns the referrer policy associated with request.
  23591. // This is used during fetching to compute the value of the request’s
  23592. // referrer.
  23593. get referrerPolicy () {
  23594. webidl.brandCheck(this, Request)
  23595. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23596. return this[kState].referrerPolicy
  23597. }
  23598. // Returns the mode associated with request, which is a string indicating
  23599. // whether the request will use CORS, or will be restricted to same-origin
  23600. // URLs.
  23601. get mode () {
  23602. webidl.brandCheck(this, Request)
  23603. // The mode getter steps are to return this’s request’s mode.
  23604. return this[kState].mode
  23605. }
  23606. // Returns the credentials mode associated with request,
  23607. // which is a string indicating whether credentials will be sent with the
  23608. // request always, never, or only when sent to a same-origin URL.
  23609. get credentials () {
  23610. // The credentials getter steps are to return this’s request’s credentials mode.
  23611. return this[kState].credentials
  23612. }
  23613. // Returns the cache mode associated with request,
  23614. // which is a string indicating how the request will
  23615. // interact with the browser’s cache when fetching.
  23616. get cache () {
  23617. webidl.brandCheck(this, Request)
  23618. // The cache getter steps are to return this’s request’s cache mode.
  23619. return this[kState].cache
  23620. }
  23621. // Returns the redirect mode associated with request,
  23622. // which is a string indicating how redirects for the
  23623. // request will be handled during fetching. A request
  23624. // will follow redirects by default.
  23625. get redirect () {
  23626. webidl.brandCheck(this, Request)
  23627. // The redirect getter steps are to return this’s request’s redirect mode.
  23628. return this[kState].redirect
  23629. }
  23630. // Returns request’s subresource integrity metadata, which is a
  23631. // cryptographic hash of the resource being fetched. Its value
  23632. // consists of multiple hashes separated by whitespace. [SRI]
  23633. get integrity () {
  23634. webidl.brandCheck(this, Request)
  23635. // The integrity getter steps are to return this’s request’s integrity
  23636. // metadata.
  23637. return this[kState].integrity
  23638. }
  23639. // Returns a boolean indicating whether or not request can outlive the
  23640. // global in which it was created.
  23641. get keepalive () {
  23642. webidl.brandCheck(this, Request)
  23643. // The keepalive getter steps are to return this’s request’s keepalive.
  23644. return this[kState].keepalive
  23645. }
  23646. // Returns a boolean indicating whether or not request is for a reload
  23647. // navigation.
  23648. get isReloadNavigation () {
  23649. webidl.brandCheck(this, Request)
  23650. // The isReloadNavigation getter steps are to return true if this’s
  23651. // request’s reload-navigation flag is set; otherwise false.
  23652. return this[kState].reloadNavigation
  23653. }
  23654. // Returns a boolean indicating whether or not request is for a history
  23655. // navigation (a.k.a. back-foward navigation).
  23656. get isHistoryNavigation () {
  23657. webidl.brandCheck(this, Request)
  23658. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23659. // history-navigation flag is set; otherwise false.
  23660. return this[kState].historyNavigation
  23661. }
  23662. // Returns the signal associated with request, which is an AbortSignal
  23663. // object indicating whether or not request has been aborted, and its
  23664. // abort event handler.
  23665. get signal () {
  23666. webidl.brandCheck(this, Request)
  23667. // The signal getter steps are to return this’s signal.
  23668. return this[kSignal]
  23669. }
  23670. get body () {
  23671. webidl.brandCheck(this, Request)
  23672. return this[kState].body ? this[kState].body.stream : null
  23673. }
  23674. get bodyUsed () {
  23675. webidl.brandCheck(this, Request)
  23676. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23677. }
  23678. get duplex () {
  23679. webidl.brandCheck(this, Request)
  23680. return 'half'
  23681. }
  23682. // Returns a clone of request.
  23683. clone () {
  23684. webidl.brandCheck(this, Request)
  23685. // 1. If this is unusable, then throw a TypeError.
  23686. if (this.bodyUsed || this.body?.locked) {
  23687. throw new TypeError('unusable')
  23688. }
  23689. // 2. Let clonedRequest be the result of cloning this’s request.
  23690. const clonedRequest = cloneRequest(this[kState])
  23691. // 3. Let clonedRequestObject be the result of creating a Request object,
  23692. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23693. const clonedRequestObject = new Request(kConstruct)
  23694. clonedRequestObject[kState] = clonedRequest
  23695. clonedRequestObject[kRealm] = this[kRealm]
  23696. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23697. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23698. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23699. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23700. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23701. const ac = new AbortController()
  23702. if (this.signal.aborted) {
  23703. ac.abort(this.signal.reason)
  23704. } else {
  23705. util.addAbortListener(
  23706. this.signal,
  23707. () => {
  23708. ac.abort(this.signal.reason)
  23709. }
  23710. )
  23711. }
  23712. clonedRequestObject[kSignal] = ac.signal
  23713. // 4. Return clonedRequestObject.
  23714. return clonedRequestObject
  23715. }
  23716. }
  23717. mixinBody(Request)
  23718. function makeRequest (init) {
  23719. // https://fetch.spec.whatwg.org/#requests
  23720. const request = {
  23721. method: 'GET',
  23722. localURLsOnly: false,
  23723. unsafeRequest: false,
  23724. body: null,
  23725. client: null,
  23726. reservedClient: null,
  23727. replacesClientId: '',
  23728. window: 'client',
  23729. keepalive: false,
  23730. serviceWorkers: 'all',
  23731. initiator: '',
  23732. destination: '',
  23733. priority: null,
  23734. origin: 'client',
  23735. policyContainer: 'client',
  23736. referrer: 'client',
  23737. referrerPolicy: '',
  23738. mode: 'no-cors',
  23739. useCORSPreflightFlag: false,
  23740. credentials: 'same-origin',
  23741. useCredentials: false,
  23742. cache: 'default',
  23743. redirect: 'follow',
  23744. integrity: '',
  23745. cryptoGraphicsNonceMetadata: '',
  23746. parserMetadata: '',
  23747. reloadNavigation: false,
  23748. historyNavigation: false,
  23749. userActivation: false,
  23750. taintedOrigin: false,
  23751. redirectCount: 0,
  23752. responseTainting: 'basic',
  23753. preventNoCacheCacheControlHeaderModification: false,
  23754. done: false,
  23755. timingAllowFailed: false,
  23756. ...init,
  23757. headersList: init.headersList
  23758. ? new HeadersList(init.headersList)
  23759. : new HeadersList()
  23760. }
  23761. request.url = request.urlList[0]
  23762. return request
  23763. }
  23764. // https://fetch.spec.whatwg.org/#concept-request-clone
  23765. function cloneRequest (request) {
  23766. // To clone a request request, run these steps:
  23767. // 1. Let newRequest be a copy of request, except for its body.
  23768. const newRequest = makeRequest({ ...request, body: null })
  23769. // 2. If request’s body is non-null, set newRequest’s body to the
  23770. // result of cloning request’s body.
  23771. if (request.body != null) {
  23772. newRequest.body = cloneBody(request.body)
  23773. }
  23774. // 3. Return newRequest.
  23775. return newRequest
  23776. }
  23777. Object.defineProperties(Request.prototype, {
  23778. method: kEnumerableProperty,
  23779. url: kEnumerableProperty,
  23780. headers: kEnumerableProperty,
  23781. redirect: kEnumerableProperty,
  23782. clone: kEnumerableProperty,
  23783. signal: kEnumerableProperty,
  23784. duplex: kEnumerableProperty,
  23785. destination: kEnumerableProperty,
  23786. body: kEnumerableProperty,
  23787. bodyUsed: kEnumerableProperty,
  23788. isHistoryNavigation: kEnumerableProperty,
  23789. isReloadNavigation: kEnumerableProperty,
  23790. keepalive: kEnumerableProperty,
  23791. integrity: kEnumerableProperty,
  23792. cache: kEnumerableProperty,
  23793. credentials: kEnumerableProperty,
  23794. attribute: kEnumerableProperty,
  23795. referrerPolicy: kEnumerableProperty,
  23796. referrer: kEnumerableProperty,
  23797. mode: kEnumerableProperty,
  23798. [Symbol.toStringTag]: {
  23799. value: 'Request',
  23800. configurable: true
  23801. }
  23802. })
  23803. webidl.converters.Request = webidl.interfaceConverter(
  23804. Request
  23805. )
  23806. // https://fetch.spec.whatwg.org/#requestinfo
  23807. webidl.converters.RequestInfo = function (V) {
  23808. if (typeof V === 'string') {
  23809. return webidl.converters.USVString(V)
  23810. }
  23811. if (V instanceof Request) {
  23812. return webidl.converters.Request(V)
  23813. }
  23814. return webidl.converters.USVString(V)
  23815. }
  23816. webidl.converters.AbortSignal = webidl.interfaceConverter(
  23817. AbortSignal
  23818. )
  23819. // https://fetch.spec.whatwg.org/#requestinit
  23820. webidl.converters.RequestInit = webidl.dictionaryConverter([
  23821. {
  23822. key: 'method',
  23823. converter: webidl.converters.ByteString
  23824. },
  23825. {
  23826. key: 'headers',
  23827. converter: webidl.converters.HeadersInit
  23828. },
  23829. {
  23830. key: 'body',
  23831. converter: webidl.nullableConverter(
  23832. webidl.converters.BodyInit
  23833. )
  23834. },
  23835. {
  23836. key: 'referrer',
  23837. converter: webidl.converters.USVString
  23838. },
  23839. {
  23840. key: 'referrerPolicy',
  23841. converter: webidl.converters.DOMString,
  23842. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  23843. allowedValues: referrerPolicy
  23844. },
  23845. {
  23846. key: 'mode',
  23847. converter: webidl.converters.DOMString,
  23848. // https://fetch.spec.whatwg.org/#concept-request-mode
  23849. allowedValues: requestMode
  23850. },
  23851. {
  23852. key: 'credentials',
  23853. converter: webidl.converters.DOMString,
  23854. // https://fetch.spec.whatwg.org/#requestcredentials
  23855. allowedValues: requestCredentials
  23856. },
  23857. {
  23858. key: 'cache',
  23859. converter: webidl.converters.DOMString,
  23860. // https://fetch.spec.whatwg.org/#requestcache
  23861. allowedValues: requestCache
  23862. },
  23863. {
  23864. key: 'redirect',
  23865. converter: webidl.converters.DOMString,
  23866. // https://fetch.spec.whatwg.org/#requestredirect
  23867. allowedValues: requestRedirect
  23868. },
  23869. {
  23870. key: 'integrity',
  23871. converter: webidl.converters.DOMString
  23872. },
  23873. {
  23874. key: 'keepalive',
  23875. converter: webidl.converters.boolean
  23876. },
  23877. {
  23878. key: 'signal',
  23879. converter: webidl.nullableConverter(
  23880. (signal) => webidl.converters.AbortSignal(
  23881. signal,
  23882. { strict: false }
  23883. )
  23884. )
  23885. },
  23886. {
  23887. key: 'window',
  23888. converter: webidl.converters.any
  23889. },
  23890. {
  23891. key: 'duplex',
  23892. converter: webidl.converters.DOMString,
  23893. allowedValues: requestDuplex
  23894. }
  23895. ])
  23896. module.exports = { Request, makeRequest }
  23897. /***/ }),
  23898. /***/ 7823:
  23899. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23900. "use strict";
  23901. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  23902. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  23903. const util = __nccwpck_require__(3983)
  23904. const { kEnumerableProperty } = util
  23905. const {
  23906. isValidReasonPhrase,
  23907. isCancelled,
  23908. isAborted,
  23909. isBlobLike,
  23910. serializeJavascriptValueToJSONString,
  23911. isErrorLike,
  23912. isomorphicEncode
  23913. } = __nccwpck_require__(2538)
  23914. const {
  23915. redirectStatusSet,
  23916. nullBodyStatus,
  23917. DOMException
  23918. } = __nccwpck_require__(1037)
  23919. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  23920. const { webidl } = __nccwpck_require__(1744)
  23921. const { FormData } = __nccwpck_require__(2015)
  23922. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23923. const { URLSerializer } = __nccwpck_require__(685)
  23924. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23925. const assert = __nccwpck_require__(9491)
  23926. const { types } = __nccwpck_require__(3837)
  23927. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  23928. const textEncoder = new TextEncoder('utf-8')
  23929. // https://fetch.spec.whatwg.org/#response-class
  23930. class Response {
  23931. // Creates network error Response.
  23932. static error () {
  23933. // TODO
  23934. const relevantRealm = { settingsObject: {} }
  23935. // The static error() method steps are to return the result of creating a
  23936. // Response object, given a new network error, "immutable", and this’s
  23937. // relevant Realm.
  23938. const responseObject = new Response()
  23939. responseObject[kState] = makeNetworkError()
  23940. responseObject[kRealm] = relevantRealm
  23941. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  23942. responseObject[kHeaders][kGuard] = 'immutable'
  23943. responseObject[kHeaders][kRealm] = relevantRealm
  23944. return responseObject
  23945. }
  23946. // https://fetch.spec.whatwg.org/#dom-response-json
  23947. static json (data, init = {}) {
  23948. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  23949. if (init !== null) {
  23950. init = webidl.converters.ResponseInit(init)
  23951. }
  23952. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  23953. const bytes = textEncoder.encode(
  23954. serializeJavascriptValueToJSONString(data)
  23955. )
  23956. // 2. Let body be the result of extracting bytes.
  23957. const body = extractBody(bytes)
  23958. // 3. Let responseObject be the result of creating a Response object, given a new response,
  23959. // "response", and this’s relevant Realm.
  23960. const relevantRealm = { settingsObject: {} }
  23961. const responseObject = new Response()
  23962. responseObject[kRealm] = relevantRealm
  23963. responseObject[kHeaders][kGuard] = 'response'
  23964. responseObject[kHeaders][kRealm] = relevantRealm
  23965. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  23966. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  23967. // 5. Return responseObject.
  23968. return responseObject
  23969. }
  23970. // Creates a redirect Response that redirects to url with status status.
  23971. static redirect (url, status = 302) {
  23972. const relevantRealm = { settingsObject: {} }
  23973. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  23974. url = webidl.converters.USVString(url)
  23975. status = webidl.converters['unsigned short'](status)
  23976. // 1. Let parsedURL be the result of parsing url with current settings
  23977. // object’s API base URL.
  23978. // 2. If parsedURL is failure, then throw a TypeError.
  23979. // TODO: base-URL?
  23980. let parsedURL
  23981. try {
  23982. parsedURL = new URL(url, getGlobalOrigin())
  23983. } catch (err) {
  23984. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  23985. cause: err
  23986. })
  23987. }
  23988. // 3. If status is not a redirect status, then throw a RangeError.
  23989. if (!redirectStatusSet.has(status)) {
  23990. throw new RangeError('Invalid status code ' + status)
  23991. }
  23992. // 4. Let responseObject be the result of creating a Response object,
  23993. // given a new response, "immutable", and this’s relevant Realm.
  23994. const responseObject = new Response()
  23995. responseObject[kRealm] = relevantRealm
  23996. responseObject[kHeaders][kGuard] = 'immutable'
  23997. responseObject[kHeaders][kRealm] = relevantRealm
  23998. // 5. Set responseObject’s response’s status to status.
  23999. responseObject[kState].status = status
  24000. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24001. const value = isomorphicEncode(URLSerializer(parsedURL))
  24002. // 7. Append `Location`/value to responseObject’s response’s header list.
  24003. responseObject[kState].headersList.append('location', value)
  24004. // 8. Return responseObject.
  24005. return responseObject
  24006. }
  24007. // https://fetch.spec.whatwg.org/#dom-response
  24008. constructor (body = null, init = {}) {
  24009. if (body !== null) {
  24010. body = webidl.converters.BodyInit(body)
  24011. }
  24012. init = webidl.converters.ResponseInit(init)
  24013. // TODO
  24014. this[kRealm] = { settingsObject: {} }
  24015. // 1. Set this’s response to a new response.
  24016. this[kState] = makeResponse({})
  24017. // 2. Set this’s headers to a new Headers object with this’s relevant
  24018. // Realm, whose header list is this’s response’s header list and guard
  24019. // is "response".
  24020. this[kHeaders] = new Headers(kConstruct)
  24021. this[kHeaders][kGuard] = 'response'
  24022. this[kHeaders][kHeadersList] = this[kState].headersList
  24023. this[kHeaders][kRealm] = this[kRealm]
  24024. // 3. Let bodyWithType be null.
  24025. let bodyWithType = null
  24026. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24027. if (body != null) {
  24028. const [extractedBody, type] = extractBody(body)
  24029. bodyWithType = { body: extractedBody, type }
  24030. }
  24031. // 5. Perform initialize a response given this, init, and bodyWithType.
  24032. initializeResponse(this, init, bodyWithType)
  24033. }
  24034. // Returns response’s type, e.g., "cors".
  24035. get type () {
  24036. webidl.brandCheck(this, Response)
  24037. // The type getter steps are to return this’s response’s type.
  24038. return this[kState].type
  24039. }
  24040. // Returns response’s URL, if it has one; otherwise the empty string.
  24041. get url () {
  24042. webidl.brandCheck(this, Response)
  24043. const urlList = this[kState].urlList
  24044. // The url getter steps are to return the empty string if this’s
  24045. // response’s URL is null; otherwise this’s response’s URL,
  24046. // serialized with exclude fragment set to true.
  24047. const url = urlList[urlList.length - 1] ?? null
  24048. if (url === null) {
  24049. return ''
  24050. }
  24051. return URLSerializer(url, true)
  24052. }
  24053. // Returns whether response was obtained through a redirect.
  24054. get redirected () {
  24055. webidl.brandCheck(this, Response)
  24056. // The redirected getter steps are to return true if this’s response’s URL
  24057. // list has more than one item; otherwise false.
  24058. return this[kState].urlList.length > 1
  24059. }
  24060. // Returns response’s status.
  24061. get status () {
  24062. webidl.brandCheck(this, Response)
  24063. // The status getter steps are to return this’s response’s status.
  24064. return this[kState].status
  24065. }
  24066. // Returns whether response’s status is an ok status.
  24067. get ok () {
  24068. webidl.brandCheck(this, Response)
  24069. // The ok getter steps are to return true if this’s response’s status is an
  24070. // ok status; otherwise false.
  24071. return this[kState].status >= 200 && this[kState].status <= 299
  24072. }
  24073. // Returns response’s status message.
  24074. get statusText () {
  24075. webidl.brandCheck(this, Response)
  24076. // The statusText getter steps are to return this’s response’s status
  24077. // message.
  24078. return this[kState].statusText
  24079. }
  24080. // Returns response’s headers as Headers.
  24081. get headers () {
  24082. webidl.brandCheck(this, Response)
  24083. // The headers getter steps are to return this’s headers.
  24084. return this[kHeaders]
  24085. }
  24086. get body () {
  24087. webidl.brandCheck(this, Response)
  24088. return this[kState].body ? this[kState].body.stream : null
  24089. }
  24090. get bodyUsed () {
  24091. webidl.brandCheck(this, Response)
  24092. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24093. }
  24094. // Returns a clone of response.
  24095. clone () {
  24096. webidl.brandCheck(this, Response)
  24097. // 1. If this is unusable, then throw a TypeError.
  24098. if (this.bodyUsed || (this.body && this.body.locked)) {
  24099. throw webidl.errors.exception({
  24100. header: 'Response.clone',
  24101. message: 'Body has already been consumed.'
  24102. })
  24103. }
  24104. // 2. Let clonedResponse be the result of cloning this’s response.
  24105. const clonedResponse = cloneResponse(this[kState])
  24106. // 3. Return the result of creating a Response object, given
  24107. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24108. const clonedResponseObject = new Response()
  24109. clonedResponseObject[kState] = clonedResponse
  24110. clonedResponseObject[kRealm] = this[kRealm]
  24111. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24112. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24113. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24114. return clonedResponseObject
  24115. }
  24116. }
  24117. mixinBody(Response)
  24118. Object.defineProperties(Response.prototype, {
  24119. type: kEnumerableProperty,
  24120. url: kEnumerableProperty,
  24121. status: kEnumerableProperty,
  24122. ok: kEnumerableProperty,
  24123. redirected: kEnumerableProperty,
  24124. statusText: kEnumerableProperty,
  24125. headers: kEnumerableProperty,
  24126. clone: kEnumerableProperty,
  24127. body: kEnumerableProperty,
  24128. bodyUsed: kEnumerableProperty,
  24129. [Symbol.toStringTag]: {
  24130. value: 'Response',
  24131. configurable: true
  24132. }
  24133. })
  24134. Object.defineProperties(Response, {
  24135. json: kEnumerableProperty,
  24136. redirect: kEnumerableProperty,
  24137. error: kEnumerableProperty
  24138. })
  24139. // https://fetch.spec.whatwg.org/#concept-response-clone
  24140. function cloneResponse (response) {
  24141. // To clone a response response, run these steps:
  24142. // 1. If response is a filtered response, then return a new identical
  24143. // filtered response whose internal response is a clone of response’s
  24144. // internal response.
  24145. if (response.internalResponse) {
  24146. return filterResponse(
  24147. cloneResponse(response.internalResponse),
  24148. response.type
  24149. )
  24150. }
  24151. // 2. Let newResponse be a copy of response, except for its body.
  24152. const newResponse = makeResponse({ ...response, body: null })
  24153. // 3. If response’s body is non-null, then set newResponse’s body to the
  24154. // result of cloning response’s body.
  24155. if (response.body != null) {
  24156. newResponse.body = cloneBody(response.body)
  24157. }
  24158. // 4. Return newResponse.
  24159. return newResponse
  24160. }
  24161. function makeResponse (init) {
  24162. return {
  24163. aborted: false,
  24164. rangeRequested: false,
  24165. timingAllowPassed: false,
  24166. requestIncludesCredentials: false,
  24167. type: 'default',
  24168. status: 200,
  24169. timingInfo: null,
  24170. cacheState: '',
  24171. statusText: '',
  24172. ...init,
  24173. headersList: init.headersList
  24174. ? new HeadersList(init.headersList)
  24175. : new HeadersList(),
  24176. urlList: init.urlList ? [...init.urlList] : []
  24177. }
  24178. }
  24179. function makeNetworkError (reason) {
  24180. const isError = isErrorLike(reason)
  24181. return makeResponse({
  24182. type: 'error',
  24183. status: 0,
  24184. error: isError
  24185. ? reason
  24186. : new Error(reason ? String(reason) : reason),
  24187. aborted: reason && reason.name === 'AbortError'
  24188. })
  24189. }
  24190. function makeFilteredResponse (response, state) {
  24191. state = {
  24192. internalResponse: response,
  24193. ...state
  24194. }
  24195. return new Proxy(response, {
  24196. get (target, p) {
  24197. return p in state ? state[p] : target[p]
  24198. },
  24199. set (target, p, value) {
  24200. assert(!(p in state))
  24201. target[p] = value
  24202. return true
  24203. }
  24204. })
  24205. }
  24206. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24207. function filterResponse (response, type) {
  24208. // Set response to the following filtered response with response as its
  24209. // internal response, depending on request’s response tainting:
  24210. if (type === 'basic') {
  24211. // A basic filtered response is a filtered response whose type is "basic"
  24212. // and header list excludes any headers in internal response’s header list
  24213. // whose name is a forbidden response-header name.
  24214. // Note: undici does not implement forbidden response-header names
  24215. return makeFilteredResponse(response, {
  24216. type: 'basic',
  24217. headersList: response.headersList
  24218. })
  24219. } else if (type === 'cors') {
  24220. // A CORS filtered response is a filtered response whose type is "cors"
  24221. // and header list excludes any headers in internal response’s header
  24222. // list whose name is not a CORS-safelisted response-header name, given
  24223. // internal response’s CORS-exposed header-name list.
  24224. // Note: undici does not implement CORS-safelisted response-header names
  24225. return makeFilteredResponse(response, {
  24226. type: 'cors',
  24227. headersList: response.headersList
  24228. })
  24229. } else if (type === 'opaque') {
  24230. // An opaque filtered response is a filtered response whose type is
  24231. // "opaque", URL list is the empty list, status is 0, status message
  24232. // is the empty byte sequence, header list is empty, and body is null.
  24233. return makeFilteredResponse(response, {
  24234. type: 'opaque',
  24235. urlList: Object.freeze([]),
  24236. status: 0,
  24237. statusText: '',
  24238. body: null
  24239. })
  24240. } else if (type === 'opaqueredirect') {
  24241. // An opaque-redirect filtered response is a filtered response whose type
  24242. // is "opaqueredirect", status is 0, status message is the empty byte
  24243. // sequence, header list is empty, and body is null.
  24244. return makeFilteredResponse(response, {
  24245. type: 'opaqueredirect',
  24246. status: 0,
  24247. statusText: '',
  24248. headersList: [],
  24249. body: null
  24250. })
  24251. } else {
  24252. assert(false)
  24253. }
  24254. }
  24255. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24256. function makeAppropriateNetworkError (fetchParams, err = null) {
  24257. // 1. Assert: fetchParams is canceled.
  24258. assert(isCancelled(fetchParams))
  24259. // 2. Return an aborted network error if fetchParams is aborted;
  24260. // otherwise return a network error.
  24261. return isAborted(fetchParams)
  24262. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24263. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24264. }
  24265. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24266. function initializeResponse (response, init, body) {
  24267. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24268. // throw a RangeError.
  24269. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24270. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24271. }
  24272. // 2. If init["statusText"] does not match the reason-phrase token production,
  24273. // then throw a TypeError.
  24274. if ('statusText' in init && init.statusText != null) {
  24275. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24276. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24277. if (!isValidReasonPhrase(String(init.statusText))) {
  24278. throw new TypeError('Invalid statusText')
  24279. }
  24280. }
  24281. // 3. Set response’s response’s status to init["status"].
  24282. if ('status' in init && init.status != null) {
  24283. response[kState].status = init.status
  24284. }
  24285. // 4. Set response’s response’s status message to init["statusText"].
  24286. if ('statusText' in init && init.statusText != null) {
  24287. response[kState].statusText = init.statusText
  24288. }
  24289. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24290. if ('headers' in init && init.headers != null) {
  24291. fill(response[kHeaders], init.headers)
  24292. }
  24293. // 6. If body was given, then:
  24294. if (body) {
  24295. // 1. If response's status is a null body status, then throw a TypeError.
  24296. if (nullBodyStatus.includes(response.status)) {
  24297. throw webidl.errors.exception({
  24298. header: 'Response constructor',
  24299. message: 'Invalid response status code ' + response.status
  24300. })
  24301. }
  24302. // 2. Set response's body to body's body.
  24303. response[kState].body = body.body
  24304. // 3. If body's type is non-null and response's header list does not contain
  24305. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24306. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24307. response[kState].headersList.append('content-type', body.type)
  24308. }
  24309. }
  24310. }
  24311. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24312. ReadableStream
  24313. )
  24314. webidl.converters.FormData = webidl.interfaceConverter(
  24315. FormData
  24316. )
  24317. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24318. URLSearchParams
  24319. )
  24320. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24321. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24322. if (typeof V === 'string') {
  24323. return webidl.converters.USVString(V)
  24324. }
  24325. if (isBlobLike(V)) {
  24326. return webidl.converters.Blob(V, { strict: false })
  24327. }
  24328. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24329. return webidl.converters.BufferSource(V)
  24330. }
  24331. if (util.isFormDataLike(V)) {
  24332. return webidl.converters.FormData(V, { strict: false })
  24333. }
  24334. if (V instanceof URLSearchParams) {
  24335. return webidl.converters.URLSearchParams(V)
  24336. }
  24337. return webidl.converters.DOMString(V)
  24338. }
  24339. // https://fetch.spec.whatwg.org/#bodyinit
  24340. webidl.converters.BodyInit = function (V) {
  24341. if (V instanceof ReadableStream) {
  24342. return webidl.converters.ReadableStream(V)
  24343. }
  24344. // Note: the spec doesn't include async iterables,
  24345. // this is an undici extension.
  24346. if (V?.[Symbol.asyncIterator]) {
  24347. return V
  24348. }
  24349. return webidl.converters.XMLHttpRequestBodyInit(V)
  24350. }
  24351. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24352. {
  24353. key: 'status',
  24354. converter: webidl.converters['unsigned short'],
  24355. defaultValue: 200
  24356. },
  24357. {
  24358. key: 'statusText',
  24359. converter: webidl.converters.ByteString,
  24360. defaultValue: ''
  24361. },
  24362. {
  24363. key: 'headers',
  24364. converter: webidl.converters.HeadersInit
  24365. }
  24366. ])
  24367. module.exports = {
  24368. makeNetworkError,
  24369. makeResponse,
  24370. makeAppropriateNetworkError,
  24371. filterResponse,
  24372. Response,
  24373. cloneResponse
  24374. }
  24375. /***/ }),
  24376. /***/ 5861:
  24377. /***/ ((module) => {
  24378. "use strict";
  24379. module.exports = {
  24380. kUrl: Symbol('url'),
  24381. kHeaders: Symbol('headers'),
  24382. kSignal: Symbol('signal'),
  24383. kState: Symbol('state'),
  24384. kGuard: Symbol('guard'),
  24385. kRealm: Symbol('realm')
  24386. }
  24387. /***/ }),
  24388. /***/ 2538:
  24389. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24390. "use strict";
  24391. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24392. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24393. const { performance } = __nccwpck_require__(4074)
  24394. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24395. const assert = __nccwpck_require__(9491)
  24396. const { isUint8Array } = __nccwpck_require__(9830)
  24397. let supportedHashes = []
  24398. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24399. /** @type {import('crypto')|undefined} */
  24400. let crypto
  24401. try {
  24402. crypto = __nccwpck_require__(6113)
  24403. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24404. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24405. /* c8 ignore next 3 */
  24406. } catch {
  24407. }
  24408. function responseURL (response) {
  24409. // https://fetch.spec.whatwg.org/#responses
  24410. // A response has an associated URL. It is a pointer to the last URL
  24411. // in response’s URL list and null if response’s URL list is empty.
  24412. const urlList = response.urlList
  24413. const length = urlList.length
  24414. return length === 0 ? null : urlList[length - 1].toString()
  24415. }
  24416. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24417. function responseLocationURL (response, requestFragment) {
  24418. // 1. If response’s status is not a redirect status, then return null.
  24419. if (!redirectStatusSet.has(response.status)) {
  24420. return null
  24421. }
  24422. // 2. Let location be the result of extracting header list values given
  24423. // `Location` and response’s header list.
  24424. let location = response.headersList.get('location')
  24425. // 3. If location is a header value, then set location to the result of
  24426. // parsing location with response’s URL.
  24427. if (location !== null && isValidHeaderValue(location)) {
  24428. location = new URL(location, responseURL(response))
  24429. }
  24430. // 4. If location is a URL whose fragment is null, then set location’s
  24431. // fragment to requestFragment.
  24432. if (location && !location.hash) {
  24433. location.hash = requestFragment
  24434. }
  24435. // 5. Return location.
  24436. return location
  24437. }
  24438. /** @returns {URL} */
  24439. function requestCurrentURL (request) {
  24440. return request.urlList[request.urlList.length - 1]
  24441. }
  24442. function requestBadPort (request) {
  24443. // 1. Let url be request’s current URL.
  24444. const url = requestCurrentURL(request)
  24445. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24446. // then return blocked.
  24447. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24448. return 'blocked'
  24449. }
  24450. // 3. Return allowed.
  24451. return 'allowed'
  24452. }
  24453. function isErrorLike (object) {
  24454. return object instanceof Error || (
  24455. object?.constructor?.name === 'Error' ||
  24456. object?.constructor?.name === 'DOMException'
  24457. )
  24458. }
  24459. // Check whether |statusText| is a ByteString and
  24460. // matches the Reason-Phrase token production.
  24461. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24462. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24463. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24464. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24465. function isValidReasonPhrase (statusText) {
  24466. for (let i = 0; i < statusText.length; ++i) {
  24467. const c = statusText.charCodeAt(i)
  24468. if (
  24469. !(
  24470. (
  24471. c === 0x09 || // HTAB
  24472. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24473. (c >= 0x80 && c <= 0xff)
  24474. ) // obs-text
  24475. )
  24476. ) {
  24477. return false
  24478. }
  24479. }
  24480. return true
  24481. }
  24482. /**
  24483. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24484. * @param {number} c
  24485. */
  24486. function isTokenCharCode (c) {
  24487. switch (c) {
  24488. case 0x22:
  24489. case 0x28:
  24490. case 0x29:
  24491. case 0x2c:
  24492. case 0x2f:
  24493. case 0x3a:
  24494. case 0x3b:
  24495. case 0x3c:
  24496. case 0x3d:
  24497. case 0x3e:
  24498. case 0x3f:
  24499. case 0x40:
  24500. case 0x5b:
  24501. case 0x5c:
  24502. case 0x5d:
  24503. case 0x7b:
  24504. case 0x7d:
  24505. // DQUOTE and "(),/:;<=>?@[\]{}"
  24506. return false
  24507. default:
  24508. // VCHAR %x21-7E
  24509. return c >= 0x21 && c <= 0x7e
  24510. }
  24511. }
  24512. /**
  24513. * @param {string} characters
  24514. */
  24515. function isValidHTTPToken (characters) {
  24516. if (characters.length === 0) {
  24517. return false
  24518. }
  24519. for (let i = 0; i < characters.length; ++i) {
  24520. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24521. return false
  24522. }
  24523. }
  24524. return true
  24525. }
  24526. /**
  24527. * @see https://fetch.spec.whatwg.org/#header-name
  24528. * @param {string} potentialValue
  24529. */
  24530. function isValidHeaderName (potentialValue) {
  24531. return isValidHTTPToken(potentialValue)
  24532. }
  24533. /**
  24534. * @see https://fetch.spec.whatwg.org/#header-value
  24535. * @param {string} potentialValue
  24536. */
  24537. function isValidHeaderValue (potentialValue) {
  24538. // - Has no leading or trailing HTTP tab or space bytes.
  24539. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24540. if (
  24541. potentialValue.startsWith('\t') ||
  24542. potentialValue.startsWith(' ') ||
  24543. potentialValue.endsWith('\t') ||
  24544. potentialValue.endsWith(' ')
  24545. ) {
  24546. return false
  24547. }
  24548. if (
  24549. potentialValue.includes('\0') ||
  24550. potentialValue.includes('\r') ||
  24551. potentialValue.includes('\n')
  24552. ) {
  24553. return false
  24554. }
  24555. return true
  24556. }
  24557. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24558. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24559. // Given a request request and a response actualResponse, this algorithm
  24560. // updates request’s referrer policy according to the Referrer-Policy
  24561. // header (if any) in actualResponse.
  24562. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24563. // from a Referrer-Policy header on actualResponse.
  24564. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24565. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24566. const { headersList } = actualResponse
  24567. // 2. Let policy be the empty string.
  24568. // 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.
  24569. // 4. Return policy.
  24570. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24571. // Note: As the referrer-policy can contain multiple policies
  24572. // separated by comma, we need to loop through all of them
  24573. // and pick the first valid one.
  24574. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24575. let policy = ''
  24576. if (policyHeader.length > 0) {
  24577. // The right-most policy takes precedence.
  24578. // The left-most policy is the fallback.
  24579. for (let i = policyHeader.length; i !== 0; i--) {
  24580. const token = policyHeader[i - 1].trim()
  24581. if (referrerPolicyTokens.has(token)) {
  24582. policy = token
  24583. break
  24584. }
  24585. }
  24586. }
  24587. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24588. if (policy !== '') {
  24589. request.referrerPolicy = policy
  24590. }
  24591. }
  24592. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24593. function crossOriginResourcePolicyCheck () {
  24594. // TODO
  24595. return 'allowed'
  24596. }
  24597. // https://fetch.spec.whatwg.org/#concept-cors-check
  24598. function corsCheck () {
  24599. // TODO
  24600. return 'success'
  24601. }
  24602. // https://fetch.spec.whatwg.org/#concept-tao-check
  24603. function TAOCheck () {
  24604. // TODO
  24605. return 'success'
  24606. }
  24607. function appendFetchMetadata (httpRequest) {
  24608. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24609. // TODO
  24610. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24611. // 1. Assert: r’s url is a potentially trustworthy URL.
  24612. // TODO
  24613. // 2. Let header be a Structured Header whose value is a token.
  24614. let header = null
  24615. // 3. Set header’s value to r’s mode.
  24616. header = httpRequest.mode
  24617. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24618. httpRequest.headersList.set('sec-fetch-mode', header)
  24619. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24620. // TODO
  24621. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24622. // TODO
  24623. }
  24624. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24625. function appendRequestOriginHeader (request) {
  24626. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24627. let serializedOrigin = request.origin
  24628. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24629. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24630. if (serializedOrigin) {
  24631. request.headersList.append('origin', serializedOrigin)
  24632. }
  24633. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24634. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24635. // 1. Switch on request’s referrer policy:
  24636. switch (request.referrerPolicy) {
  24637. case 'no-referrer':
  24638. // Set serializedOrigin to `null`.
  24639. serializedOrigin = null
  24640. break
  24641. case 'no-referrer-when-downgrade':
  24642. case 'strict-origin':
  24643. case 'strict-origin-when-cross-origin':
  24644. // 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`.
  24645. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24646. serializedOrigin = null
  24647. }
  24648. break
  24649. case 'same-origin':
  24650. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24651. if (!sameOrigin(request, requestCurrentURL(request))) {
  24652. serializedOrigin = null
  24653. }
  24654. break
  24655. default:
  24656. // Do nothing.
  24657. }
  24658. if (serializedOrigin) {
  24659. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24660. request.headersList.append('origin', serializedOrigin)
  24661. }
  24662. }
  24663. }
  24664. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24665. // TODO
  24666. return performance.now()
  24667. }
  24668. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24669. function createOpaqueTimingInfo (timingInfo) {
  24670. return {
  24671. startTime: timingInfo.startTime ?? 0,
  24672. redirectStartTime: 0,
  24673. redirectEndTime: 0,
  24674. postRedirectStartTime: timingInfo.startTime ?? 0,
  24675. finalServiceWorkerStartTime: 0,
  24676. finalNetworkResponseStartTime: 0,
  24677. finalNetworkRequestStartTime: 0,
  24678. endTime: 0,
  24679. encodedBodySize: 0,
  24680. decodedBodySize: 0,
  24681. finalConnectionTimingInfo: null
  24682. }
  24683. }
  24684. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24685. function makePolicyContainer () {
  24686. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24687. return {
  24688. referrerPolicy: 'strict-origin-when-cross-origin'
  24689. }
  24690. }
  24691. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24692. function clonePolicyContainer (policyContainer) {
  24693. return {
  24694. referrerPolicy: policyContainer.referrerPolicy
  24695. }
  24696. }
  24697. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24698. function determineRequestsReferrer (request) {
  24699. // 1. Let policy be request's referrer policy.
  24700. const policy = request.referrerPolicy
  24701. // Note: policy cannot (shouldn't) be null or an empty string.
  24702. assert(policy)
  24703. // 2. Let environment be request’s client.
  24704. let referrerSource = null
  24705. // 3. Switch on request’s referrer:
  24706. if (request.referrer === 'client') {
  24707. // Note: node isn't a browser and doesn't implement document/iframes,
  24708. // so we bypass this step and replace it with our own.
  24709. const globalOrigin = getGlobalOrigin()
  24710. if (!globalOrigin || globalOrigin.origin === 'null') {
  24711. return 'no-referrer'
  24712. }
  24713. // note: we need to clone it as it's mutated
  24714. referrerSource = new URL(globalOrigin)
  24715. } else if (request.referrer instanceof URL) {
  24716. // Let referrerSource be request’s referrer.
  24717. referrerSource = request.referrer
  24718. }
  24719. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24720. // use as a referrer.
  24721. let referrerURL = stripURLForReferrer(referrerSource)
  24722. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  24723. // a referrer, with the origin-only flag set to true.
  24724. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  24725. // 6. If the result of serializing referrerURL is a string whose length is
  24726. // greater than 4096, set referrerURL to referrerOrigin.
  24727. if (referrerURL.toString().length > 4096) {
  24728. referrerURL = referrerOrigin
  24729. }
  24730. const areSameOrigin = sameOrigin(request, referrerURL)
  24731. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  24732. !isURLPotentiallyTrustworthy(request.url)
  24733. // 8. Execute the switch statements corresponding to the value of policy:
  24734. switch (policy) {
  24735. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  24736. case 'unsafe-url': return referrerURL
  24737. case 'same-origin':
  24738. return areSameOrigin ? referrerOrigin : 'no-referrer'
  24739. case 'origin-when-cross-origin':
  24740. return areSameOrigin ? referrerURL : referrerOrigin
  24741. case 'strict-origin-when-cross-origin': {
  24742. const currentURL = requestCurrentURL(request)
  24743. // 1. If the origin of referrerURL and the origin of request’s current
  24744. // URL are the same, then return referrerURL.
  24745. if (sameOrigin(referrerURL, currentURL)) {
  24746. return referrerURL
  24747. }
  24748. // 2. If referrerURL is a potentially trustworthy URL and request’s
  24749. // current URL is not a potentially trustworthy URL, then return no
  24750. // referrer.
  24751. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  24752. return 'no-referrer'
  24753. }
  24754. // 3. Return referrerOrigin.
  24755. return referrerOrigin
  24756. }
  24757. case 'strict-origin': // eslint-disable-line
  24758. /**
  24759. * 1. If referrerURL is a potentially trustworthy URL and
  24760. * request’s current URL is not a potentially trustworthy URL,
  24761. * then return no referrer.
  24762. * 2. Return referrerOrigin
  24763. */
  24764. case 'no-referrer-when-downgrade': // eslint-disable-line
  24765. /**
  24766. * 1. If referrerURL is a potentially trustworthy URL and
  24767. * request’s current URL is not a potentially trustworthy URL,
  24768. * then return no referrer.
  24769. * 2. Return referrerOrigin
  24770. */
  24771. default: // eslint-disable-line
  24772. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  24773. }
  24774. }
  24775. /**
  24776. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  24777. * @param {URL} url
  24778. * @param {boolean|undefined} originOnly
  24779. */
  24780. function stripURLForReferrer (url, originOnly) {
  24781. // 1. Assert: url is a URL.
  24782. assert(url instanceof URL)
  24783. // 2. If url’s scheme is a local scheme, then return no referrer.
  24784. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  24785. return 'no-referrer'
  24786. }
  24787. // 3. Set url’s username to the empty string.
  24788. url.username = ''
  24789. // 4. Set url’s password to the empty string.
  24790. url.password = ''
  24791. // 5. Set url’s fragment to null.
  24792. url.hash = ''
  24793. // 6. If the origin-only flag is true, then:
  24794. if (originOnly) {
  24795. // 1. Set url’s path to « the empty string ».
  24796. url.pathname = ''
  24797. // 2. Set url’s query to null.
  24798. url.search = ''
  24799. }
  24800. // 7. Return url.
  24801. return url
  24802. }
  24803. function isURLPotentiallyTrustworthy (url) {
  24804. if (!(url instanceof URL)) {
  24805. return false
  24806. }
  24807. // If child of about, return true
  24808. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  24809. return true
  24810. }
  24811. // If scheme is data, return true
  24812. if (url.protocol === 'data:') return true
  24813. // If file, return true
  24814. if (url.protocol === 'file:') return true
  24815. return isOriginPotentiallyTrustworthy(url.origin)
  24816. function isOriginPotentiallyTrustworthy (origin) {
  24817. // If origin is explicitly null, return false
  24818. if (origin == null || origin === 'null') return false
  24819. const originAsURL = new URL(origin)
  24820. // If secure, return true
  24821. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  24822. return true
  24823. }
  24824. // If localhost or variants, return true
  24825. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  24826. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  24827. (originAsURL.hostname.endsWith('.localhost'))) {
  24828. return true
  24829. }
  24830. // If any other, return false
  24831. return false
  24832. }
  24833. }
  24834. /**
  24835. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  24836. * @param {Uint8Array} bytes
  24837. * @param {string} metadataList
  24838. */
  24839. function bytesMatch (bytes, metadataList) {
  24840. // If node is not built with OpenSSL support, we cannot check
  24841. // a request's integrity, so allow it by default (the spec will
  24842. // allow requests if an invalid hash is given, as precedence).
  24843. /* istanbul ignore if: only if node is built with --without-ssl */
  24844. if (crypto === undefined) {
  24845. return true
  24846. }
  24847. // 1. Let parsedMetadata be the result of parsing metadataList.
  24848. const parsedMetadata = parseMetadata(metadataList)
  24849. // 2. If parsedMetadata is no metadata, return true.
  24850. if (parsedMetadata === 'no metadata') {
  24851. return true
  24852. }
  24853. // 3. If response is not eligible for integrity validation, return false.
  24854. // TODO
  24855. // 4. If parsedMetadata is the empty set, return true.
  24856. if (parsedMetadata.length === 0) {
  24857. return true
  24858. }
  24859. // 5. Let metadata be the result of getting the strongest
  24860. // metadata from parsedMetadata.
  24861. const strongest = getStrongestMetadata(parsedMetadata)
  24862. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  24863. // 6. For each item in metadata:
  24864. for (const item of metadata) {
  24865. // 1. Let algorithm be the alg component of item.
  24866. const algorithm = item.algo
  24867. // 2. Let expectedValue be the val component of item.
  24868. const expectedValue = item.hash
  24869. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  24870. // "be liberal with padding". This is annoying, and it's not even in the spec.
  24871. // 3. Let actualValue be the result of applying algorithm to bytes.
  24872. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  24873. if (actualValue[actualValue.length - 1] === '=') {
  24874. if (actualValue[actualValue.length - 2] === '=') {
  24875. actualValue = actualValue.slice(0, -2)
  24876. } else {
  24877. actualValue = actualValue.slice(0, -1)
  24878. }
  24879. }
  24880. // 4. If actualValue is a case-sensitive match for expectedValue,
  24881. // return true.
  24882. if (compareBase64Mixed(actualValue, expectedValue)) {
  24883. return true
  24884. }
  24885. }
  24886. // 7. Return false.
  24887. return false
  24888. }
  24889. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  24890. // https://www.w3.org/TR/CSP2/#source-list-syntax
  24891. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  24892. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  24893. /**
  24894. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  24895. * @param {string} metadata
  24896. */
  24897. function parseMetadata (metadata) {
  24898. // 1. Let result be the empty set.
  24899. /** @type {{ algo: string, hash: string }[]} */
  24900. const result = []
  24901. // 2. Let empty be equal to true.
  24902. let empty = true
  24903. // 3. For each token returned by splitting metadata on spaces:
  24904. for (const token of metadata.split(' ')) {
  24905. // 1. Set empty to false.
  24906. empty = false
  24907. // 2. Parse token as a hash-with-options.
  24908. const parsedToken = parseHashWithOptions.exec(token)
  24909. // 3. If token does not parse, continue to the next token.
  24910. if (
  24911. parsedToken === null ||
  24912. parsedToken.groups === undefined ||
  24913. parsedToken.groups.algo === undefined
  24914. ) {
  24915. // Note: Chromium blocks the request at this point, but Firefox
  24916. // gives a warning that an invalid integrity was given. The
  24917. // correct behavior is to ignore these, and subsequently not
  24918. // check the integrity of the resource.
  24919. continue
  24920. }
  24921. // 4. Let algorithm be the hash-algo component of token.
  24922. const algorithm = parsedToken.groups.algo.toLowerCase()
  24923. // 5. If algorithm is a hash function recognized by the user
  24924. // agent, add the parsed token to result.
  24925. if (supportedHashes.includes(algorithm)) {
  24926. result.push(parsedToken.groups)
  24927. }
  24928. }
  24929. // 4. Return no metadata if empty is true, otherwise return result.
  24930. if (empty === true) {
  24931. return 'no metadata'
  24932. }
  24933. return result
  24934. }
  24935. /**
  24936. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  24937. */
  24938. function getStrongestMetadata (metadataList) {
  24939. // Let algorithm be the algo component of the first item in metadataList.
  24940. // Can be sha256
  24941. let algorithm = metadataList[0].algo
  24942. // If the algorithm is sha512, then it is the strongest
  24943. // and we can return immediately
  24944. if (algorithm[3] === '5') {
  24945. return algorithm
  24946. }
  24947. for (let i = 1; i < metadataList.length; ++i) {
  24948. const metadata = metadataList[i]
  24949. // If the algorithm is sha512, then it is the strongest
  24950. // and we can break the loop immediately
  24951. if (metadata.algo[3] === '5') {
  24952. algorithm = 'sha512'
  24953. break
  24954. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  24955. } else if (algorithm[3] === '3') {
  24956. continue
  24957. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  24958. // the strongest
  24959. } else if (metadata.algo[3] === '3') {
  24960. algorithm = 'sha384'
  24961. }
  24962. }
  24963. return algorithm
  24964. }
  24965. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  24966. if (metadataList.length === 1) {
  24967. return metadataList
  24968. }
  24969. let pos = 0
  24970. for (let i = 0; i < metadataList.length; ++i) {
  24971. if (metadataList[i].algo === algorithm) {
  24972. metadataList[pos++] = metadataList[i]
  24973. }
  24974. }
  24975. metadataList.length = pos
  24976. return metadataList
  24977. }
  24978. /**
  24979. * Compares two base64 strings, allowing for base64url
  24980. * in the second string.
  24981. *
  24982. * @param {string} actualValue always base64
  24983. * @param {string} expectedValue base64 or base64url
  24984. * @returns {boolean}
  24985. */
  24986. function compareBase64Mixed (actualValue, expectedValue) {
  24987. if (actualValue.length !== expectedValue.length) {
  24988. return false
  24989. }
  24990. for (let i = 0; i < actualValue.length; ++i) {
  24991. if (actualValue[i] !== expectedValue[i]) {
  24992. if (
  24993. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  24994. (actualValue[i] === '/' && expectedValue[i] === '_')
  24995. ) {
  24996. continue
  24997. }
  24998. return false
  24999. }
  25000. }
  25001. return true
  25002. }
  25003. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25004. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25005. // TODO
  25006. }
  25007. /**
  25008. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25009. * @param {URL} A
  25010. * @param {URL} B
  25011. */
  25012. function sameOrigin (A, B) {
  25013. // 1. If A and B are the same opaque origin, then return true.
  25014. if (A.origin === B.origin && A.origin === 'null') {
  25015. return true
  25016. }
  25017. // 2. If A and B are both tuple origins and their schemes,
  25018. // hosts, and port are identical, then return true.
  25019. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25020. return true
  25021. }
  25022. // 3. Return false.
  25023. return false
  25024. }
  25025. function createDeferredPromise () {
  25026. let res
  25027. let rej
  25028. const promise = new Promise((resolve, reject) => {
  25029. res = resolve
  25030. rej = reject
  25031. })
  25032. return { promise, resolve: res, reject: rej }
  25033. }
  25034. function isAborted (fetchParams) {
  25035. return fetchParams.controller.state === 'aborted'
  25036. }
  25037. function isCancelled (fetchParams) {
  25038. return fetchParams.controller.state === 'aborted' ||
  25039. fetchParams.controller.state === 'terminated'
  25040. }
  25041. const normalizeMethodRecord = {
  25042. delete: 'DELETE',
  25043. DELETE: 'DELETE',
  25044. get: 'GET',
  25045. GET: 'GET',
  25046. head: 'HEAD',
  25047. HEAD: 'HEAD',
  25048. options: 'OPTIONS',
  25049. OPTIONS: 'OPTIONS',
  25050. post: 'POST',
  25051. POST: 'POST',
  25052. put: 'PUT',
  25053. PUT: 'PUT'
  25054. }
  25055. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25056. Object.setPrototypeOf(normalizeMethodRecord, null)
  25057. /**
  25058. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25059. * @param {string} method
  25060. */
  25061. function normalizeMethod (method) {
  25062. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25063. }
  25064. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25065. function serializeJavascriptValueToJSONString (value) {
  25066. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25067. const result = JSON.stringify(value)
  25068. // 2. If result is undefined, then throw a TypeError.
  25069. if (result === undefined) {
  25070. throw new TypeError('Value is not JSON serializable')
  25071. }
  25072. // 3. Assert: result is a string.
  25073. assert(typeof result === 'string')
  25074. // 4. Return result.
  25075. return result
  25076. }
  25077. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25078. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25079. /**
  25080. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25081. * @param {() => unknown[]} iterator
  25082. * @param {string} name name of the instance
  25083. * @param {'key'|'value'|'key+value'} kind
  25084. */
  25085. function makeIterator (iterator, name, kind) {
  25086. const object = {
  25087. index: 0,
  25088. kind,
  25089. target: iterator
  25090. }
  25091. const i = {
  25092. next () {
  25093. // 1. Let interface be the interface for which the iterator prototype object exists.
  25094. // 2. Let thisValue be the this value.
  25095. // 3. Let object be ? ToObject(thisValue).
  25096. // 4. If object is a platform object, then perform a security
  25097. // check, passing:
  25098. // 5. If object is not a default iterator object for interface,
  25099. // then throw a TypeError.
  25100. if (Object.getPrototypeOf(this) !== i) {
  25101. throw new TypeError(
  25102. `'next' called on an object that does not implement interface ${name} Iterator.`
  25103. )
  25104. }
  25105. // 6. Let index be object’s index.
  25106. // 7. Let kind be object’s kind.
  25107. // 8. Let values be object’s target's value pairs to iterate over.
  25108. const { index, kind, target } = object
  25109. const values = target()
  25110. // 9. Let len be the length of values.
  25111. const len = values.length
  25112. // 10. If index is greater than or equal to len, then return
  25113. // CreateIterResultObject(undefined, true).
  25114. if (index >= len) {
  25115. return { value: undefined, done: true }
  25116. }
  25117. // 11. Let pair be the entry in values at index index.
  25118. const pair = values[index]
  25119. // 12. Set object’s index to index + 1.
  25120. object.index = index + 1
  25121. // 13. Return the iterator result for pair and kind.
  25122. return iteratorResult(pair, kind)
  25123. },
  25124. // The class string of an iterator prototype object for a given interface is the
  25125. // result of concatenating the identifier of the interface and the string " Iterator".
  25126. [Symbol.toStringTag]: `${name} Iterator`
  25127. }
  25128. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25129. Object.setPrototypeOf(i, esIteratorPrototype)
  25130. // esIteratorPrototype needs to be the prototype of i
  25131. // which is the prototype of an empty object. Yes, it's confusing.
  25132. return Object.setPrototypeOf({}, i)
  25133. }
  25134. // https://webidl.spec.whatwg.org/#iterator-result
  25135. function iteratorResult (pair, kind) {
  25136. let result
  25137. // 1. Let result be a value determined by the value of kind:
  25138. switch (kind) {
  25139. case 'key': {
  25140. // 1. Let idlKey be pair’s key.
  25141. // 2. Let key be the result of converting idlKey to an
  25142. // ECMAScript value.
  25143. // 3. result is key.
  25144. result = pair[0]
  25145. break
  25146. }
  25147. case 'value': {
  25148. // 1. Let idlValue be pair’s value.
  25149. // 2. Let value be the result of converting idlValue to
  25150. // an ECMAScript value.
  25151. // 3. result is value.
  25152. result = pair[1]
  25153. break
  25154. }
  25155. case 'key+value': {
  25156. // 1. Let idlKey be pair’s key.
  25157. // 2. Let idlValue be pair’s value.
  25158. // 3. Let key be the result of converting idlKey to an
  25159. // ECMAScript value.
  25160. // 4. Let value be the result of converting idlValue to
  25161. // an ECMAScript value.
  25162. // 5. Let array be ! ArrayCreate(2).
  25163. // 6. Call ! CreateDataProperty(array, "0", key).
  25164. // 7. Call ! CreateDataProperty(array, "1", value).
  25165. // 8. result is array.
  25166. result = pair
  25167. break
  25168. }
  25169. }
  25170. // 2. Return CreateIterResultObject(result, false).
  25171. return { value: result, done: false }
  25172. }
  25173. /**
  25174. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25175. */
  25176. async function fullyReadBody (body, processBody, processBodyError) {
  25177. // 1. If taskDestination is null, then set taskDestination to
  25178. // the result of starting a new parallel queue.
  25179. // 2. Let successSteps given a byte sequence bytes be to queue a
  25180. // fetch task to run processBody given bytes, with taskDestination.
  25181. const successSteps = processBody
  25182. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25183. // with taskDestination.
  25184. const errorSteps = processBodyError
  25185. // 4. Let reader be the result of getting a reader for body’s stream.
  25186. // If that threw an exception, then run errorSteps with that
  25187. // exception and return.
  25188. let reader
  25189. try {
  25190. reader = body.stream.getReader()
  25191. } catch (e) {
  25192. errorSteps(e)
  25193. return
  25194. }
  25195. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25196. try {
  25197. const result = await readAllBytes(reader)
  25198. successSteps(result)
  25199. } catch (e) {
  25200. errorSteps(e)
  25201. }
  25202. }
  25203. /** @type {ReadableStream} */
  25204. let ReadableStream = globalThis.ReadableStream
  25205. function isReadableStreamLike (stream) {
  25206. if (!ReadableStream) {
  25207. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25208. }
  25209. return stream instanceof ReadableStream || (
  25210. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25211. typeof stream.tee === 'function'
  25212. )
  25213. }
  25214. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25215. /**
  25216. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25217. * @param {number[]|Uint8Array} input
  25218. */
  25219. function isomorphicDecode (input) {
  25220. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25221. // length is equal to input’s length and whose code points have the same values
  25222. // as the values of input’s bytes, in the same order.
  25223. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25224. return String.fromCharCode(...input)
  25225. }
  25226. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25227. }
  25228. /**
  25229. * @param {ReadableStreamController<Uint8Array>} controller
  25230. */
  25231. function readableStreamClose (controller) {
  25232. try {
  25233. controller.close()
  25234. } catch (err) {
  25235. // TODO: add comment explaining why this error occurs.
  25236. if (!err.message.includes('Controller is already closed')) {
  25237. throw err
  25238. }
  25239. }
  25240. }
  25241. /**
  25242. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25243. * @param {string} input
  25244. */
  25245. function isomorphicEncode (input) {
  25246. // 1. Assert: input contains no code points greater than U+00FF.
  25247. for (let i = 0; i < input.length; i++) {
  25248. assert(input.charCodeAt(i) <= 0xFF)
  25249. }
  25250. // 2. Return a byte sequence whose length is equal to input’s code
  25251. // point length and whose bytes have the same values as the
  25252. // values of input’s code points, in the same order
  25253. return input
  25254. }
  25255. /**
  25256. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25257. * @see https://streams.spec.whatwg.org/#read-loop
  25258. * @param {ReadableStreamDefaultReader} reader
  25259. */
  25260. async function readAllBytes (reader) {
  25261. const bytes = []
  25262. let byteLength = 0
  25263. while (true) {
  25264. const { done, value: chunk } = await reader.read()
  25265. if (done) {
  25266. // 1. Call successSteps with bytes.
  25267. return Buffer.concat(bytes, byteLength)
  25268. }
  25269. // 1. If chunk is not a Uint8Array object, call failureSteps
  25270. // with a TypeError and abort these steps.
  25271. if (!isUint8Array(chunk)) {
  25272. throw new TypeError('Received non-Uint8Array chunk')
  25273. }
  25274. // 2. Append the bytes represented by chunk to bytes.
  25275. bytes.push(chunk)
  25276. byteLength += chunk.length
  25277. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25278. }
  25279. }
  25280. /**
  25281. * @see https://fetch.spec.whatwg.org/#is-local
  25282. * @param {URL} url
  25283. */
  25284. function urlIsLocal (url) {
  25285. assert('protocol' in url) // ensure it's a url object
  25286. const protocol = url.protocol
  25287. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25288. }
  25289. /**
  25290. * @param {string|URL} url
  25291. */
  25292. function urlHasHttpsScheme (url) {
  25293. if (typeof url === 'string') {
  25294. return url.startsWith('https:')
  25295. }
  25296. return url.protocol === 'https:'
  25297. }
  25298. /**
  25299. * @see https://fetch.spec.whatwg.org/#http-scheme
  25300. * @param {URL} url
  25301. */
  25302. function urlIsHttpHttpsScheme (url) {
  25303. assert('protocol' in url) // ensure it's a url object
  25304. const protocol = url.protocol
  25305. return protocol === 'http:' || protocol === 'https:'
  25306. }
  25307. /**
  25308. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25309. */
  25310. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25311. module.exports = {
  25312. isAborted,
  25313. isCancelled,
  25314. createDeferredPromise,
  25315. ReadableStreamFrom,
  25316. toUSVString,
  25317. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25318. coarsenedSharedCurrentTime,
  25319. determineRequestsReferrer,
  25320. makePolicyContainer,
  25321. clonePolicyContainer,
  25322. appendFetchMetadata,
  25323. appendRequestOriginHeader,
  25324. TAOCheck,
  25325. corsCheck,
  25326. crossOriginResourcePolicyCheck,
  25327. createOpaqueTimingInfo,
  25328. setRequestReferrerPolicyOnRedirect,
  25329. isValidHTTPToken,
  25330. requestBadPort,
  25331. requestCurrentURL,
  25332. responseURL,
  25333. responseLocationURL,
  25334. isBlobLike,
  25335. isURLPotentiallyTrustworthy,
  25336. isValidReasonPhrase,
  25337. sameOrigin,
  25338. normalizeMethod,
  25339. serializeJavascriptValueToJSONString,
  25340. makeIterator,
  25341. isValidHeaderName,
  25342. isValidHeaderValue,
  25343. hasOwn,
  25344. isErrorLike,
  25345. fullyReadBody,
  25346. bytesMatch,
  25347. isReadableStreamLike,
  25348. readableStreamClose,
  25349. isomorphicEncode,
  25350. isomorphicDecode,
  25351. urlIsLocal,
  25352. urlHasHttpsScheme,
  25353. urlIsHttpHttpsScheme,
  25354. readAllBytes,
  25355. normalizeMethodRecord,
  25356. parseMetadata
  25357. }
  25358. /***/ }),
  25359. /***/ 1744:
  25360. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25361. "use strict";
  25362. const { types } = __nccwpck_require__(3837)
  25363. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25364. /** @type {import('../../types/webidl').Webidl} */
  25365. const webidl = {}
  25366. webidl.converters = {}
  25367. webidl.util = {}
  25368. webidl.errors = {}
  25369. webidl.errors.exception = function (message) {
  25370. return new TypeError(`${message.header}: ${message.message}`)
  25371. }
  25372. webidl.errors.conversionFailed = function (context) {
  25373. const plural = context.types.length === 1 ? '' : ' one of'
  25374. const message =
  25375. `${context.argument} could not be converted to` +
  25376. `${plural}: ${context.types.join(', ')}.`
  25377. return webidl.errors.exception({
  25378. header: context.prefix,
  25379. message
  25380. })
  25381. }
  25382. webidl.errors.invalidArgument = function (context) {
  25383. return webidl.errors.exception({
  25384. header: context.prefix,
  25385. message: `"${context.value}" is an invalid ${context.type}.`
  25386. })
  25387. }
  25388. // https://webidl.spec.whatwg.org/#implements
  25389. webidl.brandCheck = function (V, I, opts = undefined) {
  25390. if (opts?.strict !== false && !(V instanceof I)) {
  25391. throw new TypeError('Illegal invocation')
  25392. } else {
  25393. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25394. }
  25395. }
  25396. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25397. if (length < min) {
  25398. throw webidl.errors.exception({
  25399. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25400. `but${length ? ' only' : ''} ${length} found.`,
  25401. ...ctx
  25402. })
  25403. }
  25404. }
  25405. webidl.illegalConstructor = function () {
  25406. throw webidl.errors.exception({
  25407. header: 'TypeError',
  25408. message: 'Illegal constructor'
  25409. })
  25410. }
  25411. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25412. webidl.util.Type = function (V) {
  25413. switch (typeof V) {
  25414. case 'undefined': return 'Undefined'
  25415. case 'boolean': return 'Boolean'
  25416. case 'string': return 'String'
  25417. case 'symbol': return 'Symbol'
  25418. case 'number': return 'Number'
  25419. case 'bigint': return 'BigInt'
  25420. case 'function':
  25421. case 'object': {
  25422. if (V === null) {
  25423. return 'Null'
  25424. }
  25425. return 'Object'
  25426. }
  25427. }
  25428. }
  25429. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25430. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25431. let upperBound
  25432. let lowerBound
  25433. // 1. If bitLength is 64, then:
  25434. if (bitLength === 64) {
  25435. // 1. Let upperBound be 2^53 − 1.
  25436. upperBound = Math.pow(2, 53) - 1
  25437. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25438. if (signedness === 'unsigned') {
  25439. lowerBound = 0
  25440. } else {
  25441. // 3. Otherwise let lowerBound be −2^53 + 1.
  25442. lowerBound = Math.pow(-2, 53) + 1
  25443. }
  25444. } else if (signedness === 'unsigned') {
  25445. // 2. Otherwise, if signedness is "unsigned", then:
  25446. // 1. Let lowerBound be 0.
  25447. lowerBound = 0
  25448. // 2. Let upperBound be 2^bitLength − 1.
  25449. upperBound = Math.pow(2, bitLength) - 1
  25450. } else {
  25451. // 3. Otherwise:
  25452. // 1. Let lowerBound be -2^bitLength − 1.
  25453. lowerBound = Math.pow(-2, bitLength) - 1
  25454. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25455. upperBound = Math.pow(2, bitLength - 1) - 1
  25456. }
  25457. // 4. Let x be ? ToNumber(V).
  25458. let x = Number(V)
  25459. // 5. If x is −0, then set x to +0.
  25460. if (x === 0) {
  25461. x = 0
  25462. }
  25463. // 6. If the conversion is to an IDL type associated
  25464. // with the [EnforceRange] extended attribute, then:
  25465. if (opts.enforceRange === true) {
  25466. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25467. if (
  25468. Number.isNaN(x) ||
  25469. x === Number.POSITIVE_INFINITY ||
  25470. x === Number.NEGATIVE_INFINITY
  25471. ) {
  25472. throw webidl.errors.exception({
  25473. header: 'Integer conversion',
  25474. message: `Could not convert ${V} to an integer.`
  25475. })
  25476. }
  25477. // 2. Set x to IntegerPart(x).
  25478. x = webidl.util.IntegerPart(x)
  25479. // 3. If x < lowerBound or x > upperBound, then
  25480. // throw a TypeError.
  25481. if (x < lowerBound || x > upperBound) {
  25482. throw webidl.errors.exception({
  25483. header: 'Integer conversion',
  25484. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25485. })
  25486. }
  25487. // 4. Return x.
  25488. return x
  25489. }
  25490. // 7. If x is not NaN and the conversion is to an IDL
  25491. // type associated with the [Clamp] extended
  25492. // attribute, then:
  25493. if (!Number.isNaN(x) && opts.clamp === true) {
  25494. // 1. Set x to min(max(x, lowerBound), upperBound).
  25495. x = Math.min(Math.max(x, lowerBound), upperBound)
  25496. // 2. Round x to the nearest integer, choosing the
  25497. // even integer if it lies halfway between two,
  25498. // and choosing +0 rather than −0.
  25499. if (Math.floor(x) % 2 === 0) {
  25500. x = Math.floor(x)
  25501. } else {
  25502. x = Math.ceil(x)
  25503. }
  25504. // 3. Return x.
  25505. return x
  25506. }
  25507. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25508. if (
  25509. Number.isNaN(x) ||
  25510. (x === 0 && Object.is(0, x)) ||
  25511. x === Number.POSITIVE_INFINITY ||
  25512. x === Number.NEGATIVE_INFINITY
  25513. ) {
  25514. return 0
  25515. }
  25516. // 9. Set x to IntegerPart(x).
  25517. x = webidl.util.IntegerPart(x)
  25518. // 10. Set x to x modulo 2^bitLength.
  25519. x = x % Math.pow(2, bitLength)
  25520. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25521. // then return x − 2^bitLength.
  25522. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25523. return x - Math.pow(2, bitLength)
  25524. }
  25525. // 12. Otherwise, return x.
  25526. return x
  25527. }
  25528. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25529. webidl.util.IntegerPart = function (n) {
  25530. // 1. Let r be floor(abs(n)).
  25531. const r = Math.floor(Math.abs(n))
  25532. // 2. If n < 0, then return -1 × r.
  25533. if (n < 0) {
  25534. return -1 * r
  25535. }
  25536. // 3. Otherwise, return r.
  25537. return r
  25538. }
  25539. // https://webidl.spec.whatwg.org/#es-sequence
  25540. webidl.sequenceConverter = function (converter) {
  25541. return (V) => {
  25542. // 1. If Type(V) is not Object, throw a TypeError.
  25543. if (webidl.util.Type(V) !== 'Object') {
  25544. throw webidl.errors.exception({
  25545. header: 'Sequence',
  25546. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25547. })
  25548. }
  25549. // 2. Let method be ? GetMethod(V, @@iterator).
  25550. /** @type {Generator} */
  25551. const method = V?.[Symbol.iterator]?.()
  25552. const seq = []
  25553. // 3. If method is undefined, throw a TypeError.
  25554. if (
  25555. method === undefined ||
  25556. typeof method.next !== 'function'
  25557. ) {
  25558. throw webidl.errors.exception({
  25559. header: 'Sequence',
  25560. message: 'Object is not an iterator.'
  25561. })
  25562. }
  25563. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25564. while (true) {
  25565. const { done, value } = method.next()
  25566. if (done) {
  25567. break
  25568. }
  25569. seq.push(converter(value))
  25570. }
  25571. return seq
  25572. }
  25573. }
  25574. // https://webidl.spec.whatwg.org/#es-to-record
  25575. webidl.recordConverter = function (keyConverter, valueConverter) {
  25576. return (O) => {
  25577. // 1. If Type(O) is not Object, throw a TypeError.
  25578. if (webidl.util.Type(O) !== 'Object') {
  25579. throw webidl.errors.exception({
  25580. header: 'Record',
  25581. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25582. })
  25583. }
  25584. // 2. Let result be a new empty instance of record<K, V>.
  25585. const result = {}
  25586. if (!types.isProxy(O)) {
  25587. // Object.keys only returns enumerable properties
  25588. const keys = Object.keys(O)
  25589. for (const key of keys) {
  25590. // 1. Let typedKey be key converted to an IDL value of type K.
  25591. const typedKey = keyConverter(key)
  25592. // 2. Let value be ? Get(O, key).
  25593. // 3. Let typedValue be value converted to an IDL value of type V.
  25594. const typedValue = valueConverter(O[key])
  25595. // 4. Set result[typedKey] to typedValue.
  25596. result[typedKey] = typedValue
  25597. }
  25598. // 5. Return result.
  25599. return result
  25600. }
  25601. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25602. const keys = Reflect.ownKeys(O)
  25603. // 4. For each key of keys.
  25604. for (const key of keys) {
  25605. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25606. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25607. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25608. if (desc?.enumerable) {
  25609. // 1. Let typedKey be key converted to an IDL value of type K.
  25610. const typedKey = keyConverter(key)
  25611. // 2. Let value be ? Get(O, key).
  25612. // 3. Let typedValue be value converted to an IDL value of type V.
  25613. const typedValue = valueConverter(O[key])
  25614. // 4. Set result[typedKey] to typedValue.
  25615. result[typedKey] = typedValue
  25616. }
  25617. }
  25618. // 5. Return result.
  25619. return result
  25620. }
  25621. }
  25622. webidl.interfaceConverter = function (i) {
  25623. return (V, opts = {}) => {
  25624. if (opts.strict !== false && !(V instanceof i)) {
  25625. throw webidl.errors.exception({
  25626. header: i.name,
  25627. message: `Expected ${V} to be an instance of ${i.name}.`
  25628. })
  25629. }
  25630. return V
  25631. }
  25632. }
  25633. webidl.dictionaryConverter = function (converters) {
  25634. return (dictionary) => {
  25635. const type = webidl.util.Type(dictionary)
  25636. const dict = {}
  25637. if (type === 'Null' || type === 'Undefined') {
  25638. return dict
  25639. } else if (type !== 'Object') {
  25640. throw webidl.errors.exception({
  25641. header: 'Dictionary',
  25642. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25643. })
  25644. }
  25645. for (const options of converters) {
  25646. const { key, defaultValue, required, converter } = options
  25647. if (required === true) {
  25648. if (!hasOwn(dictionary, key)) {
  25649. throw webidl.errors.exception({
  25650. header: 'Dictionary',
  25651. message: `Missing required key "${key}".`
  25652. })
  25653. }
  25654. }
  25655. let value = dictionary[key]
  25656. const hasDefault = hasOwn(options, 'defaultValue')
  25657. // Only use defaultValue if value is undefined and
  25658. // a defaultValue options was provided.
  25659. if (hasDefault && value !== null) {
  25660. value = value ?? defaultValue
  25661. }
  25662. // A key can be optional and have no default value.
  25663. // When this happens, do not perform a conversion,
  25664. // and do not assign the key a value.
  25665. if (required || hasDefault || value !== undefined) {
  25666. value = converter(value)
  25667. if (
  25668. options.allowedValues &&
  25669. !options.allowedValues.includes(value)
  25670. ) {
  25671. throw webidl.errors.exception({
  25672. header: 'Dictionary',
  25673. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25674. })
  25675. }
  25676. dict[key] = value
  25677. }
  25678. }
  25679. return dict
  25680. }
  25681. }
  25682. webidl.nullableConverter = function (converter) {
  25683. return (V) => {
  25684. if (V === null) {
  25685. return V
  25686. }
  25687. return converter(V)
  25688. }
  25689. }
  25690. // https://webidl.spec.whatwg.org/#es-DOMString
  25691. webidl.converters.DOMString = function (V, opts = {}) {
  25692. // 1. If V is null and the conversion is to an IDL type
  25693. // associated with the [LegacyNullToEmptyString]
  25694. // extended attribute, then return the DOMString value
  25695. // that represents the empty string.
  25696. if (V === null && opts.legacyNullToEmptyString) {
  25697. return ''
  25698. }
  25699. // 2. Let x be ? ToString(V).
  25700. if (typeof V === 'symbol') {
  25701. throw new TypeError('Could not convert argument of type symbol to string.')
  25702. }
  25703. // 3. Return the IDL DOMString value that represents the
  25704. // same sequence of code units as the one the
  25705. // ECMAScript String value x represents.
  25706. return String(V)
  25707. }
  25708. // https://webidl.spec.whatwg.org/#es-ByteString
  25709. webidl.converters.ByteString = function (V) {
  25710. // 1. Let x be ? ToString(V).
  25711. // Note: DOMString converter perform ? ToString(V)
  25712. const x = webidl.converters.DOMString(V)
  25713. // 2. If the value of any element of x is greater than
  25714. // 255, then throw a TypeError.
  25715. for (let index = 0; index < x.length; index++) {
  25716. if (x.charCodeAt(index) > 255) {
  25717. throw new TypeError(
  25718. 'Cannot convert argument to a ByteString because the character at ' +
  25719. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25720. )
  25721. }
  25722. }
  25723. // 3. Return an IDL ByteString value whose length is the
  25724. // length of x, and where the value of each element is
  25725. // the value of the corresponding element of x.
  25726. return x
  25727. }
  25728. // https://webidl.spec.whatwg.org/#es-USVString
  25729. webidl.converters.USVString = toUSVString
  25730. // https://webidl.spec.whatwg.org/#es-boolean
  25731. webidl.converters.boolean = function (V) {
  25732. // 1. Let x be the result of computing ToBoolean(V).
  25733. const x = Boolean(V)
  25734. // 2. Return the IDL boolean value that is the one that represents
  25735. // the same truth value as the ECMAScript Boolean value x.
  25736. return x
  25737. }
  25738. // https://webidl.spec.whatwg.org/#es-any
  25739. webidl.converters.any = function (V) {
  25740. return V
  25741. }
  25742. // https://webidl.spec.whatwg.org/#es-long-long
  25743. webidl.converters['long long'] = function (V) {
  25744. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  25745. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  25746. // 2. Return the IDL long long value that represents
  25747. // the same numeric value as x.
  25748. return x
  25749. }
  25750. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  25751. webidl.converters['unsigned long long'] = function (V) {
  25752. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  25753. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  25754. // 2. Return the IDL unsigned long long value that
  25755. // represents the same numeric value as x.
  25756. return x
  25757. }
  25758. // https://webidl.spec.whatwg.org/#es-unsigned-long
  25759. webidl.converters['unsigned long'] = function (V) {
  25760. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  25761. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  25762. // 2. Return the IDL unsigned long value that
  25763. // represents the same numeric value as x.
  25764. return x
  25765. }
  25766. // https://webidl.spec.whatwg.org/#es-unsigned-short
  25767. webidl.converters['unsigned short'] = function (V, opts) {
  25768. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  25769. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  25770. // 2. Return the IDL unsigned short value that represents
  25771. // the same numeric value as x.
  25772. return x
  25773. }
  25774. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  25775. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  25776. // 1. If Type(V) is not Object, or V does not have an
  25777. // [[ArrayBufferData]] internal slot, then throw a
  25778. // TypeError.
  25779. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  25780. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  25781. if (
  25782. webidl.util.Type(V) !== 'Object' ||
  25783. !types.isAnyArrayBuffer(V)
  25784. ) {
  25785. throw webidl.errors.conversionFailed({
  25786. prefix: `${V}`,
  25787. argument: `${V}`,
  25788. types: ['ArrayBuffer']
  25789. })
  25790. }
  25791. // 2. If the conversion is not to an IDL type associated
  25792. // with the [AllowShared] extended attribute, and
  25793. // IsSharedArrayBuffer(V) is true, then throw a
  25794. // TypeError.
  25795. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  25796. throw webidl.errors.exception({
  25797. header: 'ArrayBuffer',
  25798. message: 'SharedArrayBuffer is not allowed.'
  25799. })
  25800. }
  25801. // 3. If the conversion is not to an IDL type associated
  25802. // with the [AllowResizable] extended attribute, and
  25803. // IsResizableArrayBuffer(V) is true, then throw a
  25804. // TypeError.
  25805. // Note: resizable ArrayBuffers are currently a proposal.
  25806. // 4. Return the IDL ArrayBuffer value that is a
  25807. // reference to the same object as V.
  25808. return V
  25809. }
  25810. webidl.converters.TypedArray = function (V, T, opts = {}) {
  25811. // 1. Let T be the IDL type V is being converted to.
  25812. // 2. If Type(V) is not Object, or V does not have a
  25813. // [[TypedArrayName]] internal slot with a value
  25814. // equal to T’s name, then throw a TypeError.
  25815. if (
  25816. webidl.util.Type(V) !== 'Object' ||
  25817. !types.isTypedArray(V) ||
  25818. V.constructor.name !== T.name
  25819. ) {
  25820. throw webidl.errors.conversionFailed({
  25821. prefix: `${T.name}`,
  25822. argument: `${V}`,
  25823. types: [T.name]
  25824. })
  25825. }
  25826. // 3. If the conversion is not to an IDL type associated
  25827. // with the [AllowShared] extended attribute, and
  25828. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25829. // true, then throw a TypeError.
  25830. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25831. throw webidl.errors.exception({
  25832. header: 'ArrayBuffer',
  25833. message: 'SharedArrayBuffer is not allowed.'
  25834. })
  25835. }
  25836. // 4. If the conversion is not to an IDL type associated
  25837. // with the [AllowResizable] extended attribute, and
  25838. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25839. // true, then throw a TypeError.
  25840. // Note: resizable array buffers are currently a proposal
  25841. // 5. Return the IDL value of type T that is a reference
  25842. // to the same object as V.
  25843. return V
  25844. }
  25845. webidl.converters.DataView = function (V, opts = {}) {
  25846. // 1. If Type(V) is not Object, or V does not have a
  25847. // [[DataView]] internal slot, then throw a TypeError.
  25848. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  25849. throw webidl.errors.exception({
  25850. header: 'DataView',
  25851. message: 'Object is not a DataView.'
  25852. })
  25853. }
  25854. // 2. If the conversion is not to an IDL type associated
  25855. // with the [AllowShared] extended attribute, and
  25856. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  25857. // then throw a TypeError.
  25858. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25859. throw webidl.errors.exception({
  25860. header: 'ArrayBuffer',
  25861. message: 'SharedArrayBuffer is not allowed.'
  25862. })
  25863. }
  25864. // 3. If the conversion is not to an IDL type associated
  25865. // with the [AllowResizable] extended attribute, and
  25866. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25867. // true, then throw a TypeError.
  25868. // Note: resizable ArrayBuffers are currently a proposal
  25869. // 4. Return the IDL DataView value that is a reference
  25870. // to the same object as V.
  25871. return V
  25872. }
  25873. // https://webidl.spec.whatwg.org/#BufferSource
  25874. webidl.converters.BufferSource = function (V, opts = {}) {
  25875. if (types.isAnyArrayBuffer(V)) {
  25876. return webidl.converters.ArrayBuffer(V, opts)
  25877. }
  25878. if (types.isTypedArray(V)) {
  25879. return webidl.converters.TypedArray(V, V.constructor)
  25880. }
  25881. if (types.isDataView(V)) {
  25882. return webidl.converters.DataView(V, opts)
  25883. }
  25884. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  25885. }
  25886. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  25887. webidl.converters.ByteString
  25888. )
  25889. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  25890. webidl.converters['sequence<ByteString>']
  25891. )
  25892. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  25893. webidl.converters.ByteString,
  25894. webidl.converters.ByteString
  25895. )
  25896. module.exports = {
  25897. webidl
  25898. }
  25899. /***/ }),
  25900. /***/ 4854:
  25901. /***/ ((module) => {
  25902. "use strict";
  25903. /**
  25904. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  25905. * @param {string|undefined} label
  25906. */
  25907. function getEncoding (label) {
  25908. if (!label) {
  25909. return 'failure'
  25910. }
  25911. // 1. Remove any leading and trailing ASCII whitespace from label.
  25912. // 2. If label is an ASCII case-insensitive match for any of the
  25913. // labels listed in the table below, then return the
  25914. // corresponding encoding; otherwise return failure.
  25915. switch (label.trim().toLowerCase()) {
  25916. case 'unicode-1-1-utf-8':
  25917. case 'unicode11utf8':
  25918. case 'unicode20utf8':
  25919. case 'utf-8':
  25920. case 'utf8':
  25921. case 'x-unicode20utf8':
  25922. return 'UTF-8'
  25923. case '866':
  25924. case 'cp866':
  25925. case 'csibm866':
  25926. case 'ibm866':
  25927. return 'IBM866'
  25928. case 'csisolatin2':
  25929. case 'iso-8859-2':
  25930. case 'iso-ir-101':
  25931. case 'iso8859-2':
  25932. case 'iso88592':
  25933. case 'iso_8859-2':
  25934. case 'iso_8859-2:1987':
  25935. case 'l2':
  25936. case 'latin2':
  25937. return 'ISO-8859-2'
  25938. case 'csisolatin3':
  25939. case 'iso-8859-3':
  25940. case 'iso-ir-109':
  25941. case 'iso8859-3':
  25942. case 'iso88593':
  25943. case 'iso_8859-3':
  25944. case 'iso_8859-3:1988':
  25945. case 'l3':
  25946. case 'latin3':
  25947. return 'ISO-8859-3'
  25948. case 'csisolatin4':
  25949. case 'iso-8859-4':
  25950. case 'iso-ir-110':
  25951. case 'iso8859-4':
  25952. case 'iso88594':
  25953. case 'iso_8859-4':
  25954. case 'iso_8859-4:1988':
  25955. case 'l4':
  25956. case 'latin4':
  25957. return 'ISO-8859-4'
  25958. case 'csisolatincyrillic':
  25959. case 'cyrillic':
  25960. case 'iso-8859-5':
  25961. case 'iso-ir-144':
  25962. case 'iso8859-5':
  25963. case 'iso88595':
  25964. case 'iso_8859-5':
  25965. case 'iso_8859-5:1988':
  25966. return 'ISO-8859-5'
  25967. case 'arabic':
  25968. case 'asmo-708':
  25969. case 'csiso88596e':
  25970. case 'csiso88596i':
  25971. case 'csisolatinarabic':
  25972. case 'ecma-114':
  25973. case 'iso-8859-6':
  25974. case 'iso-8859-6-e':
  25975. case 'iso-8859-6-i':
  25976. case 'iso-ir-127':
  25977. case 'iso8859-6':
  25978. case 'iso88596':
  25979. case 'iso_8859-6':
  25980. case 'iso_8859-6:1987':
  25981. return 'ISO-8859-6'
  25982. case 'csisolatingreek':
  25983. case 'ecma-118':
  25984. case 'elot_928':
  25985. case 'greek':
  25986. case 'greek8':
  25987. case 'iso-8859-7':
  25988. case 'iso-ir-126':
  25989. case 'iso8859-7':
  25990. case 'iso88597':
  25991. case 'iso_8859-7':
  25992. case 'iso_8859-7:1987':
  25993. case 'sun_eu_greek':
  25994. return 'ISO-8859-7'
  25995. case 'csiso88598e':
  25996. case 'csisolatinhebrew':
  25997. case 'hebrew':
  25998. case 'iso-8859-8':
  25999. case 'iso-8859-8-e':
  26000. case 'iso-ir-138':
  26001. case 'iso8859-8':
  26002. case 'iso88598':
  26003. case 'iso_8859-8':
  26004. case 'iso_8859-8:1988':
  26005. case 'visual':
  26006. return 'ISO-8859-8'
  26007. case 'csiso88598i':
  26008. case 'iso-8859-8-i':
  26009. case 'logical':
  26010. return 'ISO-8859-8-I'
  26011. case 'csisolatin6':
  26012. case 'iso-8859-10':
  26013. case 'iso-ir-157':
  26014. case 'iso8859-10':
  26015. case 'iso885910':
  26016. case 'l6':
  26017. case 'latin6':
  26018. return 'ISO-8859-10'
  26019. case 'iso-8859-13':
  26020. case 'iso8859-13':
  26021. case 'iso885913':
  26022. return 'ISO-8859-13'
  26023. case 'iso-8859-14':
  26024. case 'iso8859-14':
  26025. case 'iso885914':
  26026. return 'ISO-8859-14'
  26027. case 'csisolatin9':
  26028. case 'iso-8859-15':
  26029. case 'iso8859-15':
  26030. case 'iso885915':
  26031. case 'iso_8859-15':
  26032. case 'l9':
  26033. return 'ISO-8859-15'
  26034. case 'iso-8859-16':
  26035. return 'ISO-8859-16'
  26036. case 'cskoi8r':
  26037. case 'koi':
  26038. case 'koi8':
  26039. case 'koi8-r':
  26040. case 'koi8_r':
  26041. return 'KOI8-R'
  26042. case 'koi8-ru':
  26043. case 'koi8-u':
  26044. return 'KOI8-U'
  26045. case 'csmacintosh':
  26046. case 'mac':
  26047. case 'macintosh':
  26048. case 'x-mac-roman':
  26049. return 'macintosh'
  26050. case 'iso-8859-11':
  26051. case 'iso8859-11':
  26052. case 'iso885911':
  26053. case 'tis-620':
  26054. case 'windows-874':
  26055. return 'windows-874'
  26056. case 'cp1250':
  26057. case 'windows-1250':
  26058. case 'x-cp1250':
  26059. return 'windows-1250'
  26060. case 'cp1251':
  26061. case 'windows-1251':
  26062. case 'x-cp1251':
  26063. return 'windows-1251'
  26064. case 'ansi_x3.4-1968':
  26065. case 'ascii':
  26066. case 'cp1252':
  26067. case 'cp819':
  26068. case 'csisolatin1':
  26069. case 'ibm819':
  26070. case 'iso-8859-1':
  26071. case 'iso-ir-100':
  26072. case 'iso8859-1':
  26073. case 'iso88591':
  26074. case 'iso_8859-1':
  26075. case 'iso_8859-1:1987':
  26076. case 'l1':
  26077. case 'latin1':
  26078. case 'us-ascii':
  26079. case 'windows-1252':
  26080. case 'x-cp1252':
  26081. return 'windows-1252'
  26082. case 'cp1253':
  26083. case 'windows-1253':
  26084. case 'x-cp1253':
  26085. return 'windows-1253'
  26086. case 'cp1254':
  26087. case 'csisolatin5':
  26088. case 'iso-8859-9':
  26089. case 'iso-ir-148':
  26090. case 'iso8859-9':
  26091. case 'iso88599':
  26092. case 'iso_8859-9':
  26093. case 'iso_8859-9:1989':
  26094. case 'l5':
  26095. case 'latin5':
  26096. case 'windows-1254':
  26097. case 'x-cp1254':
  26098. return 'windows-1254'
  26099. case 'cp1255':
  26100. case 'windows-1255':
  26101. case 'x-cp1255':
  26102. return 'windows-1255'
  26103. case 'cp1256':
  26104. case 'windows-1256':
  26105. case 'x-cp1256':
  26106. return 'windows-1256'
  26107. case 'cp1257':
  26108. case 'windows-1257':
  26109. case 'x-cp1257':
  26110. return 'windows-1257'
  26111. case 'cp1258':
  26112. case 'windows-1258':
  26113. case 'x-cp1258':
  26114. return 'windows-1258'
  26115. case 'x-mac-cyrillic':
  26116. case 'x-mac-ukrainian':
  26117. return 'x-mac-cyrillic'
  26118. case 'chinese':
  26119. case 'csgb2312':
  26120. case 'csiso58gb231280':
  26121. case 'gb2312':
  26122. case 'gb_2312':
  26123. case 'gb_2312-80':
  26124. case 'gbk':
  26125. case 'iso-ir-58':
  26126. case 'x-gbk':
  26127. return 'GBK'
  26128. case 'gb18030':
  26129. return 'gb18030'
  26130. case 'big5':
  26131. case 'big5-hkscs':
  26132. case 'cn-big5':
  26133. case 'csbig5':
  26134. case 'x-x-big5':
  26135. return 'Big5'
  26136. case 'cseucpkdfmtjapanese':
  26137. case 'euc-jp':
  26138. case 'x-euc-jp':
  26139. return 'EUC-JP'
  26140. case 'csiso2022jp':
  26141. case 'iso-2022-jp':
  26142. return 'ISO-2022-JP'
  26143. case 'csshiftjis':
  26144. case 'ms932':
  26145. case 'ms_kanji':
  26146. case 'shift-jis':
  26147. case 'shift_jis':
  26148. case 'sjis':
  26149. case 'windows-31j':
  26150. case 'x-sjis':
  26151. return 'Shift_JIS'
  26152. case 'cseuckr':
  26153. case 'csksc56011987':
  26154. case 'euc-kr':
  26155. case 'iso-ir-149':
  26156. case 'korean':
  26157. case 'ks_c_5601-1987':
  26158. case 'ks_c_5601-1989':
  26159. case 'ksc5601':
  26160. case 'ksc_5601':
  26161. case 'windows-949':
  26162. return 'EUC-KR'
  26163. case 'csiso2022kr':
  26164. case 'hz-gb-2312':
  26165. case 'iso-2022-cn':
  26166. case 'iso-2022-cn-ext':
  26167. case 'iso-2022-kr':
  26168. case 'replacement':
  26169. return 'replacement'
  26170. case 'unicodefffe':
  26171. case 'utf-16be':
  26172. return 'UTF-16BE'
  26173. case 'csunicode':
  26174. case 'iso-10646-ucs-2':
  26175. case 'ucs-2':
  26176. case 'unicode':
  26177. case 'unicodefeff':
  26178. case 'utf-16':
  26179. case 'utf-16le':
  26180. return 'UTF-16LE'
  26181. case 'x-user-defined':
  26182. return 'x-user-defined'
  26183. default: return 'failure'
  26184. }
  26185. }
  26186. module.exports = {
  26187. getEncoding
  26188. }
  26189. /***/ }),
  26190. /***/ 1446:
  26191. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26192. "use strict";
  26193. const {
  26194. staticPropertyDescriptors,
  26195. readOperation,
  26196. fireAProgressEvent
  26197. } = __nccwpck_require__(7530)
  26198. const {
  26199. kState,
  26200. kError,
  26201. kResult,
  26202. kEvents,
  26203. kAborted
  26204. } = __nccwpck_require__(9054)
  26205. const { webidl } = __nccwpck_require__(1744)
  26206. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26207. class FileReader extends EventTarget {
  26208. constructor () {
  26209. super()
  26210. this[kState] = 'empty'
  26211. this[kResult] = null
  26212. this[kError] = null
  26213. this[kEvents] = {
  26214. loadend: null,
  26215. error: null,
  26216. abort: null,
  26217. load: null,
  26218. progress: null,
  26219. loadstart: null
  26220. }
  26221. }
  26222. /**
  26223. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26224. * @param {import('buffer').Blob} blob
  26225. */
  26226. readAsArrayBuffer (blob) {
  26227. webidl.brandCheck(this, FileReader)
  26228. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26229. blob = webidl.converters.Blob(blob, { strict: false })
  26230. // The readAsArrayBuffer(blob) method, when invoked,
  26231. // must initiate a read operation for blob with ArrayBuffer.
  26232. readOperation(this, blob, 'ArrayBuffer')
  26233. }
  26234. /**
  26235. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26236. * @param {import('buffer').Blob} blob
  26237. */
  26238. readAsBinaryString (blob) {
  26239. webidl.brandCheck(this, FileReader)
  26240. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26241. blob = webidl.converters.Blob(blob, { strict: false })
  26242. // The readAsBinaryString(blob) method, when invoked,
  26243. // must initiate a read operation for blob with BinaryString.
  26244. readOperation(this, blob, 'BinaryString')
  26245. }
  26246. /**
  26247. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26248. * @param {import('buffer').Blob} blob
  26249. * @param {string?} encoding
  26250. */
  26251. readAsText (blob, encoding = undefined) {
  26252. webidl.brandCheck(this, FileReader)
  26253. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26254. blob = webidl.converters.Blob(blob, { strict: false })
  26255. if (encoding !== undefined) {
  26256. encoding = webidl.converters.DOMString(encoding)
  26257. }
  26258. // The readAsText(blob, encoding) method, when invoked,
  26259. // must initiate a read operation for blob with Text and encoding.
  26260. readOperation(this, blob, 'Text', encoding)
  26261. }
  26262. /**
  26263. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26264. * @param {import('buffer').Blob} blob
  26265. */
  26266. readAsDataURL (blob) {
  26267. webidl.brandCheck(this, FileReader)
  26268. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26269. blob = webidl.converters.Blob(blob, { strict: false })
  26270. // The readAsDataURL(blob) method, when invoked, must
  26271. // initiate a read operation for blob with DataURL.
  26272. readOperation(this, blob, 'DataURL')
  26273. }
  26274. /**
  26275. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26276. */
  26277. abort () {
  26278. // 1. If this's state is "empty" or if this's state is
  26279. // "done" set this's result to null and terminate
  26280. // this algorithm.
  26281. if (this[kState] === 'empty' || this[kState] === 'done') {
  26282. this[kResult] = null
  26283. return
  26284. }
  26285. // 2. If this's state is "loading" set this's state to
  26286. // "done" and set this's result to null.
  26287. if (this[kState] === 'loading') {
  26288. this[kState] = 'done'
  26289. this[kResult] = null
  26290. }
  26291. // 3. If there are any tasks from this on the file reading
  26292. // task source in an affiliated task queue, then remove
  26293. // those tasks from that task queue.
  26294. this[kAborted] = true
  26295. // 4. Terminate the algorithm for the read method being processed.
  26296. // TODO
  26297. // 5. Fire a progress event called abort at this.
  26298. fireAProgressEvent('abort', this)
  26299. // 6. If this's state is not "loading", fire a progress
  26300. // event called loadend at this.
  26301. if (this[kState] !== 'loading') {
  26302. fireAProgressEvent('loadend', this)
  26303. }
  26304. }
  26305. /**
  26306. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26307. */
  26308. get readyState () {
  26309. webidl.brandCheck(this, FileReader)
  26310. switch (this[kState]) {
  26311. case 'empty': return this.EMPTY
  26312. case 'loading': return this.LOADING
  26313. case 'done': return this.DONE
  26314. }
  26315. }
  26316. /**
  26317. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26318. */
  26319. get result () {
  26320. webidl.brandCheck(this, FileReader)
  26321. // The result attribute’s getter, when invoked, must return
  26322. // this's result.
  26323. return this[kResult]
  26324. }
  26325. /**
  26326. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26327. */
  26328. get error () {
  26329. webidl.brandCheck(this, FileReader)
  26330. // The error attribute’s getter, when invoked, must return
  26331. // this's error.
  26332. return this[kError]
  26333. }
  26334. get onloadend () {
  26335. webidl.brandCheck(this, FileReader)
  26336. return this[kEvents].loadend
  26337. }
  26338. set onloadend (fn) {
  26339. webidl.brandCheck(this, FileReader)
  26340. if (this[kEvents].loadend) {
  26341. this.removeEventListener('loadend', this[kEvents].loadend)
  26342. }
  26343. if (typeof fn === 'function') {
  26344. this[kEvents].loadend = fn
  26345. this.addEventListener('loadend', fn)
  26346. } else {
  26347. this[kEvents].loadend = null
  26348. }
  26349. }
  26350. get onerror () {
  26351. webidl.brandCheck(this, FileReader)
  26352. return this[kEvents].error
  26353. }
  26354. set onerror (fn) {
  26355. webidl.brandCheck(this, FileReader)
  26356. if (this[kEvents].error) {
  26357. this.removeEventListener('error', this[kEvents].error)
  26358. }
  26359. if (typeof fn === 'function') {
  26360. this[kEvents].error = fn
  26361. this.addEventListener('error', fn)
  26362. } else {
  26363. this[kEvents].error = null
  26364. }
  26365. }
  26366. get onloadstart () {
  26367. webidl.brandCheck(this, FileReader)
  26368. return this[kEvents].loadstart
  26369. }
  26370. set onloadstart (fn) {
  26371. webidl.brandCheck(this, FileReader)
  26372. if (this[kEvents].loadstart) {
  26373. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26374. }
  26375. if (typeof fn === 'function') {
  26376. this[kEvents].loadstart = fn
  26377. this.addEventListener('loadstart', fn)
  26378. } else {
  26379. this[kEvents].loadstart = null
  26380. }
  26381. }
  26382. get onprogress () {
  26383. webidl.brandCheck(this, FileReader)
  26384. return this[kEvents].progress
  26385. }
  26386. set onprogress (fn) {
  26387. webidl.brandCheck(this, FileReader)
  26388. if (this[kEvents].progress) {
  26389. this.removeEventListener('progress', this[kEvents].progress)
  26390. }
  26391. if (typeof fn === 'function') {
  26392. this[kEvents].progress = fn
  26393. this.addEventListener('progress', fn)
  26394. } else {
  26395. this[kEvents].progress = null
  26396. }
  26397. }
  26398. get onload () {
  26399. webidl.brandCheck(this, FileReader)
  26400. return this[kEvents].load
  26401. }
  26402. set onload (fn) {
  26403. webidl.brandCheck(this, FileReader)
  26404. if (this[kEvents].load) {
  26405. this.removeEventListener('load', this[kEvents].load)
  26406. }
  26407. if (typeof fn === 'function') {
  26408. this[kEvents].load = fn
  26409. this.addEventListener('load', fn)
  26410. } else {
  26411. this[kEvents].load = null
  26412. }
  26413. }
  26414. get onabort () {
  26415. webidl.brandCheck(this, FileReader)
  26416. return this[kEvents].abort
  26417. }
  26418. set onabort (fn) {
  26419. webidl.brandCheck(this, FileReader)
  26420. if (this[kEvents].abort) {
  26421. this.removeEventListener('abort', this[kEvents].abort)
  26422. }
  26423. if (typeof fn === 'function') {
  26424. this[kEvents].abort = fn
  26425. this.addEventListener('abort', fn)
  26426. } else {
  26427. this[kEvents].abort = null
  26428. }
  26429. }
  26430. }
  26431. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26432. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26433. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26434. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26435. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26436. FileReader.DONE = FileReader.prototype.DONE = 2
  26437. Object.defineProperties(FileReader.prototype, {
  26438. EMPTY: staticPropertyDescriptors,
  26439. LOADING: staticPropertyDescriptors,
  26440. DONE: staticPropertyDescriptors,
  26441. readAsArrayBuffer: kEnumerableProperty,
  26442. readAsBinaryString: kEnumerableProperty,
  26443. readAsText: kEnumerableProperty,
  26444. readAsDataURL: kEnumerableProperty,
  26445. abort: kEnumerableProperty,
  26446. readyState: kEnumerableProperty,
  26447. result: kEnumerableProperty,
  26448. error: kEnumerableProperty,
  26449. onloadstart: kEnumerableProperty,
  26450. onprogress: kEnumerableProperty,
  26451. onload: kEnumerableProperty,
  26452. onabort: kEnumerableProperty,
  26453. onerror: kEnumerableProperty,
  26454. onloadend: kEnumerableProperty,
  26455. [Symbol.toStringTag]: {
  26456. value: 'FileReader',
  26457. writable: false,
  26458. enumerable: false,
  26459. configurable: true
  26460. }
  26461. })
  26462. Object.defineProperties(FileReader, {
  26463. EMPTY: staticPropertyDescriptors,
  26464. LOADING: staticPropertyDescriptors,
  26465. DONE: staticPropertyDescriptors
  26466. })
  26467. module.exports = {
  26468. FileReader
  26469. }
  26470. /***/ }),
  26471. /***/ 5504:
  26472. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26473. "use strict";
  26474. const { webidl } = __nccwpck_require__(1744)
  26475. const kState = Symbol('ProgressEvent state')
  26476. /**
  26477. * @see https://xhr.spec.whatwg.org/#progressevent
  26478. */
  26479. class ProgressEvent extends Event {
  26480. constructor (type, eventInitDict = {}) {
  26481. type = webidl.converters.DOMString(type)
  26482. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26483. super(type, eventInitDict)
  26484. this[kState] = {
  26485. lengthComputable: eventInitDict.lengthComputable,
  26486. loaded: eventInitDict.loaded,
  26487. total: eventInitDict.total
  26488. }
  26489. }
  26490. get lengthComputable () {
  26491. webidl.brandCheck(this, ProgressEvent)
  26492. return this[kState].lengthComputable
  26493. }
  26494. get loaded () {
  26495. webidl.brandCheck(this, ProgressEvent)
  26496. return this[kState].loaded
  26497. }
  26498. get total () {
  26499. webidl.brandCheck(this, ProgressEvent)
  26500. return this[kState].total
  26501. }
  26502. }
  26503. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26504. {
  26505. key: 'lengthComputable',
  26506. converter: webidl.converters.boolean,
  26507. defaultValue: false
  26508. },
  26509. {
  26510. key: 'loaded',
  26511. converter: webidl.converters['unsigned long long'],
  26512. defaultValue: 0
  26513. },
  26514. {
  26515. key: 'total',
  26516. converter: webidl.converters['unsigned long long'],
  26517. defaultValue: 0
  26518. },
  26519. {
  26520. key: 'bubbles',
  26521. converter: webidl.converters.boolean,
  26522. defaultValue: false
  26523. },
  26524. {
  26525. key: 'cancelable',
  26526. converter: webidl.converters.boolean,
  26527. defaultValue: false
  26528. },
  26529. {
  26530. key: 'composed',
  26531. converter: webidl.converters.boolean,
  26532. defaultValue: false
  26533. }
  26534. ])
  26535. module.exports = {
  26536. ProgressEvent
  26537. }
  26538. /***/ }),
  26539. /***/ 9054:
  26540. /***/ ((module) => {
  26541. "use strict";
  26542. module.exports = {
  26543. kState: Symbol('FileReader state'),
  26544. kResult: Symbol('FileReader result'),
  26545. kError: Symbol('FileReader error'),
  26546. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26547. kEvents: Symbol('FileReader events'),
  26548. kAborted: Symbol('FileReader aborted')
  26549. }
  26550. /***/ }),
  26551. /***/ 7530:
  26552. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26553. "use strict";
  26554. const {
  26555. kState,
  26556. kError,
  26557. kResult,
  26558. kAborted,
  26559. kLastProgressEventFired
  26560. } = __nccwpck_require__(9054)
  26561. const { ProgressEvent } = __nccwpck_require__(5504)
  26562. const { getEncoding } = __nccwpck_require__(4854)
  26563. const { DOMException } = __nccwpck_require__(1037)
  26564. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26565. const { types } = __nccwpck_require__(3837)
  26566. const { StringDecoder } = __nccwpck_require__(1576)
  26567. const { btoa } = __nccwpck_require__(4300)
  26568. /** @type {PropertyDescriptor} */
  26569. const staticPropertyDescriptors = {
  26570. enumerable: true,
  26571. writable: false,
  26572. configurable: false
  26573. }
  26574. /**
  26575. * @see https://w3c.github.io/FileAPI/#readOperation
  26576. * @param {import('./filereader').FileReader} fr
  26577. * @param {import('buffer').Blob} blob
  26578. * @param {string} type
  26579. * @param {string?} encodingName
  26580. */
  26581. function readOperation (fr, blob, type, encodingName) {
  26582. // 1. If fr’s state is "loading", throw an InvalidStateError
  26583. // DOMException.
  26584. if (fr[kState] === 'loading') {
  26585. throw new DOMException('Invalid state', 'InvalidStateError')
  26586. }
  26587. // 2. Set fr’s state to "loading".
  26588. fr[kState] = 'loading'
  26589. // 3. Set fr’s result to null.
  26590. fr[kResult] = null
  26591. // 4. Set fr’s error to null.
  26592. fr[kError] = null
  26593. // 5. Let stream be the result of calling get stream on blob.
  26594. /** @type {import('stream/web').ReadableStream} */
  26595. const stream = blob.stream()
  26596. // 6. Let reader be the result of getting a reader from stream.
  26597. const reader = stream.getReader()
  26598. // 7. Let bytes be an empty byte sequence.
  26599. /** @type {Uint8Array[]} */
  26600. const bytes = []
  26601. // 8. Let chunkPromise be the result of reading a chunk from
  26602. // stream with reader.
  26603. let chunkPromise = reader.read()
  26604. // 9. Let isFirstChunk be true.
  26605. let isFirstChunk = true
  26606. // 10. In parallel, while true:
  26607. // Note: "In parallel" just means non-blocking
  26608. // Note 2: readOperation itself cannot be async as double
  26609. // reading the body would then reject the promise, instead
  26610. // of throwing an error.
  26611. ;(async () => {
  26612. while (!fr[kAborted]) {
  26613. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26614. try {
  26615. const { done, value } = await chunkPromise
  26616. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26617. // true, queue a task to fire a progress event called
  26618. // loadstart at fr.
  26619. if (isFirstChunk && !fr[kAborted]) {
  26620. queueMicrotask(() => {
  26621. fireAProgressEvent('loadstart', fr)
  26622. })
  26623. }
  26624. // 3. Set isFirstChunk to false.
  26625. isFirstChunk = false
  26626. // 4. If chunkPromise is fulfilled with an object whose
  26627. // done property is false and whose value property is
  26628. // a Uint8Array object, run these steps:
  26629. if (!done && types.isUint8Array(value)) {
  26630. // 1. Let bs be the byte sequence represented by the
  26631. // Uint8Array object.
  26632. // 2. Append bs to bytes.
  26633. bytes.push(value)
  26634. // 3. If roughly 50ms have passed since these steps
  26635. // were last invoked, queue a task to fire a
  26636. // progress event called progress at fr.
  26637. if (
  26638. (
  26639. fr[kLastProgressEventFired] === undefined ||
  26640. Date.now() - fr[kLastProgressEventFired] >= 50
  26641. ) &&
  26642. !fr[kAborted]
  26643. ) {
  26644. fr[kLastProgressEventFired] = Date.now()
  26645. queueMicrotask(() => {
  26646. fireAProgressEvent('progress', fr)
  26647. })
  26648. }
  26649. // 4. Set chunkPromise to the result of reading a
  26650. // chunk from stream with reader.
  26651. chunkPromise = reader.read()
  26652. } else if (done) {
  26653. // 5. Otherwise, if chunkPromise is fulfilled with an
  26654. // object whose done property is true, queue a task
  26655. // to run the following steps and abort this algorithm:
  26656. queueMicrotask(() => {
  26657. // 1. Set fr’s state to "done".
  26658. fr[kState] = 'done'
  26659. // 2. Let result be the result of package data given
  26660. // bytes, type, blob’s type, and encodingName.
  26661. try {
  26662. const result = packageData(bytes, type, blob.type, encodingName)
  26663. // 4. Else:
  26664. if (fr[kAborted]) {
  26665. return
  26666. }
  26667. // 1. Set fr’s result to result.
  26668. fr[kResult] = result
  26669. // 2. Fire a progress event called load at the fr.
  26670. fireAProgressEvent('load', fr)
  26671. } catch (error) {
  26672. // 3. If package data threw an exception error:
  26673. // 1. Set fr’s error to error.
  26674. fr[kError] = error
  26675. // 2. Fire a progress event called error at fr.
  26676. fireAProgressEvent('error', fr)
  26677. }
  26678. // 5. If fr’s state is not "loading", fire a progress
  26679. // event called loadend at the fr.
  26680. if (fr[kState] !== 'loading') {
  26681. fireAProgressEvent('loadend', fr)
  26682. }
  26683. })
  26684. break
  26685. }
  26686. } catch (error) {
  26687. if (fr[kAborted]) {
  26688. return
  26689. }
  26690. // 6. Otherwise, if chunkPromise is rejected with an
  26691. // error error, queue a task to run the following
  26692. // steps and abort this algorithm:
  26693. queueMicrotask(() => {
  26694. // 1. Set fr’s state to "done".
  26695. fr[kState] = 'done'
  26696. // 2. Set fr’s error to error.
  26697. fr[kError] = error
  26698. // 3. Fire a progress event called error at fr.
  26699. fireAProgressEvent('error', fr)
  26700. // 4. If fr’s state is not "loading", fire a progress
  26701. // event called loadend at fr.
  26702. if (fr[kState] !== 'loading') {
  26703. fireAProgressEvent('loadend', fr)
  26704. }
  26705. })
  26706. break
  26707. }
  26708. }
  26709. })()
  26710. }
  26711. /**
  26712. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26713. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26714. * @param {string} e The name of the event
  26715. * @param {import('./filereader').FileReader} reader
  26716. */
  26717. function fireAProgressEvent (e, reader) {
  26718. // The progress event e does not bubble. e.bubbles must be false
  26719. // The progress event e is NOT cancelable. e.cancelable must be false
  26720. const event = new ProgressEvent(e, {
  26721. bubbles: false,
  26722. cancelable: false
  26723. })
  26724. reader.dispatchEvent(event)
  26725. }
  26726. /**
  26727. * @see https://w3c.github.io/FileAPI/#blob-package-data
  26728. * @param {Uint8Array[]} bytes
  26729. * @param {string} type
  26730. * @param {string?} mimeType
  26731. * @param {string?} encodingName
  26732. */
  26733. function packageData (bytes, type, mimeType, encodingName) {
  26734. // 1. A Blob has an associated package data algorithm, given
  26735. // bytes, a type, a optional mimeType, and a optional
  26736. // encodingName, which switches on type and runs the
  26737. // associated steps:
  26738. switch (type) {
  26739. case 'DataURL': {
  26740. // 1. Return bytes as a DataURL [RFC2397] subject to
  26741. // the considerations below:
  26742. // * Use mimeType as part of the Data URL if it is
  26743. // available in keeping with the Data URL
  26744. // specification [RFC2397].
  26745. // * If mimeType is not available return a Data URL
  26746. // without a media-type. [RFC2397].
  26747. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  26748. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  26749. // mediatype := [ type "/" subtype ] *( ";" parameter )
  26750. // data := *urlchar
  26751. // parameter := attribute "=" value
  26752. let dataURL = 'data:'
  26753. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  26754. if (parsed !== 'failure') {
  26755. dataURL += serializeAMimeType(parsed)
  26756. }
  26757. dataURL += ';base64,'
  26758. const decoder = new StringDecoder('latin1')
  26759. for (const chunk of bytes) {
  26760. dataURL += btoa(decoder.write(chunk))
  26761. }
  26762. dataURL += btoa(decoder.end())
  26763. return dataURL
  26764. }
  26765. case 'Text': {
  26766. // 1. Let encoding be failure
  26767. let encoding = 'failure'
  26768. // 2. If the encodingName is present, set encoding to the
  26769. // result of getting an encoding from encodingName.
  26770. if (encodingName) {
  26771. encoding = getEncoding(encodingName)
  26772. }
  26773. // 3. If encoding is failure, and mimeType is present:
  26774. if (encoding === 'failure' && mimeType) {
  26775. // 1. Let type be the result of parse a MIME type
  26776. // given mimeType.
  26777. const type = parseMIMEType(mimeType)
  26778. // 2. If type is not failure, set encoding to the result
  26779. // of getting an encoding from type’s parameters["charset"].
  26780. if (type !== 'failure') {
  26781. encoding = getEncoding(type.parameters.get('charset'))
  26782. }
  26783. }
  26784. // 4. If encoding is failure, then set encoding to UTF-8.
  26785. if (encoding === 'failure') {
  26786. encoding = 'UTF-8'
  26787. }
  26788. // 5. Decode bytes using fallback encoding encoding, and
  26789. // return the result.
  26790. return decode(bytes, encoding)
  26791. }
  26792. case 'ArrayBuffer': {
  26793. // Return a new ArrayBuffer whose contents are bytes.
  26794. const sequence = combineByteSequences(bytes)
  26795. return sequence.buffer
  26796. }
  26797. case 'BinaryString': {
  26798. // Return bytes as a binary string, in which every byte
  26799. // is represented by a code unit of equal value [0..255].
  26800. let binaryString = ''
  26801. const decoder = new StringDecoder('latin1')
  26802. for (const chunk of bytes) {
  26803. binaryString += decoder.write(chunk)
  26804. }
  26805. binaryString += decoder.end()
  26806. return binaryString
  26807. }
  26808. }
  26809. }
  26810. /**
  26811. * @see https://encoding.spec.whatwg.org/#decode
  26812. * @param {Uint8Array[]} ioQueue
  26813. * @param {string} encoding
  26814. */
  26815. function decode (ioQueue, encoding) {
  26816. const bytes = combineByteSequences(ioQueue)
  26817. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  26818. const BOMEncoding = BOMSniffing(bytes)
  26819. let slice = 0
  26820. // 2. If BOMEncoding is non-null:
  26821. if (BOMEncoding !== null) {
  26822. // 1. Set encoding to BOMEncoding.
  26823. encoding = BOMEncoding
  26824. // 2. Read three bytes from ioQueue, if BOMEncoding is
  26825. // UTF-8; otherwise read two bytes.
  26826. // (Do nothing with those bytes.)
  26827. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  26828. }
  26829. // 3. Process a queue with an instance of encoding’s
  26830. // decoder, ioQueue, output, and "replacement".
  26831. // 4. Return output.
  26832. const sliced = bytes.slice(slice)
  26833. return new TextDecoder(encoding).decode(sliced)
  26834. }
  26835. /**
  26836. * @see https://encoding.spec.whatwg.org/#bom-sniff
  26837. * @param {Uint8Array} ioQueue
  26838. */
  26839. function BOMSniffing (ioQueue) {
  26840. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  26841. // converted to a byte sequence.
  26842. const [a, b, c] = ioQueue
  26843. // 2. For each of the rows in the table below, starting with
  26844. // the first one and going down, if BOM starts with the
  26845. // bytes given in the first column, then return the
  26846. // encoding given in the cell in the second column of that
  26847. // row. Otherwise, return null.
  26848. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  26849. return 'UTF-8'
  26850. } else if (a === 0xFE && b === 0xFF) {
  26851. return 'UTF-16BE'
  26852. } else if (a === 0xFF && b === 0xFE) {
  26853. return 'UTF-16LE'
  26854. }
  26855. return null
  26856. }
  26857. /**
  26858. * @param {Uint8Array[]} sequences
  26859. */
  26860. function combineByteSequences (sequences) {
  26861. const size = sequences.reduce((a, b) => {
  26862. return a + b.byteLength
  26863. }, 0)
  26864. let offset = 0
  26865. return sequences.reduce((a, b) => {
  26866. a.set(b, offset)
  26867. offset += b.byteLength
  26868. return a
  26869. }, new Uint8Array(size))
  26870. }
  26871. module.exports = {
  26872. staticPropertyDescriptors,
  26873. readOperation,
  26874. fireAProgressEvent
  26875. }
  26876. /***/ }),
  26877. /***/ 1892:
  26878. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26879. "use strict";
  26880. // We include a version number for the Dispatcher API. In case of breaking changes,
  26881. // this version number must be increased to avoid conflicts.
  26882. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  26883. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26884. const Agent = __nccwpck_require__(7890)
  26885. if (getGlobalDispatcher() === undefined) {
  26886. setGlobalDispatcher(new Agent())
  26887. }
  26888. function setGlobalDispatcher (agent) {
  26889. if (!agent || typeof agent.dispatch !== 'function') {
  26890. throw new InvalidArgumentError('Argument agent must implement Agent')
  26891. }
  26892. Object.defineProperty(globalThis, globalDispatcher, {
  26893. value: agent,
  26894. writable: true,
  26895. enumerable: false,
  26896. configurable: false
  26897. })
  26898. }
  26899. function getGlobalDispatcher () {
  26900. return globalThis[globalDispatcher]
  26901. }
  26902. module.exports = {
  26903. setGlobalDispatcher,
  26904. getGlobalDispatcher
  26905. }
  26906. /***/ }),
  26907. /***/ 6930:
  26908. /***/ ((module) => {
  26909. "use strict";
  26910. module.exports = class DecoratorHandler {
  26911. constructor (handler) {
  26912. this.handler = handler
  26913. }
  26914. onConnect (...args) {
  26915. return this.handler.onConnect(...args)
  26916. }
  26917. onError (...args) {
  26918. return this.handler.onError(...args)
  26919. }
  26920. onUpgrade (...args) {
  26921. return this.handler.onUpgrade(...args)
  26922. }
  26923. onHeaders (...args) {
  26924. return this.handler.onHeaders(...args)
  26925. }
  26926. onData (...args) {
  26927. return this.handler.onData(...args)
  26928. }
  26929. onComplete (...args) {
  26930. return this.handler.onComplete(...args)
  26931. }
  26932. onBodySent (...args) {
  26933. return this.handler.onBodySent(...args)
  26934. }
  26935. }
  26936. /***/ }),
  26937. /***/ 2860:
  26938. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26939. "use strict";
  26940. const util = __nccwpck_require__(3983)
  26941. const { kBodyUsed } = __nccwpck_require__(2785)
  26942. const assert = __nccwpck_require__(9491)
  26943. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26944. const EE = __nccwpck_require__(2361)
  26945. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  26946. const kBody = Symbol('body')
  26947. class BodyAsyncIterable {
  26948. constructor (body) {
  26949. this[kBody] = body
  26950. this[kBodyUsed] = false
  26951. }
  26952. async * [Symbol.asyncIterator] () {
  26953. assert(!this[kBodyUsed], 'disturbed')
  26954. this[kBodyUsed] = true
  26955. yield * this[kBody]
  26956. }
  26957. }
  26958. class RedirectHandler {
  26959. constructor (dispatch, maxRedirections, opts, handler) {
  26960. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  26961. throw new InvalidArgumentError('maxRedirections must be a positive number')
  26962. }
  26963. util.validateHandler(handler, opts.method, opts.upgrade)
  26964. this.dispatch = dispatch
  26965. this.location = null
  26966. this.abort = null
  26967. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  26968. this.maxRedirections = maxRedirections
  26969. this.handler = handler
  26970. this.history = []
  26971. if (util.isStream(this.opts.body)) {
  26972. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  26973. // so that it can be dispatched again?
  26974. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  26975. if (util.bodyLength(this.opts.body) === 0) {
  26976. this.opts.body
  26977. .on('data', function () {
  26978. assert(false)
  26979. })
  26980. }
  26981. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  26982. this.opts.body[kBodyUsed] = false
  26983. EE.prototype.on.call(this.opts.body, 'data', function () {
  26984. this[kBodyUsed] = true
  26985. })
  26986. }
  26987. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  26988. // TODO (fix): We can't access ReadableStream internal state
  26989. // to determine whether or not it has been disturbed. This is just
  26990. // a workaround.
  26991. this.opts.body = new BodyAsyncIterable(this.opts.body)
  26992. } else if (
  26993. this.opts.body &&
  26994. typeof this.opts.body !== 'string' &&
  26995. !ArrayBuffer.isView(this.opts.body) &&
  26996. util.isIterable(this.opts.body)
  26997. ) {
  26998. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  26999. // or through some other flag?
  27000. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27001. }
  27002. }
  27003. onConnect (abort) {
  27004. this.abort = abort
  27005. this.handler.onConnect(abort, { history: this.history })
  27006. }
  27007. onUpgrade (statusCode, headers, socket) {
  27008. this.handler.onUpgrade(statusCode, headers, socket)
  27009. }
  27010. onError (error) {
  27011. this.handler.onError(error)
  27012. }
  27013. onHeaders (statusCode, headers, resume, statusText) {
  27014. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27015. ? null
  27016. : parseLocation(statusCode, headers)
  27017. if (this.opts.origin) {
  27018. this.history.push(new URL(this.opts.path, this.opts.origin))
  27019. }
  27020. if (!this.location) {
  27021. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27022. }
  27023. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27024. const path = search ? `${pathname}${search}` : pathname
  27025. // Remove headers referring to the original URL.
  27026. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27027. // https://tools.ietf.org/html/rfc7231#section-6.4
  27028. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27029. this.opts.path = path
  27030. this.opts.origin = origin
  27031. this.opts.maxRedirections = 0
  27032. this.opts.query = null
  27033. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27034. // In case of HTTP 303, always replace method to be either HEAD or GET
  27035. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27036. this.opts.method = 'GET'
  27037. this.opts.body = null
  27038. }
  27039. }
  27040. onData (chunk) {
  27041. if (this.location) {
  27042. /*
  27043. https://tools.ietf.org/html/rfc7231#section-6.4
  27044. TLDR: undici always ignores 3xx response bodies.
  27045. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27046. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27047. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27048. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27049. the Location response header, so the body can be ignored safely.
  27050. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27051. response header AND a response body with the other possible location to follow.
  27052. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27053. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27054. */
  27055. } else {
  27056. return this.handler.onData(chunk)
  27057. }
  27058. }
  27059. onComplete (trailers) {
  27060. if (this.location) {
  27061. /*
  27062. https://tools.ietf.org/html/rfc7231#section-6.4
  27063. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27064. and neither are useful if present.
  27065. See comment on onData method above for more detailed informations.
  27066. */
  27067. this.location = null
  27068. this.abort = null
  27069. this.dispatch(this.opts, this)
  27070. } else {
  27071. this.handler.onComplete(trailers)
  27072. }
  27073. }
  27074. onBodySent (chunk) {
  27075. if (this.handler.onBodySent) {
  27076. this.handler.onBodySent(chunk)
  27077. }
  27078. }
  27079. }
  27080. function parseLocation (statusCode, headers) {
  27081. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27082. return null
  27083. }
  27084. for (let i = 0; i < headers.length; i += 2) {
  27085. if (headers[i].toString().toLowerCase() === 'location') {
  27086. return headers[i + 1]
  27087. }
  27088. }
  27089. }
  27090. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27091. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27092. if (header.length === 4) {
  27093. return util.headerNameToString(header) === 'host'
  27094. }
  27095. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27096. return true
  27097. }
  27098. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27099. const name = util.headerNameToString(header)
  27100. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27101. }
  27102. return false
  27103. }
  27104. // https://tools.ietf.org/html/rfc7231#section-6.4
  27105. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27106. const ret = []
  27107. if (Array.isArray(headers)) {
  27108. for (let i = 0; i < headers.length; i += 2) {
  27109. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27110. ret.push(headers[i], headers[i + 1])
  27111. }
  27112. }
  27113. } else if (headers && typeof headers === 'object') {
  27114. for (const key of Object.keys(headers)) {
  27115. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27116. ret.push(key, headers[key])
  27117. }
  27118. }
  27119. } else {
  27120. assert(headers == null, 'headers must be an object or an array')
  27121. }
  27122. return ret
  27123. }
  27124. module.exports = RedirectHandler
  27125. /***/ }),
  27126. /***/ 2286:
  27127. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27128. const assert = __nccwpck_require__(9491)
  27129. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27130. const { RequestRetryError } = __nccwpck_require__(8045)
  27131. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27132. function calculateRetryAfterHeader (retryAfter) {
  27133. const current = Date.now()
  27134. const diff = new Date(retryAfter).getTime() - current
  27135. return diff
  27136. }
  27137. class RetryHandler {
  27138. constructor (opts, handlers) {
  27139. const { retryOptions, ...dispatchOpts } = opts
  27140. const {
  27141. // Retry scoped
  27142. retry: retryFn,
  27143. maxRetries,
  27144. maxTimeout,
  27145. minTimeout,
  27146. timeoutFactor,
  27147. // Response scoped
  27148. methods,
  27149. errorCodes,
  27150. retryAfter,
  27151. statusCodes
  27152. } = retryOptions ?? {}
  27153. this.dispatch = handlers.dispatch
  27154. this.handler = handlers.handler
  27155. this.opts = dispatchOpts
  27156. this.abort = null
  27157. this.aborted = false
  27158. this.retryOpts = {
  27159. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27160. retryAfter: retryAfter ?? true,
  27161. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27162. timeout: minTimeout ?? 500, // .5s
  27163. timeoutFactor: timeoutFactor ?? 2,
  27164. maxRetries: maxRetries ?? 5,
  27165. // What errors we should retry
  27166. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27167. // Indicates which errors to retry
  27168. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27169. // List of errors to retry
  27170. errorCodes: errorCodes ?? [
  27171. 'ECONNRESET',
  27172. 'ECONNREFUSED',
  27173. 'ENOTFOUND',
  27174. 'ENETDOWN',
  27175. 'ENETUNREACH',
  27176. 'EHOSTDOWN',
  27177. 'EHOSTUNREACH',
  27178. 'EPIPE'
  27179. ]
  27180. }
  27181. this.retryCount = 0
  27182. this.start = 0
  27183. this.end = null
  27184. this.etag = null
  27185. this.resume = null
  27186. // Handle possible onConnect duplication
  27187. this.handler.onConnect(reason => {
  27188. this.aborted = true
  27189. if (this.abort) {
  27190. this.abort(reason)
  27191. } else {
  27192. this.reason = reason
  27193. }
  27194. })
  27195. }
  27196. onRequestSent () {
  27197. if (this.handler.onRequestSent) {
  27198. this.handler.onRequestSent()
  27199. }
  27200. }
  27201. onUpgrade (statusCode, headers, socket) {
  27202. if (this.handler.onUpgrade) {
  27203. this.handler.onUpgrade(statusCode, headers, socket)
  27204. }
  27205. }
  27206. onConnect (abort) {
  27207. if (this.aborted) {
  27208. abort(this.reason)
  27209. } else {
  27210. this.abort = abort
  27211. }
  27212. }
  27213. onBodySent (chunk) {
  27214. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27215. }
  27216. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27217. const { statusCode, code, headers } = err
  27218. const { method, retryOptions } = opts
  27219. const {
  27220. maxRetries,
  27221. timeout,
  27222. maxTimeout,
  27223. timeoutFactor,
  27224. statusCodes,
  27225. errorCodes,
  27226. methods
  27227. } = retryOptions
  27228. let { counter, currentTimeout } = state
  27229. currentTimeout =
  27230. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27231. // Any code that is not a Undici's originated and allowed to retry
  27232. if (
  27233. code &&
  27234. code !== 'UND_ERR_REQ_RETRY' &&
  27235. code !== 'UND_ERR_SOCKET' &&
  27236. !errorCodes.includes(code)
  27237. ) {
  27238. cb(err)
  27239. return
  27240. }
  27241. // If a set of method are provided and the current method is not in the list
  27242. if (Array.isArray(methods) && !methods.includes(method)) {
  27243. cb(err)
  27244. return
  27245. }
  27246. // If a set of status code are provided and the current status code is not in the list
  27247. if (
  27248. statusCode != null &&
  27249. Array.isArray(statusCodes) &&
  27250. !statusCodes.includes(statusCode)
  27251. ) {
  27252. cb(err)
  27253. return
  27254. }
  27255. // If we reached the max number of retries
  27256. if (counter > maxRetries) {
  27257. cb(err)
  27258. return
  27259. }
  27260. let retryAfterHeader = headers != null && headers['retry-after']
  27261. if (retryAfterHeader) {
  27262. retryAfterHeader = Number(retryAfterHeader)
  27263. retryAfterHeader = isNaN(retryAfterHeader)
  27264. ? calculateRetryAfterHeader(retryAfterHeader)
  27265. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27266. }
  27267. const retryTimeout =
  27268. retryAfterHeader > 0
  27269. ? Math.min(retryAfterHeader, maxTimeout)
  27270. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27271. state.currentTimeout = retryTimeout
  27272. setTimeout(() => cb(null), retryTimeout)
  27273. }
  27274. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27275. const headers = parseHeaders(rawHeaders)
  27276. this.retryCount += 1
  27277. if (statusCode >= 300) {
  27278. this.abort(
  27279. new RequestRetryError('Request failed', statusCode, {
  27280. headers,
  27281. count: this.retryCount
  27282. })
  27283. )
  27284. return false
  27285. }
  27286. // Checkpoint for resume from where we left it
  27287. if (this.resume != null) {
  27288. this.resume = null
  27289. if (statusCode !== 206) {
  27290. return true
  27291. }
  27292. const contentRange = parseRangeHeader(headers['content-range'])
  27293. // If no content range
  27294. if (!contentRange) {
  27295. this.abort(
  27296. new RequestRetryError('Content-Range mismatch', statusCode, {
  27297. headers,
  27298. count: this.retryCount
  27299. })
  27300. )
  27301. return false
  27302. }
  27303. // Let's start with a weak etag check
  27304. if (this.etag != null && this.etag !== headers.etag) {
  27305. this.abort(
  27306. new RequestRetryError('ETag mismatch', statusCode, {
  27307. headers,
  27308. count: this.retryCount
  27309. })
  27310. )
  27311. return false
  27312. }
  27313. const { start, size, end = size } = contentRange
  27314. assert(this.start === start, 'content-range mismatch')
  27315. assert(this.end == null || this.end === end, 'content-range mismatch')
  27316. this.resume = resume
  27317. return true
  27318. }
  27319. if (this.end == null) {
  27320. if (statusCode === 206) {
  27321. // First time we receive 206
  27322. const range = parseRangeHeader(headers['content-range'])
  27323. if (range == null) {
  27324. return this.handler.onHeaders(
  27325. statusCode,
  27326. rawHeaders,
  27327. resume,
  27328. statusMessage
  27329. )
  27330. }
  27331. const { start, size, end = size } = range
  27332. assert(
  27333. start != null && Number.isFinite(start) && this.start !== start,
  27334. 'content-range mismatch'
  27335. )
  27336. assert(Number.isFinite(start))
  27337. assert(
  27338. end != null && Number.isFinite(end) && this.end !== end,
  27339. 'invalid content-length'
  27340. )
  27341. this.start = start
  27342. this.end = end
  27343. }
  27344. // We make our best to checkpoint the body for further range headers
  27345. if (this.end == null) {
  27346. const contentLength = headers['content-length']
  27347. this.end = contentLength != null ? Number(contentLength) : null
  27348. }
  27349. assert(Number.isFinite(this.start))
  27350. assert(
  27351. this.end == null || Number.isFinite(this.end),
  27352. 'invalid content-length'
  27353. )
  27354. this.resume = resume
  27355. this.etag = headers.etag != null ? headers.etag : null
  27356. return this.handler.onHeaders(
  27357. statusCode,
  27358. rawHeaders,
  27359. resume,
  27360. statusMessage
  27361. )
  27362. }
  27363. const err = new RequestRetryError('Request failed', statusCode, {
  27364. headers,
  27365. count: this.retryCount
  27366. })
  27367. this.abort(err)
  27368. return false
  27369. }
  27370. onData (chunk) {
  27371. this.start += chunk.length
  27372. return this.handler.onData(chunk)
  27373. }
  27374. onComplete (rawTrailers) {
  27375. this.retryCount = 0
  27376. return this.handler.onComplete(rawTrailers)
  27377. }
  27378. onError (err) {
  27379. if (this.aborted || isDisturbed(this.opts.body)) {
  27380. return this.handler.onError(err)
  27381. }
  27382. this.retryOpts.retry(
  27383. err,
  27384. {
  27385. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27386. opts: { retryOptions: this.retryOpts, ...this.opts }
  27387. },
  27388. onRetry.bind(this)
  27389. )
  27390. function onRetry (err) {
  27391. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27392. return this.handler.onError(err)
  27393. }
  27394. if (this.start !== 0) {
  27395. this.opts = {
  27396. ...this.opts,
  27397. headers: {
  27398. ...this.opts.headers,
  27399. range: `bytes=${this.start}-${this.end ?? ''}`
  27400. }
  27401. }
  27402. }
  27403. try {
  27404. this.dispatch(this.opts, this)
  27405. } catch (err) {
  27406. this.handler.onError(err)
  27407. }
  27408. }
  27409. }
  27410. }
  27411. module.exports = RetryHandler
  27412. /***/ }),
  27413. /***/ 8861:
  27414. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27415. "use strict";
  27416. const RedirectHandler = __nccwpck_require__(2860)
  27417. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27418. return (dispatch) => {
  27419. return function Intercept (opts, handler) {
  27420. const { maxRedirections = defaultMaxRedirections } = opts
  27421. if (!maxRedirections) {
  27422. return dispatch(opts, handler)
  27423. }
  27424. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27425. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27426. return dispatch(opts, redirectHandler)
  27427. }
  27428. }
  27429. }
  27430. module.exports = createRedirectInterceptor
  27431. /***/ }),
  27432. /***/ 953:
  27433. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27434. "use strict";
  27435. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27436. 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;
  27437. const utils_1 = __nccwpck_require__(1891);
  27438. // C headers
  27439. var ERROR;
  27440. (function (ERROR) {
  27441. ERROR[ERROR["OK"] = 0] = "OK";
  27442. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27443. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27444. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27445. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27446. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27447. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27448. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27449. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27450. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27451. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27452. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27453. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27454. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27455. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27456. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27457. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27458. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27459. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27460. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27461. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27462. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27463. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27464. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27465. ERROR[ERROR["USER"] = 24] = "USER";
  27466. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27467. var TYPE;
  27468. (function (TYPE) {
  27469. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27470. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27471. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27472. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27473. var FLAGS;
  27474. (function (FLAGS) {
  27475. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27476. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27477. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27478. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27479. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27480. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27481. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27482. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27483. // 1 << 8 is unused
  27484. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27485. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27486. var LENIENT_FLAGS;
  27487. (function (LENIENT_FLAGS) {
  27488. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27489. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27490. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27491. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27492. var METHODS;
  27493. (function (METHODS) {
  27494. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27495. METHODS[METHODS["GET"] = 1] = "GET";
  27496. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27497. METHODS[METHODS["POST"] = 3] = "POST";
  27498. METHODS[METHODS["PUT"] = 4] = "PUT";
  27499. /* pathological */
  27500. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27501. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27502. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27503. /* WebDAV */
  27504. METHODS[METHODS["COPY"] = 8] = "COPY";
  27505. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27506. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27507. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27508. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27509. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27510. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27511. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27512. METHODS[METHODS["BIND"] = 16] = "BIND";
  27513. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27514. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27515. METHODS[METHODS["ACL"] = 19] = "ACL";
  27516. /* subversion */
  27517. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27518. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27519. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27520. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27521. /* upnp */
  27522. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27523. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27524. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27525. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27526. /* RFC-5789 */
  27527. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27528. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27529. /* CalDAV */
  27530. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27531. /* RFC-2068, section 19.6.1.2 */
  27532. METHODS[METHODS["LINK"] = 31] = "LINK";
  27533. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27534. /* icecast */
  27535. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27536. /* RFC-7540, section 11.6 */
  27537. METHODS[METHODS["PRI"] = 34] = "PRI";
  27538. /* RFC-2326 RTSP */
  27539. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27540. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27541. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27542. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27543. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27544. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27545. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27546. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27547. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27548. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27549. /* RAOP */
  27550. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27551. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27552. exports.METHODS_HTTP = [
  27553. METHODS.DELETE,
  27554. METHODS.GET,
  27555. METHODS.HEAD,
  27556. METHODS.POST,
  27557. METHODS.PUT,
  27558. METHODS.CONNECT,
  27559. METHODS.OPTIONS,
  27560. METHODS.TRACE,
  27561. METHODS.COPY,
  27562. METHODS.LOCK,
  27563. METHODS.MKCOL,
  27564. METHODS.MOVE,
  27565. METHODS.PROPFIND,
  27566. METHODS.PROPPATCH,
  27567. METHODS.SEARCH,
  27568. METHODS.UNLOCK,
  27569. METHODS.BIND,
  27570. METHODS.REBIND,
  27571. METHODS.UNBIND,
  27572. METHODS.ACL,
  27573. METHODS.REPORT,
  27574. METHODS.MKACTIVITY,
  27575. METHODS.CHECKOUT,
  27576. METHODS.MERGE,
  27577. METHODS['M-SEARCH'],
  27578. METHODS.NOTIFY,
  27579. METHODS.SUBSCRIBE,
  27580. METHODS.UNSUBSCRIBE,
  27581. METHODS.PATCH,
  27582. METHODS.PURGE,
  27583. METHODS.MKCALENDAR,
  27584. METHODS.LINK,
  27585. METHODS.UNLINK,
  27586. METHODS.PRI,
  27587. // TODO(indutny): should we allow it with HTTP?
  27588. METHODS.SOURCE,
  27589. ];
  27590. exports.METHODS_ICE = [
  27591. METHODS.SOURCE,
  27592. ];
  27593. exports.METHODS_RTSP = [
  27594. METHODS.OPTIONS,
  27595. METHODS.DESCRIBE,
  27596. METHODS.ANNOUNCE,
  27597. METHODS.SETUP,
  27598. METHODS.PLAY,
  27599. METHODS.PAUSE,
  27600. METHODS.TEARDOWN,
  27601. METHODS.GET_PARAMETER,
  27602. METHODS.SET_PARAMETER,
  27603. METHODS.REDIRECT,
  27604. METHODS.RECORD,
  27605. METHODS.FLUSH,
  27606. // For AirPlay
  27607. METHODS.GET,
  27608. METHODS.POST,
  27609. ];
  27610. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27611. exports.H_METHOD_MAP = {};
  27612. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27613. if (/^H/.test(key)) {
  27614. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27615. }
  27616. });
  27617. var FINISH;
  27618. (function (FINISH) {
  27619. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27620. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27621. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27622. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27623. exports.ALPHA = [];
  27624. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27625. // Upper case
  27626. exports.ALPHA.push(String.fromCharCode(i));
  27627. // Lower case
  27628. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27629. }
  27630. exports.NUM_MAP = {
  27631. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27632. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27633. };
  27634. exports.HEX_MAP = {
  27635. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27636. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27637. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27638. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27639. };
  27640. exports.NUM = [
  27641. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27642. ];
  27643. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27644. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27645. exports.USERINFO_CHARS = exports.ALPHANUM
  27646. .concat(exports.MARK)
  27647. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27648. // TODO(indutny): use RFC
  27649. exports.STRICT_URL_CHAR = [
  27650. '!', '"', '$', '%', '&', '\'',
  27651. '(', ')', '*', '+', ',', '-', '.', '/',
  27652. ':', ';', '<', '=', '>',
  27653. '@', '[', '\\', ']', '^', '_',
  27654. '`',
  27655. '{', '|', '}', '~',
  27656. ].concat(exports.ALPHANUM);
  27657. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27658. .concat(['\t', '\f']);
  27659. // All characters with 0x80 bit set to 1
  27660. for (let i = 0x80; i <= 0xff; i++) {
  27661. exports.URL_CHAR.push(i);
  27662. }
  27663. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27664. /* Tokens as defined by rfc 2616. Also lowercases them.
  27665. * token = 1*<any CHAR except CTLs or separators>
  27666. * separators = "(" | ")" | "<" | ">" | "@"
  27667. * | "," | ";" | ":" | "\" | <">
  27668. * | "/" | "[" | "]" | "?" | "="
  27669. * | "{" | "}" | SP | HT
  27670. */
  27671. exports.STRICT_TOKEN = [
  27672. '!', '#', '$', '%', '&', '\'',
  27673. '*', '+', '-', '.',
  27674. '^', '_', '`',
  27675. '|', '~',
  27676. ].concat(exports.ALPHANUM);
  27677. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27678. /*
  27679. * Verify that a char is a valid visible (printable) US-ASCII
  27680. * character or %x80-FF
  27681. */
  27682. exports.HEADER_CHARS = ['\t'];
  27683. for (let i = 32; i <= 255; i++) {
  27684. if (i !== 127) {
  27685. exports.HEADER_CHARS.push(i);
  27686. }
  27687. }
  27688. // ',' = \x44
  27689. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27690. exports.MAJOR = exports.NUM_MAP;
  27691. exports.MINOR = exports.MAJOR;
  27692. var HEADER_STATE;
  27693. (function (HEADER_STATE) {
  27694. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27695. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27696. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27697. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27698. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27699. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27700. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27701. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27702. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27703. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27704. exports.SPECIAL_HEADERS = {
  27705. 'connection': HEADER_STATE.CONNECTION,
  27706. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27707. 'proxy-connection': HEADER_STATE.CONNECTION,
  27708. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27709. 'upgrade': HEADER_STATE.UPGRADE,
  27710. };
  27711. //# sourceMappingURL=constants.js.map
  27712. /***/ }),
  27713. /***/ 1145:
  27714. /***/ ((module) => {
  27715. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJf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WVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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AhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHO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cIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMog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AAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNk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VC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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EQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhB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MzwILIARBAWohAUHnACEQDM4CCwJAIAEiBCACRw0AQf0AIRAM5wILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNzwEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf0AIRAM5wILIABBADYCACAQQQFqIQFBECEQDMwBCwJAIAEiBCACRw0AQf4AIRAM5gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQfbOgIAAai0AAEcNzgEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf4AIRAM5gILIABBADYCACAQQQFqIQFBFiEQDMsBCwJAIAEiBCACRw0AQf8AIRAM5QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQfzOgIAAai0AAEcNzQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf8AIRAM5QILIABBADYCACAQQQFqIQFBBSEQDMoBCwJAIAEiBCACRw0AQYABIRAM5AILIAQtAABB2QBHDcsBIARBAWohAUEIIRAMyQELAkAgASIEIAJHDQBBgQEhEAzjAgsCQAJAIAQtAABBsn9qDgMAzAEBzAELIARBAWohAUHrACEQDMoCCyAEQQFqIQFB7AAhEAzJAgsCQCABIgQgAkcNAEGCASEQDOICCwJAAkAgBC0AAEG4f2oOCADLAcsBywHLAcsBywEBywELIARBAWohAUHqACEQDMkCCyAEQQFqIQFB7QAhEAzIAgsCQCABIgQgAkcNAEGDASEQDOECCyACIARrIAAoAgAiAWohECAEIAFrQQJqIRQCQANAIAQtAAAgAUGAz4CAAGotAABHDckBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgEDYCAEGDASEQDOECC0EAIRAgAEEANgIAIBRBAWohAQzGAQsCQCABIgQgAkcNAEGEASEQDOACCyACIARrIAAoAgAiAWohFCAEIAFrQQRqIRACQANAIAQtAAAgAUGDz4CAAGotAABHDcgBIAFBBEYNASABQQF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EINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAy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object.defineProperty(exports, "__esModule", ({ value: true }));
  27725. exports.enumToMap = void 0;
  27726. function enumToMap(obj) {
  27727. const res = {};
  27728. Object.keys(obj).forEach((key) => {
  27729. const value = obj[key];
  27730. if (typeof value === 'number') {
  27731. res[key] = value;
  27732. }
  27733. });
  27734. return res;
  27735. }
  27736. exports.enumToMap = enumToMap;
  27737. //# sourceMappingURL=utils.js.map
  27738. /***/ }),
  27739. /***/ 6771:
  27740. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27741. "use strict";
  27742. const { kClients } = __nccwpck_require__(2785)
  27743. const Agent = __nccwpck_require__(7890)
  27744. const {
  27745. kAgent,
  27746. kMockAgentSet,
  27747. kMockAgentGet,
  27748. kDispatches,
  27749. kIsMockActive,
  27750. kNetConnect,
  27751. kGetNetConnect,
  27752. kOptions,
  27753. kFactory
  27754. } = __nccwpck_require__(4347)
  27755. const MockClient = __nccwpck_require__(8687)
  27756. const MockPool = __nccwpck_require__(6193)
  27757. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  27758. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  27759. const Dispatcher = __nccwpck_require__(412)
  27760. const Pluralizer = __nccwpck_require__(8891)
  27761. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  27762. class FakeWeakRef {
  27763. constructor (value) {
  27764. this.value = value
  27765. }
  27766. deref () {
  27767. return this.value
  27768. }
  27769. }
  27770. class MockAgent extends Dispatcher {
  27771. constructor (opts) {
  27772. super(opts)
  27773. this[kNetConnect] = true
  27774. this[kIsMockActive] = true
  27775. // Instantiate Agent and encapsulate
  27776. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  27777. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27778. }
  27779. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  27780. this[kAgent] = agent
  27781. this[kClients] = agent[kClients]
  27782. this[kOptions] = buildMockOptions(opts)
  27783. }
  27784. get (origin) {
  27785. let dispatcher = this[kMockAgentGet](origin)
  27786. if (!dispatcher) {
  27787. dispatcher = this[kFactory](origin)
  27788. this[kMockAgentSet](origin, dispatcher)
  27789. }
  27790. return dispatcher
  27791. }
  27792. dispatch (opts, handler) {
  27793. // Call MockAgent.get to perform additional setup before dispatching as normal
  27794. this.get(opts.origin)
  27795. return this[kAgent].dispatch(opts, handler)
  27796. }
  27797. async close () {
  27798. await this[kAgent].close()
  27799. this[kClients].clear()
  27800. }
  27801. deactivate () {
  27802. this[kIsMockActive] = false
  27803. }
  27804. activate () {
  27805. this[kIsMockActive] = true
  27806. }
  27807. enableNetConnect (matcher) {
  27808. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  27809. if (Array.isArray(this[kNetConnect])) {
  27810. this[kNetConnect].push(matcher)
  27811. } else {
  27812. this[kNetConnect] = [matcher]
  27813. }
  27814. } else if (typeof matcher === 'undefined') {
  27815. this[kNetConnect] = true
  27816. } else {
  27817. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  27818. }
  27819. }
  27820. disableNetConnect () {
  27821. this[kNetConnect] = false
  27822. }
  27823. // This is required to bypass issues caused by using global symbols - see:
  27824. // https://github.com/nodejs/undici/issues/1447
  27825. get isMockActive () {
  27826. return this[kIsMockActive]
  27827. }
  27828. [kMockAgentSet] (origin, dispatcher) {
  27829. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  27830. }
  27831. [kFactory] (origin) {
  27832. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  27833. return this[kOptions] && this[kOptions].connections === 1
  27834. ? new MockClient(origin, mockOptions)
  27835. : new MockPool(origin, mockOptions)
  27836. }
  27837. [kMockAgentGet] (origin) {
  27838. // First check if we can immediately find it
  27839. const ref = this[kClients].get(origin)
  27840. if (ref) {
  27841. return ref.deref()
  27842. }
  27843. // If the origin is not a string create a dummy parent pool and return to user
  27844. if (typeof origin !== 'string') {
  27845. const dispatcher = this[kFactory]('http://localhost:9999')
  27846. this[kMockAgentSet](origin, dispatcher)
  27847. return dispatcher
  27848. }
  27849. // If we match, create a pool and assign the same dispatches
  27850. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  27851. const nonExplicitDispatcher = nonExplicitRef.deref()
  27852. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  27853. const dispatcher = this[kFactory](origin)
  27854. this[kMockAgentSet](origin, dispatcher)
  27855. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  27856. return dispatcher
  27857. }
  27858. }
  27859. }
  27860. [kGetNetConnect] () {
  27861. return this[kNetConnect]
  27862. }
  27863. pendingInterceptors () {
  27864. const mockAgentClients = this[kClients]
  27865. return Array.from(mockAgentClients.entries())
  27866. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  27867. .filter(({ pending }) => pending)
  27868. }
  27869. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  27870. const pending = this.pendingInterceptors()
  27871. if (pending.length === 0) {
  27872. return
  27873. }
  27874. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  27875. throw new UndiciError(`
  27876. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  27877. ${pendingInterceptorsFormatter.format(pending)}
  27878. `.trim())
  27879. }
  27880. }
  27881. module.exports = MockAgent
  27882. /***/ }),
  27883. /***/ 8687:
  27884. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27885. "use strict";
  27886. const { promisify } = __nccwpck_require__(3837)
  27887. const Client = __nccwpck_require__(3598)
  27888. const { buildMockDispatch } = __nccwpck_require__(9323)
  27889. const {
  27890. kDispatches,
  27891. kMockAgent,
  27892. kClose,
  27893. kOriginalClose,
  27894. kOrigin,
  27895. kOriginalDispatch,
  27896. kConnected
  27897. } = __nccwpck_require__(4347)
  27898. const { MockInterceptor } = __nccwpck_require__(410)
  27899. const Symbols = __nccwpck_require__(2785)
  27900. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27901. /**
  27902. * MockClient provides an API that extends the Client to influence the mockDispatches.
  27903. */
  27904. class MockClient extends Client {
  27905. constructor (origin, opts) {
  27906. super(origin, opts)
  27907. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  27908. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27909. }
  27910. this[kMockAgent] = opts.agent
  27911. this[kOrigin] = origin
  27912. this[kDispatches] = []
  27913. this[kConnected] = 1
  27914. this[kOriginalDispatch] = this.dispatch
  27915. this[kOriginalClose] = this.close.bind(this)
  27916. this.dispatch = buildMockDispatch.call(this)
  27917. this.close = this[kClose]
  27918. }
  27919. get [Symbols.kConnected] () {
  27920. return this[kConnected]
  27921. }
  27922. /**
  27923. * Sets up the base interceptor for mocking replies from undici.
  27924. */
  27925. intercept (opts) {
  27926. return new MockInterceptor(opts, this[kDispatches])
  27927. }
  27928. async [kClose] () {
  27929. await promisify(this[kOriginalClose])()
  27930. this[kConnected] = 0
  27931. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  27932. }
  27933. }
  27934. module.exports = MockClient
  27935. /***/ }),
  27936. /***/ 888:
  27937. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27938. "use strict";
  27939. const { UndiciError } = __nccwpck_require__(8045)
  27940. class MockNotMatchedError extends UndiciError {
  27941. constructor (message) {
  27942. super(message)
  27943. Error.captureStackTrace(this, MockNotMatchedError)
  27944. this.name = 'MockNotMatchedError'
  27945. this.message = message || 'The request does not match any registered mock dispatches'
  27946. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  27947. }
  27948. }
  27949. module.exports = {
  27950. MockNotMatchedError
  27951. }
  27952. /***/ }),
  27953. /***/ 410:
  27954. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27955. "use strict";
  27956. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  27957. const {
  27958. kDispatches,
  27959. kDispatchKey,
  27960. kDefaultHeaders,
  27961. kDefaultTrailers,
  27962. kContentLength,
  27963. kMockDispatch
  27964. } = __nccwpck_require__(4347)
  27965. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27966. const { buildURL } = __nccwpck_require__(3983)
  27967. /**
  27968. * Defines the scope API for an interceptor reply
  27969. */
  27970. class MockScope {
  27971. constructor (mockDispatch) {
  27972. this[kMockDispatch] = mockDispatch
  27973. }
  27974. /**
  27975. * Delay a reply by a set amount in ms.
  27976. */
  27977. delay (waitInMs) {
  27978. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  27979. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  27980. }
  27981. this[kMockDispatch].delay = waitInMs
  27982. return this
  27983. }
  27984. /**
  27985. * For a defined reply, never mark as consumed.
  27986. */
  27987. persist () {
  27988. this[kMockDispatch].persist = true
  27989. return this
  27990. }
  27991. /**
  27992. * Allow one to define a reply for a set amount of matching requests.
  27993. */
  27994. times (repeatTimes) {
  27995. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  27996. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  27997. }
  27998. this[kMockDispatch].times = repeatTimes
  27999. return this
  28000. }
  28001. }
  28002. /**
  28003. * Defines an interceptor for a Mock
  28004. */
  28005. class MockInterceptor {
  28006. constructor (opts, mockDispatches) {
  28007. if (typeof opts !== 'object') {
  28008. throw new InvalidArgumentError('opts must be an object')
  28009. }
  28010. if (typeof opts.path === 'undefined') {
  28011. throw new InvalidArgumentError('opts.path must be defined')
  28012. }
  28013. if (typeof opts.method === 'undefined') {
  28014. opts.method = 'GET'
  28015. }
  28016. // See https://github.com/nodejs/undici/issues/1245
  28017. // As per RFC 3986, clients are not supposed to send URI
  28018. // fragments to servers when they retrieve a document,
  28019. if (typeof opts.path === 'string') {
  28020. if (opts.query) {
  28021. opts.path = buildURL(opts.path, opts.query)
  28022. } else {
  28023. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28024. const parsedURL = new URL(opts.path, 'data://')
  28025. opts.path = parsedURL.pathname + parsedURL.search
  28026. }
  28027. }
  28028. if (typeof opts.method === 'string') {
  28029. opts.method = opts.method.toUpperCase()
  28030. }
  28031. this[kDispatchKey] = buildKey(opts)
  28032. this[kDispatches] = mockDispatches
  28033. this[kDefaultHeaders] = {}
  28034. this[kDefaultTrailers] = {}
  28035. this[kContentLength] = false
  28036. }
  28037. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28038. const responseData = getResponseData(data)
  28039. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28040. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28041. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28042. return { statusCode, data, headers, trailers }
  28043. }
  28044. validateReplyParameters (statusCode, data, responseOptions) {
  28045. if (typeof statusCode === 'undefined') {
  28046. throw new InvalidArgumentError('statusCode must be defined')
  28047. }
  28048. if (typeof data === 'undefined') {
  28049. throw new InvalidArgumentError('data must be defined')
  28050. }
  28051. if (typeof responseOptions !== 'object') {
  28052. throw new InvalidArgumentError('responseOptions must be an object')
  28053. }
  28054. }
  28055. /**
  28056. * Mock an undici request with a defined reply.
  28057. */
  28058. reply (replyData) {
  28059. // Values of reply aren't available right now as they
  28060. // can only be available when the reply callback is invoked.
  28061. if (typeof replyData === 'function') {
  28062. // We'll first wrap the provided callback in another function,
  28063. // this function will properly resolve the data from the callback
  28064. // when invoked.
  28065. const wrappedDefaultsCallback = (opts) => {
  28066. // Our reply options callback contains the parameter for statusCode, data and options.
  28067. const resolvedData = replyData(opts)
  28068. // Check if it is in the right format
  28069. if (typeof resolvedData !== 'object') {
  28070. throw new InvalidArgumentError('reply options callback must return an object')
  28071. }
  28072. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28073. this.validateReplyParameters(statusCode, data, responseOptions)
  28074. // Since the values can be obtained immediately we return them
  28075. // from this higher order function that will be resolved later.
  28076. return {
  28077. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28078. }
  28079. }
  28080. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28081. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28082. return new MockScope(newMockDispatch)
  28083. }
  28084. // We can have either one or three parameters, if we get here,
  28085. // we should have 1-3 parameters. So we spread the arguments of
  28086. // this function to obtain the parameters, since replyData will always
  28087. // just be the statusCode.
  28088. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28089. this.validateReplyParameters(statusCode, data, responseOptions)
  28090. // Send in-already provided data like usual
  28091. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28092. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28093. return new MockScope(newMockDispatch)
  28094. }
  28095. /**
  28096. * Mock an undici request with a defined error.
  28097. */
  28098. replyWithError (error) {
  28099. if (typeof error === 'undefined') {
  28100. throw new InvalidArgumentError('error must be defined')
  28101. }
  28102. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28103. return new MockScope(newMockDispatch)
  28104. }
  28105. /**
  28106. * Set default reply headers on the interceptor for subsequent replies
  28107. */
  28108. defaultReplyHeaders (headers) {
  28109. if (typeof headers === 'undefined') {
  28110. throw new InvalidArgumentError('headers must be defined')
  28111. }
  28112. this[kDefaultHeaders] = headers
  28113. return this
  28114. }
  28115. /**
  28116. * Set default reply trailers on the interceptor for subsequent replies
  28117. */
  28118. defaultReplyTrailers (trailers) {
  28119. if (typeof trailers === 'undefined') {
  28120. throw new InvalidArgumentError('trailers must be defined')
  28121. }
  28122. this[kDefaultTrailers] = trailers
  28123. return this
  28124. }
  28125. /**
  28126. * Set reply content length header for replies on the interceptor
  28127. */
  28128. replyContentLength () {
  28129. this[kContentLength] = true
  28130. return this
  28131. }
  28132. }
  28133. module.exports.MockInterceptor = MockInterceptor
  28134. module.exports.MockScope = MockScope
  28135. /***/ }),
  28136. /***/ 6193:
  28137. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28138. "use strict";
  28139. const { promisify } = __nccwpck_require__(3837)
  28140. const Pool = __nccwpck_require__(4634)
  28141. const { buildMockDispatch } = __nccwpck_require__(9323)
  28142. const {
  28143. kDispatches,
  28144. kMockAgent,
  28145. kClose,
  28146. kOriginalClose,
  28147. kOrigin,
  28148. kOriginalDispatch,
  28149. kConnected
  28150. } = __nccwpck_require__(4347)
  28151. const { MockInterceptor } = __nccwpck_require__(410)
  28152. const Symbols = __nccwpck_require__(2785)
  28153. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28154. /**
  28155. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28156. */
  28157. class MockPool extends Pool {
  28158. constructor (origin, opts) {
  28159. super(origin, opts)
  28160. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28161. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28162. }
  28163. this[kMockAgent] = opts.agent
  28164. this[kOrigin] = origin
  28165. this[kDispatches] = []
  28166. this[kConnected] = 1
  28167. this[kOriginalDispatch] = this.dispatch
  28168. this[kOriginalClose] = this.close.bind(this)
  28169. this.dispatch = buildMockDispatch.call(this)
  28170. this.close = this[kClose]
  28171. }
  28172. get [Symbols.kConnected] () {
  28173. return this[kConnected]
  28174. }
  28175. /**
  28176. * Sets up the base interceptor for mocking replies from undici.
  28177. */
  28178. intercept (opts) {
  28179. return new MockInterceptor(opts, this[kDispatches])
  28180. }
  28181. async [kClose] () {
  28182. await promisify(this[kOriginalClose])()
  28183. this[kConnected] = 0
  28184. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28185. }
  28186. }
  28187. module.exports = MockPool
  28188. /***/ }),
  28189. /***/ 4347:
  28190. /***/ ((module) => {
  28191. "use strict";
  28192. module.exports = {
  28193. kAgent: Symbol('agent'),
  28194. kOptions: Symbol('options'),
  28195. kFactory: Symbol('factory'),
  28196. kDispatches: Symbol('dispatches'),
  28197. kDispatchKey: Symbol('dispatch key'),
  28198. kDefaultHeaders: Symbol('default headers'),
  28199. kDefaultTrailers: Symbol('default trailers'),
  28200. kContentLength: Symbol('content length'),
  28201. kMockAgent: Symbol('mock agent'),
  28202. kMockAgentSet: Symbol('mock agent set'),
  28203. kMockAgentGet: Symbol('mock agent get'),
  28204. kMockDispatch: Symbol('mock dispatch'),
  28205. kClose: Symbol('close'),
  28206. kOriginalClose: Symbol('original agent close'),
  28207. kOrigin: Symbol('origin'),
  28208. kIsMockActive: Symbol('is mock active'),
  28209. kNetConnect: Symbol('net connect'),
  28210. kGetNetConnect: Symbol('get net connect'),
  28211. kConnected: Symbol('connected')
  28212. }
  28213. /***/ }),
  28214. /***/ 9323:
  28215. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28216. "use strict";
  28217. const { MockNotMatchedError } = __nccwpck_require__(888)
  28218. const {
  28219. kDispatches,
  28220. kMockAgent,
  28221. kOriginalDispatch,
  28222. kOrigin,
  28223. kGetNetConnect
  28224. } = __nccwpck_require__(4347)
  28225. const { buildURL, nop } = __nccwpck_require__(3983)
  28226. const { STATUS_CODES } = __nccwpck_require__(3685)
  28227. const {
  28228. types: {
  28229. isPromise
  28230. }
  28231. } = __nccwpck_require__(3837)
  28232. function matchValue (match, value) {
  28233. if (typeof match === 'string') {
  28234. return match === value
  28235. }
  28236. if (match instanceof RegExp) {
  28237. return match.test(value)
  28238. }
  28239. if (typeof match === 'function') {
  28240. return match(value) === true
  28241. }
  28242. return false
  28243. }
  28244. function lowerCaseEntries (headers) {
  28245. return Object.fromEntries(
  28246. Object.entries(headers).map(([headerName, headerValue]) => {
  28247. return [headerName.toLocaleLowerCase(), headerValue]
  28248. })
  28249. )
  28250. }
  28251. /**
  28252. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28253. * @param {string} key
  28254. */
  28255. function getHeaderByName (headers, key) {
  28256. if (Array.isArray(headers)) {
  28257. for (let i = 0; i < headers.length; i += 2) {
  28258. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28259. return headers[i + 1]
  28260. }
  28261. }
  28262. return undefined
  28263. } else if (typeof headers.get === 'function') {
  28264. return headers.get(key)
  28265. } else {
  28266. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28267. }
  28268. }
  28269. /** @param {string[]} headers */
  28270. function buildHeadersFromArray (headers) { // fetch HeadersList
  28271. const clone = headers.slice()
  28272. const entries = []
  28273. for (let index = 0; index < clone.length; index += 2) {
  28274. entries.push([clone[index], clone[index + 1]])
  28275. }
  28276. return Object.fromEntries(entries)
  28277. }
  28278. function matchHeaders (mockDispatch, headers) {
  28279. if (typeof mockDispatch.headers === 'function') {
  28280. if (Array.isArray(headers)) { // fetch HeadersList
  28281. headers = buildHeadersFromArray(headers)
  28282. }
  28283. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28284. }
  28285. if (typeof mockDispatch.headers === 'undefined') {
  28286. return true
  28287. }
  28288. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28289. return false
  28290. }
  28291. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28292. const headerValue = getHeaderByName(headers, matchHeaderName)
  28293. if (!matchValue(matchHeaderValue, headerValue)) {
  28294. return false
  28295. }
  28296. }
  28297. return true
  28298. }
  28299. function safeUrl (path) {
  28300. if (typeof path !== 'string') {
  28301. return path
  28302. }
  28303. const pathSegments = path.split('?')
  28304. if (pathSegments.length !== 2) {
  28305. return path
  28306. }
  28307. const qp = new URLSearchParams(pathSegments.pop())
  28308. qp.sort()
  28309. return [...pathSegments, qp.toString()].join('?')
  28310. }
  28311. function matchKey (mockDispatch, { path, method, body, headers }) {
  28312. const pathMatch = matchValue(mockDispatch.path, path)
  28313. const methodMatch = matchValue(mockDispatch.method, method)
  28314. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28315. const headersMatch = matchHeaders(mockDispatch, headers)
  28316. return pathMatch && methodMatch && bodyMatch && headersMatch
  28317. }
  28318. function getResponseData (data) {
  28319. if (Buffer.isBuffer(data)) {
  28320. return data
  28321. } else if (typeof data === 'object') {
  28322. return JSON.stringify(data)
  28323. } else {
  28324. return data.toString()
  28325. }
  28326. }
  28327. function getMockDispatch (mockDispatches, key) {
  28328. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28329. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28330. // Match path
  28331. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28332. if (matchedMockDispatches.length === 0) {
  28333. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28334. }
  28335. // Match method
  28336. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28337. if (matchedMockDispatches.length === 0) {
  28338. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28339. }
  28340. // Match body
  28341. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28342. if (matchedMockDispatches.length === 0) {
  28343. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28344. }
  28345. // Match headers
  28346. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28347. if (matchedMockDispatches.length === 0) {
  28348. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28349. }
  28350. return matchedMockDispatches[0]
  28351. }
  28352. function addMockDispatch (mockDispatches, key, data) {
  28353. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28354. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28355. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28356. mockDispatches.push(newMockDispatch)
  28357. return newMockDispatch
  28358. }
  28359. function deleteMockDispatch (mockDispatches, key) {
  28360. const index = mockDispatches.findIndex(dispatch => {
  28361. if (!dispatch.consumed) {
  28362. return false
  28363. }
  28364. return matchKey(dispatch, key)
  28365. })
  28366. if (index !== -1) {
  28367. mockDispatches.splice(index, 1)
  28368. }
  28369. }
  28370. function buildKey (opts) {
  28371. const { path, method, body, headers, query } = opts
  28372. return {
  28373. path,
  28374. method,
  28375. body,
  28376. headers,
  28377. query
  28378. }
  28379. }
  28380. function generateKeyValues (data) {
  28381. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28382. ...keyValuePairs,
  28383. Buffer.from(`${key}`),
  28384. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28385. ], [])
  28386. }
  28387. /**
  28388. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28389. * @param {number} statusCode
  28390. */
  28391. function getStatusText (statusCode) {
  28392. return STATUS_CODES[statusCode] || 'unknown'
  28393. }
  28394. async function getResponse (body) {
  28395. const buffers = []
  28396. for await (const data of body) {
  28397. buffers.push(data)
  28398. }
  28399. return Buffer.concat(buffers).toString('utf8')
  28400. }
  28401. /**
  28402. * Mock dispatch function used to simulate undici dispatches
  28403. */
  28404. function mockDispatch (opts, handler) {
  28405. // Get mock dispatch from built key
  28406. const key = buildKey(opts)
  28407. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28408. mockDispatch.timesInvoked++
  28409. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28410. if (mockDispatch.data.callback) {
  28411. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28412. }
  28413. // Parse mockDispatch data
  28414. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28415. const { timesInvoked, times } = mockDispatch
  28416. // If it's used up and not persistent, mark as consumed
  28417. mockDispatch.consumed = !persist && timesInvoked >= times
  28418. mockDispatch.pending = timesInvoked < times
  28419. // If specified, trigger dispatch error
  28420. if (error !== null) {
  28421. deleteMockDispatch(this[kDispatches], key)
  28422. handler.onError(error)
  28423. return true
  28424. }
  28425. // Handle the request with a delay if necessary
  28426. if (typeof delay === 'number' && delay > 0) {
  28427. setTimeout(() => {
  28428. handleReply(this[kDispatches])
  28429. }, delay)
  28430. } else {
  28431. handleReply(this[kDispatches])
  28432. }
  28433. function handleReply (mockDispatches, _data = data) {
  28434. // fetch's HeadersList is a 1D string array
  28435. const optsHeaders = Array.isArray(opts.headers)
  28436. ? buildHeadersFromArray(opts.headers)
  28437. : opts.headers
  28438. const body = typeof _data === 'function'
  28439. ? _data({ ...opts, headers: optsHeaders })
  28440. : _data
  28441. // util.types.isPromise is likely needed for jest.
  28442. if (isPromise(body)) {
  28443. // If handleReply is asynchronous, throwing an error
  28444. // in the callback will reject the promise, rather than
  28445. // synchronously throw the error, which breaks some tests.
  28446. // Rather, we wait for the callback to resolve if it is a
  28447. // promise, and then re-run handleReply with the new body.
  28448. body.then((newData) => handleReply(mockDispatches, newData))
  28449. return
  28450. }
  28451. const responseData = getResponseData(body)
  28452. const responseHeaders = generateKeyValues(headers)
  28453. const responseTrailers = generateKeyValues(trailers)
  28454. handler.abort = nop
  28455. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28456. handler.onData(Buffer.from(responseData))
  28457. handler.onComplete(responseTrailers)
  28458. deleteMockDispatch(mockDispatches, key)
  28459. }
  28460. function resume () {}
  28461. return true
  28462. }
  28463. function buildMockDispatch () {
  28464. const agent = this[kMockAgent]
  28465. const origin = this[kOrigin]
  28466. const originalDispatch = this[kOriginalDispatch]
  28467. return function dispatch (opts, handler) {
  28468. if (agent.isMockActive) {
  28469. try {
  28470. mockDispatch.call(this, opts, handler)
  28471. } catch (error) {
  28472. if (error instanceof MockNotMatchedError) {
  28473. const netConnect = agent[kGetNetConnect]()
  28474. if (netConnect === false) {
  28475. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28476. }
  28477. if (checkNetConnect(netConnect, origin)) {
  28478. originalDispatch.call(this, opts, handler)
  28479. } else {
  28480. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28481. }
  28482. } else {
  28483. throw error
  28484. }
  28485. }
  28486. } else {
  28487. originalDispatch.call(this, opts, handler)
  28488. }
  28489. }
  28490. }
  28491. function checkNetConnect (netConnect, origin) {
  28492. const url = new URL(origin)
  28493. if (netConnect === true) {
  28494. return true
  28495. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28496. return true
  28497. }
  28498. return false
  28499. }
  28500. function buildMockOptions (opts) {
  28501. if (opts) {
  28502. const { agent, ...mockOptions } = opts
  28503. return mockOptions
  28504. }
  28505. }
  28506. module.exports = {
  28507. getResponseData,
  28508. getMockDispatch,
  28509. addMockDispatch,
  28510. deleteMockDispatch,
  28511. buildKey,
  28512. generateKeyValues,
  28513. matchValue,
  28514. getResponse,
  28515. getStatusText,
  28516. mockDispatch,
  28517. buildMockDispatch,
  28518. checkNetConnect,
  28519. buildMockOptions,
  28520. getHeaderByName
  28521. }
  28522. /***/ }),
  28523. /***/ 6823:
  28524. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28525. "use strict";
  28526. const { Transform } = __nccwpck_require__(2781)
  28527. const { Console } = __nccwpck_require__(6206)
  28528. /**
  28529. * Gets the output of `console.table(…)` as a string.
  28530. */
  28531. module.exports = class PendingInterceptorsFormatter {
  28532. constructor ({ disableColors } = {}) {
  28533. this.transform = new Transform({
  28534. transform (chunk, _enc, cb) {
  28535. cb(null, chunk)
  28536. }
  28537. })
  28538. this.logger = new Console({
  28539. stdout: this.transform,
  28540. inspectOptions: {
  28541. colors: !disableColors && !process.env.CI
  28542. }
  28543. })
  28544. }
  28545. format (pendingInterceptors) {
  28546. const withPrettyHeaders = pendingInterceptors.map(
  28547. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28548. Method: method,
  28549. Origin: origin,
  28550. Path: path,
  28551. 'Status code': statusCode,
  28552. Persistent: persist ? '✅' : '❌',
  28553. Invocations: timesInvoked,
  28554. Remaining: persist ? Infinity : times - timesInvoked
  28555. }))
  28556. this.logger.table(withPrettyHeaders)
  28557. return this.transform.read().toString()
  28558. }
  28559. }
  28560. /***/ }),
  28561. /***/ 8891:
  28562. /***/ ((module) => {
  28563. "use strict";
  28564. const singulars = {
  28565. pronoun: 'it',
  28566. is: 'is',
  28567. was: 'was',
  28568. this: 'this'
  28569. }
  28570. const plurals = {
  28571. pronoun: 'they',
  28572. is: 'are',
  28573. was: 'were',
  28574. this: 'these'
  28575. }
  28576. module.exports = class Pluralizer {
  28577. constructor (singular, plural) {
  28578. this.singular = singular
  28579. this.plural = plural
  28580. }
  28581. pluralize (count) {
  28582. const one = count === 1
  28583. const keys = one ? singulars : plurals
  28584. const noun = one ? this.singular : this.plural
  28585. return { ...keys, count, noun }
  28586. }
  28587. }
  28588. /***/ }),
  28589. /***/ 8266:
  28590. /***/ ((module) => {
  28591. "use strict";
  28592. /* eslint-disable */
  28593. // Extracted from node/lib/internal/fixed_queue.js
  28594. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28595. const kSize = 2048;
  28596. const kMask = kSize - 1;
  28597. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28598. // circular buffers. It looks something like this:
  28599. //
  28600. // head tail
  28601. // | |
  28602. // v v
  28603. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28604. // | [null] | \----- | next | \------- | next |
  28605. // +-----------+ +-----------+ +-----------+
  28606. // | item | <-- bottom | item | <-- bottom | [empty] |
  28607. // | item | | item | | [empty] |
  28608. // | item | | item | | [empty] |
  28609. // | item | | item | | [empty] |
  28610. // | item | | item | bottom --> | item |
  28611. // | item | | item | | item |
  28612. // | ... | | ... | | ... |
  28613. // | item | | item | | item |
  28614. // | item | | item | | item |
  28615. // | [empty] | <-- top | item | | item |
  28616. // | [empty] | | item | | item |
  28617. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28618. // +-----------+ +-----------+ +-----------+
  28619. //
  28620. // Or, if there is only one circular buffer, it looks something
  28621. // like either of these:
  28622. //
  28623. // head tail head tail
  28624. // | | | |
  28625. // v v v v
  28626. // +-----------+ +-----------+
  28627. // | [null] | | [null] |
  28628. // +-----------+ +-----------+
  28629. // | [empty] | | item |
  28630. // | [empty] | | item |
  28631. // | item | <-- bottom top --> | [empty] |
  28632. // | item | | [empty] |
  28633. // | [empty] | <-- top bottom --> | item |
  28634. // | [empty] | | item |
  28635. // +-----------+ +-----------+
  28636. //
  28637. // Adding a value means moving `top` forward by one, removing means
  28638. // moving `bottom` forward by one. After reaching the end, the queue
  28639. // wraps around.
  28640. //
  28641. // When `top === bottom` the current queue is empty and when
  28642. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28643. // but allows much quicker checks.
  28644. class FixedCircularBuffer {
  28645. constructor() {
  28646. this.bottom = 0;
  28647. this.top = 0;
  28648. this.list = new Array(kSize);
  28649. this.next = null;
  28650. }
  28651. isEmpty() {
  28652. return this.top === this.bottom;
  28653. }
  28654. isFull() {
  28655. return ((this.top + 1) & kMask) === this.bottom;
  28656. }
  28657. push(data) {
  28658. this.list[this.top] = data;
  28659. this.top = (this.top + 1) & kMask;
  28660. }
  28661. shift() {
  28662. const nextItem = this.list[this.bottom];
  28663. if (nextItem === undefined)
  28664. return null;
  28665. this.list[this.bottom] = undefined;
  28666. this.bottom = (this.bottom + 1) & kMask;
  28667. return nextItem;
  28668. }
  28669. }
  28670. module.exports = class FixedQueue {
  28671. constructor() {
  28672. this.head = this.tail = new FixedCircularBuffer();
  28673. }
  28674. isEmpty() {
  28675. return this.head.isEmpty();
  28676. }
  28677. push(data) {
  28678. if (this.head.isFull()) {
  28679. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28680. // and sets it as the new main queue.
  28681. this.head = this.head.next = new FixedCircularBuffer();
  28682. }
  28683. this.head.push(data);
  28684. }
  28685. shift() {
  28686. const tail = this.tail;
  28687. const next = tail.shift();
  28688. if (tail.isEmpty() && tail.next !== null) {
  28689. // If there is another queue, it forms the new tail.
  28690. this.tail = tail.next;
  28691. }
  28692. return next;
  28693. }
  28694. };
  28695. /***/ }),
  28696. /***/ 3198:
  28697. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28698. "use strict";
  28699. const DispatcherBase = __nccwpck_require__(4839)
  28700. const FixedQueue = __nccwpck_require__(8266)
  28701. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28702. const PoolStats = __nccwpck_require__(9689)
  28703. const kClients = Symbol('clients')
  28704. const kNeedDrain = Symbol('needDrain')
  28705. const kQueue = Symbol('queue')
  28706. const kClosedResolve = Symbol('closed resolve')
  28707. const kOnDrain = Symbol('onDrain')
  28708. const kOnConnect = Symbol('onConnect')
  28709. const kOnDisconnect = Symbol('onDisconnect')
  28710. const kOnConnectionError = Symbol('onConnectionError')
  28711. const kGetDispatcher = Symbol('get dispatcher')
  28712. const kAddClient = Symbol('add client')
  28713. const kRemoveClient = Symbol('remove client')
  28714. const kStats = Symbol('stats')
  28715. class PoolBase extends DispatcherBase {
  28716. constructor () {
  28717. super()
  28718. this[kQueue] = new FixedQueue()
  28719. this[kClients] = []
  28720. this[kQueued] = 0
  28721. const pool = this
  28722. this[kOnDrain] = function onDrain (origin, targets) {
  28723. const queue = pool[kQueue]
  28724. let needDrain = false
  28725. while (!needDrain) {
  28726. const item = queue.shift()
  28727. if (!item) {
  28728. break
  28729. }
  28730. pool[kQueued]--
  28731. needDrain = !this.dispatch(item.opts, item.handler)
  28732. }
  28733. this[kNeedDrain] = needDrain
  28734. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  28735. pool[kNeedDrain] = false
  28736. pool.emit('drain', origin, [pool, ...targets])
  28737. }
  28738. if (pool[kClosedResolve] && queue.isEmpty()) {
  28739. Promise
  28740. .all(pool[kClients].map(c => c.close()))
  28741. .then(pool[kClosedResolve])
  28742. }
  28743. }
  28744. this[kOnConnect] = (origin, targets) => {
  28745. pool.emit('connect', origin, [pool, ...targets])
  28746. }
  28747. this[kOnDisconnect] = (origin, targets, err) => {
  28748. pool.emit('disconnect', origin, [pool, ...targets], err)
  28749. }
  28750. this[kOnConnectionError] = (origin, targets, err) => {
  28751. pool.emit('connectionError', origin, [pool, ...targets], err)
  28752. }
  28753. this[kStats] = new PoolStats(this)
  28754. }
  28755. get [kBusy] () {
  28756. return this[kNeedDrain]
  28757. }
  28758. get [kConnected] () {
  28759. return this[kClients].filter(client => client[kConnected]).length
  28760. }
  28761. get [kFree] () {
  28762. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  28763. }
  28764. get [kPending] () {
  28765. let ret = this[kQueued]
  28766. for (const { [kPending]: pending } of this[kClients]) {
  28767. ret += pending
  28768. }
  28769. return ret
  28770. }
  28771. get [kRunning] () {
  28772. let ret = 0
  28773. for (const { [kRunning]: running } of this[kClients]) {
  28774. ret += running
  28775. }
  28776. return ret
  28777. }
  28778. get [kSize] () {
  28779. let ret = this[kQueued]
  28780. for (const { [kSize]: size } of this[kClients]) {
  28781. ret += size
  28782. }
  28783. return ret
  28784. }
  28785. get stats () {
  28786. return this[kStats]
  28787. }
  28788. async [kClose] () {
  28789. if (this[kQueue].isEmpty()) {
  28790. return Promise.all(this[kClients].map(c => c.close()))
  28791. } else {
  28792. return new Promise((resolve) => {
  28793. this[kClosedResolve] = resolve
  28794. })
  28795. }
  28796. }
  28797. async [kDestroy] (err) {
  28798. while (true) {
  28799. const item = this[kQueue].shift()
  28800. if (!item) {
  28801. break
  28802. }
  28803. item.handler.onError(err)
  28804. }
  28805. return Promise.all(this[kClients].map(c => c.destroy(err)))
  28806. }
  28807. [kDispatch] (opts, handler) {
  28808. const dispatcher = this[kGetDispatcher]()
  28809. if (!dispatcher) {
  28810. this[kNeedDrain] = true
  28811. this[kQueue].push({ opts, handler })
  28812. this[kQueued]++
  28813. } else if (!dispatcher.dispatch(opts, handler)) {
  28814. dispatcher[kNeedDrain] = true
  28815. this[kNeedDrain] = !this[kGetDispatcher]()
  28816. }
  28817. return !this[kNeedDrain]
  28818. }
  28819. [kAddClient] (client) {
  28820. client
  28821. .on('drain', this[kOnDrain])
  28822. .on('connect', this[kOnConnect])
  28823. .on('disconnect', this[kOnDisconnect])
  28824. .on('connectionError', this[kOnConnectionError])
  28825. this[kClients].push(client)
  28826. if (this[kNeedDrain]) {
  28827. process.nextTick(() => {
  28828. if (this[kNeedDrain]) {
  28829. this[kOnDrain](client[kUrl], [this, client])
  28830. }
  28831. })
  28832. }
  28833. return this
  28834. }
  28835. [kRemoveClient] (client) {
  28836. client.close(() => {
  28837. const idx = this[kClients].indexOf(client)
  28838. if (idx !== -1) {
  28839. this[kClients].splice(idx, 1)
  28840. }
  28841. })
  28842. this[kNeedDrain] = this[kClients].some(dispatcher => (
  28843. !dispatcher[kNeedDrain] &&
  28844. dispatcher.closed !== true &&
  28845. dispatcher.destroyed !== true
  28846. ))
  28847. }
  28848. }
  28849. module.exports = {
  28850. PoolBase,
  28851. kClients,
  28852. kNeedDrain,
  28853. kAddClient,
  28854. kRemoveClient,
  28855. kGetDispatcher
  28856. }
  28857. /***/ }),
  28858. /***/ 9689:
  28859. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28860. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  28861. const kPool = Symbol('pool')
  28862. class PoolStats {
  28863. constructor (pool) {
  28864. this[kPool] = pool
  28865. }
  28866. get connected () {
  28867. return this[kPool][kConnected]
  28868. }
  28869. get free () {
  28870. return this[kPool][kFree]
  28871. }
  28872. get pending () {
  28873. return this[kPool][kPending]
  28874. }
  28875. get queued () {
  28876. return this[kPool][kQueued]
  28877. }
  28878. get running () {
  28879. return this[kPool][kRunning]
  28880. }
  28881. get size () {
  28882. return this[kPool][kSize]
  28883. }
  28884. }
  28885. module.exports = PoolStats
  28886. /***/ }),
  28887. /***/ 4634:
  28888. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28889. "use strict";
  28890. const {
  28891. PoolBase,
  28892. kClients,
  28893. kNeedDrain,
  28894. kAddClient,
  28895. kGetDispatcher
  28896. } = __nccwpck_require__(3198)
  28897. const Client = __nccwpck_require__(3598)
  28898. const {
  28899. InvalidArgumentError
  28900. } = __nccwpck_require__(8045)
  28901. const util = __nccwpck_require__(3983)
  28902. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  28903. const buildConnector = __nccwpck_require__(2067)
  28904. const kOptions = Symbol('options')
  28905. const kConnections = Symbol('connections')
  28906. const kFactory = Symbol('factory')
  28907. function defaultFactory (origin, opts) {
  28908. return new Client(origin, opts)
  28909. }
  28910. class Pool extends PoolBase {
  28911. constructor (origin, {
  28912. connections,
  28913. factory = defaultFactory,
  28914. connect,
  28915. connectTimeout,
  28916. tls,
  28917. maxCachedSessions,
  28918. socketPath,
  28919. autoSelectFamily,
  28920. autoSelectFamilyAttemptTimeout,
  28921. allowH2,
  28922. ...options
  28923. } = {}) {
  28924. super()
  28925. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  28926. throw new InvalidArgumentError('invalid connections')
  28927. }
  28928. if (typeof factory !== 'function') {
  28929. throw new InvalidArgumentError('factory must be a function.')
  28930. }
  28931. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  28932. throw new InvalidArgumentError('connect must be a function or an object')
  28933. }
  28934. if (typeof connect !== 'function') {
  28935. connect = buildConnector({
  28936. ...tls,
  28937. maxCachedSessions,
  28938. allowH2,
  28939. socketPath,
  28940. timeout: connectTimeout,
  28941. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  28942. ...connect
  28943. })
  28944. }
  28945. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  28946. ? options.interceptors.Pool
  28947. : []
  28948. this[kConnections] = connections || null
  28949. this[kUrl] = util.parseOrigin(origin)
  28950. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  28951. this[kOptions].interceptors = options.interceptors
  28952. ? { ...options.interceptors }
  28953. : undefined
  28954. this[kFactory] = factory
  28955. }
  28956. [kGetDispatcher] () {
  28957. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  28958. if (dispatcher) {
  28959. return dispatcher
  28960. }
  28961. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  28962. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  28963. this[kAddClient](dispatcher)
  28964. }
  28965. return dispatcher
  28966. }
  28967. }
  28968. module.exports = Pool
  28969. /***/ }),
  28970. /***/ 7858:
  28971. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28972. "use strict";
  28973. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  28974. const { URL } = __nccwpck_require__(7310)
  28975. const Agent = __nccwpck_require__(7890)
  28976. const Pool = __nccwpck_require__(4634)
  28977. const DispatcherBase = __nccwpck_require__(4839)
  28978. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  28979. const buildConnector = __nccwpck_require__(2067)
  28980. const kAgent = Symbol('proxy agent')
  28981. const kClient = Symbol('proxy client')
  28982. const kProxyHeaders = Symbol('proxy headers')
  28983. const kRequestTls = Symbol('request tls settings')
  28984. const kProxyTls = Symbol('proxy tls settings')
  28985. const kConnectEndpoint = Symbol('connect endpoint function')
  28986. function defaultProtocolPort (protocol) {
  28987. return protocol === 'https:' ? 443 : 80
  28988. }
  28989. function buildProxyOptions (opts) {
  28990. if (typeof opts === 'string') {
  28991. opts = { uri: opts }
  28992. }
  28993. if (!opts || !opts.uri) {
  28994. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  28995. }
  28996. return {
  28997. uri: opts.uri,
  28998. protocol: opts.protocol || 'https'
  28999. }
  29000. }
  29001. function defaultFactory (origin, opts) {
  29002. return new Pool(origin, opts)
  29003. }
  29004. class ProxyAgent extends DispatcherBase {
  29005. constructor (opts) {
  29006. super(opts)
  29007. this[kProxy] = buildProxyOptions(opts)
  29008. this[kAgent] = new Agent(opts)
  29009. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29010. ? opts.interceptors.ProxyAgent
  29011. : []
  29012. if (typeof opts === 'string') {
  29013. opts = { uri: opts }
  29014. }
  29015. if (!opts || !opts.uri) {
  29016. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29017. }
  29018. const { clientFactory = defaultFactory } = opts
  29019. if (typeof clientFactory !== 'function') {
  29020. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29021. }
  29022. this[kRequestTls] = opts.requestTls
  29023. this[kProxyTls] = opts.proxyTls
  29024. this[kProxyHeaders] = opts.headers || {}
  29025. const resolvedUrl = new URL(opts.uri)
  29026. const { origin, port, host, username, password } = resolvedUrl
  29027. if (opts.auth && opts.token) {
  29028. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29029. } else if (opts.auth) {
  29030. /* @deprecated in favour of opts.token */
  29031. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29032. } else if (opts.token) {
  29033. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29034. } else if (username && password) {
  29035. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29036. }
  29037. const connect = buildConnector({ ...opts.proxyTls })
  29038. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29039. this[kClient] = clientFactory(resolvedUrl, { connect })
  29040. this[kAgent] = new Agent({
  29041. ...opts,
  29042. connect: async (opts, callback) => {
  29043. let requestedHost = opts.host
  29044. if (!opts.port) {
  29045. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29046. }
  29047. try {
  29048. const { socket, statusCode } = await this[kClient].connect({
  29049. origin,
  29050. port,
  29051. path: requestedHost,
  29052. signal: opts.signal,
  29053. headers: {
  29054. ...this[kProxyHeaders],
  29055. host
  29056. }
  29057. })
  29058. if (statusCode !== 200) {
  29059. socket.on('error', () => {}).destroy()
  29060. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29061. }
  29062. if (opts.protocol !== 'https:') {
  29063. callback(null, socket)
  29064. return
  29065. }
  29066. let servername
  29067. if (this[kRequestTls]) {
  29068. servername = this[kRequestTls].servername
  29069. } else {
  29070. servername = opts.servername
  29071. }
  29072. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29073. } catch (err) {
  29074. callback(err)
  29075. }
  29076. }
  29077. })
  29078. }
  29079. dispatch (opts, handler) {
  29080. const { host } = new URL(opts.origin)
  29081. const headers = buildHeaders(opts.headers)
  29082. throwIfProxyAuthIsSent(headers)
  29083. return this[kAgent].dispatch(
  29084. {
  29085. ...opts,
  29086. headers: {
  29087. ...headers,
  29088. host
  29089. }
  29090. },
  29091. handler
  29092. )
  29093. }
  29094. async [kClose] () {
  29095. await this[kAgent].close()
  29096. await this[kClient].close()
  29097. }
  29098. async [kDestroy] () {
  29099. await this[kAgent].destroy()
  29100. await this[kClient].destroy()
  29101. }
  29102. }
  29103. /**
  29104. * @param {string[] | Record<string, string>} headers
  29105. * @returns {Record<string, string>}
  29106. */
  29107. function buildHeaders (headers) {
  29108. // When using undici.fetch, the headers list is stored
  29109. // as an array.
  29110. if (Array.isArray(headers)) {
  29111. /** @type {Record<string, string>} */
  29112. const headersPair = {}
  29113. for (let i = 0; i < headers.length; i += 2) {
  29114. headersPair[headers[i]] = headers[i + 1]
  29115. }
  29116. return headersPair
  29117. }
  29118. return headers
  29119. }
  29120. /**
  29121. * @param {Record<string, string>} headers
  29122. *
  29123. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29124. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29125. * this check was created.
  29126. * It should be removed in the next major version for performance reasons
  29127. */
  29128. function throwIfProxyAuthIsSent (headers) {
  29129. const existProxyAuth = headers && Object.keys(headers)
  29130. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29131. if (existProxyAuth) {
  29132. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29133. }
  29134. }
  29135. module.exports = ProxyAgent
  29136. /***/ }),
  29137. /***/ 9459:
  29138. /***/ ((module) => {
  29139. "use strict";
  29140. let fastNow = Date.now()
  29141. let fastNowTimeout
  29142. const fastTimers = []
  29143. function onTimeout () {
  29144. fastNow = Date.now()
  29145. let len = fastTimers.length
  29146. let idx = 0
  29147. while (idx < len) {
  29148. const timer = fastTimers[idx]
  29149. if (timer.state === 0) {
  29150. timer.state = fastNow + timer.delay
  29151. } else if (timer.state > 0 && fastNow >= timer.state) {
  29152. timer.state = -1
  29153. timer.callback(timer.opaque)
  29154. }
  29155. if (timer.state === -1) {
  29156. timer.state = -2
  29157. if (idx !== len - 1) {
  29158. fastTimers[idx] = fastTimers.pop()
  29159. } else {
  29160. fastTimers.pop()
  29161. }
  29162. len -= 1
  29163. } else {
  29164. idx += 1
  29165. }
  29166. }
  29167. if (fastTimers.length > 0) {
  29168. refreshTimeout()
  29169. }
  29170. }
  29171. function refreshTimeout () {
  29172. if (fastNowTimeout && fastNowTimeout.refresh) {
  29173. fastNowTimeout.refresh()
  29174. } else {
  29175. clearTimeout(fastNowTimeout)
  29176. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29177. if (fastNowTimeout.unref) {
  29178. fastNowTimeout.unref()
  29179. }
  29180. }
  29181. }
  29182. class Timeout {
  29183. constructor (callback, delay, opaque) {
  29184. this.callback = callback
  29185. this.delay = delay
  29186. this.opaque = opaque
  29187. // -2 not in timer list
  29188. // -1 in timer list but inactive
  29189. // 0 in timer list waiting for time
  29190. // > 0 in timer list waiting for time to expire
  29191. this.state = -2
  29192. this.refresh()
  29193. }
  29194. refresh () {
  29195. if (this.state === -2) {
  29196. fastTimers.push(this)
  29197. if (!fastNowTimeout || fastTimers.length === 1) {
  29198. refreshTimeout()
  29199. }
  29200. }
  29201. this.state = 0
  29202. }
  29203. clear () {
  29204. this.state = -1
  29205. }
  29206. }
  29207. module.exports = {
  29208. setTimeout (callback, delay, opaque) {
  29209. return delay < 1e3
  29210. ? setTimeout(callback, delay, opaque)
  29211. : new Timeout(callback, delay, opaque)
  29212. },
  29213. clearTimeout (timeout) {
  29214. if (timeout instanceof Timeout) {
  29215. timeout.clear()
  29216. } else {
  29217. clearTimeout(timeout)
  29218. }
  29219. }
  29220. }
  29221. /***/ }),
  29222. /***/ 5354:
  29223. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29224. "use strict";
  29225. const diagnosticsChannel = __nccwpck_require__(7643)
  29226. const { uid, states } = __nccwpck_require__(9188)
  29227. const {
  29228. kReadyState,
  29229. kSentClose,
  29230. kByteParser,
  29231. kReceivedClose
  29232. } = __nccwpck_require__(7578)
  29233. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29234. const { CloseEvent } = __nccwpck_require__(2611)
  29235. const { makeRequest } = __nccwpck_require__(8359)
  29236. const { fetching } = __nccwpck_require__(4881)
  29237. const { Headers } = __nccwpck_require__(554)
  29238. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29239. const { kHeadersList } = __nccwpck_require__(2785)
  29240. const channels = {}
  29241. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29242. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29243. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29244. /** @type {import('crypto')} */
  29245. let crypto
  29246. try {
  29247. crypto = __nccwpck_require__(6113)
  29248. } catch {
  29249. }
  29250. /**
  29251. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29252. * @param {URL} url
  29253. * @param {string|string[]} protocols
  29254. * @param {import('./websocket').WebSocket} ws
  29255. * @param {(response: any) => void} onEstablish
  29256. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29257. */
  29258. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29259. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29260. // scheme is "ws", and to "https" otherwise.
  29261. const requestURL = url
  29262. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29263. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29264. // service-workers mode is "none", referrer is "no-referrer", mode is
  29265. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29266. // and redirect mode is "error".
  29267. const request = makeRequest({
  29268. urlList: [requestURL],
  29269. serviceWorkers: 'none',
  29270. referrer: 'no-referrer',
  29271. mode: 'websocket',
  29272. credentials: 'include',
  29273. cache: 'no-store',
  29274. redirect: 'error'
  29275. })
  29276. // Note: undici extension, allow setting custom headers.
  29277. if (options.headers) {
  29278. const headersList = new Headers(options.headers)[kHeadersList]
  29279. request.headersList = headersList
  29280. }
  29281. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29282. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29283. // Note: both of these are handled by undici currently.
  29284. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29285. // 5. Let keyValue be a nonce consisting of a randomly selected
  29286. // 16-byte value that has been forgiving-base64-encoded and
  29287. // isomorphic encoded.
  29288. const keyValue = crypto.randomBytes(16).toString('base64')
  29289. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29290. // header list.
  29291. request.headersList.append('sec-websocket-key', keyValue)
  29292. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29293. // header list.
  29294. request.headersList.append('sec-websocket-version', '13')
  29295. // 8. For each protocol in protocols, combine
  29296. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29297. // list.
  29298. for (const protocol of protocols) {
  29299. request.headersList.append('sec-websocket-protocol', protocol)
  29300. }
  29301. // 9. Let permessageDeflate be a user-agent defined
  29302. // "permessage-deflate" extension header value.
  29303. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29304. // TODO: enable once permessage-deflate is supported
  29305. const permessageDeflate = '' // 'permessage-deflate; 15'
  29306. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29307. // request’s header list.
  29308. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29309. // 11. Fetch request with useParallelQueue set to true, and
  29310. // processResponse given response being these steps:
  29311. const controller = fetching({
  29312. request,
  29313. useParallelQueue: true,
  29314. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29315. processResponse (response) {
  29316. // 1. If response is a network error or its status is not 101,
  29317. // fail the WebSocket connection.
  29318. if (response.type === 'error' || response.status !== 101) {
  29319. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29320. return
  29321. }
  29322. // 2. If protocols is not the empty list and extracting header
  29323. // list values given `Sec-WebSocket-Protocol` and response’s
  29324. // header list results in null, failure, or the empty byte
  29325. // sequence, then fail the WebSocket connection.
  29326. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29327. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29328. return
  29329. }
  29330. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29331. // of the last set of steps in section 4.1 of The WebSocket
  29332. // Protocol to validate response. This either results in fail
  29333. // the WebSocket connection or the WebSocket connection is
  29334. // established.
  29335. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29336. // header field contains a value that is not an ASCII case-
  29337. // insensitive match for the value "websocket", the client MUST
  29338. // _Fail the WebSocket Connection_.
  29339. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29340. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29341. return
  29342. }
  29343. // 3. If the response lacks a |Connection| header field or the
  29344. // |Connection| header field doesn't contain a token that is an
  29345. // ASCII case-insensitive match for the value "Upgrade", the client
  29346. // MUST _Fail the WebSocket Connection_.
  29347. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29348. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29349. return
  29350. }
  29351. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29352. // the |Sec-WebSocket-Accept| contains a value other than the
  29353. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29354. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29355. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29356. // trailing whitespace, the client MUST _Fail the WebSocket
  29357. // Connection_.
  29358. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29359. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29360. if (secWSAccept !== digest) {
  29361. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29362. return
  29363. }
  29364. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29365. // field and this header field indicates the use of an extension
  29366. // that was not present in the client's handshake (the server has
  29367. // indicated an extension not requested by the client), the client
  29368. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29369. // header field to determine which extensions are requested is
  29370. // discussed in Section 9.1.)
  29371. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29372. if (secExtension !== null && secExtension !== permessageDeflate) {
  29373. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29374. return
  29375. }
  29376. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29377. // and this header field indicates the use of a subprotocol that was
  29378. // not present in the client's handshake (the server has indicated a
  29379. // subprotocol not requested by the client), the client MUST _Fail
  29380. // the WebSocket Connection_.
  29381. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29382. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29383. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29384. return
  29385. }
  29386. response.socket.on('data', onSocketData)
  29387. response.socket.on('close', onSocketClose)
  29388. response.socket.on('error', onSocketError)
  29389. if (channels.open.hasSubscribers) {
  29390. channels.open.publish({
  29391. address: response.socket.address(),
  29392. protocol: secProtocol,
  29393. extensions: secExtension
  29394. })
  29395. }
  29396. onEstablish(response)
  29397. }
  29398. })
  29399. return controller
  29400. }
  29401. /**
  29402. * @param {Buffer} chunk
  29403. */
  29404. function onSocketData (chunk) {
  29405. if (!this.ws[kByteParser].write(chunk)) {
  29406. this.pause()
  29407. }
  29408. }
  29409. /**
  29410. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29411. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29412. */
  29413. function onSocketClose () {
  29414. const { ws } = this
  29415. // If the TCP connection was closed after the
  29416. // WebSocket closing handshake was completed, the WebSocket connection
  29417. // is said to have been closed _cleanly_.
  29418. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29419. let code = 1005
  29420. let reason = ''
  29421. const result = ws[kByteParser].closingInfo
  29422. if (result) {
  29423. code = result.code ?? 1005
  29424. reason = result.reason
  29425. } else if (!ws[kSentClose]) {
  29426. // If _The WebSocket
  29427. // Connection is Closed_ and no Close control frame was received by the
  29428. // endpoint (such as could occur if the underlying transport connection
  29429. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29430. // 1006.
  29431. code = 1006
  29432. }
  29433. // 1. Change the ready state to CLOSED (3).
  29434. ws[kReadyState] = states.CLOSED
  29435. // 2. If the user agent was required to fail the WebSocket
  29436. // connection, or if the WebSocket connection was closed
  29437. // after being flagged as full, fire an event named error
  29438. // at the WebSocket object.
  29439. // TODO
  29440. // 3. Fire an event named close at the WebSocket object,
  29441. // using CloseEvent, with the wasClean attribute
  29442. // initialized to true if the connection closed cleanly
  29443. // and false otherwise, the code attribute initialized to
  29444. // the WebSocket connection close code, and the reason
  29445. // attribute initialized to the result of applying UTF-8
  29446. // decode without BOM to the WebSocket connection close
  29447. // reason.
  29448. fireEvent('close', ws, CloseEvent, {
  29449. wasClean, code, reason
  29450. })
  29451. if (channels.close.hasSubscribers) {
  29452. channels.close.publish({
  29453. websocket: ws,
  29454. code,
  29455. reason
  29456. })
  29457. }
  29458. }
  29459. function onSocketError (error) {
  29460. const { ws } = this
  29461. ws[kReadyState] = states.CLOSING
  29462. if (channels.socketError.hasSubscribers) {
  29463. channels.socketError.publish(error)
  29464. }
  29465. this.destroy()
  29466. }
  29467. module.exports = {
  29468. establishWebSocketConnection
  29469. }
  29470. /***/ }),
  29471. /***/ 9188:
  29472. /***/ ((module) => {
  29473. "use strict";
  29474. // This is a Globally Unique Identifier unique used
  29475. // to validate that the endpoint accepts websocket
  29476. // connections.
  29477. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29478. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29479. /** @type {PropertyDescriptor} */
  29480. const staticPropertyDescriptors = {
  29481. enumerable: true,
  29482. writable: false,
  29483. configurable: false
  29484. }
  29485. const states = {
  29486. CONNECTING: 0,
  29487. OPEN: 1,
  29488. CLOSING: 2,
  29489. CLOSED: 3
  29490. }
  29491. const opcodes = {
  29492. CONTINUATION: 0x0,
  29493. TEXT: 0x1,
  29494. BINARY: 0x2,
  29495. CLOSE: 0x8,
  29496. PING: 0x9,
  29497. PONG: 0xA
  29498. }
  29499. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29500. const parserStates = {
  29501. INFO: 0,
  29502. PAYLOADLENGTH_16: 2,
  29503. PAYLOADLENGTH_64: 3,
  29504. READ_DATA: 4
  29505. }
  29506. const emptyBuffer = Buffer.allocUnsafe(0)
  29507. module.exports = {
  29508. uid,
  29509. staticPropertyDescriptors,
  29510. states,
  29511. opcodes,
  29512. maxUnsigned16Bit,
  29513. parserStates,
  29514. emptyBuffer
  29515. }
  29516. /***/ }),
  29517. /***/ 2611:
  29518. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29519. "use strict";
  29520. const { webidl } = __nccwpck_require__(1744)
  29521. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29522. const { MessagePort } = __nccwpck_require__(1267)
  29523. /**
  29524. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29525. */
  29526. class MessageEvent extends Event {
  29527. #eventInit
  29528. constructor (type, eventInitDict = {}) {
  29529. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29530. type = webidl.converters.DOMString(type)
  29531. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29532. super(type, eventInitDict)
  29533. this.#eventInit = eventInitDict
  29534. }
  29535. get data () {
  29536. webidl.brandCheck(this, MessageEvent)
  29537. return this.#eventInit.data
  29538. }
  29539. get origin () {
  29540. webidl.brandCheck(this, MessageEvent)
  29541. return this.#eventInit.origin
  29542. }
  29543. get lastEventId () {
  29544. webidl.brandCheck(this, MessageEvent)
  29545. return this.#eventInit.lastEventId
  29546. }
  29547. get source () {
  29548. webidl.brandCheck(this, MessageEvent)
  29549. return this.#eventInit.source
  29550. }
  29551. get ports () {
  29552. webidl.brandCheck(this, MessageEvent)
  29553. if (!Object.isFrozen(this.#eventInit.ports)) {
  29554. Object.freeze(this.#eventInit.ports)
  29555. }
  29556. return this.#eventInit.ports
  29557. }
  29558. initMessageEvent (
  29559. type,
  29560. bubbles = false,
  29561. cancelable = false,
  29562. data = null,
  29563. origin = '',
  29564. lastEventId = '',
  29565. source = null,
  29566. ports = []
  29567. ) {
  29568. webidl.brandCheck(this, MessageEvent)
  29569. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29570. return new MessageEvent(type, {
  29571. bubbles, cancelable, data, origin, lastEventId, source, ports
  29572. })
  29573. }
  29574. }
  29575. /**
  29576. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29577. */
  29578. class CloseEvent extends Event {
  29579. #eventInit
  29580. constructor (type, eventInitDict = {}) {
  29581. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29582. type = webidl.converters.DOMString(type)
  29583. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29584. super(type, eventInitDict)
  29585. this.#eventInit = eventInitDict
  29586. }
  29587. get wasClean () {
  29588. webidl.brandCheck(this, CloseEvent)
  29589. return this.#eventInit.wasClean
  29590. }
  29591. get code () {
  29592. webidl.brandCheck(this, CloseEvent)
  29593. return this.#eventInit.code
  29594. }
  29595. get reason () {
  29596. webidl.brandCheck(this, CloseEvent)
  29597. return this.#eventInit.reason
  29598. }
  29599. }
  29600. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29601. class ErrorEvent extends Event {
  29602. #eventInit
  29603. constructor (type, eventInitDict) {
  29604. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29605. super(type, eventInitDict)
  29606. type = webidl.converters.DOMString(type)
  29607. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29608. this.#eventInit = eventInitDict
  29609. }
  29610. get message () {
  29611. webidl.brandCheck(this, ErrorEvent)
  29612. return this.#eventInit.message
  29613. }
  29614. get filename () {
  29615. webidl.brandCheck(this, ErrorEvent)
  29616. return this.#eventInit.filename
  29617. }
  29618. get lineno () {
  29619. webidl.brandCheck(this, ErrorEvent)
  29620. return this.#eventInit.lineno
  29621. }
  29622. get colno () {
  29623. webidl.brandCheck(this, ErrorEvent)
  29624. return this.#eventInit.colno
  29625. }
  29626. get error () {
  29627. webidl.brandCheck(this, ErrorEvent)
  29628. return this.#eventInit.error
  29629. }
  29630. }
  29631. Object.defineProperties(MessageEvent.prototype, {
  29632. [Symbol.toStringTag]: {
  29633. value: 'MessageEvent',
  29634. configurable: true
  29635. },
  29636. data: kEnumerableProperty,
  29637. origin: kEnumerableProperty,
  29638. lastEventId: kEnumerableProperty,
  29639. source: kEnumerableProperty,
  29640. ports: kEnumerableProperty,
  29641. initMessageEvent: kEnumerableProperty
  29642. })
  29643. Object.defineProperties(CloseEvent.prototype, {
  29644. [Symbol.toStringTag]: {
  29645. value: 'CloseEvent',
  29646. configurable: true
  29647. },
  29648. reason: kEnumerableProperty,
  29649. code: kEnumerableProperty,
  29650. wasClean: kEnumerableProperty
  29651. })
  29652. Object.defineProperties(ErrorEvent.prototype, {
  29653. [Symbol.toStringTag]: {
  29654. value: 'ErrorEvent',
  29655. configurable: true
  29656. },
  29657. message: kEnumerableProperty,
  29658. filename: kEnumerableProperty,
  29659. lineno: kEnumerableProperty,
  29660. colno: kEnumerableProperty,
  29661. error: kEnumerableProperty
  29662. })
  29663. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29664. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29665. webidl.converters.MessagePort
  29666. )
  29667. const eventInit = [
  29668. {
  29669. key: 'bubbles',
  29670. converter: webidl.converters.boolean,
  29671. defaultValue: false
  29672. },
  29673. {
  29674. key: 'cancelable',
  29675. converter: webidl.converters.boolean,
  29676. defaultValue: false
  29677. },
  29678. {
  29679. key: 'composed',
  29680. converter: webidl.converters.boolean,
  29681. defaultValue: false
  29682. }
  29683. ]
  29684. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29685. ...eventInit,
  29686. {
  29687. key: 'data',
  29688. converter: webidl.converters.any,
  29689. defaultValue: null
  29690. },
  29691. {
  29692. key: 'origin',
  29693. converter: webidl.converters.USVString,
  29694. defaultValue: ''
  29695. },
  29696. {
  29697. key: 'lastEventId',
  29698. converter: webidl.converters.DOMString,
  29699. defaultValue: ''
  29700. },
  29701. {
  29702. key: 'source',
  29703. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29704. // valid value for source is a MessagePort.
  29705. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29706. defaultValue: null
  29707. },
  29708. {
  29709. key: 'ports',
  29710. converter: webidl.converters['sequence<MessagePort>'],
  29711. get defaultValue () {
  29712. return []
  29713. }
  29714. }
  29715. ])
  29716. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  29717. ...eventInit,
  29718. {
  29719. key: 'wasClean',
  29720. converter: webidl.converters.boolean,
  29721. defaultValue: false
  29722. },
  29723. {
  29724. key: 'code',
  29725. converter: webidl.converters['unsigned short'],
  29726. defaultValue: 0
  29727. },
  29728. {
  29729. key: 'reason',
  29730. converter: webidl.converters.USVString,
  29731. defaultValue: ''
  29732. }
  29733. ])
  29734. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  29735. ...eventInit,
  29736. {
  29737. key: 'message',
  29738. converter: webidl.converters.DOMString,
  29739. defaultValue: ''
  29740. },
  29741. {
  29742. key: 'filename',
  29743. converter: webidl.converters.USVString,
  29744. defaultValue: ''
  29745. },
  29746. {
  29747. key: 'lineno',
  29748. converter: webidl.converters['unsigned long'],
  29749. defaultValue: 0
  29750. },
  29751. {
  29752. key: 'colno',
  29753. converter: webidl.converters['unsigned long'],
  29754. defaultValue: 0
  29755. },
  29756. {
  29757. key: 'error',
  29758. converter: webidl.converters.any
  29759. }
  29760. ])
  29761. module.exports = {
  29762. MessageEvent,
  29763. CloseEvent,
  29764. ErrorEvent
  29765. }
  29766. /***/ }),
  29767. /***/ 5444:
  29768. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29769. "use strict";
  29770. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  29771. /** @type {import('crypto')} */
  29772. let crypto
  29773. try {
  29774. crypto = __nccwpck_require__(6113)
  29775. } catch {
  29776. }
  29777. class WebsocketFrameSend {
  29778. /**
  29779. * @param {Buffer|undefined} data
  29780. */
  29781. constructor (data) {
  29782. this.frameData = data
  29783. this.maskKey = crypto.randomBytes(4)
  29784. }
  29785. createFrame (opcode) {
  29786. const bodyLength = this.frameData?.byteLength ?? 0
  29787. /** @type {number} */
  29788. let payloadLength = bodyLength // 0-125
  29789. let offset = 6
  29790. if (bodyLength > maxUnsigned16Bit) {
  29791. offset += 8 // payload length is next 8 bytes
  29792. payloadLength = 127
  29793. } else if (bodyLength > 125) {
  29794. offset += 2 // payload length is next 2 bytes
  29795. payloadLength = 126
  29796. }
  29797. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  29798. // Clear first 2 bytes, everything else is overwritten
  29799. buffer[0] = buffer[1] = 0
  29800. buffer[0] |= 0x80 // FIN
  29801. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  29802. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  29803. buffer[offset - 4] = this.maskKey[0]
  29804. buffer[offset - 3] = this.maskKey[1]
  29805. buffer[offset - 2] = this.maskKey[2]
  29806. buffer[offset - 1] = this.maskKey[3]
  29807. buffer[1] = payloadLength
  29808. if (payloadLength === 126) {
  29809. buffer.writeUInt16BE(bodyLength, 2)
  29810. } else if (payloadLength === 127) {
  29811. // Clear extended payload length
  29812. buffer[2] = buffer[3] = 0
  29813. buffer.writeUIntBE(bodyLength, 4, 6)
  29814. }
  29815. buffer[1] |= 0x80 // MASK
  29816. // mask body
  29817. for (let i = 0; i < bodyLength; i++) {
  29818. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  29819. }
  29820. return buffer
  29821. }
  29822. }
  29823. module.exports = {
  29824. WebsocketFrameSend
  29825. }
  29826. /***/ }),
  29827. /***/ 1688:
  29828. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29829. "use strict";
  29830. const { Writable } = __nccwpck_require__(2781)
  29831. const diagnosticsChannel = __nccwpck_require__(7643)
  29832. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  29833. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  29834. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  29835. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  29836. // This code was influenced by ws released under the MIT license.
  29837. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  29838. // Copyright (c) 2013 Arnout Kazemier and contributors
  29839. // Copyright (c) 2016 Luigi Pinca and contributors
  29840. const channels = {}
  29841. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  29842. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  29843. class ByteParser extends Writable {
  29844. #buffers = []
  29845. #byteOffset = 0
  29846. #state = parserStates.INFO
  29847. #info = {}
  29848. #fragments = []
  29849. constructor (ws) {
  29850. super()
  29851. this.ws = ws
  29852. }
  29853. /**
  29854. * @param {Buffer} chunk
  29855. * @param {() => void} callback
  29856. */
  29857. _write (chunk, _, callback) {
  29858. this.#buffers.push(chunk)
  29859. this.#byteOffset += chunk.length
  29860. this.run(callback)
  29861. }
  29862. /**
  29863. * Runs whenever a new chunk is received.
  29864. * Callback is called whenever there are no more chunks buffering,
  29865. * or not enough bytes are buffered to parse.
  29866. */
  29867. run (callback) {
  29868. while (true) {
  29869. if (this.#state === parserStates.INFO) {
  29870. // If there aren't enough bytes to parse the payload length, etc.
  29871. if (this.#byteOffset < 2) {
  29872. return callback()
  29873. }
  29874. const buffer = this.consume(2)
  29875. this.#info.fin = (buffer[0] & 0x80) !== 0
  29876. this.#info.opcode = buffer[0] & 0x0F
  29877. // If we receive a fragmented message, we use the type of the first
  29878. // frame to parse the full message as binary/text, when it's terminated
  29879. this.#info.originalOpcode ??= this.#info.opcode
  29880. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  29881. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  29882. // Only text and binary frames can be fragmented
  29883. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  29884. return
  29885. }
  29886. const payloadLength = buffer[1] & 0x7F
  29887. if (payloadLength <= 125) {
  29888. this.#info.payloadLength = payloadLength
  29889. this.#state = parserStates.READ_DATA
  29890. } else if (payloadLength === 126) {
  29891. this.#state = parserStates.PAYLOADLENGTH_16
  29892. } else if (payloadLength === 127) {
  29893. this.#state = parserStates.PAYLOADLENGTH_64
  29894. }
  29895. if (this.#info.fragmented && payloadLength > 125) {
  29896. // A fragmented frame can't be fragmented itself
  29897. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  29898. return
  29899. } else if (
  29900. (this.#info.opcode === opcodes.PING ||
  29901. this.#info.opcode === opcodes.PONG ||
  29902. this.#info.opcode === opcodes.CLOSE) &&
  29903. payloadLength > 125
  29904. ) {
  29905. // Control frames can have a payload length of 125 bytes MAX
  29906. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  29907. return
  29908. } else if (this.#info.opcode === opcodes.CLOSE) {
  29909. if (payloadLength === 1) {
  29910. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  29911. return
  29912. }
  29913. const body = this.consume(payloadLength)
  29914. this.#info.closeInfo = this.parseCloseBody(false, body)
  29915. if (!this.ws[kSentClose]) {
  29916. // If an endpoint receives a Close frame and did not previously send a
  29917. // Close frame, the endpoint MUST send a Close frame in response. (When
  29918. // sending a Close frame in response, the endpoint typically echos the
  29919. // status code it received.)
  29920. const body = Buffer.allocUnsafe(2)
  29921. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  29922. const closeFrame = new WebsocketFrameSend(body)
  29923. this.ws[kResponse].socket.write(
  29924. closeFrame.createFrame(opcodes.CLOSE),
  29925. (err) => {
  29926. if (!err) {
  29927. this.ws[kSentClose] = true
  29928. }
  29929. }
  29930. )
  29931. }
  29932. // Upon either sending or receiving a Close control frame, it is said
  29933. // that _The WebSocket Closing Handshake is Started_ and that the
  29934. // WebSocket connection is in the CLOSING state.
  29935. this.ws[kReadyState] = states.CLOSING
  29936. this.ws[kReceivedClose] = true
  29937. this.end()
  29938. return
  29939. } else if (this.#info.opcode === opcodes.PING) {
  29940. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  29941. // response, unless it already received a Close frame.
  29942. // A Pong frame sent in response to a Ping frame must have identical
  29943. // "Application data"
  29944. const body = this.consume(payloadLength)
  29945. if (!this.ws[kReceivedClose]) {
  29946. const frame = new WebsocketFrameSend(body)
  29947. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  29948. if (channels.ping.hasSubscribers) {
  29949. channels.ping.publish({
  29950. payload: body
  29951. })
  29952. }
  29953. }
  29954. this.#state = parserStates.INFO
  29955. if (this.#byteOffset > 0) {
  29956. continue
  29957. } else {
  29958. callback()
  29959. return
  29960. }
  29961. } else if (this.#info.opcode === opcodes.PONG) {
  29962. // A Pong frame MAY be sent unsolicited. This serves as a
  29963. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  29964. // not expected.
  29965. const body = this.consume(payloadLength)
  29966. if (channels.pong.hasSubscribers) {
  29967. channels.pong.publish({
  29968. payload: body
  29969. })
  29970. }
  29971. if (this.#byteOffset > 0) {
  29972. continue
  29973. } else {
  29974. callback()
  29975. return
  29976. }
  29977. }
  29978. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  29979. if (this.#byteOffset < 2) {
  29980. return callback()
  29981. }
  29982. const buffer = this.consume(2)
  29983. this.#info.payloadLength = buffer.readUInt16BE(0)
  29984. this.#state = parserStates.READ_DATA
  29985. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  29986. if (this.#byteOffset < 8) {
  29987. return callback()
  29988. }
  29989. const buffer = this.consume(8)
  29990. const upper = buffer.readUInt32BE(0)
  29991. // 2^31 is the maxinimum bytes an arraybuffer can contain
  29992. // on 32-bit systems. Although, on 64-bit systems, this is
  29993. // 2^53-1 bytes.
  29994. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  29995. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  29996. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  29997. if (upper > 2 ** 31 - 1) {
  29998. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  29999. return
  30000. }
  30001. const lower = buffer.readUInt32BE(4)
  30002. this.#info.payloadLength = (upper << 8) + lower
  30003. this.#state = parserStates.READ_DATA
  30004. } else if (this.#state === parserStates.READ_DATA) {
  30005. if (this.#byteOffset < this.#info.payloadLength) {
  30006. // If there is still more data in this chunk that needs to be read
  30007. return callback()
  30008. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30009. // If the server sent multiple frames in a single chunk
  30010. const body = this.consume(this.#info.payloadLength)
  30011. this.#fragments.push(body)
  30012. // If the frame is unfragmented, or a fragmented frame was terminated,
  30013. // a message was received
  30014. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30015. const fullMessage = Buffer.concat(this.#fragments)
  30016. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30017. this.#info = {}
  30018. this.#fragments.length = 0
  30019. }
  30020. this.#state = parserStates.INFO
  30021. }
  30022. }
  30023. if (this.#byteOffset > 0) {
  30024. continue
  30025. } else {
  30026. callback()
  30027. break
  30028. }
  30029. }
  30030. }
  30031. /**
  30032. * Take n bytes from the buffered Buffers
  30033. * @param {number} n
  30034. * @returns {Buffer|null}
  30035. */
  30036. consume (n) {
  30037. if (n > this.#byteOffset) {
  30038. return null
  30039. } else if (n === 0) {
  30040. return emptyBuffer
  30041. }
  30042. if (this.#buffers[0].length === n) {
  30043. this.#byteOffset -= this.#buffers[0].length
  30044. return this.#buffers.shift()
  30045. }
  30046. const buffer = Buffer.allocUnsafe(n)
  30047. let offset = 0
  30048. while (offset !== n) {
  30049. const next = this.#buffers[0]
  30050. const { length } = next
  30051. if (length + offset === n) {
  30052. buffer.set(this.#buffers.shift(), offset)
  30053. break
  30054. } else if (length + offset > n) {
  30055. buffer.set(next.subarray(0, n - offset), offset)
  30056. this.#buffers[0] = next.subarray(n - offset)
  30057. break
  30058. } else {
  30059. buffer.set(this.#buffers.shift(), offset)
  30060. offset += next.length
  30061. }
  30062. }
  30063. this.#byteOffset -= n
  30064. return buffer
  30065. }
  30066. parseCloseBody (onlyCode, data) {
  30067. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30068. /** @type {number|undefined} */
  30069. let code
  30070. if (data.length >= 2) {
  30071. // _The WebSocket Connection Close Code_ is
  30072. // defined as the status code (Section 7.4) contained in the first Close
  30073. // control frame received by the application
  30074. code = data.readUInt16BE(0)
  30075. }
  30076. if (onlyCode) {
  30077. if (!isValidStatusCode(code)) {
  30078. return null
  30079. }
  30080. return { code }
  30081. }
  30082. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30083. /** @type {Buffer} */
  30084. let reason = data.subarray(2)
  30085. // Remove BOM
  30086. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30087. reason = reason.subarray(3)
  30088. }
  30089. if (code !== undefined && !isValidStatusCode(code)) {
  30090. return null
  30091. }
  30092. try {
  30093. // TODO: optimize this
  30094. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30095. } catch {
  30096. return null
  30097. }
  30098. return { code, reason }
  30099. }
  30100. get closingInfo () {
  30101. return this.#info.closeInfo
  30102. }
  30103. }
  30104. module.exports = {
  30105. ByteParser
  30106. }
  30107. /***/ }),
  30108. /***/ 7578:
  30109. /***/ ((module) => {
  30110. "use strict";
  30111. module.exports = {
  30112. kWebSocketURL: Symbol('url'),
  30113. kReadyState: Symbol('ready state'),
  30114. kController: Symbol('controller'),
  30115. kResponse: Symbol('response'),
  30116. kBinaryType: Symbol('binary type'),
  30117. kSentClose: Symbol('sent close'),
  30118. kReceivedClose: Symbol('received close'),
  30119. kByteParser: Symbol('byte parser')
  30120. }
  30121. /***/ }),
  30122. /***/ 5515:
  30123. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30124. "use strict";
  30125. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30126. const { states, opcodes } = __nccwpck_require__(9188)
  30127. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30128. /* globals Blob */
  30129. /**
  30130. * @param {import('./websocket').WebSocket} ws
  30131. */
  30132. function isEstablished (ws) {
  30133. // If the server's response is validated as provided for above, it is
  30134. // said that _The WebSocket Connection is Established_ and that the
  30135. // WebSocket Connection is in the OPEN state.
  30136. return ws[kReadyState] === states.OPEN
  30137. }
  30138. /**
  30139. * @param {import('./websocket').WebSocket} ws
  30140. */
  30141. function isClosing (ws) {
  30142. // Upon either sending or receiving a Close control frame, it is said
  30143. // that _The WebSocket Closing Handshake is Started_ and that the
  30144. // WebSocket connection is in the CLOSING state.
  30145. return ws[kReadyState] === states.CLOSING
  30146. }
  30147. /**
  30148. * @param {import('./websocket').WebSocket} ws
  30149. */
  30150. function isClosed (ws) {
  30151. return ws[kReadyState] === states.CLOSED
  30152. }
  30153. /**
  30154. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30155. * @param {string} e
  30156. * @param {EventTarget} target
  30157. * @param {EventInit | undefined} eventInitDict
  30158. */
  30159. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30160. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30161. // 2. Let event be the result of creating an event given eventConstructor,
  30162. // in the relevant realm of target.
  30163. // 3. Initialize event’s type attribute to e.
  30164. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30165. // 4. Initialize any other IDL attributes of event as described in the
  30166. // invocation of this algorithm.
  30167. // 5. Return the result of dispatching event at target, with legacy target
  30168. // override flag set if set.
  30169. target.dispatchEvent(event)
  30170. }
  30171. /**
  30172. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30173. * @param {import('./websocket').WebSocket} ws
  30174. * @param {number} type Opcode
  30175. * @param {Buffer} data application data
  30176. */
  30177. function websocketMessageReceived (ws, type, data) {
  30178. // 1. If ready state is not OPEN (1), then return.
  30179. if (ws[kReadyState] !== states.OPEN) {
  30180. return
  30181. }
  30182. // 2. Let dataForEvent be determined by switching on type and binary type:
  30183. let dataForEvent
  30184. if (type === opcodes.TEXT) {
  30185. // -> type indicates that the data is Text
  30186. // a new DOMString containing data
  30187. try {
  30188. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30189. } catch {
  30190. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30191. return
  30192. }
  30193. } else if (type === opcodes.BINARY) {
  30194. if (ws[kBinaryType] === 'blob') {
  30195. // -> type indicates that the data is Binary and binary type is "blob"
  30196. // a new Blob object, created in the relevant Realm of the WebSocket
  30197. // object, that represents data as its raw data
  30198. dataForEvent = new Blob([data])
  30199. } else {
  30200. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30201. // a new ArrayBuffer object, created in the relevant Realm of the
  30202. // WebSocket object, whose contents are data
  30203. dataForEvent = new Uint8Array(data).buffer
  30204. }
  30205. }
  30206. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30207. // with the origin attribute initialized to the serialization of the WebSocket
  30208. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30209. fireEvent('message', ws, MessageEvent, {
  30210. origin: ws[kWebSocketURL].origin,
  30211. data: dataForEvent
  30212. })
  30213. }
  30214. /**
  30215. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30216. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30217. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30218. * @param {string} protocol
  30219. */
  30220. function isValidSubprotocol (protocol) {
  30221. // If present, this value indicates one
  30222. // or more comma-separated subprotocol the client wishes to speak,
  30223. // ordered by preference. The elements that comprise this value
  30224. // MUST be non-empty strings with characters in the range U+0021 to
  30225. // U+007E not including separator characters as defined in
  30226. // [RFC2616] and MUST all be unique strings.
  30227. if (protocol.length === 0) {
  30228. return false
  30229. }
  30230. for (const char of protocol) {
  30231. const code = char.charCodeAt(0)
  30232. if (
  30233. code < 0x21 ||
  30234. code > 0x7E ||
  30235. char === '(' ||
  30236. char === ')' ||
  30237. char === '<' ||
  30238. char === '>' ||
  30239. char === '@' ||
  30240. char === ',' ||
  30241. char === ';' ||
  30242. char === ':' ||
  30243. char === '\\' ||
  30244. char === '"' ||
  30245. char === '/' ||
  30246. char === '[' ||
  30247. char === ']' ||
  30248. char === '?' ||
  30249. char === '=' ||
  30250. char === '{' ||
  30251. char === '}' ||
  30252. code === 32 || // SP
  30253. code === 9 // HT
  30254. ) {
  30255. return false
  30256. }
  30257. }
  30258. return true
  30259. }
  30260. /**
  30261. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30262. * @param {number} code
  30263. */
  30264. function isValidStatusCode (code) {
  30265. if (code >= 1000 && code < 1015) {
  30266. return (
  30267. code !== 1004 && // reserved
  30268. code !== 1005 && // "MUST NOT be set as a status code"
  30269. code !== 1006 // "MUST NOT be set as a status code"
  30270. )
  30271. }
  30272. return code >= 3000 && code <= 4999
  30273. }
  30274. /**
  30275. * @param {import('./websocket').WebSocket} ws
  30276. * @param {string|undefined} reason
  30277. */
  30278. function failWebsocketConnection (ws, reason) {
  30279. const { [kController]: controller, [kResponse]: response } = ws
  30280. controller.abort()
  30281. if (response?.socket && !response.socket.destroyed) {
  30282. response.socket.destroy()
  30283. }
  30284. if (reason) {
  30285. fireEvent('error', ws, ErrorEvent, {
  30286. error: new Error(reason)
  30287. })
  30288. }
  30289. }
  30290. module.exports = {
  30291. isEstablished,
  30292. isClosing,
  30293. isClosed,
  30294. fireEvent,
  30295. isValidSubprotocol,
  30296. isValidStatusCode,
  30297. failWebsocketConnection,
  30298. websocketMessageReceived
  30299. }
  30300. /***/ }),
  30301. /***/ 4284:
  30302. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30303. "use strict";
  30304. const { webidl } = __nccwpck_require__(1744)
  30305. const { DOMException } = __nccwpck_require__(1037)
  30306. const { URLSerializer } = __nccwpck_require__(685)
  30307. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30308. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30309. const {
  30310. kWebSocketURL,
  30311. kReadyState,
  30312. kController,
  30313. kBinaryType,
  30314. kResponse,
  30315. kSentClose,
  30316. kByteParser
  30317. } = __nccwpck_require__(7578)
  30318. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30319. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30320. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30321. const { ByteParser } = __nccwpck_require__(1688)
  30322. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30323. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30324. const { types } = __nccwpck_require__(3837)
  30325. let experimentalWarned = false
  30326. // https://websockets.spec.whatwg.org/#interface-definition
  30327. class WebSocket extends EventTarget {
  30328. #events = {
  30329. open: null,
  30330. error: null,
  30331. close: null,
  30332. message: null
  30333. }
  30334. #bufferedAmount = 0
  30335. #protocol = ''
  30336. #extensions = ''
  30337. /**
  30338. * @param {string} url
  30339. * @param {string|string[]} protocols
  30340. */
  30341. constructor (url, protocols = []) {
  30342. super()
  30343. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30344. if (!experimentalWarned) {
  30345. experimentalWarned = true
  30346. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30347. code: 'UNDICI-WS'
  30348. })
  30349. }
  30350. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30351. url = webidl.converters.USVString(url)
  30352. protocols = options.protocols
  30353. // 1. Let baseURL be this's relevant settings object's API base URL.
  30354. const baseURL = getGlobalOrigin()
  30355. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30356. let urlRecord
  30357. try {
  30358. urlRecord = new URL(url, baseURL)
  30359. } catch (e) {
  30360. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30361. throw new DOMException(e, 'SyntaxError')
  30362. }
  30363. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30364. if (urlRecord.protocol === 'http:') {
  30365. urlRecord.protocol = 'ws:'
  30366. } else if (urlRecord.protocol === 'https:') {
  30367. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30368. urlRecord.protocol = 'wss:'
  30369. }
  30370. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30371. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30372. throw new DOMException(
  30373. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30374. 'SyntaxError'
  30375. )
  30376. }
  30377. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30378. // DOMException.
  30379. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30380. throw new DOMException('Got fragment', 'SyntaxError')
  30381. }
  30382. // 8. If protocols is a string, set protocols to a sequence consisting
  30383. // of just that string.
  30384. if (typeof protocols === 'string') {
  30385. protocols = [protocols]
  30386. }
  30387. // 9. If any of the values in protocols occur more than once or otherwise
  30388. // fail to match the requirements for elements that comprise the value
  30389. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30390. // protocol, then throw a "SyntaxError" DOMException.
  30391. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30392. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30393. }
  30394. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30395. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30396. }
  30397. // 10. Set this's url to urlRecord.
  30398. this[kWebSocketURL] = new URL(urlRecord.href)
  30399. // 11. Let client be this's relevant settings object.
  30400. // 12. Run this step in parallel:
  30401. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30402. // and client.
  30403. this[kController] = establishWebSocketConnection(
  30404. urlRecord,
  30405. protocols,
  30406. this,
  30407. (response) => this.#onConnectionEstablished(response),
  30408. options
  30409. )
  30410. // Each WebSocket object has an associated ready state, which is a
  30411. // number representing the state of the connection. Initially it must
  30412. // be CONNECTING (0).
  30413. this[kReadyState] = WebSocket.CONNECTING
  30414. // The extensions attribute must initially return the empty string.
  30415. // The protocol attribute must initially return the empty string.
  30416. // Each WebSocket object has an associated binary type, which is a
  30417. // BinaryType. Initially it must be "blob".
  30418. this[kBinaryType] = 'blob'
  30419. }
  30420. /**
  30421. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30422. * @param {number|undefined} code
  30423. * @param {string|undefined} reason
  30424. */
  30425. close (code = undefined, reason = undefined) {
  30426. webidl.brandCheck(this, WebSocket)
  30427. if (code !== undefined) {
  30428. code = webidl.converters['unsigned short'](code, { clamp: true })
  30429. }
  30430. if (reason !== undefined) {
  30431. reason = webidl.converters.USVString(reason)
  30432. }
  30433. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30434. // integer in the range 3000 to 4999, inclusive, throw an
  30435. // "InvalidAccessError" DOMException.
  30436. if (code !== undefined) {
  30437. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30438. throw new DOMException('invalid code', 'InvalidAccessError')
  30439. }
  30440. }
  30441. let reasonByteLength = 0
  30442. // 2. If reason is present, then run these substeps:
  30443. if (reason !== undefined) {
  30444. // 1. Let reasonBytes be the result of encoding reason.
  30445. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30446. // "SyntaxError" DOMException.
  30447. reasonByteLength = Buffer.byteLength(reason)
  30448. if (reasonByteLength > 123) {
  30449. throw new DOMException(
  30450. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30451. 'SyntaxError'
  30452. )
  30453. }
  30454. }
  30455. // 3. Run the first matching steps from the following list:
  30456. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30457. // If this's ready state is CLOSING (2) or CLOSED (3)
  30458. // Do nothing.
  30459. } else if (!isEstablished(this)) {
  30460. // If the WebSocket connection is not yet established
  30461. // Fail the WebSocket connection and set this's ready state
  30462. // to CLOSING (2).
  30463. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30464. this[kReadyState] = WebSocket.CLOSING
  30465. } else if (!isClosing(this)) {
  30466. // If the WebSocket closing handshake has not yet been started
  30467. // Start the WebSocket closing handshake and set this's ready
  30468. // state to CLOSING (2).
  30469. // - If neither code nor reason is present, the WebSocket Close
  30470. // message must not have a body.
  30471. // - If code is present, then the status code to use in the
  30472. // WebSocket Close message must be the integer given by code.
  30473. // - If reason is also present, then reasonBytes must be
  30474. // provided in the Close message after the status code.
  30475. const frame = new WebsocketFrameSend()
  30476. // If neither code nor reason is present, the WebSocket Close
  30477. // message must not have a body.
  30478. // If code is present, then the status code to use in the
  30479. // WebSocket Close message must be the integer given by code.
  30480. if (code !== undefined && reason === undefined) {
  30481. frame.frameData = Buffer.allocUnsafe(2)
  30482. frame.frameData.writeUInt16BE(code, 0)
  30483. } else if (code !== undefined && reason !== undefined) {
  30484. // If reason is also present, then reasonBytes must be
  30485. // provided in the Close message after the status code.
  30486. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30487. frame.frameData.writeUInt16BE(code, 0)
  30488. // the body MAY contain UTF-8-encoded data with value /reason/
  30489. frame.frameData.write(reason, 2, 'utf-8')
  30490. } else {
  30491. frame.frameData = emptyBuffer
  30492. }
  30493. /** @type {import('stream').Duplex} */
  30494. const socket = this[kResponse].socket
  30495. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30496. if (!err) {
  30497. this[kSentClose] = true
  30498. }
  30499. })
  30500. // Upon either sending or receiving a Close control frame, it is said
  30501. // that _The WebSocket Closing Handshake is Started_ and that the
  30502. // WebSocket connection is in the CLOSING state.
  30503. this[kReadyState] = states.CLOSING
  30504. } else {
  30505. // Otherwise
  30506. // Set this's ready state to CLOSING (2).
  30507. this[kReadyState] = WebSocket.CLOSING
  30508. }
  30509. }
  30510. /**
  30511. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30512. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30513. */
  30514. send (data) {
  30515. webidl.brandCheck(this, WebSocket)
  30516. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30517. data = webidl.converters.WebSocketSendData(data)
  30518. // 1. If this's ready state is CONNECTING, then throw an
  30519. // "InvalidStateError" DOMException.
  30520. if (this[kReadyState] === WebSocket.CONNECTING) {
  30521. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30522. }
  30523. // 2. Run the appropriate set of steps from the following list:
  30524. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30525. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30526. if (!isEstablished(this) || isClosing(this)) {
  30527. return
  30528. }
  30529. /** @type {import('stream').Duplex} */
  30530. const socket = this[kResponse].socket
  30531. // If data is a string
  30532. if (typeof data === 'string') {
  30533. // If the WebSocket connection is established and the WebSocket
  30534. // closing handshake has not yet started, then the user agent
  30535. // must send a WebSocket Message comprised of the data argument
  30536. // using a text frame opcode; if the data cannot be sent, e.g.
  30537. // because it would need to be buffered but the buffer is full,
  30538. // the user agent must flag the WebSocket as full and then close
  30539. // the WebSocket connection. Any invocation of this method with a
  30540. // string argument that does not throw an exception must increase
  30541. // the bufferedAmount attribute by the number of bytes needed to
  30542. // express the argument as UTF-8.
  30543. const value = Buffer.from(data)
  30544. const frame = new WebsocketFrameSend(value)
  30545. const buffer = frame.createFrame(opcodes.TEXT)
  30546. this.#bufferedAmount += value.byteLength
  30547. socket.write(buffer, () => {
  30548. this.#bufferedAmount -= value.byteLength
  30549. })
  30550. } else if (types.isArrayBuffer(data)) {
  30551. // If the WebSocket connection is established, and the WebSocket
  30552. // closing handshake has not yet started, then the user agent must
  30553. // send a WebSocket Message comprised of data using a binary frame
  30554. // opcode; if the data cannot be sent, e.g. because it would need
  30555. // to be buffered but the buffer is full, the user agent must flag
  30556. // the WebSocket as full and then close the WebSocket connection.
  30557. // The data to be sent is the data stored in the buffer described
  30558. // by the ArrayBuffer object. Any invocation of this method with an
  30559. // ArrayBuffer argument that does not throw an exception must
  30560. // increase the bufferedAmount attribute by the length of the
  30561. // ArrayBuffer in bytes.
  30562. const value = Buffer.from(data)
  30563. const frame = new WebsocketFrameSend(value)
  30564. const buffer = frame.createFrame(opcodes.BINARY)
  30565. this.#bufferedAmount += value.byteLength
  30566. socket.write(buffer, () => {
  30567. this.#bufferedAmount -= value.byteLength
  30568. })
  30569. } else if (ArrayBuffer.isView(data)) {
  30570. // If the WebSocket connection is established, and the WebSocket
  30571. // closing handshake has not yet started, then the user agent must
  30572. // send a WebSocket Message comprised of data using a binary frame
  30573. // opcode; if the data cannot be sent, e.g. because it would need to
  30574. // be buffered but the buffer is full, the user agent must flag the
  30575. // WebSocket as full and then close the WebSocket connection. The
  30576. // data to be sent is the data stored in the section of the buffer
  30577. // described by the ArrayBuffer object that data references. Any
  30578. // invocation of this method with this kind of argument that does
  30579. // not throw an exception must increase the bufferedAmount attribute
  30580. // by the length of data’s buffer in bytes.
  30581. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30582. const frame = new WebsocketFrameSend(ab)
  30583. const buffer = frame.createFrame(opcodes.BINARY)
  30584. this.#bufferedAmount += ab.byteLength
  30585. socket.write(buffer, () => {
  30586. this.#bufferedAmount -= ab.byteLength
  30587. })
  30588. } else if (isBlobLike(data)) {
  30589. // If the WebSocket connection is established, and the WebSocket
  30590. // closing handshake has not yet started, then the user agent must
  30591. // send a WebSocket Message comprised of data using a binary frame
  30592. // opcode; if the data cannot be sent, e.g. because it would need to
  30593. // be buffered but the buffer is full, the user agent must flag the
  30594. // WebSocket as full and then close the WebSocket connection. The data
  30595. // to be sent is the raw data represented by the Blob object. Any
  30596. // invocation of this method with a Blob argument that does not throw
  30597. // an exception must increase the bufferedAmount attribute by the size
  30598. // of the Blob object’s raw data, in bytes.
  30599. const frame = new WebsocketFrameSend()
  30600. data.arrayBuffer().then((ab) => {
  30601. const value = Buffer.from(ab)
  30602. frame.frameData = value
  30603. const buffer = frame.createFrame(opcodes.BINARY)
  30604. this.#bufferedAmount += value.byteLength
  30605. socket.write(buffer, () => {
  30606. this.#bufferedAmount -= value.byteLength
  30607. })
  30608. })
  30609. }
  30610. }
  30611. get readyState () {
  30612. webidl.brandCheck(this, WebSocket)
  30613. // The readyState getter steps are to return this's ready state.
  30614. return this[kReadyState]
  30615. }
  30616. get bufferedAmount () {
  30617. webidl.brandCheck(this, WebSocket)
  30618. return this.#bufferedAmount
  30619. }
  30620. get url () {
  30621. webidl.brandCheck(this, WebSocket)
  30622. // The url getter steps are to return this's url, serialized.
  30623. return URLSerializer(this[kWebSocketURL])
  30624. }
  30625. get extensions () {
  30626. webidl.brandCheck(this, WebSocket)
  30627. return this.#extensions
  30628. }
  30629. get protocol () {
  30630. webidl.brandCheck(this, WebSocket)
  30631. return this.#protocol
  30632. }
  30633. get onopen () {
  30634. webidl.brandCheck(this, WebSocket)
  30635. return this.#events.open
  30636. }
  30637. set onopen (fn) {
  30638. webidl.brandCheck(this, WebSocket)
  30639. if (this.#events.open) {
  30640. this.removeEventListener('open', this.#events.open)
  30641. }
  30642. if (typeof fn === 'function') {
  30643. this.#events.open = fn
  30644. this.addEventListener('open', fn)
  30645. } else {
  30646. this.#events.open = null
  30647. }
  30648. }
  30649. get onerror () {
  30650. webidl.brandCheck(this, WebSocket)
  30651. return this.#events.error
  30652. }
  30653. set onerror (fn) {
  30654. webidl.brandCheck(this, WebSocket)
  30655. if (this.#events.error) {
  30656. this.removeEventListener('error', this.#events.error)
  30657. }
  30658. if (typeof fn === 'function') {
  30659. this.#events.error = fn
  30660. this.addEventListener('error', fn)
  30661. } else {
  30662. this.#events.error = null
  30663. }
  30664. }
  30665. get onclose () {
  30666. webidl.brandCheck(this, WebSocket)
  30667. return this.#events.close
  30668. }
  30669. set onclose (fn) {
  30670. webidl.brandCheck(this, WebSocket)
  30671. if (this.#events.close) {
  30672. this.removeEventListener('close', this.#events.close)
  30673. }
  30674. if (typeof fn === 'function') {
  30675. this.#events.close = fn
  30676. this.addEventListener('close', fn)
  30677. } else {
  30678. this.#events.close = null
  30679. }
  30680. }
  30681. get onmessage () {
  30682. webidl.brandCheck(this, WebSocket)
  30683. return this.#events.message
  30684. }
  30685. set onmessage (fn) {
  30686. webidl.brandCheck(this, WebSocket)
  30687. if (this.#events.message) {
  30688. this.removeEventListener('message', this.#events.message)
  30689. }
  30690. if (typeof fn === 'function') {
  30691. this.#events.message = fn
  30692. this.addEventListener('message', fn)
  30693. } else {
  30694. this.#events.message = null
  30695. }
  30696. }
  30697. get binaryType () {
  30698. webidl.brandCheck(this, WebSocket)
  30699. return this[kBinaryType]
  30700. }
  30701. set binaryType (type) {
  30702. webidl.brandCheck(this, WebSocket)
  30703. if (type !== 'blob' && type !== 'arraybuffer') {
  30704. this[kBinaryType] = 'blob'
  30705. } else {
  30706. this[kBinaryType] = type
  30707. }
  30708. }
  30709. /**
  30710. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30711. */
  30712. #onConnectionEstablished (response) {
  30713. // processResponse is called when the "response’s header list has been received and initialized."
  30714. // once this happens, the connection is open
  30715. this[kResponse] = response
  30716. const parser = new ByteParser(this)
  30717. parser.on('drain', function onParserDrain () {
  30718. this.ws[kResponse].socket.resume()
  30719. })
  30720. response.socket.ws = this
  30721. this[kByteParser] = parser
  30722. // 1. Change the ready state to OPEN (1).
  30723. this[kReadyState] = states.OPEN
  30724. // 2. Change the extensions attribute’s value to the extensions in use, if
  30725. // it is not the null value.
  30726. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  30727. const extensions = response.headersList.get('sec-websocket-extensions')
  30728. if (extensions !== null) {
  30729. this.#extensions = extensions
  30730. }
  30731. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  30732. // it is not the null value.
  30733. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  30734. const protocol = response.headersList.get('sec-websocket-protocol')
  30735. if (protocol !== null) {
  30736. this.#protocol = protocol
  30737. }
  30738. // 4. Fire an event named open at the WebSocket object.
  30739. fireEvent('open', this)
  30740. }
  30741. }
  30742. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  30743. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  30744. // https://websockets.spec.whatwg.org/#dom-websocket-open
  30745. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  30746. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  30747. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  30748. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  30749. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  30750. Object.defineProperties(WebSocket.prototype, {
  30751. CONNECTING: staticPropertyDescriptors,
  30752. OPEN: staticPropertyDescriptors,
  30753. CLOSING: staticPropertyDescriptors,
  30754. CLOSED: staticPropertyDescriptors,
  30755. url: kEnumerableProperty,
  30756. readyState: kEnumerableProperty,
  30757. bufferedAmount: kEnumerableProperty,
  30758. onopen: kEnumerableProperty,
  30759. onerror: kEnumerableProperty,
  30760. onclose: kEnumerableProperty,
  30761. close: kEnumerableProperty,
  30762. onmessage: kEnumerableProperty,
  30763. binaryType: kEnumerableProperty,
  30764. send: kEnumerableProperty,
  30765. extensions: kEnumerableProperty,
  30766. protocol: kEnumerableProperty,
  30767. [Symbol.toStringTag]: {
  30768. value: 'WebSocket',
  30769. writable: false,
  30770. enumerable: false,
  30771. configurable: true
  30772. }
  30773. })
  30774. Object.defineProperties(WebSocket, {
  30775. CONNECTING: staticPropertyDescriptors,
  30776. OPEN: staticPropertyDescriptors,
  30777. CLOSING: staticPropertyDescriptors,
  30778. CLOSED: staticPropertyDescriptors
  30779. })
  30780. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  30781. webidl.converters.DOMString
  30782. )
  30783. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  30784. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  30785. return webidl.converters['sequence<DOMString>'](V)
  30786. }
  30787. return webidl.converters.DOMString(V)
  30788. }
  30789. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  30790. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  30791. {
  30792. key: 'protocols',
  30793. converter: webidl.converters['DOMString or sequence<DOMString>'],
  30794. get defaultValue () {
  30795. return []
  30796. }
  30797. },
  30798. {
  30799. key: 'dispatcher',
  30800. converter: (V) => V,
  30801. get defaultValue () {
  30802. return getGlobalDispatcher()
  30803. }
  30804. },
  30805. {
  30806. key: 'headers',
  30807. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  30808. }
  30809. ])
  30810. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  30811. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  30812. return webidl.converters.WebSocketInit(V)
  30813. }
  30814. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  30815. }
  30816. webidl.converters.WebSocketSendData = function (V) {
  30817. if (webidl.util.Type(V) === 'Object') {
  30818. if (isBlobLike(V)) {
  30819. return webidl.converters.Blob(V, { strict: false })
  30820. }
  30821. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  30822. return webidl.converters.BufferSource(V)
  30823. }
  30824. }
  30825. return webidl.converters.USVString(V)
  30826. }
  30827. module.exports = {
  30828. WebSocket
  30829. }
  30830. /***/ }),
  30831. /***/ 5030:
  30832. /***/ ((__unused_webpack_module, exports) => {
  30833. "use strict";
  30834. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30835. function getUserAgent() {
  30836. if (typeof navigator === "object" && "userAgent" in navigator) {
  30837. return navigator.userAgent;
  30838. }
  30839. if (typeof process === "object" && process.version !== undefined) {
  30840. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  30841. }
  30842. return "<environment undetectable>";
  30843. }
  30844. exports.getUserAgent = getUserAgent;
  30845. //# sourceMappingURL=index.js.map
  30846. /***/ }),
  30847. /***/ 5840:
  30848. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30849. "use strict";
  30850. Object.defineProperty(exports, "__esModule", ({
  30851. value: true
  30852. }));
  30853. Object.defineProperty(exports, "NIL", ({
  30854. enumerable: true,
  30855. get: function () {
  30856. return _nil.default;
  30857. }
  30858. }));
  30859. Object.defineProperty(exports, "parse", ({
  30860. enumerable: true,
  30861. get: function () {
  30862. return _parse.default;
  30863. }
  30864. }));
  30865. Object.defineProperty(exports, "stringify", ({
  30866. enumerable: true,
  30867. get: function () {
  30868. return _stringify.default;
  30869. }
  30870. }));
  30871. Object.defineProperty(exports, "v1", ({
  30872. enumerable: true,
  30873. get: function () {
  30874. return _v.default;
  30875. }
  30876. }));
  30877. Object.defineProperty(exports, "v3", ({
  30878. enumerable: true,
  30879. get: function () {
  30880. return _v2.default;
  30881. }
  30882. }));
  30883. Object.defineProperty(exports, "v4", ({
  30884. enumerable: true,
  30885. get: function () {
  30886. return _v3.default;
  30887. }
  30888. }));
  30889. Object.defineProperty(exports, "v5", ({
  30890. enumerable: true,
  30891. get: function () {
  30892. return _v4.default;
  30893. }
  30894. }));
  30895. Object.defineProperty(exports, "validate", ({
  30896. enumerable: true,
  30897. get: function () {
  30898. return _validate.default;
  30899. }
  30900. }));
  30901. Object.defineProperty(exports, "version", ({
  30902. enumerable: true,
  30903. get: function () {
  30904. return _version.default;
  30905. }
  30906. }));
  30907. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  30908. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  30909. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  30910. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  30911. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  30912. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  30913. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30914. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  30915. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  30916. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30917. /***/ }),
  30918. /***/ 4569:
  30919. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30920. "use strict";
  30921. Object.defineProperty(exports, "__esModule", ({
  30922. value: true
  30923. }));
  30924. exports["default"] = void 0;
  30925. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30926. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30927. function md5(bytes) {
  30928. if (Array.isArray(bytes)) {
  30929. bytes = Buffer.from(bytes);
  30930. } else if (typeof bytes === 'string') {
  30931. bytes = Buffer.from(bytes, 'utf8');
  30932. }
  30933. return _crypto.default.createHash('md5').update(bytes).digest();
  30934. }
  30935. var _default = md5;
  30936. exports["default"] = _default;
  30937. /***/ }),
  30938. /***/ 2054:
  30939. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30940. "use strict";
  30941. Object.defineProperty(exports, "__esModule", ({
  30942. value: true
  30943. }));
  30944. exports["default"] = void 0;
  30945. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30946. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30947. var _default = {
  30948. randomUUID: _crypto.default.randomUUID
  30949. };
  30950. exports["default"] = _default;
  30951. /***/ }),
  30952. /***/ 5332:
  30953. /***/ ((__unused_webpack_module, exports) => {
  30954. "use strict";
  30955. Object.defineProperty(exports, "__esModule", ({
  30956. value: true
  30957. }));
  30958. exports["default"] = void 0;
  30959. var _default = '00000000-0000-0000-0000-000000000000';
  30960. exports["default"] = _default;
  30961. /***/ }),
  30962. /***/ 2746:
  30963. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30964. "use strict";
  30965. Object.defineProperty(exports, "__esModule", ({
  30966. value: true
  30967. }));
  30968. exports["default"] = void 0;
  30969. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30970. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30971. function parse(uuid) {
  30972. if (!(0, _validate.default)(uuid)) {
  30973. throw TypeError('Invalid UUID');
  30974. }
  30975. let v;
  30976. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  30977. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  30978. arr[1] = v >>> 16 & 0xff;
  30979. arr[2] = v >>> 8 & 0xff;
  30980. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  30981. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  30982. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  30983. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  30984. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  30985. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  30986. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  30987. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  30988. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  30989. arr[11] = v / 0x100000000 & 0xff;
  30990. arr[12] = v >>> 24 & 0xff;
  30991. arr[13] = v >>> 16 & 0xff;
  30992. arr[14] = v >>> 8 & 0xff;
  30993. arr[15] = v & 0xff;
  30994. return arr;
  30995. }
  30996. var _default = parse;
  30997. exports["default"] = _default;
  30998. /***/ }),
  30999. /***/ 814:
  31000. /***/ ((__unused_webpack_module, exports) => {
  31001. "use strict";
  31002. Object.defineProperty(exports, "__esModule", ({
  31003. value: true
  31004. }));
  31005. exports["default"] = void 0;
  31006. 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;
  31007. exports["default"] = _default;
  31008. /***/ }),
  31009. /***/ 807:
  31010. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31011. "use strict";
  31012. Object.defineProperty(exports, "__esModule", ({
  31013. value: true
  31014. }));
  31015. exports["default"] = rng;
  31016. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31017. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31018. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31019. let poolPtr = rnds8Pool.length;
  31020. function rng() {
  31021. if (poolPtr > rnds8Pool.length - 16) {
  31022. _crypto.default.randomFillSync(rnds8Pool);
  31023. poolPtr = 0;
  31024. }
  31025. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31026. }
  31027. /***/ }),
  31028. /***/ 5274:
  31029. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31030. "use strict";
  31031. Object.defineProperty(exports, "__esModule", ({
  31032. value: true
  31033. }));
  31034. exports["default"] = void 0;
  31035. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31036. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31037. function sha1(bytes) {
  31038. if (Array.isArray(bytes)) {
  31039. bytes = Buffer.from(bytes);
  31040. } else if (typeof bytes === 'string') {
  31041. bytes = Buffer.from(bytes, 'utf8');
  31042. }
  31043. return _crypto.default.createHash('sha1').update(bytes).digest();
  31044. }
  31045. var _default = sha1;
  31046. exports["default"] = _default;
  31047. /***/ }),
  31048. /***/ 8950:
  31049. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31050. "use strict";
  31051. Object.defineProperty(exports, "__esModule", ({
  31052. value: true
  31053. }));
  31054. exports["default"] = void 0;
  31055. exports.unsafeStringify = unsafeStringify;
  31056. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31057. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31058. /**
  31059. * Convert array of 16 byte values to UUID string format of the form:
  31060. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31061. */
  31062. const byteToHex = [];
  31063. for (let i = 0; i < 256; ++i) {
  31064. byteToHex.push((i + 0x100).toString(16).slice(1));
  31065. }
  31066. function unsafeStringify(arr, offset = 0) {
  31067. // Note: Be careful editing this code! It's been tuned for performance
  31068. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31069. 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]];
  31070. }
  31071. function stringify(arr, offset = 0) {
  31072. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31073. // of the following:
  31074. // - One or more input array values don't map to a hex octet (leading to
  31075. // "undefined" in the uuid)
  31076. // - Invalid input values for the RFC `version` or `variant` fields
  31077. if (!(0, _validate.default)(uuid)) {
  31078. throw TypeError('Stringified UUID is invalid');
  31079. }
  31080. return uuid;
  31081. }
  31082. var _default = stringify;
  31083. exports["default"] = _default;
  31084. /***/ }),
  31085. /***/ 8628:
  31086. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31087. "use strict";
  31088. Object.defineProperty(exports, "__esModule", ({
  31089. value: true
  31090. }));
  31091. exports["default"] = void 0;
  31092. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31093. var _stringify = __nccwpck_require__(8950);
  31094. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31095. // **`v1()` - Generate time-based UUID**
  31096. //
  31097. // Inspired by https://github.com/LiosK/UUID.js
  31098. // and http://docs.python.org/library/uuid.html
  31099. let _nodeId;
  31100. let _clockseq; // Previous uuid creation time
  31101. let _lastMSecs = 0;
  31102. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31103. function v1(options, buf, offset) {
  31104. let i = buf && offset || 0;
  31105. const b = buf || new Array(16);
  31106. options = options || {};
  31107. let node = options.node || _nodeId;
  31108. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31109. // specified. We do this lazily to minimize issues related to insufficient
  31110. // system entropy. See #189
  31111. if (node == null || clockseq == null) {
  31112. const seedBytes = options.random || (options.rng || _rng.default)();
  31113. if (node == null) {
  31114. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31115. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31116. }
  31117. if (clockseq == null) {
  31118. // Per 4.2.2, randomize (14 bit) clockseq
  31119. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31120. }
  31121. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31122. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31123. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31124. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31125. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31126. // cycle to simulate higher resolution clock
  31127. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31128. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31129. if (dt < 0 && options.clockseq === undefined) {
  31130. clockseq = clockseq + 1 & 0x3fff;
  31131. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31132. // time interval
  31133. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31134. nsecs = 0;
  31135. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31136. if (nsecs >= 10000) {
  31137. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31138. }
  31139. _lastMSecs = msecs;
  31140. _lastNSecs = nsecs;
  31141. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31142. msecs += 12219292800000; // `time_low`
  31143. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31144. b[i++] = tl >>> 24 & 0xff;
  31145. b[i++] = tl >>> 16 & 0xff;
  31146. b[i++] = tl >>> 8 & 0xff;
  31147. b[i++] = tl & 0xff; // `time_mid`
  31148. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31149. b[i++] = tmh >>> 8 & 0xff;
  31150. b[i++] = tmh & 0xff; // `time_high_and_version`
  31151. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31152. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31153. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31154. b[i++] = clockseq & 0xff; // `node`
  31155. for (let n = 0; n < 6; ++n) {
  31156. b[i + n] = node[n];
  31157. }
  31158. return buf || (0, _stringify.unsafeStringify)(b);
  31159. }
  31160. var _default = v1;
  31161. exports["default"] = _default;
  31162. /***/ }),
  31163. /***/ 6409:
  31164. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31165. "use strict";
  31166. Object.defineProperty(exports, "__esModule", ({
  31167. value: true
  31168. }));
  31169. exports["default"] = void 0;
  31170. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31171. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31172. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31173. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31174. var _default = v3;
  31175. exports["default"] = _default;
  31176. /***/ }),
  31177. /***/ 5998:
  31178. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31179. "use strict";
  31180. Object.defineProperty(exports, "__esModule", ({
  31181. value: true
  31182. }));
  31183. exports.URL = exports.DNS = void 0;
  31184. exports["default"] = v35;
  31185. var _stringify = __nccwpck_require__(8950);
  31186. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31187. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31188. function stringToBytes(str) {
  31189. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31190. const bytes = [];
  31191. for (let i = 0; i < str.length; ++i) {
  31192. bytes.push(str.charCodeAt(i));
  31193. }
  31194. return bytes;
  31195. }
  31196. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31197. exports.DNS = DNS;
  31198. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31199. exports.URL = URL;
  31200. function v35(name, version, hashfunc) {
  31201. function generateUUID(value, namespace, buf, offset) {
  31202. var _namespace;
  31203. if (typeof value === 'string') {
  31204. value = stringToBytes(value);
  31205. }
  31206. if (typeof namespace === 'string') {
  31207. namespace = (0, _parse.default)(namespace);
  31208. }
  31209. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31210. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31211. } // Compute hash of namespace and value, Per 4.3
  31212. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31213. // hashfunc([...namespace, ... value])`
  31214. let bytes = new Uint8Array(16 + value.length);
  31215. bytes.set(namespace);
  31216. bytes.set(value, namespace.length);
  31217. bytes = hashfunc(bytes);
  31218. bytes[6] = bytes[6] & 0x0f | version;
  31219. bytes[8] = bytes[8] & 0x3f | 0x80;
  31220. if (buf) {
  31221. offset = offset || 0;
  31222. for (let i = 0; i < 16; ++i) {
  31223. buf[offset + i] = bytes[i];
  31224. }
  31225. return buf;
  31226. }
  31227. return (0, _stringify.unsafeStringify)(bytes);
  31228. } // Function#name is not settable on some platforms (#270)
  31229. try {
  31230. generateUUID.name = name; // eslint-disable-next-line no-empty
  31231. } catch (err) {} // For CommonJS default export support
  31232. generateUUID.DNS = DNS;
  31233. generateUUID.URL = URL;
  31234. return generateUUID;
  31235. }
  31236. /***/ }),
  31237. /***/ 5122:
  31238. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31239. "use strict";
  31240. Object.defineProperty(exports, "__esModule", ({
  31241. value: true
  31242. }));
  31243. exports["default"] = void 0;
  31244. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31245. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31246. var _stringify = __nccwpck_require__(8950);
  31247. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31248. function v4(options, buf, offset) {
  31249. if (_native.default.randomUUID && !buf && !options) {
  31250. return _native.default.randomUUID();
  31251. }
  31252. options = options || {};
  31253. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31254. rnds[6] = rnds[6] & 0x0f | 0x40;
  31255. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31256. if (buf) {
  31257. offset = offset || 0;
  31258. for (let i = 0; i < 16; ++i) {
  31259. buf[offset + i] = rnds[i];
  31260. }
  31261. return buf;
  31262. }
  31263. return (0, _stringify.unsafeStringify)(rnds);
  31264. }
  31265. var _default = v4;
  31266. exports["default"] = _default;
  31267. /***/ }),
  31268. /***/ 9120:
  31269. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31270. "use strict";
  31271. Object.defineProperty(exports, "__esModule", ({
  31272. value: true
  31273. }));
  31274. exports["default"] = void 0;
  31275. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31276. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31277. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31278. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31279. var _default = v5;
  31280. exports["default"] = _default;
  31281. /***/ }),
  31282. /***/ 6900:
  31283. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31284. "use strict";
  31285. Object.defineProperty(exports, "__esModule", ({
  31286. value: true
  31287. }));
  31288. exports["default"] = void 0;
  31289. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31290. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31291. function validate(uuid) {
  31292. return typeof uuid === 'string' && _regex.default.test(uuid);
  31293. }
  31294. var _default = validate;
  31295. exports["default"] = _default;
  31296. /***/ }),
  31297. /***/ 2414:
  31298. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31299. "use strict";
  31300. Object.defineProperty(exports, "__esModule", ({
  31301. value: true
  31302. }));
  31303. exports["default"] = void 0;
  31304. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31305. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31306. function version(uuid) {
  31307. if (!(0, _validate.default)(uuid)) {
  31308. throw TypeError('Invalid UUID');
  31309. }
  31310. return parseInt(uuid.slice(14, 15), 16);
  31311. }
  31312. var _default = version;
  31313. exports["default"] = _default;
  31314. /***/ }),
  31315. /***/ 2940:
  31316. /***/ ((module) => {
  31317. // Returns a wrapper function that returns a wrapped callback
  31318. // The wrapper function should do some stuff, and return a
  31319. // presumably different callback function.
  31320. // This makes sure that own properties are retained, so that
  31321. // decorations and such are not lost along the way.
  31322. module.exports = wrappy
  31323. function wrappy (fn, cb) {
  31324. if (fn && cb) return wrappy(fn)(cb)
  31325. if (typeof fn !== 'function')
  31326. throw new TypeError('need wrapper function')
  31327. Object.keys(fn).forEach(function (k) {
  31328. wrapper[k] = fn[k]
  31329. })
  31330. return wrapper
  31331. function wrapper() {
  31332. var args = new Array(arguments.length)
  31333. for (var i = 0; i < args.length; i++) {
  31334. args[i] = arguments[i]
  31335. }
  31336. var ret = fn.apply(this, args)
  31337. var cb = args[args.length-1]
  31338. if (typeof ret === 'function' && ret !== cb) {
  31339. Object.keys(cb).forEach(function (k) {
  31340. ret[k] = cb[k]
  31341. })
  31342. }
  31343. return ret
  31344. }
  31345. }
  31346. /***/ }),
  31347. /***/ 9491:
  31348. /***/ ((module) => {
  31349. "use strict";
  31350. module.exports = require("assert");
  31351. /***/ }),
  31352. /***/ 852:
  31353. /***/ ((module) => {
  31354. "use strict";
  31355. module.exports = require("async_hooks");
  31356. /***/ }),
  31357. /***/ 4300:
  31358. /***/ ((module) => {
  31359. "use strict";
  31360. module.exports = require("buffer");
  31361. /***/ }),
  31362. /***/ 2081:
  31363. /***/ ((module) => {
  31364. "use strict";
  31365. module.exports = require("child_process");
  31366. /***/ }),
  31367. /***/ 6206:
  31368. /***/ ((module) => {
  31369. "use strict";
  31370. module.exports = require("console");
  31371. /***/ }),
  31372. /***/ 6113:
  31373. /***/ ((module) => {
  31374. "use strict";
  31375. module.exports = require("crypto");
  31376. /***/ }),
  31377. /***/ 7643:
  31378. /***/ ((module) => {
  31379. "use strict";
  31380. module.exports = require("diagnostics_channel");
  31381. /***/ }),
  31382. /***/ 2361:
  31383. /***/ ((module) => {
  31384. "use strict";
  31385. module.exports = require("events");
  31386. /***/ }),
  31387. /***/ 7147:
  31388. /***/ ((module) => {
  31389. "use strict";
  31390. module.exports = require("fs");
  31391. /***/ }),
  31392. /***/ 3685:
  31393. /***/ ((module) => {
  31394. "use strict";
  31395. module.exports = require("http");
  31396. /***/ }),
  31397. /***/ 5158:
  31398. /***/ ((module) => {
  31399. "use strict";
  31400. module.exports = require("http2");
  31401. /***/ }),
  31402. /***/ 5687:
  31403. /***/ ((module) => {
  31404. "use strict";
  31405. module.exports = require("https");
  31406. /***/ }),
  31407. /***/ 1808:
  31408. /***/ ((module) => {
  31409. "use strict";
  31410. module.exports = require("net");
  31411. /***/ }),
  31412. /***/ 5673:
  31413. /***/ ((module) => {
  31414. "use strict";
  31415. module.exports = require("node:events");
  31416. /***/ }),
  31417. /***/ 4492:
  31418. /***/ ((module) => {
  31419. "use strict";
  31420. module.exports = require("node:stream");
  31421. /***/ }),
  31422. /***/ 7261:
  31423. /***/ ((module) => {
  31424. "use strict";
  31425. module.exports = require("node:util");
  31426. /***/ }),
  31427. /***/ 2037:
  31428. /***/ ((module) => {
  31429. "use strict";
  31430. module.exports = require("os");
  31431. /***/ }),
  31432. /***/ 1017:
  31433. /***/ ((module) => {
  31434. "use strict";
  31435. module.exports = require("path");
  31436. /***/ }),
  31437. /***/ 4074:
  31438. /***/ ((module) => {
  31439. "use strict";
  31440. module.exports = require("perf_hooks");
  31441. /***/ }),
  31442. /***/ 3477:
  31443. /***/ ((module) => {
  31444. "use strict";
  31445. module.exports = require("querystring");
  31446. /***/ }),
  31447. /***/ 2781:
  31448. /***/ ((module) => {
  31449. "use strict";
  31450. module.exports = require("stream");
  31451. /***/ }),
  31452. /***/ 5356:
  31453. /***/ ((module) => {
  31454. "use strict";
  31455. module.exports = require("stream/web");
  31456. /***/ }),
  31457. /***/ 1576:
  31458. /***/ ((module) => {
  31459. "use strict";
  31460. module.exports = require("string_decoder");
  31461. /***/ }),
  31462. /***/ 9512:
  31463. /***/ ((module) => {
  31464. "use strict";
  31465. module.exports = require("timers");
  31466. /***/ }),
  31467. /***/ 4404:
  31468. /***/ ((module) => {
  31469. "use strict";
  31470. module.exports = require("tls");
  31471. /***/ }),
  31472. /***/ 7310:
  31473. /***/ ((module) => {
  31474. "use strict";
  31475. module.exports = require("url");
  31476. /***/ }),
  31477. /***/ 3837:
  31478. /***/ ((module) => {
  31479. "use strict";
  31480. module.exports = require("util");
  31481. /***/ }),
  31482. /***/ 9830:
  31483. /***/ ((module) => {
  31484. "use strict";
  31485. module.exports = require("util/types");
  31486. /***/ }),
  31487. /***/ 1267:
  31488. /***/ ((module) => {
  31489. "use strict";
  31490. module.exports = require("worker_threads");
  31491. /***/ }),
  31492. /***/ 9796:
  31493. /***/ ((module) => {
  31494. "use strict";
  31495. module.exports = require("zlib");
  31496. /***/ }),
  31497. /***/ 2960:
  31498. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31499. "use strict";
  31500. const WritableStream = (__nccwpck_require__(4492).Writable)
  31501. const inherits = (__nccwpck_require__(7261).inherits)
  31502. const StreamSearch = __nccwpck_require__(1142)
  31503. const PartStream = __nccwpck_require__(1620)
  31504. const HeaderParser = __nccwpck_require__(2032)
  31505. const DASH = 45
  31506. const B_ONEDASH = Buffer.from('-')
  31507. const B_CRLF = Buffer.from('\r\n')
  31508. const EMPTY_FN = function () {}
  31509. function Dicer (cfg) {
  31510. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31511. WritableStream.call(this, cfg)
  31512. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31513. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31514. this._headerFirst = cfg.headerFirst
  31515. this._dashes = 0
  31516. this._parts = 0
  31517. this._finished = false
  31518. this._realFinish = false
  31519. this._isPreamble = true
  31520. this._justMatched = false
  31521. this._firstWrite = true
  31522. this._inHeader = true
  31523. this._part = undefined
  31524. this._cb = undefined
  31525. this._ignoreData = false
  31526. this._partOpts = { highWaterMark: cfg.partHwm }
  31527. this._pause = false
  31528. const self = this
  31529. this._hparser = new HeaderParser(cfg)
  31530. this._hparser.on('header', function (header) {
  31531. self._inHeader = false
  31532. self._part.emit('header', header)
  31533. })
  31534. }
  31535. inherits(Dicer, WritableStream)
  31536. Dicer.prototype.emit = function (ev) {
  31537. if (ev === 'finish' && !this._realFinish) {
  31538. if (!this._finished) {
  31539. const self = this
  31540. process.nextTick(function () {
  31541. self.emit('error', new Error('Unexpected end of multipart data'))
  31542. if (self._part && !self._ignoreData) {
  31543. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31544. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31545. self._part.push(null)
  31546. process.nextTick(function () {
  31547. self._realFinish = true
  31548. self.emit('finish')
  31549. self._realFinish = false
  31550. })
  31551. return
  31552. }
  31553. self._realFinish = true
  31554. self.emit('finish')
  31555. self._realFinish = false
  31556. })
  31557. }
  31558. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31559. }
  31560. Dicer.prototype._write = function (data, encoding, cb) {
  31561. // ignore unexpected data (e.g. extra trailer data after finished)
  31562. if (!this._hparser && !this._bparser) { return cb() }
  31563. if (this._headerFirst && this._isPreamble) {
  31564. if (!this._part) {
  31565. this._part = new PartStream(this._partOpts)
  31566. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31567. }
  31568. const r = this._hparser.push(data)
  31569. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31570. }
  31571. // allows for "easier" testing
  31572. if (this._firstWrite) {
  31573. this._bparser.push(B_CRLF)
  31574. this._firstWrite = false
  31575. }
  31576. this._bparser.push(data)
  31577. if (this._pause) { this._cb = cb } else { cb() }
  31578. }
  31579. Dicer.prototype.reset = function () {
  31580. this._part = undefined
  31581. this._bparser = undefined
  31582. this._hparser = undefined
  31583. }
  31584. Dicer.prototype.setBoundary = function (boundary) {
  31585. const self = this
  31586. this._bparser = new StreamSearch('\r\n--' + boundary)
  31587. this._bparser.on('info', function (isMatch, data, start, end) {
  31588. self._oninfo(isMatch, data, start, end)
  31589. })
  31590. }
  31591. Dicer.prototype._ignore = function () {
  31592. if (this._part && !this._ignoreData) {
  31593. this._ignoreData = true
  31594. this._part.on('error', EMPTY_FN)
  31595. // we must perform some kind of read on the stream even though we are
  31596. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31597. // after pushing null to the stream
  31598. this._part.resume()
  31599. }
  31600. }
  31601. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31602. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31603. if (!this._part && this._justMatched && data) {
  31604. while (this._dashes < 2 && (start + i) < end) {
  31605. if (data[start + i] === DASH) {
  31606. ++i
  31607. ++this._dashes
  31608. } else {
  31609. if (this._dashes) { buf = B_ONEDASH }
  31610. this._dashes = 0
  31611. break
  31612. }
  31613. }
  31614. if (this._dashes === 2) {
  31615. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31616. this.reset()
  31617. this._finished = true
  31618. // no more parts will be added
  31619. if (self._parts === 0) {
  31620. self._realFinish = true
  31621. self.emit('finish')
  31622. self._realFinish = false
  31623. }
  31624. }
  31625. if (this._dashes) { return }
  31626. }
  31627. if (this._justMatched) { this._justMatched = false }
  31628. if (!this._part) {
  31629. this._part = new PartStream(this._partOpts)
  31630. this._part._read = function (n) {
  31631. self._unpause()
  31632. }
  31633. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31634. this.emit('preamble', this._part)
  31635. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31636. this.emit('part', this._part)
  31637. } else {
  31638. this._ignore()
  31639. }
  31640. if (!this._isPreamble) { this._inHeader = true }
  31641. }
  31642. if (data && start < end && !this._ignoreData) {
  31643. if (this._isPreamble || !this._inHeader) {
  31644. if (buf) { shouldWriteMore = this._part.push(buf) }
  31645. shouldWriteMore = this._part.push(data.slice(start, end))
  31646. if (!shouldWriteMore) { this._pause = true }
  31647. } else if (!this._isPreamble && this._inHeader) {
  31648. if (buf) { this._hparser.push(buf) }
  31649. r = this._hparser.push(data.slice(start, end))
  31650. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31651. }
  31652. }
  31653. if (isMatch) {
  31654. this._hparser.reset()
  31655. if (this._isPreamble) { this._isPreamble = false } else {
  31656. if (start !== end) {
  31657. ++this._parts
  31658. this._part.on('end', function () {
  31659. if (--self._parts === 0) {
  31660. if (self._finished) {
  31661. self._realFinish = true
  31662. self.emit('finish')
  31663. self._realFinish = false
  31664. } else {
  31665. self._unpause()
  31666. }
  31667. }
  31668. })
  31669. }
  31670. }
  31671. this._part.push(null)
  31672. this._part = undefined
  31673. this._ignoreData = false
  31674. this._justMatched = true
  31675. this._dashes = 0
  31676. }
  31677. }
  31678. Dicer.prototype._unpause = function () {
  31679. if (!this._pause) { return }
  31680. this._pause = false
  31681. if (this._cb) {
  31682. const cb = this._cb
  31683. this._cb = undefined
  31684. cb()
  31685. }
  31686. }
  31687. module.exports = Dicer
  31688. /***/ }),
  31689. /***/ 2032:
  31690. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31691. "use strict";
  31692. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31693. const inherits = (__nccwpck_require__(7261).inherits)
  31694. const getLimit = __nccwpck_require__(1467)
  31695. const StreamSearch = __nccwpck_require__(1142)
  31696. const B_DCRLF = Buffer.from('\r\n\r\n')
  31697. const RE_CRLF = /\r\n/g
  31698. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31699. function HeaderParser (cfg) {
  31700. EventEmitter.call(this)
  31701. cfg = cfg || {}
  31702. const self = this
  31703. this.nread = 0
  31704. this.maxed = false
  31705. this.npairs = 0
  31706. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  31707. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  31708. this.buffer = ''
  31709. this.header = {}
  31710. this.finished = false
  31711. this.ss = new StreamSearch(B_DCRLF)
  31712. this.ss.on('info', function (isMatch, data, start, end) {
  31713. if (data && !self.maxed) {
  31714. if (self.nread + end - start >= self.maxHeaderSize) {
  31715. end = self.maxHeaderSize - self.nread + start
  31716. self.nread = self.maxHeaderSize
  31717. self.maxed = true
  31718. } else { self.nread += (end - start) }
  31719. self.buffer += data.toString('binary', start, end)
  31720. }
  31721. if (isMatch) { self._finish() }
  31722. })
  31723. }
  31724. inherits(HeaderParser, EventEmitter)
  31725. HeaderParser.prototype.push = function (data) {
  31726. const r = this.ss.push(data)
  31727. if (this.finished) { return r }
  31728. }
  31729. HeaderParser.prototype.reset = function () {
  31730. this.finished = false
  31731. this.buffer = ''
  31732. this.header = {}
  31733. this.ss.reset()
  31734. }
  31735. HeaderParser.prototype._finish = function () {
  31736. if (this.buffer) { this._parseHeader() }
  31737. this.ss.matches = this.ss.maxMatches
  31738. const header = this.header
  31739. this.header = {}
  31740. this.buffer = ''
  31741. this.finished = true
  31742. this.nread = this.npairs = 0
  31743. this.maxed = false
  31744. this.emit('header', header)
  31745. }
  31746. HeaderParser.prototype._parseHeader = function () {
  31747. if (this.npairs === this.maxHeaderPairs) { return }
  31748. const lines = this.buffer.split(RE_CRLF)
  31749. const len = lines.length
  31750. let m, h
  31751. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31752. if (lines[i].length === 0) { continue }
  31753. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  31754. // folded header content
  31755. // RFC2822 says to just remove the CRLF and not the whitespace following
  31756. // it, so we follow the RFC and include the leading whitespace ...
  31757. if (h) {
  31758. this.header[h][this.header[h].length - 1] += lines[i]
  31759. continue
  31760. }
  31761. }
  31762. const posColon = lines[i].indexOf(':')
  31763. if (
  31764. posColon === -1 ||
  31765. posColon === 0
  31766. ) {
  31767. return
  31768. }
  31769. m = RE_HDR.exec(lines[i])
  31770. h = m[1].toLowerCase()
  31771. this.header[h] = this.header[h] || []
  31772. this.header[h].push((m[2] || ''))
  31773. if (++this.npairs === this.maxHeaderPairs) { break }
  31774. }
  31775. }
  31776. module.exports = HeaderParser
  31777. /***/ }),
  31778. /***/ 1620:
  31779. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31780. "use strict";
  31781. const inherits = (__nccwpck_require__(7261).inherits)
  31782. const ReadableStream = (__nccwpck_require__(4492).Readable)
  31783. function PartStream (opts) {
  31784. ReadableStream.call(this, opts)
  31785. }
  31786. inherits(PartStream, ReadableStream)
  31787. PartStream.prototype._read = function (n) {}
  31788. module.exports = PartStream
  31789. /***/ }),
  31790. /***/ 1142:
  31791. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31792. "use strict";
  31793. /**
  31794. * Copyright Brian White. All rights reserved.
  31795. *
  31796. * @see https://github.com/mscdex/streamsearch
  31797. *
  31798. * Permission is hereby granted, free of charge, to any person obtaining a copy
  31799. * of this software and associated documentation files (the "Software"), to
  31800. * deal in the Software without restriction, including without limitation the
  31801. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  31802. * sell copies of the Software, and to permit persons to whom the Software is
  31803. * furnished to do so, subject to the following conditions:
  31804. *
  31805. * The above copyright notice and this permission notice shall be included in
  31806. * all copies or substantial portions of the Software.
  31807. *
  31808. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  31809. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  31810. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  31811. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  31812. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  31813. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  31814. * IN THE SOFTWARE.
  31815. *
  31816. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  31817. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  31818. */
  31819. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31820. const inherits = (__nccwpck_require__(7261).inherits)
  31821. function SBMH (needle) {
  31822. if (typeof needle === 'string') {
  31823. needle = Buffer.from(needle)
  31824. }
  31825. if (!Buffer.isBuffer(needle)) {
  31826. throw new TypeError('The needle has to be a String or a Buffer.')
  31827. }
  31828. const needleLength = needle.length
  31829. if (needleLength === 0) {
  31830. throw new Error('The needle cannot be an empty String/Buffer.')
  31831. }
  31832. if (needleLength > 256) {
  31833. throw new Error('The needle cannot have a length bigger than 256.')
  31834. }
  31835. this.maxMatches = Infinity
  31836. this.matches = 0
  31837. this._occ = new Array(256)
  31838. .fill(needleLength) // Initialize occurrence table.
  31839. this._lookbehind_size = 0
  31840. this._needle = needle
  31841. this._bufpos = 0
  31842. this._lookbehind = Buffer.alloc(needleLength)
  31843. // Populate occurrence table with analysis of the needle,
  31844. // ignoring last letter.
  31845. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  31846. this._occ[needle[i]] = needleLength - 1 - i
  31847. }
  31848. }
  31849. inherits(SBMH, EventEmitter)
  31850. SBMH.prototype.reset = function () {
  31851. this._lookbehind_size = 0
  31852. this.matches = 0
  31853. this._bufpos = 0
  31854. }
  31855. SBMH.prototype.push = function (chunk, pos) {
  31856. if (!Buffer.isBuffer(chunk)) {
  31857. chunk = Buffer.from(chunk, 'binary')
  31858. }
  31859. const chlen = chunk.length
  31860. this._bufpos = pos || 0
  31861. let r
  31862. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  31863. return r
  31864. }
  31865. SBMH.prototype._sbmh_feed = function (data) {
  31866. const len = data.length
  31867. const needle = this._needle
  31868. const needleLength = needle.length
  31869. const lastNeedleChar = needle[needleLength - 1]
  31870. // Positive: points to a position in `data`
  31871. // pos == 3 points to data[3]
  31872. // Negative: points to a position in the lookbehind buffer
  31873. // pos == -2 points to lookbehind[lookbehind_size - 2]
  31874. let pos = -this._lookbehind_size
  31875. let ch
  31876. if (pos < 0) {
  31877. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  31878. // search with character lookup code that considers both the
  31879. // lookbehind buffer and the current round's haystack data.
  31880. //
  31881. // Loop until
  31882. // there is a match.
  31883. // or until
  31884. // we've moved past the position that requires the
  31885. // lookbehind buffer. In this case we switch to the
  31886. // optimized loop.
  31887. // or until
  31888. // the character to look at lies outside the haystack.
  31889. while (pos < 0 && pos <= len - needleLength) {
  31890. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  31891. if (
  31892. ch === lastNeedleChar &&
  31893. this._sbmh_memcmp(data, pos, needleLength - 1)
  31894. ) {
  31895. this._lookbehind_size = 0
  31896. ++this.matches
  31897. this.emit('info', true)
  31898. return (this._bufpos = pos + needleLength)
  31899. }
  31900. pos += this._occ[ch]
  31901. }
  31902. // No match.
  31903. if (pos < 0) {
  31904. // There's too few data for Boyer-Moore-Horspool to run,
  31905. // so let's use a different algorithm to skip as much as
  31906. // we can.
  31907. // Forward pos until
  31908. // the trailing part of lookbehind + data
  31909. // looks like the beginning of the needle
  31910. // or until
  31911. // pos == 0
  31912. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  31913. }
  31914. if (pos >= 0) {
  31915. // Discard lookbehind buffer.
  31916. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  31917. this._lookbehind_size = 0
  31918. } else {
  31919. // Cut off part of the lookbehind buffer that has
  31920. // been processed and append the entire haystack
  31921. // into it.
  31922. const bytesToCutOff = this._lookbehind_size + pos
  31923. if (bytesToCutOff > 0) {
  31924. // The cut off data is guaranteed not to contain the needle.
  31925. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  31926. }
  31927. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  31928. this._lookbehind_size - bytesToCutOff)
  31929. this._lookbehind_size -= bytesToCutOff
  31930. data.copy(this._lookbehind, this._lookbehind_size)
  31931. this._lookbehind_size += len
  31932. this._bufpos = len
  31933. return len
  31934. }
  31935. }
  31936. pos += (pos >= 0) * this._bufpos
  31937. // Lookbehind buffer is now empty. We only need to check if the
  31938. // needle is in the haystack.
  31939. if (data.indexOf(needle, pos) !== -1) {
  31940. pos = data.indexOf(needle, pos)
  31941. ++this.matches
  31942. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  31943. return (this._bufpos = pos + needleLength)
  31944. } else {
  31945. pos = len - needleLength
  31946. }
  31947. // There was no match. If there's trailing haystack data that we cannot
  31948. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  31949. // data is less than the needle size) then match using a modified
  31950. // algorithm that starts matching from the beginning instead of the end.
  31951. // Whatever trailing data is left after running this algorithm is added to
  31952. // the lookbehind buffer.
  31953. while (
  31954. pos < len &&
  31955. (
  31956. data[pos] !== needle[0] ||
  31957. (
  31958. (Buffer.compare(
  31959. data.subarray(pos, pos + len - pos),
  31960. needle.subarray(0, len - pos)
  31961. ) !== 0)
  31962. )
  31963. )
  31964. ) {
  31965. ++pos
  31966. }
  31967. if (pos < len) {
  31968. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  31969. this._lookbehind_size = len - pos
  31970. }
  31971. // Everything until pos is guaranteed not to contain needle data.
  31972. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  31973. this._bufpos = len
  31974. return len
  31975. }
  31976. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  31977. return (pos < 0)
  31978. ? this._lookbehind[this._lookbehind_size + pos]
  31979. : data[pos]
  31980. }
  31981. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  31982. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31983. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  31984. }
  31985. return true
  31986. }
  31987. module.exports = SBMH
  31988. /***/ }),
  31989. /***/ 727:
  31990. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31991. "use strict";
  31992. const WritableStream = (__nccwpck_require__(4492).Writable)
  31993. const { inherits } = __nccwpck_require__(7261)
  31994. const Dicer = __nccwpck_require__(2960)
  31995. const MultipartParser = __nccwpck_require__(2183)
  31996. const UrlencodedParser = __nccwpck_require__(8306)
  31997. const parseParams = __nccwpck_require__(1854)
  31998. function Busboy (opts) {
  31999. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32000. if (typeof opts !== 'object') {
  32001. throw new TypeError('Busboy expected an options-Object.')
  32002. }
  32003. if (typeof opts.headers !== 'object') {
  32004. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32005. }
  32006. if (typeof opts.headers['content-type'] !== 'string') {
  32007. throw new TypeError('Missing Content-Type-header.')
  32008. }
  32009. const {
  32010. headers,
  32011. ...streamOptions
  32012. } = opts
  32013. this.opts = {
  32014. autoDestroy: false,
  32015. ...streamOptions
  32016. }
  32017. WritableStream.call(this, this.opts)
  32018. this._done = false
  32019. this._parser = this.getParserByHeaders(headers)
  32020. this._finished = false
  32021. }
  32022. inherits(Busboy, WritableStream)
  32023. Busboy.prototype.emit = function (ev) {
  32024. if (ev === 'finish') {
  32025. if (!this._done) {
  32026. this._parser?.end()
  32027. return
  32028. } else if (this._finished) {
  32029. return
  32030. }
  32031. this._finished = true
  32032. }
  32033. WritableStream.prototype.emit.apply(this, arguments)
  32034. }
  32035. Busboy.prototype.getParserByHeaders = function (headers) {
  32036. const parsed = parseParams(headers['content-type'])
  32037. const cfg = {
  32038. defCharset: this.opts.defCharset,
  32039. fileHwm: this.opts.fileHwm,
  32040. headers,
  32041. highWaterMark: this.opts.highWaterMark,
  32042. isPartAFile: this.opts.isPartAFile,
  32043. limits: this.opts.limits,
  32044. parsedConType: parsed,
  32045. preservePath: this.opts.preservePath
  32046. }
  32047. if (MultipartParser.detect.test(parsed[0])) {
  32048. return new MultipartParser(this, cfg)
  32049. }
  32050. if (UrlencodedParser.detect.test(parsed[0])) {
  32051. return new UrlencodedParser(this, cfg)
  32052. }
  32053. throw new Error('Unsupported Content-Type.')
  32054. }
  32055. Busboy.prototype._write = function (chunk, encoding, cb) {
  32056. this._parser.write(chunk, cb)
  32057. }
  32058. module.exports = Busboy
  32059. module.exports["default"] = Busboy
  32060. module.exports.Busboy = Busboy
  32061. module.exports.Dicer = Dicer
  32062. /***/ }),
  32063. /***/ 2183:
  32064. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32065. "use strict";
  32066. // TODO:
  32067. // * support 1 nested multipart level
  32068. // (see second multipart example here:
  32069. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32070. // * support limits.fieldNameSize
  32071. // -- this will require modifications to utils.parseParams
  32072. const { Readable } = __nccwpck_require__(4492)
  32073. const { inherits } = __nccwpck_require__(7261)
  32074. const Dicer = __nccwpck_require__(2960)
  32075. const parseParams = __nccwpck_require__(1854)
  32076. const decodeText = __nccwpck_require__(4619)
  32077. const basename = __nccwpck_require__(8647)
  32078. const getLimit = __nccwpck_require__(1467)
  32079. const RE_BOUNDARY = /^boundary$/i
  32080. const RE_FIELD = /^form-data$/i
  32081. const RE_CHARSET = /^charset$/i
  32082. const RE_FILENAME = /^filename$/i
  32083. const RE_NAME = /^name$/i
  32084. Multipart.detect = /^multipart\/form-data/i
  32085. function Multipart (boy, cfg) {
  32086. let i
  32087. let len
  32088. const self = this
  32089. let boundary
  32090. const limits = cfg.limits
  32091. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32092. const parsedConType = cfg.parsedConType || []
  32093. const defCharset = cfg.defCharset || 'utf8'
  32094. const preservePath = cfg.preservePath
  32095. const fileOpts = { highWaterMark: cfg.fileHwm }
  32096. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32097. if (Array.isArray(parsedConType[i]) &&
  32098. RE_BOUNDARY.test(parsedConType[i][0])) {
  32099. boundary = parsedConType[i][1]
  32100. break
  32101. }
  32102. }
  32103. function checkFinished () {
  32104. if (nends === 0 && finished && !boy._done) {
  32105. finished = false
  32106. self.end()
  32107. }
  32108. }
  32109. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32110. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32111. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32112. const filesLimit = getLimit(limits, 'files', Infinity)
  32113. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32114. const partsLimit = getLimit(limits, 'parts', Infinity)
  32115. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32116. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32117. let nfiles = 0
  32118. let nfields = 0
  32119. let nends = 0
  32120. let curFile
  32121. let curField
  32122. let finished = false
  32123. this._needDrain = false
  32124. this._pause = false
  32125. this._cb = undefined
  32126. this._nparts = 0
  32127. this._boy = boy
  32128. const parserCfg = {
  32129. boundary,
  32130. maxHeaderPairs: headerPairsLimit,
  32131. maxHeaderSize: headerSizeLimit,
  32132. partHwm: fileOpts.highWaterMark,
  32133. highWaterMark: cfg.highWaterMark
  32134. }
  32135. this.parser = new Dicer(parserCfg)
  32136. this.parser.on('drain', function () {
  32137. self._needDrain = false
  32138. if (self._cb && !self._pause) {
  32139. const cb = self._cb
  32140. self._cb = undefined
  32141. cb()
  32142. }
  32143. }).on('part', function onPart (part) {
  32144. if (++self._nparts > partsLimit) {
  32145. self.parser.removeListener('part', onPart)
  32146. self.parser.on('part', skipPart)
  32147. boy.hitPartsLimit = true
  32148. boy.emit('partsLimit')
  32149. return skipPart(part)
  32150. }
  32151. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32152. // us emit 'end' early since we know the part has ended if we are already
  32153. // seeing the next part
  32154. if (curField) {
  32155. const field = curField
  32156. field.emit('end')
  32157. field.removeAllListeners('end')
  32158. }
  32159. part.on('header', function (header) {
  32160. let contype
  32161. let fieldname
  32162. let parsed
  32163. let charset
  32164. let encoding
  32165. let filename
  32166. let nsize = 0
  32167. if (header['content-type']) {
  32168. parsed = parseParams(header['content-type'][0])
  32169. if (parsed[0]) {
  32170. contype = parsed[0].toLowerCase()
  32171. for (i = 0, len = parsed.length; i < len; ++i) {
  32172. if (RE_CHARSET.test(parsed[i][0])) {
  32173. charset = parsed[i][1].toLowerCase()
  32174. break
  32175. }
  32176. }
  32177. }
  32178. }
  32179. if (contype === undefined) { contype = 'text/plain' }
  32180. if (charset === undefined) { charset = defCharset }
  32181. if (header['content-disposition']) {
  32182. parsed = parseParams(header['content-disposition'][0])
  32183. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32184. for (i = 0, len = parsed.length; i < len; ++i) {
  32185. if (RE_NAME.test(parsed[i][0])) {
  32186. fieldname = parsed[i][1]
  32187. } else if (RE_FILENAME.test(parsed[i][0])) {
  32188. filename = parsed[i][1]
  32189. if (!preservePath) { filename = basename(filename) }
  32190. }
  32191. }
  32192. } else { return skipPart(part) }
  32193. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32194. let onData,
  32195. onEnd
  32196. if (isPartAFile(fieldname, contype, filename)) {
  32197. // file/binary field
  32198. if (nfiles === filesLimit) {
  32199. if (!boy.hitFilesLimit) {
  32200. boy.hitFilesLimit = true
  32201. boy.emit('filesLimit')
  32202. }
  32203. return skipPart(part)
  32204. }
  32205. ++nfiles
  32206. if (boy.listenerCount('file') === 0) {
  32207. self.parser._ignore()
  32208. return
  32209. }
  32210. ++nends
  32211. const file = new FileStream(fileOpts)
  32212. curFile = file
  32213. file.on('end', function () {
  32214. --nends
  32215. self._pause = false
  32216. checkFinished()
  32217. if (self._cb && !self._needDrain) {
  32218. const cb = self._cb
  32219. self._cb = undefined
  32220. cb()
  32221. }
  32222. })
  32223. file._read = function (n) {
  32224. if (!self._pause) { return }
  32225. self._pause = false
  32226. if (self._cb && !self._needDrain) {
  32227. const cb = self._cb
  32228. self._cb = undefined
  32229. cb()
  32230. }
  32231. }
  32232. boy.emit('file', fieldname, file, filename, encoding, contype)
  32233. onData = function (data) {
  32234. if ((nsize += data.length) > fileSizeLimit) {
  32235. const extralen = fileSizeLimit - nsize + data.length
  32236. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32237. file.truncated = true
  32238. file.bytesRead = fileSizeLimit
  32239. part.removeAllListeners('data')
  32240. file.emit('limit')
  32241. return
  32242. } else if (!file.push(data)) { self._pause = true }
  32243. file.bytesRead = nsize
  32244. }
  32245. onEnd = function () {
  32246. curFile = undefined
  32247. file.push(null)
  32248. }
  32249. } else {
  32250. // non-file field
  32251. if (nfields === fieldsLimit) {
  32252. if (!boy.hitFieldsLimit) {
  32253. boy.hitFieldsLimit = true
  32254. boy.emit('fieldsLimit')
  32255. }
  32256. return skipPart(part)
  32257. }
  32258. ++nfields
  32259. ++nends
  32260. let buffer = ''
  32261. let truncated = false
  32262. curField = part
  32263. onData = function (data) {
  32264. if ((nsize += data.length) > fieldSizeLimit) {
  32265. const extralen = (fieldSizeLimit - (nsize - data.length))
  32266. buffer += data.toString('binary', 0, extralen)
  32267. truncated = true
  32268. part.removeAllListeners('data')
  32269. } else { buffer += data.toString('binary') }
  32270. }
  32271. onEnd = function () {
  32272. curField = undefined
  32273. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32274. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32275. --nends
  32276. checkFinished()
  32277. }
  32278. }
  32279. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32280. broken. Streams2/streams3 is a huge black box of confusion, but
  32281. somehow overriding the sync state seems to fix things again (and still
  32282. seems to work for previous node versions).
  32283. */
  32284. part._readableState.sync = false
  32285. part.on('data', onData)
  32286. part.on('end', onEnd)
  32287. }).on('error', function (err) {
  32288. if (curFile) { curFile.emit('error', err) }
  32289. })
  32290. }).on('error', function (err) {
  32291. boy.emit('error', err)
  32292. }).on('finish', function () {
  32293. finished = true
  32294. checkFinished()
  32295. })
  32296. }
  32297. Multipart.prototype.write = function (chunk, cb) {
  32298. const r = this.parser.write(chunk)
  32299. if (r && !this._pause) {
  32300. cb()
  32301. } else {
  32302. this._needDrain = !r
  32303. this._cb = cb
  32304. }
  32305. }
  32306. Multipart.prototype.end = function () {
  32307. const self = this
  32308. if (self.parser.writable) {
  32309. self.parser.end()
  32310. } else if (!self._boy._done) {
  32311. process.nextTick(function () {
  32312. self._boy._done = true
  32313. self._boy.emit('finish')
  32314. })
  32315. }
  32316. }
  32317. function skipPart (part) {
  32318. part.resume()
  32319. }
  32320. function FileStream (opts) {
  32321. Readable.call(this, opts)
  32322. this.bytesRead = 0
  32323. this.truncated = false
  32324. }
  32325. inherits(FileStream, Readable)
  32326. FileStream.prototype._read = function (n) {}
  32327. module.exports = Multipart
  32328. /***/ }),
  32329. /***/ 8306:
  32330. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32331. "use strict";
  32332. const Decoder = __nccwpck_require__(7100)
  32333. const decodeText = __nccwpck_require__(4619)
  32334. const getLimit = __nccwpck_require__(1467)
  32335. const RE_CHARSET = /^charset$/i
  32336. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32337. function UrlEncoded (boy, cfg) {
  32338. const limits = cfg.limits
  32339. const parsedConType = cfg.parsedConType
  32340. this.boy = boy
  32341. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32342. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32343. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32344. let charset
  32345. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32346. if (Array.isArray(parsedConType[i]) &&
  32347. RE_CHARSET.test(parsedConType[i][0])) {
  32348. charset = parsedConType[i][1].toLowerCase()
  32349. break
  32350. }
  32351. }
  32352. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32353. this.decoder = new Decoder()
  32354. this.charset = charset
  32355. this._fields = 0
  32356. this._state = 'key'
  32357. this._checkingBytes = true
  32358. this._bytesKey = 0
  32359. this._bytesVal = 0
  32360. this._key = ''
  32361. this._val = ''
  32362. this._keyTrunc = false
  32363. this._valTrunc = false
  32364. this._hitLimit = false
  32365. }
  32366. UrlEncoded.prototype.write = function (data, cb) {
  32367. if (this._fields === this.fieldsLimit) {
  32368. if (!this.boy.hitFieldsLimit) {
  32369. this.boy.hitFieldsLimit = true
  32370. this.boy.emit('fieldsLimit')
  32371. }
  32372. return cb()
  32373. }
  32374. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32375. while (p < len) {
  32376. if (this._state === 'key') {
  32377. idxeq = idxamp = undefined
  32378. for (i = p; i < len; ++i) {
  32379. if (!this._checkingBytes) { ++p }
  32380. if (data[i] === 0x3D/* = */) {
  32381. idxeq = i
  32382. break
  32383. } else if (data[i] === 0x26/* & */) {
  32384. idxamp = i
  32385. break
  32386. }
  32387. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32388. this._hitLimit = true
  32389. break
  32390. } else if (this._checkingBytes) { ++this._bytesKey }
  32391. }
  32392. if (idxeq !== undefined) {
  32393. // key with assignment
  32394. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32395. this._state = 'val'
  32396. this._hitLimit = false
  32397. this._checkingBytes = true
  32398. this._val = ''
  32399. this._bytesVal = 0
  32400. this._valTrunc = false
  32401. this.decoder.reset()
  32402. p = idxeq + 1
  32403. } else if (idxamp !== undefined) {
  32404. // key with no assignment
  32405. ++this._fields
  32406. let key; const keyTrunc = this._keyTrunc
  32407. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32408. this._hitLimit = false
  32409. this._checkingBytes = true
  32410. this._key = ''
  32411. this._bytesKey = 0
  32412. this._keyTrunc = false
  32413. this.decoder.reset()
  32414. if (key.length) {
  32415. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32416. '',
  32417. keyTrunc,
  32418. false)
  32419. }
  32420. p = idxamp + 1
  32421. if (this._fields === this.fieldsLimit) { return cb() }
  32422. } else if (this._hitLimit) {
  32423. // we may not have hit the actual limit if there are encoded bytes...
  32424. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32425. p = i
  32426. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32427. // yep, we actually did hit the limit
  32428. this._checkingBytes = false
  32429. this._keyTrunc = true
  32430. }
  32431. } else {
  32432. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32433. p = len
  32434. }
  32435. } else {
  32436. idxamp = undefined
  32437. for (i = p; i < len; ++i) {
  32438. if (!this._checkingBytes) { ++p }
  32439. if (data[i] === 0x26/* & */) {
  32440. idxamp = i
  32441. break
  32442. }
  32443. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32444. this._hitLimit = true
  32445. break
  32446. } else if (this._checkingBytes) { ++this._bytesVal }
  32447. }
  32448. if (idxamp !== undefined) {
  32449. ++this._fields
  32450. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32451. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32452. decodeText(this._val, 'binary', this.charset),
  32453. this._keyTrunc,
  32454. this._valTrunc)
  32455. this._state = 'key'
  32456. this._hitLimit = false
  32457. this._checkingBytes = true
  32458. this._key = ''
  32459. this._bytesKey = 0
  32460. this._keyTrunc = false
  32461. this.decoder.reset()
  32462. p = idxamp + 1
  32463. if (this._fields === this.fieldsLimit) { return cb() }
  32464. } else if (this._hitLimit) {
  32465. // we may not have hit the actual limit if there are encoded bytes...
  32466. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32467. p = i
  32468. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32469. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32470. // yep, we actually did hit the limit
  32471. this._checkingBytes = false
  32472. this._valTrunc = true
  32473. }
  32474. } else {
  32475. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32476. p = len
  32477. }
  32478. }
  32479. }
  32480. cb()
  32481. }
  32482. UrlEncoded.prototype.end = function () {
  32483. if (this.boy._done) { return }
  32484. if (this._state === 'key' && this._key.length > 0) {
  32485. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32486. '',
  32487. this._keyTrunc,
  32488. false)
  32489. } else if (this._state === 'val') {
  32490. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32491. decodeText(this._val, 'binary', this.charset),
  32492. this._keyTrunc,
  32493. this._valTrunc)
  32494. }
  32495. this.boy._done = true
  32496. this.boy.emit('finish')
  32497. }
  32498. module.exports = UrlEncoded
  32499. /***/ }),
  32500. /***/ 7100:
  32501. /***/ ((module) => {
  32502. "use strict";
  32503. const RE_PLUS = /\+/g
  32504. const HEX = [
  32505. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32506. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32507. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32508. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32509. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32510. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32511. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32512. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32513. ]
  32514. function Decoder () {
  32515. this.buffer = undefined
  32516. }
  32517. Decoder.prototype.write = function (str) {
  32518. // Replace '+' with ' ' before decoding
  32519. str = str.replace(RE_PLUS, ' ')
  32520. let res = ''
  32521. let i = 0; let p = 0; const len = str.length
  32522. for (; i < len; ++i) {
  32523. if (this.buffer !== undefined) {
  32524. if (!HEX[str.charCodeAt(i)]) {
  32525. res += '%' + this.buffer
  32526. this.buffer = undefined
  32527. --i // retry character
  32528. } else {
  32529. this.buffer += str[i]
  32530. ++p
  32531. if (this.buffer.length === 2) {
  32532. res += String.fromCharCode(parseInt(this.buffer, 16))
  32533. this.buffer = undefined
  32534. }
  32535. }
  32536. } else if (str[i] === '%') {
  32537. if (i > p) {
  32538. res += str.substring(p, i)
  32539. p = i
  32540. }
  32541. this.buffer = ''
  32542. ++p
  32543. }
  32544. }
  32545. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32546. return res
  32547. }
  32548. Decoder.prototype.reset = function () {
  32549. this.buffer = undefined
  32550. }
  32551. module.exports = Decoder
  32552. /***/ }),
  32553. /***/ 8647:
  32554. /***/ ((module) => {
  32555. "use strict";
  32556. module.exports = function basename (path) {
  32557. if (typeof path !== 'string') { return '' }
  32558. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32559. switch (path.charCodeAt(i)) {
  32560. case 0x2F: // '/'
  32561. case 0x5C: // '\'
  32562. path = path.slice(i + 1)
  32563. return (path === '..' || path === '.' ? '' : path)
  32564. }
  32565. }
  32566. return (path === '..' || path === '.' ? '' : path)
  32567. }
  32568. /***/ }),
  32569. /***/ 4619:
  32570. /***/ (function(module) {
  32571. "use strict";
  32572. // Node has always utf-8
  32573. const utf8Decoder = new TextDecoder('utf-8')
  32574. const textDecoders = new Map([
  32575. ['utf-8', utf8Decoder],
  32576. ['utf8', utf8Decoder]
  32577. ])
  32578. function getDecoder (charset) {
  32579. let lc
  32580. while (true) {
  32581. switch (charset) {
  32582. case 'utf-8':
  32583. case 'utf8':
  32584. return decoders.utf8
  32585. case 'latin1':
  32586. case 'ascii': // TODO: Make these a separate, strict decoder?
  32587. case 'us-ascii':
  32588. case 'iso-8859-1':
  32589. case 'iso8859-1':
  32590. case 'iso88591':
  32591. case 'iso_8859-1':
  32592. case 'windows-1252':
  32593. case 'iso_8859-1:1987':
  32594. case 'cp1252':
  32595. case 'x-cp1252':
  32596. return decoders.latin1
  32597. case 'utf16le':
  32598. case 'utf-16le':
  32599. case 'ucs2':
  32600. case 'ucs-2':
  32601. return decoders.utf16le
  32602. case 'base64':
  32603. return decoders.base64
  32604. default:
  32605. if (lc === undefined) {
  32606. lc = true
  32607. charset = charset.toLowerCase()
  32608. continue
  32609. }
  32610. return decoders.other.bind(charset)
  32611. }
  32612. }
  32613. }
  32614. const decoders = {
  32615. utf8: (data, sourceEncoding) => {
  32616. if (data.length === 0) {
  32617. return ''
  32618. }
  32619. if (typeof data === 'string') {
  32620. data = Buffer.from(data, sourceEncoding)
  32621. }
  32622. return data.utf8Slice(0, data.length)
  32623. },
  32624. latin1: (data, sourceEncoding) => {
  32625. if (data.length === 0) {
  32626. return ''
  32627. }
  32628. if (typeof data === 'string') {
  32629. return data
  32630. }
  32631. return data.latin1Slice(0, data.length)
  32632. },
  32633. utf16le: (data, sourceEncoding) => {
  32634. if (data.length === 0) {
  32635. return ''
  32636. }
  32637. if (typeof data === 'string') {
  32638. data = Buffer.from(data, sourceEncoding)
  32639. }
  32640. return data.ucs2Slice(0, data.length)
  32641. },
  32642. base64: (data, sourceEncoding) => {
  32643. if (data.length === 0) {
  32644. return ''
  32645. }
  32646. if (typeof data === 'string') {
  32647. data = Buffer.from(data, sourceEncoding)
  32648. }
  32649. return data.base64Slice(0, data.length)
  32650. },
  32651. other: (data, sourceEncoding) => {
  32652. if (data.length === 0) {
  32653. return ''
  32654. }
  32655. if (typeof data === 'string') {
  32656. data = Buffer.from(data, sourceEncoding)
  32657. }
  32658. if (textDecoders.has(this.toString())) {
  32659. try {
  32660. return textDecoders.get(this).decode(data)
  32661. } catch {}
  32662. }
  32663. return typeof data === 'string'
  32664. ? data
  32665. : data.toString()
  32666. }
  32667. }
  32668. function decodeText (text, sourceEncoding, destEncoding) {
  32669. if (text) {
  32670. return getDecoder(destEncoding)(text, sourceEncoding)
  32671. }
  32672. return text
  32673. }
  32674. module.exports = decodeText
  32675. /***/ }),
  32676. /***/ 1467:
  32677. /***/ ((module) => {
  32678. "use strict";
  32679. module.exports = function getLimit (limits, name, defaultLimit) {
  32680. if (
  32681. !limits ||
  32682. limits[name] === undefined ||
  32683. limits[name] === null
  32684. ) { return defaultLimit }
  32685. if (
  32686. typeof limits[name] !== 'number' ||
  32687. isNaN(limits[name])
  32688. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32689. return limits[name]
  32690. }
  32691. /***/ }),
  32692. /***/ 1854:
  32693. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32694. "use strict";
  32695. /* eslint-disable object-property-newline */
  32696. const decodeText = __nccwpck_require__(4619)
  32697. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32698. const EncodedLookup = {
  32699. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32700. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32701. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32702. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  32703. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  32704. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  32705. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  32706. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  32707. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  32708. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  32709. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  32710. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  32711. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  32712. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  32713. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  32714. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  32715. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  32716. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  32717. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  32718. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  32719. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  32720. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  32721. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  32722. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  32723. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  32724. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  32725. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  32726. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  32727. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  32728. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  32729. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  32730. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  32731. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  32732. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  32733. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  32734. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  32735. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  32736. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  32737. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  32738. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  32739. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  32740. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  32741. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  32742. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  32743. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  32744. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  32745. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  32746. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  32747. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  32748. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  32749. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  32750. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  32751. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  32752. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  32753. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  32754. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  32755. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  32756. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  32757. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  32758. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  32759. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  32760. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  32761. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  32762. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  32763. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  32764. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  32765. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  32766. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  32767. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  32768. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  32769. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  32770. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  32771. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  32772. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  32773. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  32774. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  32775. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  32776. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  32777. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  32778. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  32779. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  32780. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  32781. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  32782. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  32783. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  32784. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  32785. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  32786. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  32787. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  32788. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  32789. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  32790. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  32791. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  32792. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  32793. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  32794. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  32795. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  32796. }
  32797. function encodedReplacer (match) {
  32798. return EncodedLookup[match]
  32799. }
  32800. const STATE_KEY = 0
  32801. const STATE_VALUE = 1
  32802. const STATE_CHARSET = 2
  32803. const STATE_LANG = 3
  32804. function parseParams (str) {
  32805. const res = []
  32806. let state = STATE_KEY
  32807. let charset = ''
  32808. let inquote = false
  32809. let escaping = false
  32810. let p = 0
  32811. let tmp = ''
  32812. const len = str.length
  32813. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32814. const char = str[i]
  32815. if (char === '\\' && inquote) {
  32816. if (escaping) { escaping = false } else {
  32817. escaping = true
  32818. continue
  32819. }
  32820. } else if (char === '"') {
  32821. if (!escaping) {
  32822. if (inquote) {
  32823. inquote = false
  32824. state = STATE_KEY
  32825. } else { inquote = true }
  32826. continue
  32827. } else { escaping = false }
  32828. } else {
  32829. if (escaping && inquote) { tmp += '\\' }
  32830. escaping = false
  32831. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  32832. if (state === STATE_CHARSET) {
  32833. state = STATE_LANG
  32834. charset = tmp.substring(1)
  32835. } else { state = STATE_VALUE }
  32836. tmp = ''
  32837. continue
  32838. } else if (state === STATE_KEY &&
  32839. (char === '*' || char === '=') &&
  32840. res.length) {
  32841. state = char === '*'
  32842. ? STATE_CHARSET
  32843. : STATE_VALUE
  32844. res[p] = [tmp, undefined]
  32845. tmp = ''
  32846. continue
  32847. } else if (!inquote && char === ';') {
  32848. state = STATE_KEY
  32849. if (charset) {
  32850. if (tmp.length) {
  32851. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32852. 'binary',
  32853. charset)
  32854. }
  32855. charset = ''
  32856. } else if (tmp.length) {
  32857. tmp = decodeText(tmp, 'binary', 'utf8')
  32858. }
  32859. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  32860. tmp = ''
  32861. ++p
  32862. continue
  32863. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  32864. }
  32865. tmp += char
  32866. }
  32867. if (charset && tmp.length) {
  32868. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32869. 'binary',
  32870. charset)
  32871. } else if (tmp) {
  32872. tmp = decodeText(tmp, 'binary', 'utf8')
  32873. }
  32874. if (res[p] === undefined) {
  32875. if (tmp) { res[p] = tmp }
  32876. } else { res[p][1] = tmp }
  32877. return res
  32878. }
  32879. module.exports = parseParams
  32880. /***/ })
  32881. /******/ });
  32882. /************************************************************************/
  32883. /******/ // The module cache
  32884. /******/ var __webpack_module_cache__ = {};
  32885. /******/
  32886. /******/ // The require function
  32887. /******/ function __nccwpck_require__(moduleId) {
  32888. /******/ // Check if module is in cache
  32889. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  32890. /******/ if (cachedModule !== undefined) {
  32891. /******/ return cachedModule.exports;
  32892. /******/ }
  32893. /******/ // Create a new module (and put it into the cache)
  32894. /******/ var module = __webpack_module_cache__[moduleId] = {
  32895. /******/ // no module.id needed
  32896. /******/ // no module.loaded needed
  32897. /******/ exports: {}
  32898. /******/ };
  32899. /******/
  32900. /******/ // Execute the module function
  32901. /******/ var threw = true;
  32902. /******/ try {
  32903. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  32904. /******/ threw = false;
  32905. /******/ } finally {
  32906. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  32907. /******/ }
  32908. /******/
  32909. /******/ // Return the exports of the module
  32910. /******/ return module.exports;
  32911. /******/ }
  32912. /******/
  32913. /************************************************************************/
  32914. /******/ /* webpack/runtime/compat */
  32915. /******/
  32916. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  32917. /******/
  32918. /************************************************************************/
  32919. /******/
  32920. /******/ // startup
  32921. /******/ // Load entry module and return exports
  32922. /******/ // This entry module is referenced by other modules so it can't be inlined
  32923. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  32924. /******/ module.exports = __webpack_exports__;
  32925. /******/
  32926. /******/ })()
  32927. ;