index.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199
  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. const commitSHA = yield git.log1('--format=%H');
  1336. core.setOutput('commit', commitSHA.trim());
  1337. // Check for incorrect pull request merge commit
  1338. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1339. }
  1340. finally {
  1341. // Remove auth
  1342. if (authHelper) {
  1343. if (!settings.persistCredentials) {
  1344. core.startGroup('Removing auth');
  1345. yield authHelper.removeAuth();
  1346. core.endGroup();
  1347. }
  1348. authHelper.removeGlobalConfig();
  1349. }
  1350. }
  1351. });
  1352. }
  1353. exports.getSource = getSource;
  1354. function cleanup(repositoryPath) {
  1355. return __awaiter(this, void 0, void 0, function* () {
  1356. // Repo exists?
  1357. if (!repositoryPath ||
  1358. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1359. return;
  1360. }
  1361. let git;
  1362. try {
  1363. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1364. }
  1365. catch (_a) {
  1366. return;
  1367. }
  1368. // Remove auth
  1369. const authHelper = gitAuthHelper.createAuthHelper(git);
  1370. try {
  1371. if (stateHelper.PostSetSafeDirectory) {
  1372. // 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
  1373. // Otherwise all git commands we run in a container fail
  1374. yield authHelper.configureTempGlobalConfig();
  1375. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1376. yield git
  1377. .config('safe.directory', repositoryPath, true, true)
  1378. .catch(error => {
  1379. core.info(`Failed to initialize safe directory with error: ${error}`);
  1380. });
  1381. }
  1382. yield authHelper.removeAuth();
  1383. }
  1384. finally {
  1385. yield authHelper.removeGlobalConfig();
  1386. }
  1387. });
  1388. }
  1389. exports.cleanup = cleanup;
  1390. function getGitCommandManager(settings) {
  1391. return __awaiter(this, void 0, void 0, function* () {
  1392. core.info(`Working directory is '${settings.repositoryPath}'`);
  1393. try {
  1394. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1395. }
  1396. catch (err) {
  1397. // Git is required for LFS
  1398. if (settings.lfs) {
  1399. throw err;
  1400. }
  1401. // Otherwise fallback to REST API
  1402. return undefined;
  1403. }
  1404. });
  1405. }
  1406. /***/ }),
  1407. /***/ 3142:
  1408. /***/ ((__unused_webpack_module, exports) => {
  1409. "use strict";
  1410. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1411. exports.GitVersion = void 0;
  1412. class GitVersion {
  1413. /**
  1414. * Used for comparing the version of git and git-lfs against the minimum required version
  1415. * @param version the version string, e.g. 1.2 or 1.2.3
  1416. */
  1417. constructor(version) {
  1418. this.major = NaN;
  1419. this.minor = NaN;
  1420. this.patch = NaN;
  1421. if (version) {
  1422. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1423. if (match) {
  1424. this.major = Number(match[1]);
  1425. this.minor = Number(match[2]);
  1426. if (match[4]) {
  1427. this.patch = Number(match[4]);
  1428. }
  1429. }
  1430. }
  1431. }
  1432. /**
  1433. * Compares the instance against a minimum required version
  1434. * @param minimum Minimum version
  1435. */
  1436. checkMinimum(minimum) {
  1437. if (!minimum.isValid()) {
  1438. throw new Error('Arg minimum is not a valid version');
  1439. }
  1440. // Major is insufficient
  1441. if (this.major < minimum.major) {
  1442. return false;
  1443. }
  1444. // Major is equal
  1445. if (this.major === minimum.major) {
  1446. // Minor is insufficient
  1447. if (this.minor < minimum.minor) {
  1448. return false;
  1449. }
  1450. // Minor is equal
  1451. if (this.minor === minimum.minor) {
  1452. // Patch is insufficient
  1453. if (this.patch && this.patch < (minimum.patch || 0)) {
  1454. return false;
  1455. }
  1456. }
  1457. }
  1458. return true;
  1459. }
  1460. /**
  1461. * Indicates whether the instance was constructed from a valid version string
  1462. */
  1463. isValid() {
  1464. return !isNaN(this.major);
  1465. }
  1466. /**
  1467. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1468. */
  1469. toString() {
  1470. let result = '';
  1471. if (this.isValid()) {
  1472. result = `${this.major}.${this.minor}`;
  1473. if (!isNaN(this.patch)) {
  1474. result += `.${this.patch}`;
  1475. }
  1476. }
  1477. return result;
  1478. }
  1479. }
  1480. exports.GitVersion = GitVersion;
  1481. /***/ }),
  1482. /***/ 138:
  1483. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1484. "use strict";
  1485. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1486. if (k2 === undefined) k2 = k;
  1487. var desc = Object.getOwnPropertyDescriptor(m, k);
  1488. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1489. desc = { enumerable: true, get: function() { return m[k]; } };
  1490. }
  1491. Object.defineProperty(o, k2, desc);
  1492. }) : (function(o, m, k, k2) {
  1493. if (k2 === undefined) k2 = k;
  1494. o[k2] = m[k];
  1495. }));
  1496. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1497. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1498. }) : function(o, v) {
  1499. o["default"] = v;
  1500. });
  1501. var __importStar = (this && this.__importStar) || function (mod) {
  1502. if (mod && mod.__esModule) return mod;
  1503. var result = {};
  1504. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1505. __setModuleDefault(result, mod);
  1506. return result;
  1507. };
  1508. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1509. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1510. return new (P || (P = Promise))(function (resolve, reject) {
  1511. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1512. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1513. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1514. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1515. });
  1516. };
  1517. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1518. exports.getDefaultBranch = exports.downloadRepository = void 0;
  1519. const assert = __importStar(__nccwpck_require__(9491));
  1520. const core = __importStar(__nccwpck_require__(2186));
  1521. const fs = __importStar(__nccwpck_require__(7147));
  1522. const github = __importStar(__nccwpck_require__(5438));
  1523. const io = __importStar(__nccwpck_require__(7436));
  1524. const path = __importStar(__nccwpck_require__(1017));
  1525. const retryHelper = __importStar(__nccwpck_require__(2155));
  1526. const toolCache = __importStar(__nccwpck_require__(7784));
  1527. const uuid_1 = __nccwpck_require__(5840);
  1528. const url_helper_1 = __nccwpck_require__(9437);
  1529. const IS_WINDOWS = process.platform === 'win32';
  1530. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1531. return __awaiter(this, void 0, void 0, function* () {
  1532. // Determine the default branch
  1533. if (!ref && !commit) {
  1534. core.info('Determining the default branch');
  1535. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1536. }
  1537. // Download the archive
  1538. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1539. core.info('Downloading the archive');
  1540. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1541. }));
  1542. // Write archive to disk
  1543. core.info('Writing archive to disk');
  1544. const uniqueId = (0, uuid_1.v4)();
  1545. const archivePath = IS_WINDOWS
  1546. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1547. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1548. yield fs.promises.writeFile(archivePath, archiveData);
  1549. archiveData = Buffer.from(''); // Free memory
  1550. // Extract archive
  1551. core.info('Extracting the archive');
  1552. const extractPath = path.join(repositoryPath, uniqueId);
  1553. yield io.mkdirP(extractPath);
  1554. if (IS_WINDOWS) {
  1555. yield toolCache.extractZip(archivePath, extractPath);
  1556. }
  1557. else {
  1558. yield toolCache.extractTar(archivePath, extractPath);
  1559. }
  1560. yield io.rmRF(archivePath);
  1561. // Determine the path of the repository content. The archive contains
  1562. // a top-level folder and the repository content is inside.
  1563. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1564. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1565. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1566. core.info(`Resolved version ${archiveVersion}`);
  1567. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1568. // Move the files
  1569. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1570. const sourcePath = path.join(tempRepositoryPath, fileName);
  1571. const targetPath = path.join(repositoryPath, fileName);
  1572. if (IS_WINDOWS) {
  1573. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1574. }
  1575. else {
  1576. yield io.mv(sourcePath, targetPath);
  1577. }
  1578. }
  1579. yield io.rmRF(extractPath);
  1580. });
  1581. }
  1582. exports.downloadRepository = downloadRepository;
  1583. /**
  1584. * Looks up the default branch name
  1585. */
  1586. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1587. return __awaiter(this, void 0, void 0, function* () {
  1588. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1589. core.info('Retrieving the default branch name');
  1590. const octokit = github.getOctokit(authToken, {
  1591. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1592. });
  1593. let result;
  1594. try {
  1595. // Get the default branch from the repo info
  1596. const response = yield octokit.rest.repos.get({ owner, repo });
  1597. result = response.data.default_branch;
  1598. assert.ok(result, 'default_branch cannot be empty');
  1599. }
  1600. catch (err) {
  1601. // Handle .wiki repo
  1602. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1603. repo.toUpperCase().endsWith('.WIKI')) {
  1604. result = 'master';
  1605. }
  1606. // Otherwise error
  1607. else {
  1608. throw err;
  1609. }
  1610. }
  1611. // Print the default branch
  1612. core.info(`Default branch '${result}'`);
  1613. // Prefix with 'refs/heads'
  1614. if (!result.startsWith('refs/')) {
  1615. result = `refs/heads/${result}`;
  1616. }
  1617. return result;
  1618. }));
  1619. });
  1620. }
  1621. exports.getDefaultBranch = getDefaultBranch;
  1622. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1623. return __awaiter(this, void 0, void 0, function* () {
  1624. const octokit = github.getOctokit(authToken, {
  1625. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1626. });
  1627. const download = IS_WINDOWS
  1628. ? octokit.rest.repos.downloadZipballArchive
  1629. : octokit.rest.repos.downloadTarballArchive;
  1630. const response = yield download({
  1631. owner: owner,
  1632. repo: repo,
  1633. ref: commit || ref
  1634. });
  1635. return Buffer.from(response.data); // response.data is ArrayBuffer
  1636. });
  1637. }
  1638. /***/ }),
  1639. /***/ 5480:
  1640. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1641. "use strict";
  1642. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1643. if (k2 === undefined) k2 = k;
  1644. var desc = Object.getOwnPropertyDescriptor(m, k);
  1645. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1646. desc = { enumerable: true, get: function() { return m[k]; } };
  1647. }
  1648. Object.defineProperty(o, k2, desc);
  1649. }) : (function(o, m, k, k2) {
  1650. if (k2 === undefined) k2 = k;
  1651. o[k2] = m[k];
  1652. }));
  1653. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1654. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1655. }) : function(o, v) {
  1656. o["default"] = v;
  1657. });
  1658. var __importStar = (this && this.__importStar) || function (mod) {
  1659. if (mod && mod.__esModule) return mod;
  1660. var result = {};
  1661. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1662. __setModuleDefault(result, mod);
  1663. return result;
  1664. };
  1665. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1666. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1667. return new (P || (P = Promise))(function (resolve, reject) {
  1668. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1669. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1670. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1671. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1672. });
  1673. };
  1674. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1675. exports.getInputs = void 0;
  1676. const core = __importStar(__nccwpck_require__(2186));
  1677. const fsHelper = __importStar(__nccwpck_require__(7219));
  1678. const github = __importStar(__nccwpck_require__(5438));
  1679. const path = __importStar(__nccwpck_require__(1017));
  1680. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1681. function getInputs() {
  1682. return __awaiter(this, void 0, void 0, function* () {
  1683. const result = {};
  1684. // GitHub workspace
  1685. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1686. if (!githubWorkspacePath) {
  1687. throw new Error('GITHUB_WORKSPACE not defined');
  1688. }
  1689. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1690. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1691. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1692. // Qualified repository
  1693. const qualifiedRepository = core.getInput('repository') ||
  1694. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1695. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1696. const splitRepository = qualifiedRepository.split('/');
  1697. if (splitRepository.length !== 2 ||
  1698. !splitRepository[0] ||
  1699. !splitRepository[1]) {
  1700. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1701. }
  1702. result.repositoryOwner = splitRepository[0];
  1703. result.repositoryName = splitRepository[1];
  1704. // Repository path
  1705. result.repositoryPath = core.getInput('path') || '.';
  1706. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1707. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1708. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1709. }
  1710. // Workflow repository?
  1711. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1712. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1713. // Source branch, source version
  1714. result.ref = core.getInput('ref');
  1715. if (!result.ref) {
  1716. if (isWorkflowRepository) {
  1717. result.ref = github.context.ref;
  1718. result.commit = github.context.sha;
  1719. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1720. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1721. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1722. result.ref = `refs/heads/${result.ref}`;
  1723. }
  1724. }
  1725. }
  1726. // SHA?
  1727. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1728. result.commit = result.ref;
  1729. result.ref = '';
  1730. }
  1731. core.debug(`ref = '${result.ref}'`);
  1732. core.debug(`commit = '${result.commit}'`);
  1733. // Clean
  1734. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1735. core.debug(`clean = ${result.clean}`);
  1736. // Filter
  1737. const filter = core.getInput('filter');
  1738. if (filter) {
  1739. result.filter = filter;
  1740. }
  1741. core.debug(`filter = ${result.filter}`);
  1742. // Sparse checkout
  1743. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1744. if (sparseCheckout.length) {
  1745. result.sparseCheckout = sparseCheckout;
  1746. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1747. }
  1748. result.sparseCheckoutConeMode =
  1749. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1750. 'TRUE';
  1751. // Fetch depth
  1752. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  1753. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  1754. result.fetchDepth = 0;
  1755. }
  1756. core.debug(`fetch depth = ${result.fetchDepth}`);
  1757. // Fetch tags
  1758. result.fetchTags =
  1759. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  1760. core.debug(`fetch tags = ${result.fetchTags}`);
  1761. // Show fetch progress
  1762. result.showProgress =
  1763. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  1764. core.debug(`show progress = ${result.showProgress}`);
  1765. // LFS
  1766. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  1767. core.debug(`lfs = ${result.lfs}`);
  1768. // Submodules
  1769. result.submodules = false;
  1770. result.nestedSubmodules = false;
  1771. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  1772. if (submodulesString == 'RECURSIVE') {
  1773. result.submodules = true;
  1774. result.nestedSubmodules = true;
  1775. }
  1776. else if (submodulesString == 'TRUE') {
  1777. result.submodules = true;
  1778. }
  1779. core.debug(`submodules = ${result.submodules}`);
  1780. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  1781. // Auth token
  1782. result.authToken = core.getInput('token', { required: true });
  1783. // SSH
  1784. result.sshKey = core.getInput('ssh-key');
  1785. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  1786. result.sshStrict =
  1787. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  1788. result.sshUser = core.getInput('ssh-user');
  1789. // Persist credentials
  1790. result.persistCredentials =
  1791. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  1792. // Workflow organization ID
  1793. result.workflowOrganizationId =
  1794. yield workflowContextHelper.getOrganizationId();
  1795. // Set safe.directory in git global config.
  1796. result.setSafeDirectory =
  1797. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  1798. // Determine the GitHub URL that the repository is being hosted from
  1799. result.githubServerUrl = core.getInput('github-server-url');
  1800. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  1801. return result;
  1802. });
  1803. }
  1804. exports.getInputs = getInputs;
  1805. /***/ }),
  1806. /***/ 3109:
  1807. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1808. "use strict";
  1809. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1810. if (k2 === undefined) k2 = k;
  1811. var desc = Object.getOwnPropertyDescriptor(m, k);
  1812. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1813. desc = { enumerable: true, get: function() { return m[k]; } };
  1814. }
  1815. Object.defineProperty(o, k2, desc);
  1816. }) : (function(o, m, k, k2) {
  1817. if (k2 === undefined) k2 = k;
  1818. o[k2] = m[k];
  1819. }));
  1820. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1821. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1822. }) : function(o, v) {
  1823. o["default"] = v;
  1824. });
  1825. var __importStar = (this && this.__importStar) || function (mod) {
  1826. if (mod && mod.__esModule) return mod;
  1827. var result = {};
  1828. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1829. __setModuleDefault(result, mod);
  1830. return result;
  1831. };
  1832. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1833. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1834. return new (P || (P = Promise))(function (resolve, reject) {
  1835. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1836. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1837. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1838. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1839. });
  1840. };
  1841. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1842. const core = __importStar(__nccwpck_require__(2186));
  1843. const coreCommand = __importStar(__nccwpck_require__(7351));
  1844. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  1845. const inputHelper = __importStar(__nccwpck_require__(5480));
  1846. const path = __importStar(__nccwpck_require__(1017));
  1847. const stateHelper = __importStar(__nccwpck_require__(4866));
  1848. function run() {
  1849. return __awaiter(this, void 0, void 0, function* () {
  1850. var _a;
  1851. try {
  1852. const sourceSettings = yield inputHelper.getInputs();
  1853. try {
  1854. // Register problem matcher
  1855. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  1856. // Get sources
  1857. yield gitSourceProvider.getSource(sourceSettings);
  1858. core.setOutput('ref', sourceSettings.ref);
  1859. }
  1860. finally {
  1861. // Unregister problem matcher
  1862. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  1863. }
  1864. }
  1865. catch (error) {
  1866. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1867. }
  1868. });
  1869. }
  1870. function cleanup() {
  1871. return __awaiter(this, void 0, void 0, function* () {
  1872. var _a;
  1873. try {
  1874. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  1875. }
  1876. catch (error) {
  1877. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1878. }
  1879. });
  1880. }
  1881. // Main
  1882. if (!stateHelper.IsPost) {
  1883. run();
  1884. }
  1885. // Post
  1886. else {
  1887. cleanup();
  1888. }
  1889. /***/ }),
  1890. /***/ 8601:
  1891. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1892. "use strict";
  1893. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1894. if (k2 === undefined) k2 = k;
  1895. var desc = Object.getOwnPropertyDescriptor(m, k);
  1896. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1897. desc = { enumerable: true, get: function() { return m[k]; } };
  1898. }
  1899. Object.defineProperty(o, k2, desc);
  1900. }) : (function(o, m, k, k2) {
  1901. if (k2 === undefined) k2 = k;
  1902. o[k2] = m[k];
  1903. }));
  1904. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1905. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1906. }) : function(o, v) {
  1907. o["default"] = v;
  1908. });
  1909. var __importStar = (this && this.__importStar) || function (mod) {
  1910. if (mod && mod.__esModule) return mod;
  1911. var result = {};
  1912. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1913. __setModuleDefault(result, mod);
  1914. return result;
  1915. };
  1916. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1917. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1918. return new (P || (P = Promise))(function (resolve, reject) {
  1919. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1920. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1921. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1922. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1923. });
  1924. };
  1925. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1926. exports.checkCommitInfo = exports.testRef = exports.getRefSpec = exports.getRefSpecForAllHistory = exports.getCheckoutInfo = exports.tagsRefSpec = void 0;
  1927. const core = __importStar(__nccwpck_require__(2186));
  1928. const github = __importStar(__nccwpck_require__(5438));
  1929. const url_helper_1 = __nccwpck_require__(9437);
  1930. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  1931. function getCheckoutInfo(git, ref, commit) {
  1932. return __awaiter(this, void 0, void 0, function* () {
  1933. if (!git) {
  1934. throw new Error('Arg git cannot be empty');
  1935. }
  1936. if (!ref && !commit) {
  1937. throw new Error('Args ref and commit cannot both be empty');
  1938. }
  1939. const result = {};
  1940. const upperRef = (ref || '').toUpperCase();
  1941. // SHA only
  1942. if (!ref) {
  1943. result.ref = commit;
  1944. }
  1945. // refs/heads/
  1946. else if (upperRef.startsWith('REFS/HEADS/')) {
  1947. const branch = ref.substring('refs/heads/'.length);
  1948. result.ref = branch;
  1949. result.startPoint = `refs/remotes/origin/${branch}`;
  1950. }
  1951. // refs/pull/
  1952. else if (upperRef.startsWith('REFS/PULL/')) {
  1953. const branch = ref.substring('refs/pull/'.length);
  1954. result.ref = `refs/remotes/pull/${branch}`;
  1955. }
  1956. // refs/tags/
  1957. else if (upperRef.startsWith('REFS/TAGS/')) {
  1958. result.ref = ref;
  1959. }
  1960. // refs/
  1961. else if (upperRef.startsWith('REFS/') && commit) {
  1962. result.ref = commit;
  1963. }
  1964. // Unqualified ref, check for a matching branch or tag
  1965. else {
  1966. if (yield git.branchExists(true, `origin/${ref}`)) {
  1967. result.ref = ref;
  1968. result.startPoint = `refs/remotes/origin/${ref}`;
  1969. }
  1970. else if (yield git.tagExists(`${ref}`)) {
  1971. result.ref = `refs/tags/${ref}`;
  1972. }
  1973. else {
  1974. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  1975. }
  1976. }
  1977. return result;
  1978. });
  1979. }
  1980. exports.getCheckoutInfo = getCheckoutInfo;
  1981. function getRefSpecForAllHistory(ref, commit) {
  1982. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  1983. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  1984. const branch = ref.substring('refs/pull/'.length);
  1985. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  1986. }
  1987. return result;
  1988. }
  1989. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  1990. function getRefSpec(ref, commit) {
  1991. if (!ref && !commit) {
  1992. throw new Error('Args ref and commit cannot both be empty');
  1993. }
  1994. const upperRef = (ref || '').toUpperCase();
  1995. // SHA
  1996. if (commit) {
  1997. // refs/heads
  1998. if (upperRef.startsWith('REFS/HEADS/')) {
  1999. const branch = ref.substring('refs/heads/'.length);
  2000. return [`+${commit}:refs/remotes/origin/${branch}`];
  2001. }
  2002. // refs/pull/
  2003. else if (upperRef.startsWith('REFS/PULL/')) {
  2004. const branch = ref.substring('refs/pull/'.length);
  2005. return [`+${commit}:refs/remotes/pull/${branch}`];
  2006. }
  2007. // refs/tags/
  2008. else if (upperRef.startsWith('REFS/TAGS/')) {
  2009. return [`+${commit}:${ref}`];
  2010. }
  2011. // Otherwise no destination ref
  2012. else {
  2013. return [commit];
  2014. }
  2015. }
  2016. // Unqualified ref, check for a matching branch or tag
  2017. else if (!upperRef.startsWith('REFS/')) {
  2018. return [
  2019. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2020. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2021. ];
  2022. }
  2023. // refs/heads/
  2024. else if (upperRef.startsWith('REFS/HEADS/')) {
  2025. const branch = ref.substring('refs/heads/'.length);
  2026. return [`+${ref}:refs/remotes/origin/${branch}`];
  2027. }
  2028. // refs/pull/
  2029. else if (upperRef.startsWith('REFS/PULL/')) {
  2030. const branch = ref.substring('refs/pull/'.length);
  2031. return [`+${ref}:refs/remotes/pull/${branch}`];
  2032. }
  2033. // refs/tags/
  2034. else {
  2035. return [`+${ref}:${ref}`];
  2036. }
  2037. }
  2038. exports.getRefSpec = getRefSpec;
  2039. /**
  2040. * Tests whether the initial fetch created the ref at the expected commit
  2041. */
  2042. function testRef(git, ref, commit) {
  2043. return __awaiter(this, void 0, void 0, function* () {
  2044. if (!git) {
  2045. throw new Error('Arg git cannot be empty');
  2046. }
  2047. if (!ref && !commit) {
  2048. throw new Error('Args ref and commit cannot both be empty');
  2049. }
  2050. // No SHA? Nothing to test
  2051. if (!commit) {
  2052. return true;
  2053. }
  2054. // SHA only?
  2055. else if (!ref) {
  2056. return yield git.shaExists(commit);
  2057. }
  2058. const upperRef = ref.toUpperCase();
  2059. // refs/heads/
  2060. if (upperRef.startsWith('REFS/HEADS/')) {
  2061. const branch = ref.substring('refs/heads/'.length);
  2062. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2063. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2064. }
  2065. // refs/pull/
  2066. else if (upperRef.startsWith('REFS/PULL/')) {
  2067. // Assume matches because fetched using the commit
  2068. return true;
  2069. }
  2070. // refs/tags/
  2071. else if (upperRef.startsWith('REFS/TAGS/')) {
  2072. const tagName = ref.substring('refs/tags/'.length);
  2073. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2074. }
  2075. // Unexpected
  2076. else {
  2077. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2078. return true;
  2079. }
  2080. });
  2081. }
  2082. exports.testRef = testRef;
  2083. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2084. return __awaiter(this, void 0, void 0, function* () {
  2085. var _a;
  2086. try {
  2087. // GHES?
  2088. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2089. return;
  2090. }
  2091. // Auth token?
  2092. if (!token) {
  2093. return;
  2094. }
  2095. // Public PR synchronize, for workflow repo?
  2096. if (fromPayload('repository.private') !== false ||
  2097. github.context.eventName !== 'pull_request' ||
  2098. fromPayload('action') !== 'synchronize' ||
  2099. repositoryOwner !== github.context.repo.owner ||
  2100. repositoryName !== github.context.repo.repo ||
  2101. ref !== github.context.ref ||
  2102. !ref.startsWith('refs/pull/') ||
  2103. commit !== github.context.sha) {
  2104. return;
  2105. }
  2106. // Head SHA
  2107. const expectedHeadSha = fromPayload('after');
  2108. if (!expectedHeadSha) {
  2109. core.debug('Unable to determine head sha');
  2110. return;
  2111. }
  2112. // Base SHA
  2113. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2114. if (!expectedBaseSha) {
  2115. core.debug('Unable to determine base sha');
  2116. return;
  2117. }
  2118. // Expected message?
  2119. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2120. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2121. return;
  2122. }
  2123. // Extract details from message
  2124. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2125. if (!match) {
  2126. core.debug('Unexpected message format');
  2127. return;
  2128. }
  2129. // Post telemetry
  2130. const actualHeadSha = match[1];
  2131. if (actualHeadSha !== expectedHeadSha) {
  2132. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2133. const octokit = github.getOctokit(token, {
  2134. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2135. 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})`
  2136. });
  2137. yield octokit.rest.repos.get({
  2138. owner: repositoryOwner,
  2139. repo: repositoryName
  2140. });
  2141. }
  2142. }
  2143. catch (err) {
  2144. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2145. }
  2146. });
  2147. }
  2148. exports.checkCommitInfo = checkCommitInfo;
  2149. function fromPayload(path) {
  2150. return select(github.context.payload, path);
  2151. }
  2152. function select(obj, path) {
  2153. if (!obj) {
  2154. return undefined;
  2155. }
  2156. const i = path.indexOf('.');
  2157. if (i < 0) {
  2158. return obj[path];
  2159. }
  2160. const key = path.substr(0, i);
  2161. return select(obj[key], path.substr(i + 1));
  2162. }
  2163. /***/ }),
  2164. /***/ 3120:
  2165. /***/ ((__unused_webpack_module, exports) => {
  2166. "use strict";
  2167. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2168. exports.escape = void 0;
  2169. function escape(value) {
  2170. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2171. return `\\${x}`;
  2172. });
  2173. }
  2174. exports.escape = escape;
  2175. /***/ }),
  2176. /***/ 2155:
  2177. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2178. "use strict";
  2179. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2180. if (k2 === undefined) k2 = k;
  2181. var desc = Object.getOwnPropertyDescriptor(m, k);
  2182. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2183. desc = { enumerable: true, get: function() { return m[k]; } };
  2184. }
  2185. Object.defineProperty(o, k2, desc);
  2186. }) : (function(o, m, k, k2) {
  2187. if (k2 === undefined) k2 = k;
  2188. o[k2] = m[k];
  2189. }));
  2190. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2191. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2192. }) : function(o, v) {
  2193. o["default"] = v;
  2194. });
  2195. var __importStar = (this && this.__importStar) || function (mod) {
  2196. if (mod && mod.__esModule) return mod;
  2197. var result = {};
  2198. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2199. __setModuleDefault(result, mod);
  2200. return result;
  2201. };
  2202. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2203. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2204. return new (P || (P = Promise))(function (resolve, reject) {
  2205. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2206. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2207. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2208. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2209. });
  2210. };
  2211. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2212. exports.execute = exports.RetryHelper = void 0;
  2213. const core = __importStar(__nccwpck_require__(2186));
  2214. const defaultMaxAttempts = 3;
  2215. const defaultMinSeconds = 10;
  2216. const defaultMaxSeconds = 20;
  2217. class RetryHelper {
  2218. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2219. this.maxAttempts = maxAttempts;
  2220. this.minSeconds = Math.floor(minSeconds);
  2221. this.maxSeconds = Math.floor(maxSeconds);
  2222. if (this.minSeconds > this.maxSeconds) {
  2223. throw new Error('min seconds should be less than or equal to max seconds');
  2224. }
  2225. }
  2226. execute(action) {
  2227. return __awaiter(this, void 0, void 0, function* () {
  2228. let attempt = 1;
  2229. while (attempt < this.maxAttempts) {
  2230. // Try
  2231. try {
  2232. return yield action();
  2233. }
  2234. catch (err) {
  2235. core.info(err === null || err === void 0 ? void 0 : err.message);
  2236. }
  2237. // Sleep
  2238. const seconds = this.getSleepAmount();
  2239. core.info(`Waiting ${seconds} seconds before trying again`);
  2240. yield this.sleep(seconds);
  2241. attempt++;
  2242. }
  2243. // Last attempt
  2244. return yield action();
  2245. });
  2246. }
  2247. getSleepAmount() {
  2248. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2249. this.minSeconds);
  2250. }
  2251. sleep(seconds) {
  2252. return __awaiter(this, void 0, void 0, function* () {
  2253. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2254. });
  2255. }
  2256. }
  2257. exports.RetryHelper = RetryHelper;
  2258. function execute(action) {
  2259. return __awaiter(this, void 0, void 0, function* () {
  2260. const retryHelper = new RetryHelper();
  2261. return yield retryHelper.execute(action);
  2262. });
  2263. }
  2264. exports.execute = execute;
  2265. /***/ }),
  2266. /***/ 4866:
  2267. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2268. "use strict";
  2269. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2270. if (k2 === undefined) k2 = k;
  2271. var desc = Object.getOwnPropertyDescriptor(m, k);
  2272. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2273. desc = { enumerable: true, get: function() { return m[k]; } };
  2274. }
  2275. Object.defineProperty(o, k2, desc);
  2276. }) : (function(o, m, k, k2) {
  2277. if (k2 === undefined) k2 = k;
  2278. o[k2] = m[k];
  2279. }));
  2280. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2281. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2282. }) : function(o, v) {
  2283. o["default"] = v;
  2284. });
  2285. var __importStar = (this && this.__importStar) || function (mod) {
  2286. if (mod && mod.__esModule) return mod;
  2287. var result = {};
  2288. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2289. __setModuleDefault(result, mod);
  2290. return result;
  2291. };
  2292. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2293. exports.setSafeDirectory = exports.setSshKnownHostsPath = exports.setSshKeyPath = exports.setRepositoryPath = exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2294. const core = __importStar(__nccwpck_require__(2186));
  2295. /**
  2296. * Indicates whether the POST action is running
  2297. */
  2298. exports.IsPost = !!core.getState('isPost');
  2299. /**
  2300. * The repository path for the POST action. The value is empty during the MAIN action.
  2301. */
  2302. exports.RepositoryPath = core.getState('repositoryPath');
  2303. /**
  2304. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2305. */
  2306. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2307. /**
  2308. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2309. */
  2310. exports.SshKeyPath = core.getState('sshKeyPath');
  2311. /**
  2312. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2313. */
  2314. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2315. /**
  2316. * Save the repository path so the POST action can retrieve the value.
  2317. */
  2318. function setRepositoryPath(repositoryPath) {
  2319. core.saveState('repositoryPath', repositoryPath);
  2320. }
  2321. exports.setRepositoryPath = setRepositoryPath;
  2322. /**
  2323. * Save the SSH key path so the POST action can retrieve the value.
  2324. */
  2325. function setSshKeyPath(sshKeyPath) {
  2326. core.saveState('sshKeyPath', sshKeyPath);
  2327. }
  2328. exports.setSshKeyPath = setSshKeyPath;
  2329. /**
  2330. * Save the SSH known hosts path so the POST action can retrieve the value.
  2331. */
  2332. function setSshKnownHostsPath(sshKnownHostsPath) {
  2333. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2334. }
  2335. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2336. /**
  2337. * Save the set-safe-directory input so the POST action can retrieve the value.
  2338. */
  2339. function setSafeDirectory() {
  2340. core.saveState('setSafeDirectory', 'true');
  2341. }
  2342. exports.setSafeDirectory = setSafeDirectory;
  2343. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2344. // This is necessary since we don't have a separate entry point.
  2345. if (!exports.IsPost) {
  2346. core.saveState('isPost', 'true');
  2347. }
  2348. /***/ }),
  2349. /***/ 9437:
  2350. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2351. "use strict";
  2352. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2353. if (k2 === undefined) k2 = k;
  2354. var desc = Object.getOwnPropertyDescriptor(m, k);
  2355. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2356. desc = { enumerable: true, get: function() { return m[k]; } };
  2357. }
  2358. Object.defineProperty(o, k2, desc);
  2359. }) : (function(o, m, k, k2) {
  2360. if (k2 === undefined) k2 = k;
  2361. o[k2] = m[k];
  2362. }));
  2363. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2364. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2365. }) : function(o, v) {
  2366. o["default"] = v;
  2367. });
  2368. var __importStar = (this && this.__importStar) || function (mod) {
  2369. if (mod && mod.__esModule) return mod;
  2370. var result = {};
  2371. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2372. __setModuleDefault(result, mod);
  2373. return result;
  2374. };
  2375. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2376. exports.isGhes = exports.getServerApiUrl = exports.getServerUrl = exports.getFetchUrl = void 0;
  2377. const assert = __importStar(__nccwpck_require__(9491));
  2378. const url_1 = __nccwpck_require__(7310);
  2379. function getFetchUrl(settings) {
  2380. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2381. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2382. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2383. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2384. const encodedName = encodeURIComponent(settings.repositoryName);
  2385. if (settings.sshKey) {
  2386. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2387. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2388. }
  2389. // "origin" is SCHEME://HOSTNAME[:PORT]
  2390. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2391. }
  2392. exports.getFetchUrl = getFetchUrl;
  2393. function getServerUrl(url) {
  2394. let urlValue = url && url.trim().length > 0
  2395. ? url
  2396. : process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2397. return new url_1.URL(urlValue);
  2398. }
  2399. exports.getServerUrl = getServerUrl;
  2400. function getServerApiUrl(url) {
  2401. let apiUrl = 'https://api.github.com';
  2402. if (isGhes(url)) {
  2403. const serverUrl = getServerUrl(url);
  2404. apiUrl = new url_1.URL(`${serverUrl.origin}/api/v3`).toString();
  2405. }
  2406. return apiUrl;
  2407. }
  2408. exports.getServerApiUrl = getServerApiUrl;
  2409. function isGhes(url) {
  2410. const ghUrl = getServerUrl(url);
  2411. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  2412. }
  2413. exports.isGhes = isGhes;
  2414. /***/ }),
  2415. /***/ 9568:
  2416. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2417. "use strict";
  2418. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2419. if (k2 === undefined) k2 = k;
  2420. var desc = Object.getOwnPropertyDescriptor(m, k);
  2421. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2422. desc = { enumerable: true, get: function() { return m[k]; } };
  2423. }
  2424. Object.defineProperty(o, k2, desc);
  2425. }) : (function(o, m, k, k2) {
  2426. if (k2 === undefined) k2 = k;
  2427. o[k2] = m[k];
  2428. }));
  2429. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2430. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2431. }) : function(o, v) {
  2432. o["default"] = v;
  2433. });
  2434. var __importStar = (this && this.__importStar) || function (mod) {
  2435. if (mod && mod.__esModule) return mod;
  2436. var result = {};
  2437. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2438. __setModuleDefault(result, mod);
  2439. return result;
  2440. };
  2441. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2442. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2443. return new (P || (P = Promise))(function (resolve, reject) {
  2444. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2445. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2446. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2447. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2448. });
  2449. };
  2450. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2451. exports.getOrganizationId = void 0;
  2452. const core = __importStar(__nccwpck_require__(2186));
  2453. const fs = __importStar(__nccwpck_require__(7147));
  2454. /**
  2455. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2456. */
  2457. function getOrganizationId() {
  2458. return __awaiter(this, void 0, void 0, function* () {
  2459. var _a, _b;
  2460. try {
  2461. const eventPath = process.env.GITHUB_EVENT_PATH;
  2462. if (!eventPath) {
  2463. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2464. return;
  2465. }
  2466. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2467. const event = JSON.parse(content);
  2468. 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;
  2469. if (typeof id !== 'number') {
  2470. core.debug('Repository owner ID not found within GITHUB event info');
  2471. return;
  2472. }
  2473. return id;
  2474. }
  2475. catch (err) {
  2476. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2477. }
  2478. });
  2479. }
  2480. exports.getOrganizationId = getOrganizationId;
  2481. /***/ }),
  2482. /***/ 7351:
  2483. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2484. "use strict";
  2485. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2486. if (k2 === undefined) k2 = k;
  2487. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2488. }) : (function(o, m, k, k2) {
  2489. if (k2 === undefined) k2 = k;
  2490. o[k2] = m[k];
  2491. }));
  2492. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2493. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2494. }) : function(o, v) {
  2495. o["default"] = v;
  2496. });
  2497. var __importStar = (this && this.__importStar) || function (mod) {
  2498. if (mod && mod.__esModule) return mod;
  2499. var result = {};
  2500. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2501. __setModuleDefault(result, mod);
  2502. return result;
  2503. };
  2504. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2505. exports.issue = exports.issueCommand = void 0;
  2506. const os = __importStar(__nccwpck_require__(2037));
  2507. const utils_1 = __nccwpck_require__(5278);
  2508. /**
  2509. * Commands
  2510. *
  2511. * Command Format:
  2512. * ::name key=value,key=value::message
  2513. *
  2514. * Examples:
  2515. * ::warning::This is the message
  2516. * ::set-env name=MY_VAR::some value
  2517. */
  2518. function issueCommand(command, properties, message) {
  2519. const cmd = new Command(command, properties, message);
  2520. process.stdout.write(cmd.toString() + os.EOL);
  2521. }
  2522. exports.issueCommand = issueCommand;
  2523. function issue(name, message = '') {
  2524. issueCommand(name, {}, message);
  2525. }
  2526. exports.issue = issue;
  2527. const CMD_STRING = '::';
  2528. class Command {
  2529. constructor(command, properties, message) {
  2530. if (!command) {
  2531. command = 'missing.command';
  2532. }
  2533. this.command = command;
  2534. this.properties = properties;
  2535. this.message = message;
  2536. }
  2537. toString() {
  2538. let cmdStr = CMD_STRING + this.command;
  2539. if (this.properties && Object.keys(this.properties).length > 0) {
  2540. cmdStr += ' ';
  2541. let first = true;
  2542. for (const key in this.properties) {
  2543. if (this.properties.hasOwnProperty(key)) {
  2544. const val = this.properties[key];
  2545. if (val) {
  2546. if (first) {
  2547. first = false;
  2548. }
  2549. else {
  2550. cmdStr += ',';
  2551. }
  2552. cmdStr += `${key}=${escapeProperty(val)}`;
  2553. }
  2554. }
  2555. }
  2556. }
  2557. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2558. return cmdStr;
  2559. }
  2560. }
  2561. function escapeData(s) {
  2562. return utils_1.toCommandValue(s)
  2563. .replace(/%/g, '%25')
  2564. .replace(/\r/g, '%0D')
  2565. .replace(/\n/g, '%0A');
  2566. }
  2567. function escapeProperty(s) {
  2568. return utils_1.toCommandValue(s)
  2569. .replace(/%/g, '%25')
  2570. .replace(/\r/g, '%0D')
  2571. .replace(/\n/g, '%0A')
  2572. .replace(/:/g, '%3A')
  2573. .replace(/,/g, '%2C');
  2574. }
  2575. //# sourceMappingURL=command.js.map
  2576. /***/ }),
  2577. /***/ 2186:
  2578. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2579. "use strict";
  2580. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2581. if (k2 === undefined) k2 = k;
  2582. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2583. }) : (function(o, m, k, k2) {
  2584. if (k2 === undefined) k2 = k;
  2585. o[k2] = m[k];
  2586. }));
  2587. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2588. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2589. }) : function(o, v) {
  2590. o["default"] = v;
  2591. });
  2592. var __importStar = (this && this.__importStar) || function (mod) {
  2593. if (mod && mod.__esModule) return mod;
  2594. var result = {};
  2595. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2596. __setModuleDefault(result, mod);
  2597. return result;
  2598. };
  2599. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2600. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2601. return new (P || (P = Promise))(function (resolve, reject) {
  2602. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2603. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2604. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2605. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2606. });
  2607. };
  2608. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2609. 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;
  2610. const command_1 = __nccwpck_require__(7351);
  2611. const file_command_1 = __nccwpck_require__(717);
  2612. const utils_1 = __nccwpck_require__(5278);
  2613. const os = __importStar(__nccwpck_require__(2037));
  2614. const path = __importStar(__nccwpck_require__(1017));
  2615. const oidc_utils_1 = __nccwpck_require__(8041);
  2616. /**
  2617. * The code to exit an action
  2618. */
  2619. var ExitCode;
  2620. (function (ExitCode) {
  2621. /**
  2622. * A code indicating that the action was successful
  2623. */
  2624. ExitCode[ExitCode["Success"] = 0] = "Success";
  2625. /**
  2626. * A code indicating that the action was a failure
  2627. */
  2628. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2629. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2630. //-----------------------------------------------------------------------
  2631. // Variables
  2632. //-----------------------------------------------------------------------
  2633. /**
  2634. * Sets env variable for this action and future actions in the job
  2635. * @param name the name of the variable to set
  2636. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2637. */
  2638. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2639. function exportVariable(name, val) {
  2640. const convertedVal = utils_1.toCommandValue(val);
  2641. process.env[name] = convertedVal;
  2642. const filePath = process.env['GITHUB_ENV'] || '';
  2643. if (filePath) {
  2644. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2645. }
  2646. command_1.issueCommand('set-env', { name }, convertedVal);
  2647. }
  2648. exports.exportVariable = exportVariable;
  2649. /**
  2650. * Registers a secret which will get masked from logs
  2651. * @param secret value of the secret
  2652. */
  2653. function setSecret(secret) {
  2654. command_1.issueCommand('add-mask', {}, secret);
  2655. }
  2656. exports.setSecret = setSecret;
  2657. /**
  2658. * Prepends inputPath to the PATH (for this action and future actions)
  2659. * @param inputPath
  2660. */
  2661. function addPath(inputPath) {
  2662. const filePath = process.env['GITHUB_PATH'] || '';
  2663. if (filePath) {
  2664. file_command_1.issueFileCommand('PATH', inputPath);
  2665. }
  2666. else {
  2667. command_1.issueCommand('add-path', {}, inputPath);
  2668. }
  2669. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2670. }
  2671. exports.addPath = addPath;
  2672. /**
  2673. * Gets the value of an input.
  2674. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2675. * Returns an empty string if the value is not defined.
  2676. *
  2677. * @param name name of the input to get
  2678. * @param options optional. See InputOptions.
  2679. * @returns string
  2680. */
  2681. function getInput(name, options) {
  2682. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2683. if (options && options.required && !val) {
  2684. throw new Error(`Input required and not supplied: ${name}`);
  2685. }
  2686. if (options && options.trimWhitespace === false) {
  2687. return val;
  2688. }
  2689. return val.trim();
  2690. }
  2691. exports.getInput = getInput;
  2692. /**
  2693. * Gets the values of an multiline input. Each value is also trimmed.
  2694. *
  2695. * @param name name of the input to get
  2696. * @param options optional. See InputOptions.
  2697. * @returns string[]
  2698. *
  2699. */
  2700. function getMultilineInput(name, options) {
  2701. const inputs = getInput(name, options)
  2702. .split('\n')
  2703. .filter(x => x !== '');
  2704. if (options && options.trimWhitespace === false) {
  2705. return inputs;
  2706. }
  2707. return inputs.map(input => input.trim());
  2708. }
  2709. exports.getMultilineInput = getMultilineInput;
  2710. /**
  2711. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2712. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2713. * The return value is also in boolean type.
  2714. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2715. *
  2716. * @param name name of the input to get
  2717. * @param options optional. See InputOptions.
  2718. * @returns boolean
  2719. */
  2720. function getBooleanInput(name, options) {
  2721. const trueValue = ['true', 'True', 'TRUE'];
  2722. const falseValue = ['false', 'False', 'FALSE'];
  2723. const val = getInput(name, options);
  2724. if (trueValue.includes(val))
  2725. return true;
  2726. if (falseValue.includes(val))
  2727. return false;
  2728. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  2729. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  2730. }
  2731. exports.getBooleanInput = getBooleanInput;
  2732. /**
  2733. * Sets the value of an output.
  2734. *
  2735. * @param name name of the output to set
  2736. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2737. */
  2738. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2739. function setOutput(name, value) {
  2740. const filePath = process.env['GITHUB_OUTPUT'] || '';
  2741. if (filePath) {
  2742. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  2743. }
  2744. process.stdout.write(os.EOL);
  2745. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  2746. }
  2747. exports.setOutput = setOutput;
  2748. /**
  2749. * Enables or disables the echoing of commands into stdout for the rest of the step.
  2750. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  2751. *
  2752. */
  2753. function setCommandEcho(enabled) {
  2754. command_1.issue('echo', enabled ? 'on' : 'off');
  2755. }
  2756. exports.setCommandEcho = setCommandEcho;
  2757. //-----------------------------------------------------------------------
  2758. // Results
  2759. //-----------------------------------------------------------------------
  2760. /**
  2761. * Sets the action status to failed.
  2762. * When the action exits it will be with an exit code of 1
  2763. * @param message add error issue message
  2764. */
  2765. function setFailed(message) {
  2766. process.exitCode = ExitCode.Failure;
  2767. error(message);
  2768. }
  2769. exports.setFailed = setFailed;
  2770. //-----------------------------------------------------------------------
  2771. // Logging Commands
  2772. //-----------------------------------------------------------------------
  2773. /**
  2774. * Gets whether Actions Step Debug is on or not
  2775. */
  2776. function isDebug() {
  2777. return process.env['RUNNER_DEBUG'] === '1';
  2778. }
  2779. exports.isDebug = isDebug;
  2780. /**
  2781. * Writes debug message to user log
  2782. * @param message debug message
  2783. */
  2784. function debug(message) {
  2785. command_1.issueCommand('debug', {}, message);
  2786. }
  2787. exports.debug = debug;
  2788. /**
  2789. * Adds an error issue
  2790. * @param message error issue message. Errors will be converted to string via toString()
  2791. * @param properties optional properties to add to the annotation.
  2792. */
  2793. function error(message, properties = {}) {
  2794. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2795. }
  2796. exports.error = error;
  2797. /**
  2798. * Adds a warning issue
  2799. * @param message warning issue message. Errors will be converted to string via toString()
  2800. * @param properties optional properties to add to the annotation.
  2801. */
  2802. function warning(message, properties = {}) {
  2803. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2804. }
  2805. exports.warning = warning;
  2806. /**
  2807. * Adds a notice issue
  2808. * @param message notice issue message. Errors will be converted to string via toString()
  2809. * @param properties optional properties to add to the annotation.
  2810. */
  2811. function notice(message, properties = {}) {
  2812. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2813. }
  2814. exports.notice = notice;
  2815. /**
  2816. * Writes info to log with console.log.
  2817. * @param message info message
  2818. */
  2819. function info(message) {
  2820. process.stdout.write(message + os.EOL);
  2821. }
  2822. exports.info = info;
  2823. /**
  2824. * Begin an output group.
  2825. *
  2826. * Output until the next `groupEnd` will be foldable in this group
  2827. *
  2828. * @param name The name of the output group
  2829. */
  2830. function startGroup(name) {
  2831. command_1.issue('group', name);
  2832. }
  2833. exports.startGroup = startGroup;
  2834. /**
  2835. * End an output group.
  2836. */
  2837. function endGroup() {
  2838. command_1.issue('endgroup');
  2839. }
  2840. exports.endGroup = endGroup;
  2841. /**
  2842. * Wrap an asynchronous function call in a group.
  2843. *
  2844. * Returns the same type as the function itself.
  2845. *
  2846. * @param name The name of the group
  2847. * @param fn The function to wrap in the group
  2848. */
  2849. function group(name, fn) {
  2850. return __awaiter(this, void 0, void 0, function* () {
  2851. startGroup(name);
  2852. let result;
  2853. try {
  2854. result = yield fn();
  2855. }
  2856. finally {
  2857. endGroup();
  2858. }
  2859. return result;
  2860. });
  2861. }
  2862. exports.group = group;
  2863. //-----------------------------------------------------------------------
  2864. // Wrapper action state
  2865. //-----------------------------------------------------------------------
  2866. /**
  2867. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  2868. *
  2869. * @param name name of the state to store
  2870. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2871. */
  2872. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2873. function saveState(name, value) {
  2874. const filePath = process.env['GITHUB_STATE'] || '';
  2875. if (filePath) {
  2876. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  2877. }
  2878. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  2879. }
  2880. exports.saveState = saveState;
  2881. /**
  2882. * Gets the value of an state set by this action's main execution.
  2883. *
  2884. * @param name name of the state to get
  2885. * @returns string
  2886. */
  2887. function getState(name) {
  2888. return process.env[`STATE_${name}`] || '';
  2889. }
  2890. exports.getState = getState;
  2891. function getIDToken(aud) {
  2892. return __awaiter(this, void 0, void 0, function* () {
  2893. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  2894. });
  2895. }
  2896. exports.getIDToken = getIDToken;
  2897. /**
  2898. * Summary exports
  2899. */
  2900. var summary_1 = __nccwpck_require__(1327);
  2901. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  2902. /**
  2903. * @deprecated use core.summary
  2904. */
  2905. var summary_2 = __nccwpck_require__(1327);
  2906. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  2907. /**
  2908. * Path exports
  2909. */
  2910. var path_utils_1 = __nccwpck_require__(2981);
  2911. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  2912. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  2913. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  2914. //# sourceMappingURL=core.js.map
  2915. /***/ }),
  2916. /***/ 717:
  2917. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2918. "use strict";
  2919. // For internal use, subject to change.
  2920. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2921. if (k2 === undefined) k2 = k;
  2922. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2923. }) : (function(o, m, k, k2) {
  2924. if (k2 === undefined) k2 = k;
  2925. o[k2] = m[k];
  2926. }));
  2927. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2928. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2929. }) : function(o, v) {
  2930. o["default"] = v;
  2931. });
  2932. var __importStar = (this && this.__importStar) || function (mod) {
  2933. if (mod && mod.__esModule) return mod;
  2934. var result = {};
  2935. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2936. __setModuleDefault(result, mod);
  2937. return result;
  2938. };
  2939. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2940. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  2941. // We use any as a valid input type
  2942. /* eslint-disable @typescript-eslint/no-explicit-any */
  2943. const fs = __importStar(__nccwpck_require__(7147));
  2944. const os = __importStar(__nccwpck_require__(2037));
  2945. const uuid_1 = __nccwpck_require__(8974);
  2946. const utils_1 = __nccwpck_require__(5278);
  2947. function issueFileCommand(command, message) {
  2948. const filePath = process.env[`GITHUB_${command}`];
  2949. if (!filePath) {
  2950. throw new Error(`Unable to find environment variable for file command ${command}`);
  2951. }
  2952. if (!fs.existsSync(filePath)) {
  2953. throw new Error(`Missing file at path: ${filePath}`);
  2954. }
  2955. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  2956. encoding: 'utf8'
  2957. });
  2958. }
  2959. exports.issueFileCommand = issueFileCommand;
  2960. function prepareKeyValueMessage(key, value) {
  2961. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  2962. const convertedValue = utils_1.toCommandValue(value);
  2963. // These should realistically never happen, but just in case someone finds a
  2964. // way to exploit uuid generation let's not allow keys or values that contain
  2965. // the delimiter.
  2966. if (key.includes(delimiter)) {
  2967. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  2968. }
  2969. if (convertedValue.includes(delimiter)) {
  2970. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  2971. }
  2972. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  2973. }
  2974. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  2975. //# sourceMappingURL=file-command.js.map
  2976. /***/ }),
  2977. /***/ 8041:
  2978. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2979. "use strict";
  2980. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2981. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2982. return new (P || (P = Promise))(function (resolve, reject) {
  2983. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2984. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2985. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2986. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2987. });
  2988. };
  2989. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2990. exports.OidcClient = void 0;
  2991. const http_client_1 = __nccwpck_require__(6255);
  2992. const auth_1 = __nccwpck_require__(5526);
  2993. const core_1 = __nccwpck_require__(2186);
  2994. class OidcClient {
  2995. static createHttpClient(allowRetry = true, maxRetry = 10) {
  2996. const requestOptions = {
  2997. allowRetries: allowRetry,
  2998. maxRetries: maxRetry
  2999. };
  3000. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3001. }
  3002. static getRequestToken() {
  3003. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3004. if (!token) {
  3005. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3006. }
  3007. return token;
  3008. }
  3009. static getIDTokenUrl() {
  3010. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3011. if (!runtimeUrl) {
  3012. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3013. }
  3014. return runtimeUrl;
  3015. }
  3016. static getCall(id_token_url) {
  3017. var _a;
  3018. return __awaiter(this, void 0, void 0, function* () {
  3019. const httpclient = OidcClient.createHttpClient();
  3020. const res = yield httpclient
  3021. .getJson(id_token_url)
  3022. .catch(error => {
  3023. throw new Error(`Failed to get ID Token. \n
  3024. Error Code : ${error.statusCode}\n
  3025. Error Message: ${error.message}`);
  3026. });
  3027. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3028. if (!id_token) {
  3029. throw new Error('Response json body do not have ID Token field');
  3030. }
  3031. return id_token;
  3032. });
  3033. }
  3034. static getIDToken(audience) {
  3035. return __awaiter(this, void 0, void 0, function* () {
  3036. try {
  3037. // New ID Token is requested from action service
  3038. let id_token_url = OidcClient.getIDTokenUrl();
  3039. if (audience) {
  3040. const encodedAudience = encodeURIComponent(audience);
  3041. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3042. }
  3043. core_1.debug(`ID token url is ${id_token_url}`);
  3044. const id_token = yield OidcClient.getCall(id_token_url);
  3045. core_1.setSecret(id_token);
  3046. return id_token;
  3047. }
  3048. catch (error) {
  3049. throw new Error(`Error message: ${error.message}`);
  3050. }
  3051. });
  3052. }
  3053. }
  3054. exports.OidcClient = OidcClient;
  3055. //# sourceMappingURL=oidc-utils.js.map
  3056. /***/ }),
  3057. /***/ 2981:
  3058. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3059. "use strict";
  3060. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3061. if (k2 === undefined) k2 = k;
  3062. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3063. }) : (function(o, m, k, k2) {
  3064. if (k2 === undefined) k2 = k;
  3065. o[k2] = m[k];
  3066. }));
  3067. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3068. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3069. }) : function(o, v) {
  3070. o["default"] = v;
  3071. });
  3072. var __importStar = (this && this.__importStar) || function (mod) {
  3073. if (mod && mod.__esModule) return mod;
  3074. var result = {};
  3075. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3076. __setModuleDefault(result, mod);
  3077. return result;
  3078. };
  3079. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3080. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3081. const path = __importStar(__nccwpck_require__(1017));
  3082. /**
  3083. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3084. * replaced with /.
  3085. *
  3086. * @param pth. Path to transform.
  3087. * @return string Posix path.
  3088. */
  3089. function toPosixPath(pth) {
  3090. return pth.replace(/[\\]/g, '/');
  3091. }
  3092. exports.toPosixPath = toPosixPath;
  3093. /**
  3094. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3095. * replaced with \\.
  3096. *
  3097. * @param pth. Path to transform.
  3098. * @return string Win32 path.
  3099. */
  3100. function toWin32Path(pth) {
  3101. return pth.replace(/[/]/g, '\\');
  3102. }
  3103. exports.toWin32Path = toWin32Path;
  3104. /**
  3105. * toPlatformPath converts the given path to a platform-specific path. It does
  3106. * this by replacing instances of / and \ with the platform-specific path
  3107. * separator.
  3108. *
  3109. * @param pth The path to platformize.
  3110. * @return string The platform-specific path.
  3111. */
  3112. function toPlatformPath(pth) {
  3113. return pth.replace(/[/\\]/g, path.sep);
  3114. }
  3115. exports.toPlatformPath = toPlatformPath;
  3116. //# sourceMappingURL=path-utils.js.map
  3117. /***/ }),
  3118. /***/ 1327:
  3119. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3120. "use strict";
  3121. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3122. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3123. return new (P || (P = Promise))(function (resolve, reject) {
  3124. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3125. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3126. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3127. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3128. });
  3129. };
  3130. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3131. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3132. const os_1 = __nccwpck_require__(2037);
  3133. const fs_1 = __nccwpck_require__(7147);
  3134. const { access, appendFile, writeFile } = fs_1.promises;
  3135. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3136. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3137. class Summary {
  3138. constructor() {
  3139. this._buffer = '';
  3140. }
  3141. /**
  3142. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3143. * Also checks r/w permissions.
  3144. *
  3145. * @returns step summary file path
  3146. */
  3147. filePath() {
  3148. return __awaiter(this, void 0, void 0, function* () {
  3149. if (this._filePath) {
  3150. return this._filePath;
  3151. }
  3152. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3153. if (!pathFromEnv) {
  3154. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3155. }
  3156. try {
  3157. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3158. }
  3159. catch (_a) {
  3160. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3161. }
  3162. this._filePath = pathFromEnv;
  3163. return this._filePath;
  3164. });
  3165. }
  3166. /**
  3167. * Wraps content in an HTML tag, adding any HTML attributes
  3168. *
  3169. * @param {string} tag HTML tag to wrap
  3170. * @param {string | null} content content within the tag
  3171. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3172. *
  3173. * @returns {string} content wrapped in HTML element
  3174. */
  3175. wrap(tag, content, attrs = {}) {
  3176. const htmlAttrs = Object.entries(attrs)
  3177. .map(([key, value]) => ` ${key}="${value}"`)
  3178. .join('');
  3179. if (!content) {
  3180. return `<${tag}${htmlAttrs}>`;
  3181. }
  3182. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3183. }
  3184. /**
  3185. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3186. *
  3187. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3188. *
  3189. * @returns {Promise<Summary>} summary instance
  3190. */
  3191. write(options) {
  3192. return __awaiter(this, void 0, void 0, function* () {
  3193. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3194. const filePath = yield this.filePath();
  3195. const writeFunc = overwrite ? writeFile : appendFile;
  3196. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3197. return this.emptyBuffer();
  3198. });
  3199. }
  3200. /**
  3201. * Clears the summary buffer and wipes the summary file
  3202. *
  3203. * @returns {Summary} summary instance
  3204. */
  3205. clear() {
  3206. return __awaiter(this, void 0, void 0, function* () {
  3207. return this.emptyBuffer().write({ overwrite: true });
  3208. });
  3209. }
  3210. /**
  3211. * Returns the current summary buffer as a string
  3212. *
  3213. * @returns {string} string of summary buffer
  3214. */
  3215. stringify() {
  3216. return this._buffer;
  3217. }
  3218. /**
  3219. * If the summary buffer is empty
  3220. *
  3221. * @returns {boolen} true if the buffer is empty
  3222. */
  3223. isEmptyBuffer() {
  3224. return this._buffer.length === 0;
  3225. }
  3226. /**
  3227. * Resets the summary buffer without writing to summary file
  3228. *
  3229. * @returns {Summary} summary instance
  3230. */
  3231. emptyBuffer() {
  3232. this._buffer = '';
  3233. return this;
  3234. }
  3235. /**
  3236. * Adds raw text to the summary buffer
  3237. *
  3238. * @param {string} text content to add
  3239. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3240. *
  3241. * @returns {Summary} summary instance
  3242. */
  3243. addRaw(text, addEOL = false) {
  3244. this._buffer += text;
  3245. return addEOL ? this.addEOL() : this;
  3246. }
  3247. /**
  3248. * Adds the operating system-specific end-of-line marker to the buffer
  3249. *
  3250. * @returns {Summary} summary instance
  3251. */
  3252. addEOL() {
  3253. return this.addRaw(os_1.EOL);
  3254. }
  3255. /**
  3256. * Adds an HTML codeblock to the summary buffer
  3257. *
  3258. * @param {string} code content to render within fenced code block
  3259. * @param {string} lang (optional) language to syntax highlight code
  3260. *
  3261. * @returns {Summary} summary instance
  3262. */
  3263. addCodeBlock(code, lang) {
  3264. const attrs = Object.assign({}, (lang && { lang }));
  3265. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3266. return this.addRaw(element).addEOL();
  3267. }
  3268. /**
  3269. * Adds an HTML list to the summary buffer
  3270. *
  3271. * @param {string[]} items list of items to render
  3272. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3273. *
  3274. * @returns {Summary} summary instance
  3275. */
  3276. addList(items, ordered = false) {
  3277. const tag = ordered ? 'ol' : 'ul';
  3278. const listItems = items.map(item => this.wrap('li', item)).join('');
  3279. const element = this.wrap(tag, listItems);
  3280. return this.addRaw(element).addEOL();
  3281. }
  3282. /**
  3283. * Adds an HTML table to the summary buffer
  3284. *
  3285. * @param {SummaryTableCell[]} rows table rows
  3286. *
  3287. * @returns {Summary} summary instance
  3288. */
  3289. addTable(rows) {
  3290. const tableBody = rows
  3291. .map(row => {
  3292. const cells = row
  3293. .map(cell => {
  3294. if (typeof cell === 'string') {
  3295. return this.wrap('td', cell);
  3296. }
  3297. const { header, data, colspan, rowspan } = cell;
  3298. const tag = header ? 'th' : 'td';
  3299. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3300. return this.wrap(tag, data, attrs);
  3301. })
  3302. .join('');
  3303. return this.wrap('tr', cells);
  3304. })
  3305. .join('');
  3306. const element = this.wrap('table', tableBody);
  3307. return this.addRaw(element).addEOL();
  3308. }
  3309. /**
  3310. * Adds a collapsable HTML details element to the summary buffer
  3311. *
  3312. * @param {string} label text for the closed state
  3313. * @param {string} content collapsable content
  3314. *
  3315. * @returns {Summary} summary instance
  3316. */
  3317. addDetails(label, content) {
  3318. const element = this.wrap('details', this.wrap('summary', label) + content);
  3319. return this.addRaw(element).addEOL();
  3320. }
  3321. /**
  3322. * Adds an HTML image tag to the summary buffer
  3323. *
  3324. * @param {string} src path to the image you to embed
  3325. * @param {string} alt text description of the image
  3326. * @param {SummaryImageOptions} options (optional) addition image attributes
  3327. *
  3328. * @returns {Summary} summary instance
  3329. */
  3330. addImage(src, alt, options) {
  3331. const { width, height } = options || {};
  3332. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3333. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3334. return this.addRaw(element).addEOL();
  3335. }
  3336. /**
  3337. * Adds an HTML section heading element
  3338. *
  3339. * @param {string} text heading text
  3340. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3341. *
  3342. * @returns {Summary} summary instance
  3343. */
  3344. addHeading(text, level) {
  3345. const tag = `h${level}`;
  3346. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3347. ? tag
  3348. : 'h1';
  3349. const element = this.wrap(allowedTag, text);
  3350. return this.addRaw(element).addEOL();
  3351. }
  3352. /**
  3353. * Adds an HTML thematic break (<hr>) to the summary buffer
  3354. *
  3355. * @returns {Summary} summary instance
  3356. */
  3357. addSeparator() {
  3358. const element = this.wrap('hr', null);
  3359. return this.addRaw(element).addEOL();
  3360. }
  3361. /**
  3362. * Adds an HTML line break (<br>) to the summary buffer
  3363. *
  3364. * @returns {Summary} summary instance
  3365. */
  3366. addBreak() {
  3367. const element = this.wrap('br', null);
  3368. return this.addRaw(element).addEOL();
  3369. }
  3370. /**
  3371. * Adds an HTML blockquote to the summary buffer
  3372. *
  3373. * @param {string} text quote text
  3374. * @param {string} cite (optional) citation url
  3375. *
  3376. * @returns {Summary} summary instance
  3377. */
  3378. addQuote(text, cite) {
  3379. const attrs = Object.assign({}, (cite && { cite }));
  3380. const element = this.wrap('blockquote', text, attrs);
  3381. return this.addRaw(element).addEOL();
  3382. }
  3383. /**
  3384. * Adds an HTML anchor tag to the summary buffer
  3385. *
  3386. * @param {string} text link text/content
  3387. * @param {string} href hyperlink
  3388. *
  3389. * @returns {Summary} summary instance
  3390. */
  3391. addLink(text, href) {
  3392. const element = this.wrap('a', text, { href });
  3393. return this.addRaw(element).addEOL();
  3394. }
  3395. }
  3396. const _summary = new Summary();
  3397. /**
  3398. * @deprecated use `core.summary`
  3399. */
  3400. exports.markdownSummary = _summary;
  3401. exports.summary = _summary;
  3402. //# sourceMappingURL=summary.js.map
  3403. /***/ }),
  3404. /***/ 5278:
  3405. /***/ ((__unused_webpack_module, exports) => {
  3406. "use strict";
  3407. // We use any as a valid input type
  3408. /* eslint-disable @typescript-eslint/no-explicit-any */
  3409. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3410. exports.toCommandProperties = exports.toCommandValue = void 0;
  3411. /**
  3412. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3413. * @param input input to sanitize into a string
  3414. */
  3415. function toCommandValue(input) {
  3416. if (input === null || input === undefined) {
  3417. return '';
  3418. }
  3419. else if (typeof input === 'string' || input instanceof String) {
  3420. return input;
  3421. }
  3422. return JSON.stringify(input);
  3423. }
  3424. exports.toCommandValue = toCommandValue;
  3425. /**
  3426. *
  3427. * @param annotationProperties
  3428. * @returns The command properties to send with the actual annotation command
  3429. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3430. */
  3431. function toCommandProperties(annotationProperties) {
  3432. if (!Object.keys(annotationProperties).length) {
  3433. return {};
  3434. }
  3435. return {
  3436. title: annotationProperties.title,
  3437. file: annotationProperties.file,
  3438. line: annotationProperties.startLine,
  3439. endLine: annotationProperties.endLine,
  3440. col: annotationProperties.startColumn,
  3441. endColumn: annotationProperties.endColumn
  3442. };
  3443. }
  3444. exports.toCommandProperties = toCommandProperties;
  3445. //# sourceMappingURL=utils.js.map
  3446. /***/ }),
  3447. /***/ 8974:
  3448. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3449. "use strict";
  3450. Object.defineProperty(exports, "__esModule", ({
  3451. value: true
  3452. }));
  3453. Object.defineProperty(exports, "v1", ({
  3454. enumerable: true,
  3455. get: function () {
  3456. return _v.default;
  3457. }
  3458. }));
  3459. Object.defineProperty(exports, "v3", ({
  3460. enumerable: true,
  3461. get: function () {
  3462. return _v2.default;
  3463. }
  3464. }));
  3465. Object.defineProperty(exports, "v4", ({
  3466. enumerable: true,
  3467. get: function () {
  3468. return _v3.default;
  3469. }
  3470. }));
  3471. Object.defineProperty(exports, "v5", ({
  3472. enumerable: true,
  3473. get: function () {
  3474. return _v4.default;
  3475. }
  3476. }));
  3477. Object.defineProperty(exports, "NIL", ({
  3478. enumerable: true,
  3479. get: function () {
  3480. return _nil.default;
  3481. }
  3482. }));
  3483. Object.defineProperty(exports, "version", ({
  3484. enumerable: true,
  3485. get: function () {
  3486. return _version.default;
  3487. }
  3488. }));
  3489. Object.defineProperty(exports, "validate", ({
  3490. enumerable: true,
  3491. get: function () {
  3492. return _validate.default;
  3493. }
  3494. }));
  3495. Object.defineProperty(exports, "stringify", ({
  3496. enumerable: true,
  3497. get: function () {
  3498. return _stringify.default;
  3499. }
  3500. }));
  3501. Object.defineProperty(exports, "parse", ({
  3502. enumerable: true,
  3503. get: function () {
  3504. return _parse.default;
  3505. }
  3506. }));
  3507. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3508. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3509. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3510. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3511. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3512. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3513. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3514. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3515. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3516. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3517. /***/ }),
  3518. /***/ 5842:
  3519. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3520. "use strict";
  3521. Object.defineProperty(exports, "__esModule", ({
  3522. value: true
  3523. }));
  3524. exports["default"] = void 0;
  3525. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3526. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3527. function md5(bytes) {
  3528. if (Array.isArray(bytes)) {
  3529. bytes = Buffer.from(bytes);
  3530. } else if (typeof bytes === 'string') {
  3531. bytes = Buffer.from(bytes, 'utf8');
  3532. }
  3533. return _crypto.default.createHash('md5').update(bytes).digest();
  3534. }
  3535. var _default = md5;
  3536. exports["default"] = _default;
  3537. /***/ }),
  3538. /***/ 2381:
  3539. /***/ ((__unused_webpack_module, exports) => {
  3540. "use strict";
  3541. Object.defineProperty(exports, "__esModule", ({
  3542. value: true
  3543. }));
  3544. exports["default"] = void 0;
  3545. var _default = '00000000-0000-0000-0000-000000000000';
  3546. exports["default"] = _default;
  3547. /***/ }),
  3548. /***/ 6385:
  3549. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3550. "use strict";
  3551. Object.defineProperty(exports, "__esModule", ({
  3552. value: true
  3553. }));
  3554. exports["default"] = void 0;
  3555. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3556. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3557. function parse(uuid) {
  3558. if (!(0, _validate.default)(uuid)) {
  3559. throw TypeError('Invalid UUID');
  3560. }
  3561. let v;
  3562. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3563. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3564. arr[1] = v >>> 16 & 0xff;
  3565. arr[2] = v >>> 8 & 0xff;
  3566. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3567. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3568. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3569. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3570. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3571. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3572. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3573. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3574. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3575. arr[11] = v / 0x100000000 & 0xff;
  3576. arr[12] = v >>> 24 & 0xff;
  3577. arr[13] = v >>> 16 & 0xff;
  3578. arr[14] = v >>> 8 & 0xff;
  3579. arr[15] = v & 0xff;
  3580. return arr;
  3581. }
  3582. var _default = parse;
  3583. exports["default"] = _default;
  3584. /***/ }),
  3585. /***/ 6230:
  3586. /***/ ((__unused_webpack_module, exports) => {
  3587. "use strict";
  3588. Object.defineProperty(exports, "__esModule", ({
  3589. value: true
  3590. }));
  3591. exports["default"] = void 0;
  3592. 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;
  3593. exports["default"] = _default;
  3594. /***/ }),
  3595. /***/ 9784:
  3596. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3597. "use strict";
  3598. Object.defineProperty(exports, "__esModule", ({
  3599. value: true
  3600. }));
  3601. exports["default"] = rng;
  3602. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3603. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3604. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3605. let poolPtr = rnds8Pool.length;
  3606. function rng() {
  3607. if (poolPtr > rnds8Pool.length - 16) {
  3608. _crypto.default.randomFillSync(rnds8Pool);
  3609. poolPtr = 0;
  3610. }
  3611. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3612. }
  3613. /***/ }),
  3614. /***/ 8844:
  3615. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3616. "use strict";
  3617. Object.defineProperty(exports, "__esModule", ({
  3618. value: true
  3619. }));
  3620. exports["default"] = void 0;
  3621. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3622. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3623. function sha1(bytes) {
  3624. if (Array.isArray(bytes)) {
  3625. bytes = Buffer.from(bytes);
  3626. } else if (typeof bytes === 'string') {
  3627. bytes = Buffer.from(bytes, 'utf8');
  3628. }
  3629. return _crypto.default.createHash('sha1').update(bytes).digest();
  3630. }
  3631. var _default = sha1;
  3632. exports["default"] = _default;
  3633. /***/ }),
  3634. /***/ 1458:
  3635. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3636. "use strict";
  3637. Object.defineProperty(exports, "__esModule", ({
  3638. value: true
  3639. }));
  3640. exports["default"] = void 0;
  3641. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3642. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3643. /**
  3644. * Convert array of 16 byte values to UUID string format of the form:
  3645. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3646. */
  3647. const byteToHex = [];
  3648. for (let i = 0; i < 256; ++i) {
  3649. byteToHex.push((i + 0x100).toString(16).substr(1));
  3650. }
  3651. function stringify(arr, offset = 0) {
  3652. // Note: Be careful editing this code! It's been tuned for performance
  3653. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3654. 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
  3655. // of the following:
  3656. // - One or more input array values don't map to a hex octet (leading to
  3657. // "undefined" in the uuid)
  3658. // - Invalid input values for the RFC `version` or `variant` fields
  3659. if (!(0, _validate.default)(uuid)) {
  3660. throw TypeError('Stringified UUID is invalid');
  3661. }
  3662. return uuid;
  3663. }
  3664. var _default = stringify;
  3665. exports["default"] = _default;
  3666. /***/ }),
  3667. /***/ 1595:
  3668. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3669. "use strict";
  3670. Object.defineProperty(exports, "__esModule", ({
  3671. value: true
  3672. }));
  3673. exports["default"] = void 0;
  3674. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3675. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3676. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3677. // **`v1()` - Generate time-based UUID**
  3678. //
  3679. // Inspired by https://github.com/LiosK/UUID.js
  3680. // and http://docs.python.org/library/uuid.html
  3681. let _nodeId;
  3682. let _clockseq; // Previous uuid creation time
  3683. let _lastMSecs = 0;
  3684. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3685. function v1(options, buf, offset) {
  3686. let i = buf && offset || 0;
  3687. const b = buf || new Array(16);
  3688. options = options || {};
  3689. let node = options.node || _nodeId;
  3690. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3691. // specified. We do this lazily to minimize issues related to insufficient
  3692. // system entropy. See #189
  3693. if (node == null || clockseq == null) {
  3694. const seedBytes = options.random || (options.rng || _rng.default)();
  3695. if (node == null) {
  3696. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3697. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3698. }
  3699. if (clockseq == null) {
  3700. // Per 4.2.2, randomize (14 bit) clockseq
  3701. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3702. }
  3703. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3704. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3705. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3706. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3707. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3708. // cycle to simulate higher resolution clock
  3709. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3710. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3711. if (dt < 0 && options.clockseq === undefined) {
  3712. clockseq = clockseq + 1 & 0x3fff;
  3713. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3714. // time interval
  3715. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3716. nsecs = 0;
  3717. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3718. if (nsecs >= 10000) {
  3719. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3720. }
  3721. _lastMSecs = msecs;
  3722. _lastNSecs = nsecs;
  3723. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3724. msecs += 12219292800000; // `time_low`
  3725. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3726. b[i++] = tl >>> 24 & 0xff;
  3727. b[i++] = tl >>> 16 & 0xff;
  3728. b[i++] = tl >>> 8 & 0xff;
  3729. b[i++] = tl & 0xff; // `time_mid`
  3730. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  3731. b[i++] = tmh >>> 8 & 0xff;
  3732. b[i++] = tmh & 0xff; // `time_high_and_version`
  3733. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  3734. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  3735. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  3736. b[i++] = clockseq & 0xff; // `node`
  3737. for (let n = 0; n < 6; ++n) {
  3738. b[i + n] = node[n];
  3739. }
  3740. return buf || (0, _stringify.default)(b);
  3741. }
  3742. var _default = v1;
  3743. exports["default"] = _default;
  3744. /***/ }),
  3745. /***/ 6993:
  3746. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3747. "use strict";
  3748. Object.defineProperty(exports, "__esModule", ({
  3749. value: true
  3750. }));
  3751. exports["default"] = void 0;
  3752. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3753. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  3754. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3755. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  3756. var _default = v3;
  3757. exports["default"] = _default;
  3758. /***/ }),
  3759. /***/ 5920:
  3760. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3761. "use strict";
  3762. Object.defineProperty(exports, "__esModule", ({
  3763. value: true
  3764. }));
  3765. exports["default"] = _default;
  3766. exports.URL = exports.DNS = void 0;
  3767. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3768. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3769. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3770. function stringToBytes(str) {
  3771. str = unescape(encodeURIComponent(str)); // UTF8 escape
  3772. const bytes = [];
  3773. for (let i = 0; i < str.length; ++i) {
  3774. bytes.push(str.charCodeAt(i));
  3775. }
  3776. return bytes;
  3777. }
  3778. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  3779. exports.DNS = DNS;
  3780. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  3781. exports.URL = URL;
  3782. function _default(name, version, hashfunc) {
  3783. function generateUUID(value, namespace, buf, offset) {
  3784. if (typeof value === 'string') {
  3785. value = stringToBytes(value);
  3786. }
  3787. if (typeof namespace === 'string') {
  3788. namespace = (0, _parse.default)(namespace);
  3789. }
  3790. if (namespace.length !== 16) {
  3791. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  3792. } // Compute hash of namespace and value, Per 4.3
  3793. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  3794. // hashfunc([...namespace, ... value])`
  3795. let bytes = new Uint8Array(16 + value.length);
  3796. bytes.set(namespace);
  3797. bytes.set(value, namespace.length);
  3798. bytes = hashfunc(bytes);
  3799. bytes[6] = bytes[6] & 0x0f | version;
  3800. bytes[8] = bytes[8] & 0x3f | 0x80;
  3801. if (buf) {
  3802. offset = offset || 0;
  3803. for (let i = 0; i < 16; ++i) {
  3804. buf[offset + i] = bytes[i];
  3805. }
  3806. return buf;
  3807. }
  3808. return (0, _stringify.default)(bytes);
  3809. } // Function#name is not settable on some platforms (#270)
  3810. try {
  3811. generateUUID.name = name; // eslint-disable-next-line no-empty
  3812. } catch (err) {} // For CommonJS default export support
  3813. generateUUID.DNS = DNS;
  3814. generateUUID.URL = URL;
  3815. return generateUUID;
  3816. }
  3817. /***/ }),
  3818. /***/ 1472:
  3819. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3820. "use strict";
  3821. Object.defineProperty(exports, "__esModule", ({
  3822. value: true
  3823. }));
  3824. exports["default"] = void 0;
  3825. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3826. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3827. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3828. function v4(options, buf, offset) {
  3829. options = options || {};
  3830. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  3831. rnds[6] = rnds[6] & 0x0f | 0x40;
  3832. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  3833. if (buf) {
  3834. offset = offset || 0;
  3835. for (let i = 0; i < 16; ++i) {
  3836. buf[offset + i] = rnds[i];
  3837. }
  3838. return buf;
  3839. }
  3840. return (0, _stringify.default)(rnds);
  3841. }
  3842. var _default = v4;
  3843. exports["default"] = _default;
  3844. /***/ }),
  3845. /***/ 6217:
  3846. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3847. "use strict";
  3848. Object.defineProperty(exports, "__esModule", ({
  3849. value: true
  3850. }));
  3851. exports["default"] = void 0;
  3852. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3853. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  3854. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3855. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  3856. var _default = v5;
  3857. exports["default"] = _default;
  3858. /***/ }),
  3859. /***/ 2609:
  3860. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3861. "use strict";
  3862. Object.defineProperty(exports, "__esModule", ({
  3863. value: true
  3864. }));
  3865. exports["default"] = void 0;
  3866. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  3867. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3868. function validate(uuid) {
  3869. return typeof uuid === 'string' && _regex.default.test(uuid);
  3870. }
  3871. var _default = validate;
  3872. exports["default"] = _default;
  3873. /***/ }),
  3874. /***/ 427:
  3875. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3876. "use strict";
  3877. Object.defineProperty(exports, "__esModule", ({
  3878. value: true
  3879. }));
  3880. exports["default"] = void 0;
  3881. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3882. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3883. function version(uuid) {
  3884. if (!(0, _validate.default)(uuid)) {
  3885. throw TypeError('Invalid UUID');
  3886. }
  3887. return parseInt(uuid.substr(14, 1), 16);
  3888. }
  3889. var _default = version;
  3890. exports["default"] = _default;
  3891. /***/ }),
  3892. /***/ 1514:
  3893. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3894. "use strict";
  3895. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3896. if (k2 === undefined) k2 = k;
  3897. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3898. }) : (function(o, m, k, k2) {
  3899. if (k2 === undefined) k2 = k;
  3900. o[k2] = m[k];
  3901. }));
  3902. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3903. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3904. }) : function(o, v) {
  3905. o["default"] = v;
  3906. });
  3907. var __importStar = (this && this.__importStar) || function (mod) {
  3908. if (mod && mod.__esModule) return mod;
  3909. var result = {};
  3910. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3911. __setModuleDefault(result, mod);
  3912. return result;
  3913. };
  3914. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3915. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3916. return new (P || (P = Promise))(function (resolve, reject) {
  3917. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3918. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3919. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3920. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3921. });
  3922. };
  3923. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3924. exports.getExecOutput = exports.exec = void 0;
  3925. const string_decoder_1 = __nccwpck_require__(1576);
  3926. const tr = __importStar(__nccwpck_require__(8159));
  3927. /**
  3928. * Exec a command.
  3929. * Output will be streamed to the live console.
  3930. * Returns promise with return code
  3931. *
  3932. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3933. * @param args optional arguments for tool. Escaping is handled by the lib.
  3934. * @param options optional exec options. See ExecOptions
  3935. * @returns Promise<number> exit code
  3936. */
  3937. function exec(commandLine, args, options) {
  3938. return __awaiter(this, void 0, void 0, function* () {
  3939. const commandArgs = tr.argStringToArray(commandLine);
  3940. if (commandArgs.length === 0) {
  3941. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  3942. }
  3943. // Path to tool to execute should be first arg
  3944. const toolPath = commandArgs[0];
  3945. args = commandArgs.slice(1).concat(args || []);
  3946. const runner = new tr.ToolRunner(toolPath, args, options);
  3947. return runner.exec();
  3948. });
  3949. }
  3950. exports.exec = exec;
  3951. /**
  3952. * Exec a command and get the output.
  3953. * Output will be streamed to the live console.
  3954. * Returns promise with the exit code and collected stdout and stderr
  3955. *
  3956. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3957. * @param args optional arguments for tool. Escaping is handled by the lib.
  3958. * @param options optional exec options. See ExecOptions
  3959. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  3960. */
  3961. function getExecOutput(commandLine, args, options) {
  3962. var _a, _b;
  3963. return __awaiter(this, void 0, void 0, function* () {
  3964. let stdout = '';
  3965. let stderr = '';
  3966. //Using string decoder covers the case where a mult-byte character is split
  3967. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  3968. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  3969. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  3970. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  3971. const stdErrListener = (data) => {
  3972. stderr += stderrDecoder.write(data);
  3973. if (originalStdErrListener) {
  3974. originalStdErrListener(data);
  3975. }
  3976. };
  3977. const stdOutListener = (data) => {
  3978. stdout += stdoutDecoder.write(data);
  3979. if (originalStdoutListener) {
  3980. originalStdoutListener(data);
  3981. }
  3982. };
  3983. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  3984. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  3985. //flush any remaining characters
  3986. stdout += stdoutDecoder.end();
  3987. stderr += stderrDecoder.end();
  3988. return {
  3989. exitCode,
  3990. stdout,
  3991. stderr
  3992. };
  3993. });
  3994. }
  3995. exports.getExecOutput = getExecOutput;
  3996. //# sourceMappingURL=exec.js.map
  3997. /***/ }),
  3998. /***/ 8159:
  3999. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4000. "use strict";
  4001. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4002. if (k2 === undefined) k2 = k;
  4003. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4004. }) : (function(o, m, k, k2) {
  4005. if (k2 === undefined) k2 = k;
  4006. o[k2] = m[k];
  4007. }));
  4008. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4009. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4010. }) : function(o, v) {
  4011. o["default"] = v;
  4012. });
  4013. var __importStar = (this && this.__importStar) || function (mod) {
  4014. if (mod && mod.__esModule) return mod;
  4015. var result = {};
  4016. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4017. __setModuleDefault(result, mod);
  4018. return result;
  4019. };
  4020. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4021. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4022. return new (P || (P = Promise))(function (resolve, reject) {
  4023. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4024. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4025. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4026. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4027. });
  4028. };
  4029. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4030. exports.argStringToArray = exports.ToolRunner = void 0;
  4031. const os = __importStar(__nccwpck_require__(2037));
  4032. const events = __importStar(__nccwpck_require__(2361));
  4033. const child = __importStar(__nccwpck_require__(2081));
  4034. const path = __importStar(__nccwpck_require__(1017));
  4035. const io = __importStar(__nccwpck_require__(7436));
  4036. const ioUtil = __importStar(__nccwpck_require__(1962));
  4037. const timers_1 = __nccwpck_require__(9512);
  4038. /* eslint-disable @typescript-eslint/unbound-method */
  4039. const IS_WINDOWS = process.platform === 'win32';
  4040. /*
  4041. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4042. */
  4043. class ToolRunner extends events.EventEmitter {
  4044. constructor(toolPath, args, options) {
  4045. super();
  4046. if (!toolPath) {
  4047. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4048. }
  4049. this.toolPath = toolPath;
  4050. this.args = args || [];
  4051. this.options = options || {};
  4052. }
  4053. _debug(message) {
  4054. if (this.options.listeners && this.options.listeners.debug) {
  4055. this.options.listeners.debug(message);
  4056. }
  4057. }
  4058. _getCommandString(options, noPrefix) {
  4059. const toolPath = this._getSpawnFileName();
  4060. const args = this._getSpawnArgs(options);
  4061. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4062. if (IS_WINDOWS) {
  4063. // Windows + cmd file
  4064. if (this._isCmdFile()) {
  4065. cmd += toolPath;
  4066. for (const a of args) {
  4067. cmd += ` ${a}`;
  4068. }
  4069. }
  4070. // Windows + verbatim
  4071. else if (options.windowsVerbatimArguments) {
  4072. cmd += `"${toolPath}"`;
  4073. for (const a of args) {
  4074. cmd += ` ${a}`;
  4075. }
  4076. }
  4077. // Windows (regular)
  4078. else {
  4079. cmd += this._windowsQuoteCmdArg(toolPath);
  4080. for (const a of args) {
  4081. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4082. }
  4083. }
  4084. }
  4085. else {
  4086. // OSX/Linux - this can likely be improved with some form of quoting.
  4087. // creating processes on Unix is fundamentally different than Windows.
  4088. // on Unix, execvp() takes an arg array.
  4089. cmd += toolPath;
  4090. for (const a of args) {
  4091. cmd += ` ${a}`;
  4092. }
  4093. }
  4094. return cmd;
  4095. }
  4096. _processLineBuffer(data, strBuffer, onLine) {
  4097. try {
  4098. let s = strBuffer + data.toString();
  4099. let n = s.indexOf(os.EOL);
  4100. while (n > -1) {
  4101. const line = s.substring(0, n);
  4102. onLine(line);
  4103. // the rest of the string ...
  4104. s = s.substring(n + os.EOL.length);
  4105. n = s.indexOf(os.EOL);
  4106. }
  4107. return s;
  4108. }
  4109. catch (err) {
  4110. // streaming lines to console is best effort. Don't fail a build.
  4111. this._debug(`error processing line. Failed with error ${err}`);
  4112. return '';
  4113. }
  4114. }
  4115. _getSpawnFileName() {
  4116. if (IS_WINDOWS) {
  4117. if (this._isCmdFile()) {
  4118. return process.env['COMSPEC'] || 'cmd.exe';
  4119. }
  4120. }
  4121. return this.toolPath;
  4122. }
  4123. _getSpawnArgs(options) {
  4124. if (IS_WINDOWS) {
  4125. if (this._isCmdFile()) {
  4126. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4127. for (const a of this.args) {
  4128. argline += ' ';
  4129. argline += options.windowsVerbatimArguments
  4130. ? a
  4131. : this._windowsQuoteCmdArg(a);
  4132. }
  4133. argline += '"';
  4134. return [argline];
  4135. }
  4136. }
  4137. return this.args;
  4138. }
  4139. _endsWith(str, end) {
  4140. return str.endsWith(end);
  4141. }
  4142. _isCmdFile() {
  4143. const upperToolPath = this.toolPath.toUpperCase();
  4144. return (this._endsWith(upperToolPath, '.CMD') ||
  4145. this._endsWith(upperToolPath, '.BAT'));
  4146. }
  4147. _windowsQuoteCmdArg(arg) {
  4148. // for .exe, apply the normal quoting rules that libuv applies
  4149. if (!this._isCmdFile()) {
  4150. return this._uvQuoteCmdArg(arg);
  4151. }
  4152. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4153. // the libuv rules are generic and are not designed specifically for cmd.exe
  4154. // command line parser.
  4155. //
  4156. // for a detailed description of the cmd.exe command line parser, refer to
  4157. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4158. // need quotes for empty arg
  4159. if (!arg) {
  4160. return '""';
  4161. }
  4162. // determine whether the arg needs to be quoted
  4163. const cmdSpecialChars = [
  4164. ' ',
  4165. '\t',
  4166. '&',
  4167. '(',
  4168. ')',
  4169. '[',
  4170. ']',
  4171. '{',
  4172. '}',
  4173. '^',
  4174. '=',
  4175. ';',
  4176. '!',
  4177. "'",
  4178. '+',
  4179. ',',
  4180. '`',
  4181. '~',
  4182. '|',
  4183. '<',
  4184. '>',
  4185. '"'
  4186. ];
  4187. let needsQuotes = false;
  4188. for (const char of arg) {
  4189. if (cmdSpecialChars.some(x => x === char)) {
  4190. needsQuotes = true;
  4191. break;
  4192. }
  4193. }
  4194. // short-circuit if quotes not needed
  4195. if (!needsQuotes) {
  4196. return arg;
  4197. }
  4198. // the following quoting rules are very similar to the rules that by libuv applies.
  4199. //
  4200. // 1) wrap the string in quotes
  4201. //
  4202. // 2) double-up quotes - i.e. " => ""
  4203. //
  4204. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4205. // doesn't work well with a cmd.exe command line.
  4206. //
  4207. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4208. // for example, the command line:
  4209. // foo.exe "myarg:""my val"""
  4210. // is parsed by a .NET console app into an arg array:
  4211. // [ "myarg:\"my val\"" ]
  4212. // which is the same end result when applying libuv quoting rules. although the actual
  4213. // command line from libuv quoting rules would look like:
  4214. // foo.exe "myarg:\"my val\""
  4215. //
  4216. // 3) double-up slashes that precede a quote,
  4217. // e.g. hello \world => "hello \world"
  4218. // hello\"world => "hello\\""world"
  4219. // hello\\"world => "hello\\\\""world"
  4220. // hello world\ => "hello world\\"
  4221. //
  4222. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4223. // the reasons for including this as a .cmd quoting rule are:
  4224. //
  4225. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4226. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4227. //
  4228. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4229. // haven't heard any complaints about that aspect.
  4230. //
  4231. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4232. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4233. // by using %%.
  4234. //
  4235. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4236. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4237. //
  4238. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4239. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4240. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4241. // to an external program.
  4242. //
  4243. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4244. // % can be escaped within a .cmd file.
  4245. let reverse = '"';
  4246. let quoteHit = true;
  4247. for (let i = arg.length; i > 0; i--) {
  4248. // walk the string in reverse
  4249. reverse += arg[i - 1];
  4250. if (quoteHit && arg[i - 1] === '\\') {
  4251. reverse += '\\'; // double the slash
  4252. }
  4253. else if (arg[i - 1] === '"') {
  4254. quoteHit = true;
  4255. reverse += '"'; // double the quote
  4256. }
  4257. else {
  4258. quoteHit = false;
  4259. }
  4260. }
  4261. reverse += '"';
  4262. return reverse
  4263. .split('')
  4264. .reverse()
  4265. .join('');
  4266. }
  4267. _uvQuoteCmdArg(arg) {
  4268. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4269. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4270. // is used.
  4271. //
  4272. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4273. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4274. // pasting copyright notice from Node within this function:
  4275. //
  4276. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4277. //
  4278. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4279. // of this software and associated documentation files (the "Software"), to
  4280. // deal in the Software without restriction, including without limitation the
  4281. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4282. // sell copies of the Software, and to permit persons to whom the Software is
  4283. // furnished to do so, subject to the following conditions:
  4284. //
  4285. // The above copyright notice and this permission notice shall be included in
  4286. // all copies or substantial portions of the Software.
  4287. //
  4288. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4289. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4290. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4291. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4292. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4293. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4294. // IN THE SOFTWARE.
  4295. if (!arg) {
  4296. // Need double quotation for empty argument
  4297. return '""';
  4298. }
  4299. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4300. // No quotation needed
  4301. return arg;
  4302. }
  4303. if (!arg.includes('"') && !arg.includes('\\')) {
  4304. // No embedded double quotes or backslashes, so I can just wrap
  4305. // quote marks around the whole thing.
  4306. return `"${arg}"`;
  4307. }
  4308. // Expected input/output:
  4309. // input : hello"world
  4310. // output: "hello\"world"
  4311. // input : hello""world
  4312. // output: "hello\"\"world"
  4313. // input : hello\world
  4314. // output: hello\world
  4315. // input : hello\\world
  4316. // output: hello\\world
  4317. // input : hello\"world
  4318. // output: "hello\\\"world"
  4319. // input : hello\\"world
  4320. // output: "hello\\\\\"world"
  4321. // input : hello world\
  4322. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4323. // but it appears the comment is wrong, it should be "hello world\\"
  4324. let reverse = '"';
  4325. let quoteHit = true;
  4326. for (let i = arg.length; i > 0; i--) {
  4327. // walk the string in reverse
  4328. reverse += arg[i - 1];
  4329. if (quoteHit && arg[i - 1] === '\\') {
  4330. reverse += '\\';
  4331. }
  4332. else if (arg[i - 1] === '"') {
  4333. quoteHit = true;
  4334. reverse += '\\';
  4335. }
  4336. else {
  4337. quoteHit = false;
  4338. }
  4339. }
  4340. reverse += '"';
  4341. return reverse
  4342. .split('')
  4343. .reverse()
  4344. .join('');
  4345. }
  4346. _cloneExecOptions(options) {
  4347. options = options || {};
  4348. const result = {
  4349. cwd: options.cwd || process.cwd(),
  4350. env: options.env || process.env,
  4351. silent: options.silent || false,
  4352. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4353. failOnStdErr: options.failOnStdErr || false,
  4354. ignoreReturnCode: options.ignoreReturnCode || false,
  4355. delay: options.delay || 10000
  4356. };
  4357. result.outStream = options.outStream || process.stdout;
  4358. result.errStream = options.errStream || process.stderr;
  4359. return result;
  4360. }
  4361. _getSpawnOptions(options, toolPath) {
  4362. options = options || {};
  4363. const result = {};
  4364. result.cwd = options.cwd;
  4365. result.env = options.env;
  4366. result['windowsVerbatimArguments'] =
  4367. options.windowsVerbatimArguments || this._isCmdFile();
  4368. if (options.windowsVerbatimArguments) {
  4369. result.argv0 = `"${toolPath}"`;
  4370. }
  4371. return result;
  4372. }
  4373. /**
  4374. * Exec a tool.
  4375. * Output will be streamed to the live console.
  4376. * Returns promise with return code
  4377. *
  4378. * @param tool path to tool to exec
  4379. * @param options optional exec options. See ExecOptions
  4380. * @returns number
  4381. */
  4382. exec() {
  4383. return __awaiter(this, void 0, void 0, function* () {
  4384. // root the tool path if it is unrooted and contains relative pathing
  4385. if (!ioUtil.isRooted(this.toolPath) &&
  4386. (this.toolPath.includes('/') ||
  4387. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4388. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4389. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4390. }
  4391. // if the tool is only a file name, then resolve it from the PATH
  4392. // otherwise verify it exists (add extension on Windows if necessary)
  4393. this.toolPath = yield io.which(this.toolPath, true);
  4394. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4395. this._debug(`exec tool: ${this.toolPath}`);
  4396. this._debug('arguments:');
  4397. for (const arg of this.args) {
  4398. this._debug(` ${arg}`);
  4399. }
  4400. const optionsNonNull = this._cloneExecOptions(this.options);
  4401. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4402. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4403. }
  4404. const state = new ExecState(optionsNonNull, this.toolPath);
  4405. state.on('debug', (message) => {
  4406. this._debug(message);
  4407. });
  4408. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4409. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4410. }
  4411. const fileName = this._getSpawnFileName();
  4412. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4413. let stdbuffer = '';
  4414. if (cp.stdout) {
  4415. cp.stdout.on('data', (data) => {
  4416. if (this.options.listeners && this.options.listeners.stdout) {
  4417. this.options.listeners.stdout(data);
  4418. }
  4419. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4420. optionsNonNull.outStream.write(data);
  4421. }
  4422. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4423. if (this.options.listeners && this.options.listeners.stdline) {
  4424. this.options.listeners.stdline(line);
  4425. }
  4426. });
  4427. });
  4428. }
  4429. let errbuffer = '';
  4430. if (cp.stderr) {
  4431. cp.stderr.on('data', (data) => {
  4432. state.processStderr = true;
  4433. if (this.options.listeners && this.options.listeners.stderr) {
  4434. this.options.listeners.stderr(data);
  4435. }
  4436. if (!optionsNonNull.silent &&
  4437. optionsNonNull.errStream &&
  4438. optionsNonNull.outStream) {
  4439. const s = optionsNonNull.failOnStdErr
  4440. ? optionsNonNull.errStream
  4441. : optionsNonNull.outStream;
  4442. s.write(data);
  4443. }
  4444. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4445. if (this.options.listeners && this.options.listeners.errline) {
  4446. this.options.listeners.errline(line);
  4447. }
  4448. });
  4449. });
  4450. }
  4451. cp.on('error', (err) => {
  4452. state.processError = err.message;
  4453. state.processExited = true;
  4454. state.processClosed = true;
  4455. state.CheckComplete();
  4456. });
  4457. cp.on('exit', (code) => {
  4458. state.processExitCode = code;
  4459. state.processExited = true;
  4460. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4461. state.CheckComplete();
  4462. });
  4463. cp.on('close', (code) => {
  4464. state.processExitCode = code;
  4465. state.processExited = true;
  4466. state.processClosed = true;
  4467. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4468. state.CheckComplete();
  4469. });
  4470. state.on('done', (error, exitCode) => {
  4471. if (stdbuffer.length > 0) {
  4472. this.emit('stdline', stdbuffer);
  4473. }
  4474. if (errbuffer.length > 0) {
  4475. this.emit('errline', errbuffer);
  4476. }
  4477. cp.removeAllListeners();
  4478. if (error) {
  4479. reject(error);
  4480. }
  4481. else {
  4482. resolve(exitCode);
  4483. }
  4484. });
  4485. if (this.options.input) {
  4486. if (!cp.stdin) {
  4487. throw new Error('child process missing stdin');
  4488. }
  4489. cp.stdin.end(this.options.input);
  4490. }
  4491. }));
  4492. });
  4493. }
  4494. }
  4495. exports.ToolRunner = ToolRunner;
  4496. /**
  4497. * Convert an arg string to an array of args. Handles escaping
  4498. *
  4499. * @param argString string of arguments
  4500. * @returns string[] array of arguments
  4501. */
  4502. function argStringToArray(argString) {
  4503. const args = [];
  4504. let inQuotes = false;
  4505. let escaped = false;
  4506. let arg = '';
  4507. function append(c) {
  4508. // we only escape double quotes.
  4509. if (escaped && c !== '"') {
  4510. arg += '\\';
  4511. }
  4512. arg += c;
  4513. escaped = false;
  4514. }
  4515. for (let i = 0; i < argString.length; i++) {
  4516. const c = argString.charAt(i);
  4517. if (c === '"') {
  4518. if (!escaped) {
  4519. inQuotes = !inQuotes;
  4520. }
  4521. else {
  4522. append(c);
  4523. }
  4524. continue;
  4525. }
  4526. if (c === '\\' && escaped) {
  4527. append(c);
  4528. continue;
  4529. }
  4530. if (c === '\\' && inQuotes) {
  4531. escaped = true;
  4532. continue;
  4533. }
  4534. if (c === ' ' && !inQuotes) {
  4535. if (arg.length > 0) {
  4536. args.push(arg);
  4537. arg = '';
  4538. }
  4539. continue;
  4540. }
  4541. append(c);
  4542. }
  4543. if (arg.length > 0) {
  4544. args.push(arg.trim());
  4545. }
  4546. return args;
  4547. }
  4548. exports.argStringToArray = argStringToArray;
  4549. class ExecState extends events.EventEmitter {
  4550. constructor(options, toolPath) {
  4551. super();
  4552. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4553. this.processError = '';
  4554. this.processExitCode = 0;
  4555. this.processExited = false; // tracks whether the process has exited
  4556. this.processStderr = false; // tracks whether stderr was written to
  4557. this.delay = 10000; // 10 seconds
  4558. this.done = false;
  4559. this.timeout = null;
  4560. if (!toolPath) {
  4561. throw new Error('toolPath must not be empty');
  4562. }
  4563. this.options = options;
  4564. this.toolPath = toolPath;
  4565. if (options.delay) {
  4566. this.delay = options.delay;
  4567. }
  4568. }
  4569. CheckComplete() {
  4570. if (this.done) {
  4571. return;
  4572. }
  4573. if (this.processClosed) {
  4574. this._setResult();
  4575. }
  4576. else if (this.processExited) {
  4577. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4578. }
  4579. }
  4580. _debug(message) {
  4581. this.emit('debug', message);
  4582. }
  4583. _setResult() {
  4584. // determine whether there is an error
  4585. let error;
  4586. if (this.processExited) {
  4587. if (this.processError) {
  4588. 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}`);
  4589. }
  4590. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4591. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4592. }
  4593. else if (this.processStderr && this.options.failOnStdErr) {
  4594. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4595. }
  4596. }
  4597. // clear the timeout
  4598. if (this.timeout) {
  4599. clearTimeout(this.timeout);
  4600. this.timeout = null;
  4601. }
  4602. this.done = true;
  4603. this.emit('done', error, this.processExitCode);
  4604. }
  4605. static HandleTimeout(state) {
  4606. if (state.done) {
  4607. return;
  4608. }
  4609. if (!state.processClosed && state.processExited) {
  4610. const message = `The STDIO streams did not close within ${state.delay /
  4611. 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.`;
  4612. state._debug(message);
  4613. }
  4614. state._setResult();
  4615. }
  4616. }
  4617. //# sourceMappingURL=toolrunner.js.map
  4618. /***/ }),
  4619. /***/ 4087:
  4620. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4621. "use strict";
  4622. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4623. exports.Context = void 0;
  4624. const fs_1 = __nccwpck_require__(7147);
  4625. const os_1 = __nccwpck_require__(2037);
  4626. class Context {
  4627. /**
  4628. * Hydrate the context from the environment
  4629. */
  4630. constructor() {
  4631. var _a, _b, _c;
  4632. this.payload = {};
  4633. if (process.env.GITHUB_EVENT_PATH) {
  4634. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4635. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4636. }
  4637. else {
  4638. const path = process.env.GITHUB_EVENT_PATH;
  4639. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4640. }
  4641. }
  4642. this.eventName = process.env.GITHUB_EVENT_NAME;
  4643. this.sha = process.env.GITHUB_SHA;
  4644. this.ref = process.env.GITHUB_REF;
  4645. this.workflow = process.env.GITHUB_WORKFLOW;
  4646. this.action = process.env.GITHUB_ACTION;
  4647. this.actor = process.env.GITHUB_ACTOR;
  4648. this.job = process.env.GITHUB_JOB;
  4649. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4650. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4651. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4652. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4653. this.graphqlUrl =
  4654. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4655. }
  4656. get issue() {
  4657. const payload = this.payload;
  4658. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4659. }
  4660. get repo() {
  4661. if (process.env.GITHUB_REPOSITORY) {
  4662. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4663. return { owner, repo };
  4664. }
  4665. if (this.payload.repository) {
  4666. return {
  4667. owner: this.payload.repository.owner.login,
  4668. repo: this.payload.repository.name
  4669. };
  4670. }
  4671. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4672. }
  4673. }
  4674. exports.Context = Context;
  4675. //# sourceMappingURL=context.js.map
  4676. /***/ }),
  4677. /***/ 5438:
  4678. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4679. "use strict";
  4680. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4681. if (k2 === undefined) k2 = k;
  4682. var desc = Object.getOwnPropertyDescriptor(m, k);
  4683. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4684. desc = { enumerable: true, get: function() { return m[k]; } };
  4685. }
  4686. Object.defineProperty(o, k2, desc);
  4687. }) : (function(o, m, k, k2) {
  4688. if (k2 === undefined) k2 = k;
  4689. o[k2] = m[k];
  4690. }));
  4691. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4692. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4693. }) : function(o, v) {
  4694. o["default"] = v;
  4695. });
  4696. var __importStar = (this && this.__importStar) || function (mod) {
  4697. if (mod && mod.__esModule) return mod;
  4698. var result = {};
  4699. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4700. __setModuleDefault(result, mod);
  4701. return result;
  4702. };
  4703. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4704. exports.getOctokit = exports.context = void 0;
  4705. const Context = __importStar(__nccwpck_require__(4087));
  4706. const utils_1 = __nccwpck_require__(3030);
  4707. exports.context = new Context.Context();
  4708. /**
  4709. * Returns a hydrated octokit ready to use for GitHub Actions
  4710. *
  4711. * @param token the repo PAT or GITHUB_TOKEN
  4712. * @param options other options to set
  4713. */
  4714. function getOctokit(token, options, ...additionalPlugins) {
  4715. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4716. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4717. }
  4718. exports.getOctokit = getOctokit;
  4719. //# sourceMappingURL=github.js.map
  4720. /***/ }),
  4721. /***/ 7914:
  4722. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4723. "use strict";
  4724. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4725. if (k2 === undefined) k2 = k;
  4726. var desc = Object.getOwnPropertyDescriptor(m, k);
  4727. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4728. desc = { enumerable: true, get: function() { return m[k]; } };
  4729. }
  4730. Object.defineProperty(o, k2, desc);
  4731. }) : (function(o, m, k, k2) {
  4732. if (k2 === undefined) k2 = k;
  4733. o[k2] = m[k];
  4734. }));
  4735. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4736. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4737. }) : function(o, v) {
  4738. o["default"] = v;
  4739. });
  4740. var __importStar = (this && this.__importStar) || function (mod) {
  4741. if (mod && mod.__esModule) return mod;
  4742. var result = {};
  4743. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4744. __setModuleDefault(result, mod);
  4745. return result;
  4746. };
  4747. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4748. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4749. return new (P || (P = Promise))(function (resolve, reject) {
  4750. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4751. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4752. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4753. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4754. });
  4755. };
  4756. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4757. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  4758. const httpClient = __importStar(__nccwpck_require__(6255));
  4759. const undici_1 = __nccwpck_require__(1773);
  4760. function getAuthString(token, options) {
  4761. if (!token && !options.auth) {
  4762. throw new Error('Parameter token or opts.auth is required');
  4763. }
  4764. else if (token && options.auth) {
  4765. throw new Error('Parameters token and opts.auth may not both be specified');
  4766. }
  4767. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  4768. }
  4769. exports.getAuthString = getAuthString;
  4770. function getProxyAgent(destinationUrl) {
  4771. const hc = new httpClient.HttpClient();
  4772. return hc.getAgent(destinationUrl);
  4773. }
  4774. exports.getProxyAgent = getProxyAgent;
  4775. function getProxyAgentDispatcher(destinationUrl) {
  4776. const hc = new httpClient.HttpClient();
  4777. return hc.getAgentDispatcher(destinationUrl);
  4778. }
  4779. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  4780. function getProxyFetch(destinationUrl) {
  4781. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  4782. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  4783. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  4784. });
  4785. return proxyFetch;
  4786. }
  4787. exports.getProxyFetch = getProxyFetch;
  4788. function getApiBaseUrl() {
  4789. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  4790. }
  4791. exports.getApiBaseUrl = getApiBaseUrl;
  4792. //# sourceMappingURL=utils.js.map
  4793. /***/ }),
  4794. /***/ 3030:
  4795. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4796. "use strict";
  4797. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4798. if (k2 === undefined) k2 = k;
  4799. var desc = Object.getOwnPropertyDescriptor(m, k);
  4800. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4801. desc = { enumerable: true, get: function() { return m[k]; } };
  4802. }
  4803. Object.defineProperty(o, k2, desc);
  4804. }) : (function(o, m, k, k2) {
  4805. if (k2 === undefined) k2 = k;
  4806. o[k2] = m[k];
  4807. }));
  4808. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4809. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4810. }) : function(o, v) {
  4811. o["default"] = v;
  4812. });
  4813. var __importStar = (this && this.__importStar) || function (mod) {
  4814. if (mod && mod.__esModule) return mod;
  4815. var result = {};
  4816. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4817. __setModuleDefault(result, mod);
  4818. return result;
  4819. };
  4820. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4821. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  4822. const Context = __importStar(__nccwpck_require__(4087));
  4823. const Utils = __importStar(__nccwpck_require__(7914));
  4824. // octokit + plugins
  4825. const core_1 = __nccwpck_require__(6762);
  4826. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  4827. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  4828. exports.context = new Context.Context();
  4829. const baseUrl = Utils.getApiBaseUrl();
  4830. exports.defaults = {
  4831. baseUrl,
  4832. request: {
  4833. agent: Utils.getProxyAgent(baseUrl),
  4834. fetch: Utils.getProxyFetch(baseUrl)
  4835. }
  4836. };
  4837. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  4838. /**
  4839. * Convience function to correctly format Octokit Options to pass into the constructor.
  4840. *
  4841. * @param token the repo PAT or GITHUB_TOKEN
  4842. * @param options other options to set
  4843. */
  4844. function getOctokitOptions(token, options) {
  4845. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  4846. // Auth
  4847. const auth = Utils.getAuthString(token, opts);
  4848. if (auth) {
  4849. opts.auth = auth;
  4850. }
  4851. return opts;
  4852. }
  4853. exports.getOctokitOptions = getOctokitOptions;
  4854. //# sourceMappingURL=utils.js.map
  4855. /***/ }),
  4856. /***/ 5526:
  4857. /***/ (function(__unused_webpack_module, exports) {
  4858. "use strict";
  4859. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4860. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4861. return new (P || (P = Promise))(function (resolve, reject) {
  4862. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4863. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4864. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4865. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4866. });
  4867. };
  4868. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4869. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  4870. class BasicCredentialHandler {
  4871. constructor(username, password) {
  4872. this.username = username;
  4873. this.password = password;
  4874. }
  4875. prepareRequest(options) {
  4876. if (!options.headers) {
  4877. throw Error('The request has no headers');
  4878. }
  4879. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  4880. }
  4881. // This handler cannot handle 401
  4882. canHandleAuthentication() {
  4883. return false;
  4884. }
  4885. handleAuthentication() {
  4886. return __awaiter(this, void 0, void 0, function* () {
  4887. throw new Error('not implemented');
  4888. });
  4889. }
  4890. }
  4891. exports.BasicCredentialHandler = BasicCredentialHandler;
  4892. class BearerCredentialHandler {
  4893. constructor(token) {
  4894. this.token = token;
  4895. }
  4896. // currently implements pre-authorization
  4897. // TODO: support preAuth = false where it hooks on 401
  4898. prepareRequest(options) {
  4899. if (!options.headers) {
  4900. throw Error('The request has no headers');
  4901. }
  4902. options.headers['Authorization'] = `Bearer ${this.token}`;
  4903. }
  4904. // This handler cannot handle 401
  4905. canHandleAuthentication() {
  4906. return false;
  4907. }
  4908. handleAuthentication() {
  4909. return __awaiter(this, void 0, void 0, function* () {
  4910. throw new Error('not implemented');
  4911. });
  4912. }
  4913. }
  4914. exports.BearerCredentialHandler = BearerCredentialHandler;
  4915. class PersonalAccessTokenCredentialHandler {
  4916. constructor(token) {
  4917. this.token = token;
  4918. }
  4919. // currently implements pre-authorization
  4920. // TODO: support preAuth = false where it hooks on 401
  4921. prepareRequest(options) {
  4922. if (!options.headers) {
  4923. throw Error('The request has no headers');
  4924. }
  4925. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  4926. }
  4927. // This handler cannot handle 401
  4928. canHandleAuthentication() {
  4929. return false;
  4930. }
  4931. handleAuthentication() {
  4932. return __awaiter(this, void 0, void 0, function* () {
  4933. throw new Error('not implemented');
  4934. });
  4935. }
  4936. }
  4937. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  4938. //# sourceMappingURL=auth.js.map
  4939. /***/ }),
  4940. /***/ 6255:
  4941. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4942. "use strict";
  4943. /* eslint-disable @typescript-eslint/no-explicit-any */
  4944. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4945. if (k2 === undefined) k2 = k;
  4946. var desc = Object.getOwnPropertyDescriptor(m, k);
  4947. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4948. desc = { enumerable: true, get: function() { return m[k]; } };
  4949. }
  4950. Object.defineProperty(o, k2, desc);
  4951. }) : (function(o, m, k, k2) {
  4952. if (k2 === undefined) k2 = k;
  4953. o[k2] = m[k];
  4954. }));
  4955. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4956. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4957. }) : function(o, v) {
  4958. o["default"] = v;
  4959. });
  4960. var __importStar = (this && this.__importStar) || function (mod) {
  4961. if (mod && mod.__esModule) return mod;
  4962. var result = {};
  4963. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4964. __setModuleDefault(result, mod);
  4965. return result;
  4966. };
  4967. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4968. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4969. return new (P || (P = Promise))(function (resolve, reject) {
  4970. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4971. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4972. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4973. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4974. });
  4975. };
  4976. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4977. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  4978. const http = __importStar(__nccwpck_require__(3685));
  4979. const https = __importStar(__nccwpck_require__(5687));
  4980. const pm = __importStar(__nccwpck_require__(9835));
  4981. const tunnel = __importStar(__nccwpck_require__(4294));
  4982. const undici_1 = __nccwpck_require__(1773);
  4983. var HttpCodes;
  4984. (function (HttpCodes) {
  4985. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  4986. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  4987. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  4988. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  4989. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  4990. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  4991. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  4992. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  4993. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  4994. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  4995. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  4996. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  4997. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  4998. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  4999. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5000. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5001. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5002. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5003. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5004. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5005. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5006. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5007. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5008. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5009. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5010. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5011. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5012. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5013. var Headers;
  5014. (function (Headers) {
  5015. Headers["Accept"] = "accept";
  5016. Headers["ContentType"] = "content-type";
  5017. })(Headers || (exports.Headers = Headers = {}));
  5018. var MediaTypes;
  5019. (function (MediaTypes) {
  5020. MediaTypes["ApplicationJson"] = "application/json";
  5021. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5022. /**
  5023. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5024. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5025. */
  5026. function getProxyUrl(serverUrl) {
  5027. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5028. return proxyUrl ? proxyUrl.href : '';
  5029. }
  5030. exports.getProxyUrl = getProxyUrl;
  5031. const HttpRedirectCodes = [
  5032. HttpCodes.MovedPermanently,
  5033. HttpCodes.ResourceMoved,
  5034. HttpCodes.SeeOther,
  5035. HttpCodes.TemporaryRedirect,
  5036. HttpCodes.PermanentRedirect
  5037. ];
  5038. const HttpResponseRetryCodes = [
  5039. HttpCodes.BadGateway,
  5040. HttpCodes.ServiceUnavailable,
  5041. HttpCodes.GatewayTimeout
  5042. ];
  5043. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5044. const ExponentialBackoffCeiling = 10;
  5045. const ExponentialBackoffTimeSlice = 5;
  5046. class HttpClientError extends Error {
  5047. constructor(message, statusCode) {
  5048. super(message);
  5049. this.name = 'HttpClientError';
  5050. this.statusCode = statusCode;
  5051. Object.setPrototypeOf(this, HttpClientError.prototype);
  5052. }
  5053. }
  5054. exports.HttpClientError = HttpClientError;
  5055. class HttpClientResponse {
  5056. constructor(message) {
  5057. this.message = message;
  5058. }
  5059. readBody() {
  5060. return __awaiter(this, void 0, void 0, function* () {
  5061. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5062. let output = Buffer.alloc(0);
  5063. this.message.on('data', (chunk) => {
  5064. output = Buffer.concat([output, chunk]);
  5065. });
  5066. this.message.on('end', () => {
  5067. resolve(output.toString());
  5068. });
  5069. }));
  5070. });
  5071. }
  5072. readBodyBuffer() {
  5073. return __awaiter(this, void 0, void 0, function* () {
  5074. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5075. const chunks = [];
  5076. this.message.on('data', (chunk) => {
  5077. chunks.push(chunk);
  5078. });
  5079. this.message.on('end', () => {
  5080. resolve(Buffer.concat(chunks));
  5081. });
  5082. }));
  5083. });
  5084. }
  5085. }
  5086. exports.HttpClientResponse = HttpClientResponse;
  5087. function isHttps(requestUrl) {
  5088. const parsedUrl = new URL(requestUrl);
  5089. return parsedUrl.protocol === 'https:';
  5090. }
  5091. exports.isHttps = isHttps;
  5092. class HttpClient {
  5093. constructor(userAgent, handlers, requestOptions) {
  5094. this._ignoreSslError = false;
  5095. this._allowRedirects = true;
  5096. this._allowRedirectDowngrade = false;
  5097. this._maxRedirects = 50;
  5098. this._allowRetries = false;
  5099. this._maxRetries = 1;
  5100. this._keepAlive = false;
  5101. this._disposed = false;
  5102. this.userAgent = userAgent;
  5103. this.handlers = handlers || [];
  5104. this.requestOptions = requestOptions;
  5105. if (requestOptions) {
  5106. if (requestOptions.ignoreSslError != null) {
  5107. this._ignoreSslError = requestOptions.ignoreSslError;
  5108. }
  5109. this._socketTimeout = requestOptions.socketTimeout;
  5110. if (requestOptions.allowRedirects != null) {
  5111. this._allowRedirects = requestOptions.allowRedirects;
  5112. }
  5113. if (requestOptions.allowRedirectDowngrade != null) {
  5114. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5115. }
  5116. if (requestOptions.maxRedirects != null) {
  5117. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5118. }
  5119. if (requestOptions.keepAlive != null) {
  5120. this._keepAlive = requestOptions.keepAlive;
  5121. }
  5122. if (requestOptions.allowRetries != null) {
  5123. this._allowRetries = requestOptions.allowRetries;
  5124. }
  5125. if (requestOptions.maxRetries != null) {
  5126. this._maxRetries = requestOptions.maxRetries;
  5127. }
  5128. }
  5129. }
  5130. options(requestUrl, additionalHeaders) {
  5131. return __awaiter(this, void 0, void 0, function* () {
  5132. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5133. });
  5134. }
  5135. get(requestUrl, additionalHeaders) {
  5136. return __awaiter(this, void 0, void 0, function* () {
  5137. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5138. });
  5139. }
  5140. del(requestUrl, additionalHeaders) {
  5141. return __awaiter(this, void 0, void 0, function* () {
  5142. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5143. });
  5144. }
  5145. post(requestUrl, data, additionalHeaders) {
  5146. return __awaiter(this, void 0, void 0, function* () {
  5147. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5148. });
  5149. }
  5150. patch(requestUrl, data, additionalHeaders) {
  5151. return __awaiter(this, void 0, void 0, function* () {
  5152. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5153. });
  5154. }
  5155. put(requestUrl, data, additionalHeaders) {
  5156. return __awaiter(this, void 0, void 0, function* () {
  5157. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5158. });
  5159. }
  5160. head(requestUrl, additionalHeaders) {
  5161. return __awaiter(this, void 0, void 0, function* () {
  5162. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5163. });
  5164. }
  5165. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5166. return __awaiter(this, void 0, void 0, function* () {
  5167. return this.request(verb, requestUrl, stream, additionalHeaders);
  5168. });
  5169. }
  5170. /**
  5171. * Gets a typed object from an endpoint
  5172. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5173. */
  5174. getJson(requestUrl, additionalHeaders = {}) {
  5175. return __awaiter(this, void 0, void 0, function* () {
  5176. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5177. const res = yield this.get(requestUrl, additionalHeaders);
  5178. return this._processResponse(res, this.requestOptions);
  5179. });
  5180. }
  5181. postJson(requestUrl, obj, additionalHeaders = {}) {
  5182. return __awaiter(this, void 0, void 0, function* () {
  5183. const data = JSON.stringify(obj, null, 2);
  5184. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5185. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5186. const res = yield this.post(requestUrl, data, additionalHeaders);
  5187. return this._processResponse(res, this.requestOptions);
  5188. });
  5189. }
  5190. putJson(requestUrl, obj, additionalHeaders = {}) {
  5191. return __awaiter(this, void 0, void 0, function* () {
  5192. const data = JSON.stringify(obj, null, 2);
  5193. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5194. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5195. const res = yield this.put(requestUrl, data, additionalHeaders);
  5196. return this._processResponse(res, this.requestOptions);
  5197. });
  5198. }
  5199. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5200. return __awaiter(this, void 0, void 0, function* () {
  5201. const data = JSON.stringify(obj, null, 2);
  5202. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5203. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5204. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5205. return this._processResponse(res, this.requestOptions);
  5206. });
  5207. }
  5208. /**
  5209. * Makes a raw http request.
  5210. * All other methods such as get, post, patch, and request ultimately call this.
  5211. * Prefer get, del, post and patch
  5212. */
  5213. request(verb, requestUrl, data, headers) {
  5214. return __awaiter(this, void 0, void 0, function* () {
  5215. if (this._disposed) {
  5216. throw new Error('Client has already been disposed.');
  5217. }
  5218. const parsedUrl = new URL(requestUrl);
  5219. let info = this._prepareRequest(verb, parsedUrl, headers);
  5220. // Only perform retries on reads since writes may not be idempotent.
  5221. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5222. ? this._maxRetries + 1
  5223. : 1;
  5224. let numTries = 0;
  5225. let response;
  5226. do {
  5227. response = yield this.requestRaw(info, data);
  5228. // Check if it's an authentication challenge
  5229. if (response &&
  5230. response.message &&
  5231. response.message.statusCode === HttpCodes.Unauthorized) {
  5232. let authenticationHandler;
  5233. for (const handler of this.handlers) {
  5234. if (handler.canHandleAuthentication(response)) {
  5235. authenticationHandler = handler;
  5236. break;
  5237. }
  5238. }
  5239. if (authenticationHandler) {
  5240. return authenticationHandler.handleAuthentication(this, info, data);
  5241. }
  5242. else {
  5243. // We have received an unauthorized response but have no handlers to handle it.
  5244. // Let the response return to the caller.
  5245. return response;
  5246. }
  5247. }
  5248. let redirectsRemaining = this._maxRedirects;
  5249. while (response.message.statusCode &&
  5250. HttpRedirectCodes.includes(response.message.statusCode) &&
  5251. this._allowRedirects &&
  5252. redirectsRemaining > 0) {
  5253. const redirectUrl = response.message.headers['location'];
  5254. if (!redirectUrl) {
  5255. // if there's no location to redirect to, we won't
  5256. break;
  5257. }
  5258. const parsedRedirectUrl = new URL(redirectUrl);
  5259. if (parsedUrl.protocol === 'https:' &&
  5260. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5261. !this._allowRedirectDowngrade) {
  5262. 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.');
  5263. }
  5264. // we need to finish reading the response before reassigning response
  5265. // which will leak the open socket.
  5266. yield response.readBody();
  5267. // strip authorization header if redirected to a different hostname
  5268. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5269. for (const header in headers) {
  5270. // header names are case insensitive
  5271. if (header.toLowerCase() === 'authorization') {
  5272. delete headers[header];
  5273. }
  5274. }
  5275. }
  5276. // let's make the request with the new redirectUrl
  5277. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5278. response = yield this.requestRaw(info, data);
  5279. redirectsRemaining--;
  5280. }
  5281. if (!response.message.statusCode ||
  5282. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5283. // If not a retry code, return immediately instead of retrying
  5284. return response;
  5285. }
  5286. numTries += 1;
  5287. if (numTries < maxTries) {
  5288. yield response.readBody();
  5289. yield this._performExponentialBackoff(numTries);
  5290. }
  5291. } while (numTries < maxTries);
  5292. return response;
  5293. });
  5294. }
  5295. /**
  5296. * Needs to be called if keepAlive is set to true in request options.
  5297. */
  5298. dispose() {
  5299. if (this._agent) {
  5300. this._agent.destroy();
  5301. }
  5302. this._disposed = true;
  5303. }
  5304. /**
  5305. * Raw request.
  5306. * @param info
  5307. * @param data
  5308. */
  5309. requestRaw(info, data) {
  5310. return __awaiter(this, void 0, void 0, function* () {
  5311. return new Promise((resolve, reject) => {
  5312. function callbackForResult(err, res) {
  5313. if (err) {
  5314. reject(err);
  5315. }
  5316. else if (!res) {
  5317. // If `err` is not passed, then `res` must be passed.
  5318. reject(new Error('Unknown error'));
  5319. }
  5320. else {
  5321. resolve(res);
  5322. }
  5323. }
  5324. this.requestRawWithCallback(info, data, callbackForResult);
  5325. });
  5326. });
  5327. }
  5328. /**
  5329. * Raw request with callback.
  5330. * @param info
  5331. * @param data
  5332. * @param onResult
  5333. */
  5334. requestRawWithCallback(info, data, onResult) {
  5335. if (typeof data === 'string') {
  5336. if (!info.options.headers) {
  5337. info.options.headers = {};
  5338. }
  5339. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5340. }
  5341. let callbackCalled = false;
  5342. function handleResult(err, res) {
  5343. if (!callbackCalled) {
  5344. callbackCalled = true;
  5345. onResult(err, res);
  5346. }
  5347. }
  5348. const req = info.httpModule.request(info.options, (msg) => {
  5349. const res = new HttpClientResponse(msg);
  5350. handleResult(undefined, res);
  5351. });
  5352. let socket;
  5353. req.on('socket', sock => {
  5354. socket = sock;
  5355. });
  5356. // If we ever get disconnected, we want the socket to timeout eventually
  5357. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5358. if (socket) {
  5359. socket.end();
  5360. }
  5361. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5362. });
  5363. req.on('error', function (err) {
  5364. // err has statusCode property
  5365. // res should have headers
  5366. handleResult(err);
  5367. });
  5368. if (data && typeof data === 'string') {
  5369. req.write(data, 'utf8');
  5370. }
  5371. if (data && typeof data !== 'string') {
  5372. data.on('close', function () {
  5373. req.end();
  5374. });
  5375. data.pipe(req);
  5376. }
  5377. else {
  5378. req.end();
  5379. }
  5380. }
  5381. /**
  5382. * Gets an http agent. This function is useful when you need an http agent that handles
  5383. * routing through a proxy server - depending upon the url and proxy environment variables.
  5384. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5385. */
  5386. getAgent(serverUrl) {
  5387. const parsedUrl = new URL(serverUrl);
  5388. return this._getAgent(parsedUrl);
  5389. }
  5390. getAgentDispatcher(serverUrl) {
  5391. const parsedUrl = new URL(serverUrl);
  5392. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5393. const useProxy = proxyUrl && proxyUrl.hostname;
  5394. if (!useProxy) {
  5395. return;
  5396. }
  5397. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5398. }
  5399. _prepareRequest(method, requestUrl, headers) {
  5400. const info = {};
  5401. info.parsedUrl = requestUrl;
  5402. const usingSsl = info.parsedUrl.protocol === 'https:';
  5403. info.httpModule = usingSsl ? https : http;
  5404. const defaultPort = usingSsl ? 443 : 80;
  5405. info.options = {};
  5406. info.options.host = info.parsedUrl.hostname;
  5407. info.options.port = info.parsedUrl.port
  5408. ? parseInt(info.parsedUrl.port)
  5409. : defaultPort;
  5410. info.options.path =
  5411. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5412. info.options.method = method;
  5413. info.options.headers = this._mergeHeaders(headers);
  5414. if (this.userAgent != null) {
  5415. info.options.headers['user-agent'] = this.userAgent;
  5416. }
  5417. info.options.agent = this._getAgent(info.parsedUrl);
  5418. // gives handlers an opportunity to participate
  5419. if (this.handlers) {
  5420. for (const handler of this.handlers) {
  5421. handler.prepareRequest(info.options);
  5422. }
  5423. }
  5424. return info;
  5425. }
  5426. _mergeHeaders(headers) {
  5427. if (this.requestOptions && this.requestOptions.headers) {
  5428. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5429. }
  5430. return lowercaseKeys(headers || {});
  5431. }
  5432. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5433. let clientHeader;
  5434. if (this.requestOptions && this.requestOptions.headers) {
  5435. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5436. }
  5437. return additionalHeaders[header] || clientHeader || _default;
  5438. }
  5439. _getAgent(parsedUrl) {
  5440. let agent;
  5441. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5442. const useProxy = proxyUrl && proxyUrl.hostname;
  5443. if (this._keepAlive && useProxy) {
  5444. agent = this._proxyAgent;
  5445. }
  5446. if (!useProxy) {
  5447. agent = this._agent;
  5448. }
  5449. // if agent is already assigned use that agent.
  5450. if (agent) {
  5451. return agent;
  5452. }
  5453. const usingSsl = parsedUrl.protocol === 'https:';
  5454. let maxSockets = 100;
  5455. if (this.requestOptions) {
  5456. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5457. }
  5458. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5459. if (proxyUrl && proxyUrl.hostname) {
  5460. const agentOptions = {
  5461. maxSockets,
  5462. keepAlive: this._keepAlive,
  5463. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5464. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5465. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5466. };
  5467. let tunnelAgent;
  5468. const overHttps = proxyUrl.protocol === 'https:';
  5469. if (usingSsl) {
  5470. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5471. }
  5472. else {
  5473. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5474. }
  5475. agent = tunnelAgent(agentOptions);
  5476. this._proxyAgent = agent;
  5477. }
  5478. // if tunneling agent isn't assigned create a new agent
  5479. if (!agent) {
  5480. const options = { keepAlive: this._keepAlive, maxSockets };
  5481. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5482. this._agent = agent;
  5483. }
  5484. if (usingSsl && this._ignoreSslError) {
  5485. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5486. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5487. // we have to cast it to any and change it directly
  5488. agent.options = Object.assign(agent.options || {}, {
  5489. rejectUnauthorized: false
  5490. });
  5491. }
  5492. return agent;
  5493. }
  5494. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5495. let proxyAgent;
  5496. if (this._keepAlive) {
  5497. proxyAgent = this._proxyAgentDispatcher;
  5498. }
  5499. // if agent is already assigned use that agent.
  5500. if (proxyAgent) {
  5501. return proxyAgent;
  5502. }
  5503. const usingSsl = parsedUrl.protocol === 'https:';
  5504. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5505. token: `${proxyUrl.username}:${proxyUrl.password}`
  5506. })));
  5507. this._proxyAgentDispatcher = proxyAgent;
  5508. if (usingSsl && this._ignoreSslError) {
  5509. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5510. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5511. // we have to cast it to any and change it directly
  5512. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5513. rejectUnauthorized: false
  5514. });
  5515. }
  5516. return proxyAgent;
  5517. }
  5518. _performExponentialBackoff(retryNumber) {
  5519. return __awaiter(this, void 0, void 0, function* () {
  5520. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5521. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5522. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5523. });
  5524. }
  5525. _processResponse(res, options) {
  5526. return __awaiter(this, void 0, void 0, function* () {
  5527. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5528. const statusCode = res.message.statusCode || 0;
  5529. const response = {
  5530. statusCode,
  5531. result: null,
  5532. headers: {}
  5533. };
  5534. // not found leads to null obj returned
  5535. if (statusCode === HttpCodes.NotFound) {
  5536. resolve(response);
  5537. }
  5538. // get the result from the body
  5539. function dateTimeDeserializer(key, value) {
  5540. if (typeof value === 'string') {
  5541. const a = new Date(value);
  5542. if (!isNaN(a.valueOf())) {
  5543. return a;
  5544. }
  5545. }
  5546. return value;
  5547. }
  5548. let obj;
  5549. let contents;
  5550. try {
  5551. contents = yield res.readBody();
  5552. if (contents && contents.length > 0) {
  5553. if (options && options.deserializeDates) {
  5554. obj = JSON.parse(contents, dateTimeDeserializer);
  5555. }
  5556. else {
  5557. obj = JSON.parse(contents);
  5558. }
  5559. response.result = obj;
  5560. }
  5561. response.headers = res.message.headers;
  5562. }
  5563. catch (err) {
  5564. // Invalid resource (contents not json); leaving result obj null
  5565. }
  5566. // note that 3xx redirects are handled by the http layer.
  5567. if (statusCode > 299) {
  5568. let msg;
  5569. // if exception/error in body, attempt to get better error
  5570. if (obj && obj.message) {
  5571. msg = obj.message;
  5572. }
  5573. else if (contents && contents.length > 0) {
  5574. // it may be the case that the exception is in the body message as string
  5575. msg = contents;
  5576. }
  5577. else {
  5578. msg = `Failed request: (${statusCode})`;
  5579. }
  5580. const err = new HttpClientError(msg, statusCode);
  5581. err.result = response.result;
  5582. reject(err);
  5583. }
  5584. else {
  5585. resolve(response);
  5586. }
  5587. }));
  5588. });
  5589. }
  5590. }
  5591. exports.HttpClient = HttpClient;
  5592. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5593. //# sourceMappingURL=index.js.map
  5594. /***/ }),
  5595. /***/ 9835:
  5596. /***/ ((__unused_webpack_module, exports) => {
  5597. "use strict";
  5598. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5599. exports.checkBypass = exports.getProxyUrl = void 0;
  5600. function getProxyUrl(reqUrl) {
  5601. const usingSsl = reqUrl.protocol === 'https:';
  5602. if (checkBypass(reqUrl)) {
  5603. return undefined;
  5604. }
  5605. const proxyVar = (() => {
  5606. if (usingSsl) {
  5607. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5608. }
  5609. else {
  5610. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5611. }
  5612. })();
  5613. if (proxyVar) {
  5614. try {
  5615. return new URL(proxyVar);
  5616. }
  5617. catch (_a) {
  5618. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5619. return new URL(`http://${proxyVar}`);
  5620. }
  5621. }
  5622. else {
  5623. return undefined;
  5624. }
  5625. }
  5626. exports.getProxyUrl = getProxyUrl;
  5627. function checkBypass(reqUrl) {
  5628. if (!reqUrl.hostname) {
  5629. return false;
  5630. }
  5631. const reqHost = reqUrl.hostname;
  5632. if (isLoopbackAddress(reqHost)) {
  5633. return true;
  5634. }
  5635. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5636. if (!noProxy) {
  5637. return false;
  5638. }
  5639. // Determine the request port
  5640. let reqPort;
  5641. if (reqUrl.port) {
  5642. reqPort = Number(reqUrl.port);
  5643. }
  5644. else if (reqUrl.protocol === 'http:') {
  5645. reqPort = 80;
  5646. }
  5647. else if (reqUrl.protocol === 'https:') {
  5648. reqPort = 443;
  5649. }
  5650. // Format the request hostname and hostname with port
  5651. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5652. if (typeof reqPort === 'number') {
  5653. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5654. }
  5655. // Compare request host against noproxy
  5656. for (const upperNoProxyItem of noProxy
  5657. .split(',')
  5658. .map(x => x.trim().toUpperCase())
  5659. .filter(x => x)) {
  5660. if (upperNoProxyItem === '*' ||
  5661. upperReqHosts.some(x => x === upperNoProxyItem ||
  5662. x.endsWith(`.${upperNoProxyItem}`) ||
  5663. (upperNoProxyItem.startsWith('.') &&
  5664. x.endsWith(`${upperNoProxyItem}`)))) {
  5665. return true;
  5666. }
  5667. }
  5668. return false;
  5669. }
  5670. exports.checkBypass = checkBypass;
  5671. function isLoopbackAddress(host) {
  5672. const hostLower = host.toLowerCase();
  5673. return (hostLower === 'localhost' ||
  5674. hostLower.startsWith('127.') ||
  5675. hostLower.startsWith('[::1]') ||
  5676. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5677. }
  5678. //# sourceMappingURL=proxy.js.map
  5679. /***/ }),
  5680. /***/ 1962:
  5681. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5682. "use strict";
  5683. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5684. if (k2 === undefined) k2 = k;
  5685. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5686. }) : (function(o, m, k, k2) {
  5687. if (k2 === undefined) k2 = k;
  5688. o[k2] = m[k];
  5689. }));
  5690. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5691. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5692. }) : function(o, v) {
  5693. o["default"] = v;
  5694. });
  5695. var __importStar = (this && this.__importStar) || function (mod) {
  5696. if (mod && mod.__esModule) return mod;
  5697. var result = {};
  5698. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5699. __setModuleDefault(result, mod);
  5700. return result;
  5701. };
  5702. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5703. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5704. return new (P || (P = Promise))(function (resolve, reject) {
  5705. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5706. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5707. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5708. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5709. });
  5710. };
  5711. var _a;
  5712. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5713. 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;
  5714. const fs = __importStar(__nccwpck_require__(7147));
  5715. const path = __importStar(__nccwpck_require__(1017));
  5716. _a = fs.promises
  5717. // export const {open} = 'fs'
  5718. , 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;
  5719. // export const {open} = 'fs'
  5720. exports.IS_WINDOWS = process.platform === 'win32';
  5721. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5722. exports.UV_FS_O_EXLOCK = 0x10000000;
  5723. exports.READONLY = fs.constants.O_RDONLY;
  5724. function exists(fsPath) {
  5725. return __awaiter(this, void 0, void 0, function* () {
  5726. try {
  5727. yield exports.stat(fsPath);
  5728. }
  5729. catch (err) {
  5730. if (err.code === 'ENOENT') {
  5731. return false;
  5732. }
  5733. throw err;
  5734. }
  5735. return true;
  5736. });
  5737. }
  5738. exports.exists = exists;
  5739. function isDirectory(fsPath, useStat = false) {
  5740. return __awaiter(this, void 0, void 0, function* () {
  5741. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  5742. return stats.isDirectory();
  5743. });
  5744. }
  5745. exports.isDirectory = isDirectory;
  5746. /**
  5747. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  5748. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  5749. */
  5750. function isRooted(p) {
  5751. p = normalizeSeparators(p);
  5752. if (!p) {
  5753. throw new Error('isRooted() parameter "p" cannot be empty');
  5754. }
  5755. if (exports.IS_WINDOWS) {
  5756. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  5757. ); // e.g. C: or C:\hello
  5758. }
  5759. return p.startsWith('/');
  5760. }
  5761. exports.isRooted = isRooted;
  5762. /**
  5763. * Best effort attempt to determine whether a file exists and is executable.
  5764. * @param filePath file path to check
  5765. * @param extensions additional file extensions to try
  5766. * @return if file exists and is executable, returns the file path. otherwise empty string.
  5767. */
  5768. function tryGetExecutablePath(filePath, extensions) {
  5769. return __awaiter(this, void 0, void 0, function* () {
  5770. let stats = undefined;
  5771. try {
  5772. // test file exists
  5773. stats = yield exports.stat(filePath);
  5774. }
  5775. catch (err) {
  5776. if (err.code !== 'ENOENT') {
  5777. // eslint-disable-next-line no-console
  5778. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5779. }
  5780. }
  5781. if (stats && stats.isFile()) {
  5782. if (exports.IS_WINDOWS) {
  5783. // on Windows, test for valid extension
  5784. const upperExt = path.extname(filePath).toUpperCase();
  5785. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  5786. return filePath;
  5787. }
  5788. }
  5789. else {
  5790. if (isUnixExecutable(stats)) {
  5791. return filePath;
  5792. }
  5793. }
  5794. }
  5795. // try each extension
  5796. const originalFilePath = filePath;
  5797. for (const extension of extensions) {
  5798. filePath = originalFilePath + extension;
  5799. stats = undefined;
  5800. try {
  5801. stats = yield exports.stat(filePath);
  5802. }
  5803. catch (err) {
  5804. if (err.code !== 'ENOENT') {
  5805. // eslint-disable-next-line no-console
  5806. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5807. }
  5808. }
  5809. if (stats && stats.isFile()) {
  5810. if (exports.IS_WINDOWS) {
  5811. // preserve the case of the actual file (since an extension was appended)
  5812. try {
  5813. const directory = path.dirname(filePath);
  5814. const upperName = path.basename(filePath).toUpperCase();
  5815. for (const actualName of yield exports.readdir(directory)) {
  5816. if (upperName === actualName.toUpperCase()) {
  5817. filePath = path.join(directory, actualName);
  5818. break;
  5819. }
  5820. }
  5821. }
  5822. catch (err) {
  5823. // eslint-disable-next-line no-console
  5824. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  5825. }
  5826. return filePath;
  5827. }
  5828. else {
  5829. if (isUnixExecutable(stats)) {
  5830. return filePath;
  5831. }
  5832. }
  5833. }
  5834. }
  5835. return '';
  5836. });
  5837. }
  5838. exports.tryGetExecutablePath = tryGetExecutablePath;
  5839. function normalizeSeparators(p) {
  5840. p = p || '';
  5841. if (exports.IS_WINDOWS) {
  5842. // convert slashes on Windows
  5843. p = p.replace(/\//g, '\\');
  5844. // remove redundant slashes
  5845. return p.replace(/\\\\+/g, '\\');
  5846. }
  5847. // remove redundant slashes
  5848. return p.replace(/\/\/+/g, '/');
  5849. }
  5850. // on Mac/Linux, test the execute bit
  5851. // R W X R W X R W X
  5852. // 256 128 64 32 16 8 4 2 1
  5853. function isUnixExecutable(stats) {
  5854. return ((stats.mode & 1) > 0 ||
  5855. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  5856. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  5857. }
  5858. // Get the path of cmd.exe in windows
  5859. function getCmdPath() {
  5860. var _a;
  5861. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  5862. }
  5863. exports.getCmdPath = getCmdPath;
  5864. //# sourceMappingURL=io-util.js.map
  5865. /***/ }),
  5866. /***/ 7436:
  5867. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5868. "use strict";
  5869. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5870. if (k2 === undefined) k2 = k;
  5871. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5872. }) : (function(o, m, k, k2) {
  5873. if (k2 === undefined) k2 = k;
  5874. o[k2] = m[k];
  5875. }));
  5876. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5877. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5878. }) : function(o, v) {
  5879. o["default"] = v;
  5880. });
  5881. var __importStar = (this && this.__importStar) || function (mod) {
  5882. if (mod && mod.__esModule) return mod;
  5883. var result = {};
  5884. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5885. __setModuleDefault(result, mod);
  5886. return result;
  5887. };
  5888. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5889. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5890. return new (P || (P = Promise))(function (resolve, reject) {
  5891. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5892. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5893. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5894. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5895. });
  5896. };
  5897. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5898. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  5899. const assert_1 = __nccwpck_require__(9491);
  5900. const path = __importStar(__nccwpck_require__(1017));
  5901. const ioUtil = __importStar(__nccwpck_require__(1962));
  5902. /**
  5903. * Copies a file or folder.
  5904. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  5905. *
  5906. * @param source source path
  5907. * @param dest destination path
  5908. * @param options optional. See CopyOptions.
  5909. */
  5910. function cp(source, dest, options = {}) {
  5911. return __awaiter(this, void 0, void 0, function* () {
  5912. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  5913. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  5914. // Dest is an existing file, but not forcing
  5915. if (destStat && destStat.isFile() && !force) {
  5916. return;
  5917. }
  5918. // If dest is an existing directory, should copy inside.
  5919. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  5920. ? path.join(dest, path.basename(source))
  5921. : dest;
  5922. if (!(yield ioUtil.exists(source))) {
  5923. throw new Error(`no such file or directory: ${source}`);
  5924. }
  5925. const sourceStat = yield ioUtil.stat(source);
  5926. if (sourceStat.isDirectory()) {
  5927. if (!recursive) {
  5928. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  5929. }
  5930. else {
  5931. yield cpDirRecursive(source, newDest, 0, force);
  5932. }
  5933. }
  5934. else {
  5935. if (path.relative(source, newDest) === '') {
  5936. // a file cannot be copied to itself
  5937. throw new Error(`'${newDest}' and '${source}' are the same file`);
  5938. }
  5939. yield copyFile(source, newDest, force);
  5940. }
  5941. });
  5942. }
  5943. exports.cp = cp;
  5944. /**
  5945. * Moves a path.
  5946. *
  5947. * @param source source path
  5948. * @param dest destination path
  5949. * @param options optional. See MoveOptions.
  5950. */
  5951. function mv(source, dest, options = {}) {
  5952. return __awaiter(this, void 0, void 0, function* () {
  5953. if (yield ioUtil.exists(dest)) {
  5954. let destExists = true;
  5955. if (yield ioUtil.isDirectory(dest)) {
  5956. // If dest is directory copy src into dest
  5957. dest = path.join(dest, path.basename(source));
  5958. destExists = yield ioUtil.exists(dest);
  5959. }
  5960. if (destExists) {
  5961. if (options.force == null || options.force) {
  5962. yield rmRF(dest);
  5963. }
  5964. else {
  5965. throw new Error('Destination already exists');
  5966. }
  5967. }
  5968. }
  5969. yield mkdirP(path.dirname(dest));
  5970. yield ioUtil.rename(source, dest);
  5971. });
  5972. }
  5973. exports.mv = mv;
  5974. /**
  5975. * Remove a path recursively with force
  5976. *
  5977. * @param inputPath path to remove
  5978. */
  5979. function rmRF(inputPath) {
  5980. return __awaiter(this, void 0, void 0, function* () {
  5981. if (ioUtil.IS_WINDOWS) {
  5982. // Check for invalid characters
  5983. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  5984. if (/[*"<>|]/.test(inputPath)) {
  5985. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  5986. }
  5987. }
  5988. try {
  5989. // note if path does not exist, error is silent
  5990. yield ioUtil.rm(inputPath, {
  5991. force: true,
  5992. maxRetries: 3,
  5993. recursive: true,
  5994. retryDelay: 300
  5995. });
  5996. }
  5997. catch (err) {
  5998. throw new Error(`File was unable to be removed ${err}`);
  5999. }
  6000. });
  6001. }
  6002. exports.rmRF = rmRF;
  6003. /**
  6004. * Make a directory. Creates the full path with folders in between
  6005. * Will throw if it fails
  6006. *
  6007. * @param fsPath path to create
  6008. * @returns Promise<void>
  6009. */
  6010. function mkdirP(fsPath) {
  6011. return __awaiter(this, void 0, void 0, function* () {
  6012. assert_1.ok(fsPath, 'a path argument must be provided');
  6013. yield ioUtil.mkdir(fsPath, { recursive: true });
  6014. });
  6015. }
  6016. exports.mkdirP = mkdirP;
  6017. /**
  6018. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6019. * If you check and the tool does not exist, it will throw.
  6020. *
  6021. * @param tool name of the tool
  6022. * @param check whether to check if tool exists
  6023. * @returns Promise<string> path to tool
  6024. */
  6025. function which(tool, check) {
  6026. return __awaiter(this, void 0, void 0, function* () {
  6027. if (!tool) {
  6028. throw new Error("parameter 'tool' is required");
  6029. }
  6030. // recursive when check=true
  6031. if (check) {
  6032. const result = yield which(tool, false);
  6033. if (!result) {
  6034. if (ioUtil.IS_WINDOWS) {
  6035. 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.`);
  6036. }
  6037. else {
  6038. 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.`);
  6039. }
  6040. }
  6041. return result;
  6042. }
  6043. const matches = yield findInPath(tool);
  6044. if (matches && matches.length > 0) {
  6045. return matches[0];
  6046. }
  6047. return '';
  6048. });
  6049. }
  6050. exports.which = which;
  6051. /**
  6052. * Returns a list of all occurrences of the given tool on the system path.
  6053. *
  6054. * @returns Promise<string[]> the paths of the tool
  6055. */
  6056. function findInPath(tool) {
  6057. return __awaiter(this, void 0, void 0, function* () {
  6058. if (!tool) {
  6059. throw new Error("parameter 'tool' is required");
  6060. }
  6061. // build the list of extensions to try
  6062. const extensions = [];
  6063. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6064. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6065. if (extension) {
  6066. extensions.push(extension);
  6067. }
  6068. }
  6069. }
  6070. // if it's rooted, return it if exists. otherwise return empty.
  6071. if (ioUtil.isRooted(tool)) {
  6072. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6073. if (filePath) {
  6074. return [filePath];
  6075. }
  6076. return [];
  6077. }
  6078. // if any path separators, return empty
  6079. if (tool.includes(path.sep)) {
  6080. return [];
  6081. }
  6082. // build the list of directories
  6083. //
  6084. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6085. // it feels like we should not do this. Checking the current directory seems like more of a use
  6086. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6087. // across platforms.
  6088. const directories = [];
  6089. if (process.env.PATH) {
  6090. for (const p of process.env.PATH.split(path.delimiter)) {
  6091. if (p) {
  6092. directories.push(p);
  6093. }
  6094. }
  6095. }
  6096. // find all matches
  6097. const matches = [];
  6098. for (const directory of directories) {
  6099. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6100. if (filePath) {
  6101. matches.push(filePath);
  6102. }
  6103. }
  6104. return matches;
  6105. });
  6106. }
  6107. exports.findInPath = findInPath;
  6108. function readCopyOptions(options) {
  6109. const force = options.force == null ? true : options.force;
  6110. const recursive = Boolean(options.recursive);
  6111. const copySourceDirectory = options.copySourceDirectory == null
  6112. ? true
  6113. : Boolean(options.copySourceDirectory);
  6114. return { force, recursive, copySourceDirectory };
  6115. }
  6116. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6117. return __awaiter(this, void 0, void 0, function* () {
  6118. // Ensure there is not a run away recursive copy
  6119. if (currentDepth >= 255)
  6120. return;
  6121. currentDepth++;
  6122. yield mkdirP(destDir);
  6123. const files = yield ioUtil.readdir(sourceDir);
  6124. for (const fileName of files) {
  6125. const srcFile = `${sourceDir}/${fileName}`;
  6126. const destFile = `${destDir}/${fileName}`;
  6127. const srcFileStat = yield ioUtil.lstat(srcFile);
  6128. if (srcFileStat.isDirectory()) {
  6129. // Recurse
  6130. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6131. }
  6132. else {
  6133. yield copyFile(srcFile, destFile, force);
  6134. }
  6135. }
  6136. // Change the mode for the newly created directory
  6137. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6138. });
  6139. }
  6140. // Buffered file copy
  6141. function copyFile(srcFile, destFile, force) {
  6142. return __awaiter(this, void 0, void 0, function* () {
  6143. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6144. // unlink/re-link it
  6145. try {
  6146. yield ioUtil.lstat(destFile);
  6147. yield ioUtil.unlink(destFile);
  6148. }
  6149. catch (e) {
  6150. // Try to override file permission
  6151. if (e.code === 'EPERM') {
  6152. yield ioUtil.chmod(destFile, '0666');
  6153. yield ioUtil.unlink(destFile);
  6154. }
  6155. // other errors = it doesn't exist, no work to do
  6156. }
  6157. // Copy over symlink
  6158. const symlinkFull = yield ioUtil.readlink(srcFile);
  6159. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6160. }
  6161. else if (!(yield ioUtil.exists(destFile)) || force) {
  6162. yield ioUtil.copyFile(srcFile, destFile);
  6163. }
  6164. });
  6165. }
  6166. //# sourceMappingURL=io.js.map
  6167. /***/ }),
  6168. /***/ 2473:
  6169. /***/ (function(module, exports, __nccwpck_require__) {
  6170. "use strict";
  6171. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6172. if (k2 === undefined) k2 = k;
  6173. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6174. }) : (function(o, m, k, k2) {
  6175. if (k2 === undefined) k2 = k;
  6176. o[k2] = m[k];
  6177. }));
  6178. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6179. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6180. }) : function(o, v) {
  6181. o["default"] = v;
  6182. });
  6183. var __importStar = (this && this.__importStar) || function (mod) {
  6184. if (mod && mod.__esModule) return mod;
  6185. var result = {};
  6186. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6187. __setModuleDefault(result, mod);
  6188. return result;
  6189. };
  6190. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6191. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6192. return new (P || (P = Promise))(function (resolve, reject) {
  6193. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6194. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6195. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6196. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6197. });
  6198. };
  6199. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6200. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6201. const semver = __importStar(__nccwpck_require__(5911));
  6202. const core_1 = __nccwpck_require__(2186);
  6203. // needs to be require for core node modules to be mocked
  6204. /* eslint @typescript-eslint/no-require-imports: 0 */
  6205. const os = __nccwpck_require__(2037);
  6206. const cp = __nccwpck_require__(2081);
  6207. const fs = __nccwpck_require__(7147);
  6208. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6209. return __awaiter(this, void 0, void 0, function* () {
  6210. const platFilter = os.platform();
  6211. let result;
  6212. let match;
  6213. let file;
  6214. for (const candidate of candidates) {
  6215. const version = candidate.version;
  6216. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6217. if (semver.satisfies(version, versionSpec) &&
  6218. (!stable || candidate.stable === stable)) {
  6219. file = candidate.files.find(item => {
  6220. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6221. let chk = item.arch === archFilter && item.platform === platFilter;
  6222. if (chk && item.platform_version) {
  6223. const osVersion = module.exports._getOsVersion();
  6224. if (osVersion === item.platform_version) {
  6225. chk = true;
  6226. }
  6227. else {
  6228. chk = semver.satisfies(osVersion, item.platform_version);
  6229. }
  6230. }
  6231. return chk;
  6232. });
  6233. if (file) {
  6234. core_1.debug(`matched ${candidate.version}`);
  6235. match = candidate;
  6236. break;
  6237. }
  6238. }
  6239. }
  6240. if (match && file) {
  6241. // clone since we're mutating the file list to be only the file that matches
  6242. result = Object.assign({}, match);
  6243. result.files = [file];
  6244. }
  6245. return result;
  6246. });
  6247. }
  6248. exports._findMatch = _findMatch;
  6249. function _getOsVersion() {
  6250. // TODO: add windows and other linux, arm variants
  6251. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6252. const plat = os.platform();
  6253. let version = '';
  6254. if (plat === 'darwin') {
  6255. version = cp.execSync('sw_vers -productVersion').toString();
  6256. }
  6257. else if (plat === 'linux') {
  6258. // lsb_release process not in some containers, readfile
  6259. // Run cat /etc/lsb-release
  6260. // DISTRIB_ID=Ubuntu
  6261. // DISTRIB_RELEASE=18.04
  6262. // DISTRIB_CODENAME=bionic
  6263. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6264. const lsbContents = module.exports._readLinuxVersionFile();
  6265. if (lsbContents) {
  6266. const lines = lsbContents.split('\n');
  6267. for (const line of lines) {
  6268. const parts = line.split('=');
  6269. if (parts.length === 2 &&
  6270. (parts[0].trim() === 'VERSION_ID' ||
  6271. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6272. version = parts[1]
  6273. .trim()
  6274. .replace(/^"/, '')
  6275. .replace(/"$/, '');
  6276. break;
  6277. }
  6278. }
  6279. }
  6280. }
  6281. return version;
  6282. }
  6283. exports._getOsVersion = _getOsVersion;
  6284. function _readLinuxVersionFile() {
  6285. const lsbReleaseFile = '/etc/lsb-release';
  6286. const osReleaseFile = '/etc/os-release';
  6287. let contents = '';
  6288. if (fs.existsSync(lsbReleaseFile)) {
  6289. contents = fs.readFileSync(lsbReleaseFile).toString();
  6290. }
  6291. else if (fs.existsSync(osReleaseFile)) {
  6292. contents = fs.readFileSync(osReleaseFile).toString();
  6293. }
  6294. return contents;
  6295. }
  6296. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6297. //# sourceMappingURL=manifest.js.map
  6298. /***/ }),
  6299. /***/ 8279:
  6300. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6301. "use strict";
  6302. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6303. if (k2 === undefined) k2 = k;
  6304. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6305. }) : (function(o, m, k, k2) {
  6306. if (k2 === undefined) k2 = k;
  6307. o[k2] = m[k];
  6308. }));
  6309. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6310. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6311. }) : function(o, v) {
  6312. o["default"] = v;
  6313. });
  6314. var __importStar = (this && this.__importStar) || function (mod) {
  6315. if (mod && mod.__esModule) return mod;
  6316. var result = {};
  6317. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6318. __setModuleDefault(result, mod);
  6319. return result;
  6320. };
  6321. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6322. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6323. return new (P || (P = Promise))(function (resolve, reject) {
  6324. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6325. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6326. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6327. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6328. });
  6329. };
  6330. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6331. exports.RetryHelper = void 0;
  6332. const core = __importStar(__nccwpck_require__(2186));
  6333. /**
  6334. * Internal class for retries
  6335. */
  6336. class RetryHelper {
  6337. constructor(maxAttempts, minSeconds, maxSeconds) {
  6338. if (maxAttempts < 1) {
  6339. throw new Error('max attempts should be greater than or equal to 1');
  6340. }
  6341. this.maxAttempts = maxAttempts;
  6342. this.minSeconds = Math.floor(minSeconds);
  6343. this.maxSeconds = Math.floor(maxSeconds);
  6344. if (this.minSeconds > this.maxSeconds) {
  6345. throw new Error('min seconds should be less than or equal to max seconds');
  6346. }
  6347. }
  6348. execute(action, isRetryable) {
  6349. return __awaiter(this, void 0, void 0, function* () {
  6350. let attempt = 1;
  6351. while (attempt < this.maxAttempts) {
  6352. // Try
  6353. try {
  6354. return yield action();
  6355. }
  6356. catch (err) {
  6357. if (isRetryable && !isRetryable(err)) {
  6358. throw err;
  6359. }
  6360. core.info(err.message);
  6361. }
  6362. // Sleep
  6363. const seconds = this.getSleepAmount();
  6364. core.info(`Waiting ${seconds} seconds before trying again`);
  6365. yield this.sleep(seconds);
  6366. attempt++;
  6367. }
  6368. // Last attempt
  6369. return yield action();
  6370. });
  6371. }
  6372. getSleepAmount() {
  6373. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6374. this.minSeconds);
  6375. }
  6376. sleep(seconds) {
  6377. return __awaiter(this, void 0, void 0, function* () {
  6378. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6379. });
  6380. }
  6381. }
  6382. exports.RetryHelper = RetryHelper;
  6383. //# sourceMappingURL=retry-helper.js.map
  6384. /***/ }),
  6385. /***/ 7784:
  6386. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6387. "use strict";
  6388. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6389. if (k2 === undefined) k2 = k;
  6390. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6391. }) : (function(o, m, k, k2) {
  6392. if (k2 === undefined) k2 = k;
  6393. o[k2] = m[k];
  6394. }));
  6395. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6396. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6397. }) : function(o, v) {
  6398. o["default"] = v;
  6399. });
  6400. var __importStar = (this && this.__importStar) || function (mod) {
  6401. if (mod && mod.__esModule) return mod;
  6402. var result = {};
  6403. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6404. __setModuleDefault(result, mod);
  6405. return result;
  6406. };
  6407. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6408. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6409. return new (P || (P = Promise))(function (resolve, reject) {
  6410. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6411. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6412. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6413. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6414. });
  6415. };
  6416. var __importDefault = (this && this.__importDefault) || function (mod) {
  6417. return (mod && mod.__esModule) ? mod : { "default": mod };
  6418. };
  6419. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6420. 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;
  6421. const core = __importStar(__nccwpck_require__(2186));
  6422. const io = __importStar(__nccwpck_require__(7436));
  6423. const fs = __importStar(__nccwpck_require__(7147));
  6424. const mm = __importStar(__nccwpck_require__(2473));
  6425. const os = __importStar(__nccwpck_require__(2037));
  6426. const path = __importStar(__nccwpck_require__(1017));
  6427. const httpm = __importStar(__nccwpck_require__(6255));
  6428. const semver = __importStar(__nccwpck_require__(5911));
  6429. const stream = __importStar(__nccwpck_require__(2781));
  6430. const util = __importStar(__nccwpck_require__(3837));
  6431. const assert_1 = __nccwpck_require__(9491);
  6432. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6433. const exec_1 = __nccwpck_require__(1514);
  6434. const retry_helper_1 = __nccwpck_require__(8279);
  6435. class HTTPError extends Error {
  6436. constructor(httpStatusCode) {
  6437. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6438. this.httpStatusCode = httpStatusCode;
  6439. Object.setPrototypeOf(this, new.target.prototype);
  6440. }
  6441. }
  6442. exports.HTTPError = HTTPError;
  6443. const IS_WINDOWS = process.platform === 'win32';
  6444. const IS_MAC = process.platform === 'darwin';
  6445. const userAgent = 'actions/tool-cache';
  6446. /**
  6447. * Download a tool from an url and stream it into a file
  6448. *
  6449. * @param url url of tool to download
  6450. * @param dest path to download tool
  6451. * @param auth authorization header
  6452. * @param headers other headers
  6453. * @returns path to downloaded tool
  6454. */
  6455. function downloadTool(url, dest, auth, headers) {
  6456. return __awaiter(this, void 0, void 0, function* () {
  6457. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6458. yield io.mkdirP(path.dirname(dest));
  6459. core.debug(`Downloading ${url}`);
  6460. core.debug(`Destination ${dest}`);
  6461. const maxAttempts = 3;
  6462. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6463. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6464. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6465. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6466. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6467. }), (err) => {
  6468. if (err instanceof HTTPError && err.httpStatusCode) {
  6469. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6470. if (err.httpStatusCode < 500 &&
  6471. err.httpStatusCode !== 408 &&
  6472. err.httpStatusCode !== 429) {
  6473. return false;
  6474. }
  6475. }
  6476. // Otherwise retry
  6477. return true;
  6478. });
  6479. });
  6480. }
  6481. exports.downloadTool = downloadTool;
  6482. function downloadToolAttempt(url, dest, auth, headers) {
  6483. return __awaiter(this, void 0, void 0, function* () {
  6484. if (fs.existsSync(dest)) {
  6485. throw new Error(`Destination file path ${dest} already exists`);
  6486. }
  6487. // Get the response headers
  6488. const http = new httpm.HttpClient(userAgent, [], {
  6489. allowRetries: false
  6490. });
  6491. if (auth) {
  6492. core.debug('set auth');
  6493. if (headers === undefined) {
  6494. headers = {};
  6495. }
  6496. headers.authorization = auth;
  6497. }
  6498. const response = yield http.get(url, headers);
  6499. if (response.message.statusCode !== 200) {
  6500. const err = new HTTPError(response.message.statusCode);
  6501. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6502. throw err;
  6503. }
  6504. // Download the response body
  6505. const pipeline = util.promisify(stream.pipeline);
  6506. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6507. const readStream = responseMessageFactory();
  6508. let succeeded = false;
  6509. try {
  6510. yield pipeline(readStream, fs.createWriteStream(dest));
  6511. core.debug('download complete');
  6512. succeeded = true;
  6513. return dest;
  6514. }
  6515. finally {
  6516. // Error, delete dest before retry
  6517. if (!succeeded) {
  6518. core.debug('download failed');
  6519. try {
  6520. yield io.rmRF(dest);
  6521. }
  6522. catch (err) {
  6523. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6524. }
  6525. }
  6526. }
  6527. });
  6528. }
  6529. /**
  6530. * Extract a .7z file
  6531. *
  6532. * @param file path to the .7z file
  6533. * @param dest destination directory. Optional.
  6534. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6535. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6536. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6537. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6538. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6539. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6540. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6541. * to 7zr.exe can be pass to this function.
  6542. * @returns path to the destination directory
  6543. */
  6544. function extract7z(file, dest, _7zPath) {
  6545. return __awaiter(this, void 0, void 0, function* () {
  6546. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6547. assert_1.ok(file, 'parameter "file" is required');
  6548. dest = yield _createExtractFolder(dest);
  6549. const originalCwd = process.cwd();
  6550. process.chdir(dest);
  6551. if (_7zPath) {
  6552. try {
  6553. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6554. const args = [
  6555. 'x',
  6556. logLevel,
  6557. '-bd',
  6558. '-sccUTF-8',
  6559. file
  6560. ];
  6561. const options = {
  6562. silent: true
  6563. };
  6564. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6565. }
  6566. finally {
  6567. process.chdir(originalCwd);
  6568. }
  6569. }
  6570. else {
  6571. const escapedScript = path
  6572. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6573. .replace(/'/g, "''")
  6574. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6575. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6576. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6577. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6578. const args = [
  6579. '-NoLogo',
  6580. '-Sta',
  6581. '-NoProfile',
  6582. '-NonInteractive',
  6583. '-ExecutionPolicy',
  6584. 'Unrestricted',
  6585. '-Command',
  6586. command
  6587. ];
  6588. const options = {
  6589. silent: true
  6590. };
  6591. try {
  6592. const powershellPath = yield io.which('powershell', true);
  6593. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6594. }
  6595. finally {
  6596. process.chdir(originalCwd);
  6597. }
  6598. }
  6599. return dest;
  6600. });
  6601. }
  6602. exports.extract7z = extract7z;
  6603. /**
  6604. * Extract a compressed tar archive
  6605. *
  6606. * @param file path to the tar
  6607. * @param dest destination directory. Optional.
  6608. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6609. * @returns path to the destination directory
  6610. */
  6611. function extractTar(file, dest, flags = 'xz') {
  6612. return __awaiter(this, void 0, void 0, function* () {
  6613. if (!file) {
  6614. throw new Error("parameter 'file' is required");
  6615. }
  6616. // Create dest
  6617. dest = yield _createExtractFolder(dest);
  6618. // Determine whether GNU tar
  6619. core.debug('Checking tar --version');
  6620. let versionOutput = '';
  6621. yield exec_1.exec('tar --version', [], {
  6622. ignoreReturnCode: true,
  6623. silent: true,
  6624. listeners: {
  6625. stdout: (data) => (versionOutput += data.toString()),
  6626. stderr: (data) => (versionOutput += data.toString())
  6627. }
  6628. });
  6629. core.debug(versionOutput.trim());
  6630. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6631. // Initialize args
  6632. let args;
  6633. if (flags instanceof Array) {
  6634. args = flags;
  6635. }
  6636. else {
  6637. args = [flags];
  6638. }
  6639. if (core.isDebug() && !flags.includes('v')) {
  6640. args.push('-v');
  6641. }
  6642. let destArg = dest;
  6643. let fileArg = file;
  6644. if (IS_WINDOWS && isGnuTar) {
  6645. args.push('--force-local');
  6646. destArg = dest.replace(/\\/g, '/');
  6647. // Technically only the dest needs to have `/` but for aesthetic consistency
  6648. // convert slashes in the file arg too.
  6649. fileArg = file.replace(/\\/g, '/');
  6650. }
  6651. if (isGnuTar) {
  6652. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6653. args.push('--warning=no-unknown-keyword');
  6654. args.push('--overwrite');
  6655. }
  6656. args.push('-C', destArg, '-f', fileArg);
  6657. yield exec_1.exec(`tar`, args);
  6658. return dest;
  6659. });
  6660. }
  6661. exports.extractTar = extractTar;
  6662. /**
  6663. * Extract a xar compatible archive
  6664. *
  6665. * @param file path to the archive
  6666. * @param dest destination directory. Optional.
  6667. * @param flags flags for the xar. Optional.
  6668. * @returns path to the destination directory
  6669. */
  6670. function extractXar(file, dest, flags = []) {
  6671. return __awaiter(this, void 0, void 0, function* () {
  6672. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6673. assert_1.ok(file, 'parameter "file" is required');
  6674. dest = yield _createExtractFolder(dest);
  6675. let args;
  6676. if (flags instanceof Array) {
  6677. args = flags;
  6678. }
  6679. else {
  6680. args = [flags];
  6681. }
  6682. args.push('-x', '-C', dest, '-f', file);
  6683. if (core.isDebug()) {
  6684. args.push('-v');
  6685. }
  6686. const xarPath = yield io.which('xar', true);
  6687. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6688. return dest;
  6689. });
  6690. }
  6691. exports.extractXar = extractXar;
  6692. /**
  6693. * Extract a zip
  6694. *
  6695. * @param file path to the zip
  6696. * @param dest destination directory. Optional.
  6697. * @returns path to the destination directory
  6698. */
  6699. function extractZip(file, dest) {
  6700. return __awaiter(this, void 0, void 0, function* () {
  6701. if (!file) {
  6702. throw new Error("parameter 'file' is required");
  6703. }
  6704. dest = yield _createExtractFolder(dest);
  6705. if (IS_WINDOWS) {
  6706. yield extractZipWin(file, dest);
  6707. }
  6708. else {
  6709. yield extractZipNix(file, dest);
  6710. }
  6711. return dest;
  6712. });
  6713. }
  6714. exports.extractZip = extractZip;
  6715. function extractZipWin(file, dest) {
  6716. return __awaiter(this, void 0, void 0, function* () {
  6717. // build the powershell command
  6718. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6719. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6720. const pwshPath = yield io.which('pwsh', false);
  6721. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6722. //and the -Force flag for Expand-Archive as a fallback
  6723. if (pwshPath) {
  6724. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6725. const pwshCommand = [
  6726. `$ErrorActionPreference = 'Stop' ;`,
  6727. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6728. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  6729. `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 $_ } } ;`
  6730. ].join(' ');
  6731. const args = [
  6732. '-NoLogo',
  6733. '-NoProfile',
  6734. '-NonInteractive',
  6735. '-ExecutionPolicy',
  6736. 'Unrestricted',
  6737. '-Command',
  6738. pwshCommand
  6739. ];
  6740. core.debug(`Using pwsh at path: ${pwshPath}`);
  6741. yield exec_1.exec(`"${pwshPath}"`, args);
  6742. }
  6743. else {
  6744. const powershellCommand = [
  6745. `$ErrorActionPreference = 'Stop' ;`,
  6746. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  6747. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  6748. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  6749. ].join(' ');
  6750. const args = [
  6751. '-NoLogo',
  6752. '-Sta',
  6753. '-NoProfile',
  6754. '-NonInteractive',
  6755. '-ExecutionPolicy',
  6756. 'Unrestricted',
  6757. '-Command',
  6758. powershellCommand
  6759. ];
  6760. const powershellPath = yield io.which('powershell', true);
  6761. core.debug(`Using powershell at path: ${powershellPath}`);
  6762. yield exec_1.exec(`"${powershellPath}"`, args);
  6763. }
  6764. });
  6765. }
  6766. function extractZipNix(file, dest) {
  6767. return __awaiter(this, void 0, void 0, function* () {
  6768. const unzipPath = yield io.which('unzip', true);
  6769. const args = [file];
  6770. if (!core.isDebug()) {
  6771. args.unshift('-q');
  6772. }
  6773. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  6774. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  6775. });
  6776. }
  6777. /**
  6778. * Caches a directory and installs it into the tool cacheDir
  6779. *
  6780. * @param sourceDir the directory to cache into tools
  6781. * @param tool tool name
  6782. * @param version version of the tool. semver format
  6783. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6784. */
  6785. function cacheDir(sourceDir, tool, version, arch) {
  6786. return __awaiter(this, void 0, void 0, function* () {
  6787. version = semver.clean(version) || version;
  6788. arch = arch || os.arch();
  6789. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6790. core.debug(`source dir: ${sourceDir}`);
  6791. if (!fs.statSync(sourceDir).isDirectory()) {
  6792. throw new Error('sourceDir is not a directory');
  6793. }
  6794. // Create the tool dir
  6795. const destPath = yield _createToolPath(tool, version, arch);
  6796. // copy each child item. do not move. move can fail on Windows
  6797. // due to anti-virus software having an open handle on a file.
  6798. for (const itemName of fs.readdirSync(sourceDir)) {
  6799. const s = path.join(sourceDir, itemName);
  6800. yield io.cp(s, destPath, { recursive: true });
  6801. }
  6802. // write .complete
  6803. _completeToolPath(tool, version, arch);
  6804. return destPath;
  6805. });
  6806. }
  6807. exports.cacheDir = cacheDir;
  6808. /**
  6809. * Caches a downloaded file (GUID) and installs it
  6810. * into the tool cache with a given targetName
  6811. *
  6812. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  6813. * @param targetFile the name of the file name in the tools directory
  6814. * @param tool tool name
  6815. * @param version version of the tool. semver format
  6816. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6817. */
  6818. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  6819. return __awaiter(this, void 0, void 0, function* () {
  6820. version = semver.clean(version) || version;
  6821. arch = arch || os.arch();
  6822. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6823. core.debug(`source file: ${sourceFile}`);
  6824. if (!fs.statSync(sourceFile).isFile()) {
  6825. throw new Error('sourceFile is not a file');
  6826. }
  6827. // create the tool dir
  6828. const destFolder = yield _createToolPath(tool, version, arch);
  6829. // copy instead of move. move can fail on Windows due to
  6830. // anti-virus software having an open handle on a file.
  6831. const destPath = path.join(destFolder, targetFile);
  6832. core.debug(`destination file ${destPath}`);
  6833. yield io.cp(sourceFile, destPath);
  6834. // write .complete
  6835. _completeToolPath(tool, version, arch);
  6836. return destFolder;
  6837. });
  6838. }
  6839. exports.cacheFile = cacheFile;
  6840. /**
  6841. * Finds the path to a tool version in the local installed tool cache
  6842. *
  6843. * @param toolName name of the tool
  6844. * @param versionSpec version of the tool
  6845. * @param arch optional arch. defaults to arch of computer
  6846. */
  6847. function find(toolName, versionSpec, arch) {
  6848. if (!toolName) {
  6849. throw new Error('toolName parameter is required');
  6850. }
  6851. if (!versionSpec) {
  6852. throw new Error('versionSpec parameter is required');
  6853. }
  6854. arch = arch || os.arch();
  6855. // attempt to resolve an explicit version
  6856. if (!isExplicitVersion(versionSpec)) {
  6857. const localVersions = findAllVersions(toolName, arch);
  6858. const match = evaluateVersions(localVersions, versionSpec);
  6859. versionSpec = match;
  6860. }
  6861. // check for the explicit version in the cache
  6862. let toolPath = '';
  6863. if (versionSpec) {
  6864. versionSpec = semver.clean(versionSpec) || '';
  6865. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  6866. core.debug(`checking cache: ${cachePath}`);
  6867. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  6868. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  6869. toolPath = cachePath;
  6870. }
  6871. else {
  6872. core.debug('not found');
  6873. }
  6874. }
  6875. return toolPath;
  6876. }
  6877. exports.find = find;
  6878. /**
  6879. * Finds the paths to all versions of a tool that are installed in the local tool cache
  6880. *
  6881. * @param toolName name of the tool
  6882. * @param arch optional arch. defaults to arch of computer
  6883. */
  6884. function findAllVersions(toolName, arch) {
  6885. const versions = [];
  6886. arch = arch || os.arch();
  6887. const toolPath = path.join(_getCacheDirectory(), toolName);
  6888. if (fs.existsSync(toolPath)) {
  6889. const children = fs.readdirSync(toolPath);
  6890. for (const child of children) {
  6891. if (isExplicitVersion(child)) {
  6892. const fullPath = path.join(toolPath, child, arch || '');
  6893. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  6894. versions.push(child);
  6895. }
  6896. }
  6897. }
  6898. }
  6899. return versions;
  6900. }
  6901. exports.findAllVersions = findAllVersions;
  6902. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  6903. return __awaiter(this, void 0, void 0, function* () {
  6904. let releases = [];
  6905. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  6906. const http = new httpm.HttpClient('tool-cache');
  6907. const headers = {};
  6908. if (auth) {
  6909. core.debug('set auth');
  6910. headers.authorization = auth;
  6911. }
  6912. const response = yield http.getJson(treeUrl, headers);
  6913. if (!response.result) {
  6914. return releases;
  6915. }
  6916. let manifestUrl = '';
  6917. for (const item of response.result.tree) {
  6918. if (item.path === 'versions-manifest.json') {
  6919. manifestUrl = item.url;
  6920. break;
  6921. }
  6922. }
  6923. headers['accept'] = 'application/vnd.github.VERSION.raw';
  6924. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  6925. if (versionsRaw) {
  6926. // shouldn't be needed but protects against invalid json saved with BOM
  6927. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  6928. try {
  6929. releases = JSON.parse(versionsRaw);
  6930. }
  6931. catch (_a) {
  6932. core.debug('Invalid json');
  6933. }
  6934. }
  6935. return releases;
  6936. });
  6937. }
  6938. exports.getManifestFromRepo = getManifestFromRepo;
  6939. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  6940. return __awaiter(this, void 0, void 0, function* () {
  6941. // wrap the internal impl
  6942. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  6943. return match;
  6944. });
  6945. }
  6946. exports.findFromManifest = findFromManifest;
  6947. function _createExtractFolder(dest) {
  6948. return __awaiter(this, void 0, void 0, function* () {
  6949. if (!dest) {
  6950. // create a temp dir
  6951. dest = path.join(_getTempDirectory(), v4_1.default());
  6952. }
  6953. yield io.mkdirP(dest);
  6954. return dest;
  6955. });
  6956. }
  6957. function _createToolPath(tool, version, arch) {
  6958. return __awaiter(this, void 0, void 0, function* () {
  6959. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6960. core.debug(`destination ${folderPath}`);
  6961. const markerPath = `${folderPath}.complete`;
  6962. yield io.rmRF(folderPath);
  6963. yield io.rmRF(markerPath);
  6964. yield io.mkdirP(folderPath);
  6965. return folderPath;
  6966. });
  6967. }
  6968. function _completeToolPath(tool, version, arch) {
  6969. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6970. const markerPath = `${folderPath}.complete`;
  6971. fs.writeFileSync(markerPath, '');
  6972. core.debug('finished caching tool');
  6973. }
  6974. /**
  6975. * Check if version string is explicit
  6976. *
  6977. * @param versionSpec version string to check
  6978. */
  6979. function isExplicitVersion(versionSpec) {
  6980. const c = semver.clean(versionSpec) || '';
  6981. core.debug(`isExplicit: ${c}`);
  6982. const valid = semver.valid(c) != null;
  6983. core.debug(`explicit? ${valid}`);
  6984. return valid;
  6985. }
  6986. exports.isExplicitVersion = isExplicitVersion;
  6987. /**
  6988. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  6989. *
  6990. * @param versions array of versions to evaluate
  6991. * @param versionSpec semantic version spec to satisfy
  6992. */
  6993. function evaluateVersions(versions, versionSpec) {
  6994. let version = '';
  6995. core.debug(`evaluating ${versions.length} versions`);
  6996. versions = versions.sort((a, b) => {
  6997. if (semver.gt(a, b)) {
  6998. return 1;
  6999. }
  7000. return -1;
  7001. });
  7002. for (let i = versions.length - 1; i >= 0; i--) {
  7003. const potential = versions[i];
  7004. const satisfied = semver.satisfies(potential, versionSpec);
  7005. if (satisfied) {
  7006. version = potential;
  7007. break;
  7008. }
  7009. }
  7010. if (version) {
  7011. core.debug(`matched: ${version}`);
  7012. }
  7013. else {
  7014. core.debug('match not found');
  7015. }
  7016. return version;
  7017. }
  7018. exports.evaluateVersions = evaluateVersions;
  7019. /**
  7020. * Gets RUNNER_TOOL_CACHE
  7021. */
  7022. function _getCacheDirectory() {
  7023. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7024. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7025. return cacheDirectory;
  7026. }
  7027. /**
  7028. * Gets RUNNER_TEMP
  7029. */
  7030. function _getTempDirectory() {
  7031. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7032. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7033. return tempDirectory;
  7034. }
  7035. /**
  7036. * Gets a global variable
  7037. */
  7038. function _getGlobal(key, defaultValue) {
  7039. /* eslint-disable @typescript-eslint/no-explicit-any */
  7040. const value = global[key];
  7041. /* eslint-enable @typescript-eslint/no-explicit-any */
  7042. return value !== undefined ? value : defaultValue;
  7043. }
  7044. /**
  7045. * Returns an array of unique values.
  7046. * @param values Values to make unique.
  7047. */
  7048. function _unique(values) {
  7049. return Array.from(new Set(values));
  7050. }
  7051. //# sourceMappingURL=tool-cache.js.map
  7052. /***/ }),
  7053. /***/ 7701:
  7054. /***/ ((module) => {
  7055. /**
  7056. * Convert array of 16 byte values to UUID string format of the form:
  7057. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7058. */
  7059. var byteToHex = [];
  7060. for (var i = 0; i < 256; ++i) {
  7061. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7062. }
  7063. function bytesToUuid(buf, offset) {
  7064. var i = offset || 0;
  7065. var bth = byteToHex;
  7066. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7067. return ([
  7068. bth[buf[i++]], bth[buf[i++]],
  7069. bth[buf[i++]], bth[buf[i++]], '-',
  7070. bth[buf[i++]], bth[buf[i++]], '-',
  7071. bth[buf[i++]], bth[buf[i++]], '-',
  7072. bth[buf[i++]], bth[buf[i++]], '-',
  7073. bth[buf[i++]], bth[buf[i++]],
  7074. bth[buf[i++]], bth[buf[i++]],
  7075. bth[buf[i++]], bth[buf[i++]]
  7076. ]).join('');
  7077. }
  7078. module.exports = bytesToUuid;
  7079. /***/ }),
  7080. /***/ 7269:
  7081. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7082. // Unique ID creation requires a high quality random # generator. In node.js
  7083. // this is pretty straight-forward - we use the crypto API.
  7084. var crypto = __nccwpck_require__(6113);
  7085. module.exports = function nodeRNG() {
  7086. return crypto.randomBytes(16);
  7087. };
  7088. /***/ }),
  7089. /***/ 7468:
  7090. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7091. var rng = __nccwpck_require__(7269);
  7092. var bytesToUuid = __nccwpck_require__(7701);
  7093. function v4(options, buf, offset) {
  7094. var i = buf && offset || 0;
  7095. if (typeof(options) == 'string') {
  7096. buf = options === 'binary' ? new Array(16) : null;
  7097. options = null;
  7098. }
  7099. options = options || {};
  7100. var rnds = options.random || (options.rng || rng)();
  7101. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7102. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7103. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7104. // Copy bytes to buffer, if provided
  7105. if (buf) {
  7106. for (var ii = 0; ii < 16; ++ii) {
  7107. buf[i + ii] = rnds[ii];
  7108. }
  7109. }
  7110. return buf || bytesToUuid(rnds);
  7111. }
  7112. module.exports = v4;
  7113. /***/ }),
  7114. /***/ 334:
  7115. /***/ ((module) => {
  7116. "use strict";
  7117. var __defProp = Object.defineProperty;
  7118. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7119. var __getOwnPropNames = Object.getOwnPropertyNames;
  7120. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7121. var __export = (target, all) => {
  7122. for (var name in all)
  7123. __defProp(target, name, { get: all[name], enumerable: true });
  7124. };
  7125. var __copyProps = (to, from, except, desc) => {
  7126. if (from && typeof from === "object" || typeof from === "function") {
  7127. for (let key of __getOwnPropNames(from))
  7128. if (!__hasOwnProp.call(to, key) && key !== except)
  7129. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7130. }
  7131. return to;
  7132. };
  7133. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7134. // pkg/dist-src/index.js
  7135. var dist_src_exports = {};
  7136. __export(dist_src_exports, {
  7137. createTokenAuth: () => createTokenAuth
  7138. });
  7139. module.exports = __toCommonJS(dist_src_exports);
  7140. // pkg/dist-src/auth.js
  7141. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7142. var REGEX_IS_INSTALLATION = /^ghs_/;
  7143. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7144. async function auth(token) {
  7145. const isApp = token.split(/\./).length === 3;
  7146. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7147. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7148. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7149. return {
  7150. type: "token",
  7151. token,
  7152. tokenType
  7153. };
  7154. }
  7155. // pkg/dist-src/with-authorization-prefix.js
  7156. function withAuthorizationPrefix(token) {
  7157. if (token.split(/\./).length === 3) {
  7158. return `bearer ${token}`;
  7159. }
  7160. return `token ${token}`;
  7161. }
  7162. // pkg/dist-src/hook.js
  7163. async function hook(token, request, route, parameters) {
  7164. const endpoint = request.endpoint.merge(
  7165. route,
  7166. parameters
  7167. );
  7168. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7169. return request(endpoint);
  7170. }
  7171. // pkg/dist-src/index.js
  7172. var createTokenAuth = function createTokenAuth2(token) {
  7173. if (!token) {
  7174. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7175. }
  7176. if (typeof token !== "string") {
  7177. throw new Error(
  7178. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7179. );
  7180. }
  7181. token = token.replace(/^(token|bearer) +/i, "");
  7182. return Object.assign(auth.bind(null, token), {
  7183. hook: hook.bind(null, token)
  7184. });
  7185. };
  7186. // Annotate the CommonJS export names for ESM import in node:
  7187. 0 && (0);
  7188. /***/ }),
  7189. /***/ 6762:
  7190. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7191. "use strict";
  7192. var __defProp = Object.defineProperty;
  7193. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7194. var __getOwnPropNames = Object.getOwnPropertyNames;
  7195. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7196. var __export = (target, all) => {
  7197. for (var name in all)
  7198. __defProp(target, name, { get: all[name], enumerable: true });
  7199. };
  7200. var __copyProps = (to, from, except, desc) => {
  7201. if (from && typeof from === "object" || typeof from === "function") {
  7202. for (let key of __getOwnPropNames(from))
  7203. if (!__hasOwnProp.call(to, key) && key !== except)
  7204. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7205. }
  7206. return to;
  7207. };
  7208. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7209. // pkg/dist-src/index.js
  7210. var dist_src_exports = {};
  7211. __export(dist_src_exports, {
  7212. Octokit: () => Octokit
  7213. });
  7214. module.exports = __toCommonJS(dist_src_exports);
  7215. var import_universal_user_agent = __nccwpck_require__(5030);
  7216. var import_before_after_hook = __nccwpck_require__(3682);
  7217. var import_request = __nccwpck_require__(6234);
  7218. var import_graphql = __nccwpck_require__(8467);
  7219. var import_auth_token = __nccwpck_require__(334);
  7220. // pkg/dist-src/version.js
  7221. var VERSION = "5.2.0";
  7222. // pkg/dist-src/index.js
  7223. var noop = () => {
  7224. };
  7225. var consoleWarn = console.warn.bind(console);
  7226. var consoleError = console.error.bind(console);
  7227. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7228. var Octokit = class {
  7229. static {
  7230. this.VERSION = VERSION;
  7231. }
  7232. static defaults(defaults) {
  7233. const OctokitWithDefaults = class extends this {
  7234. constructor(...args) {
  7235. const options = args[0] || {};
  7236. if (typeof defaults === "function") {
  7237. super(defaults(options));
  7238. return;
  7239. }
  7240. super(
  7241. Object.assign(
  7242. {},
  7243. defaults,
  7244. options,
  7245. options.userAgent && defaults.userAgent ? {
  7246. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7247. } : null
  7248. )
  7249. );
  7250. }
  7251. };
  7252. return OctokitWithDefaults;
  7253. }
  7254. static {
  7255. this.plugins = [];
  7256. }
  7257. /**
  7258. * Attach a plugin (or many) to your Octokit instance.
  7259. *
  7260. * @example
  7261. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7262. */
  7263. static plugin(...newPlugins) {
  7264. const currentPlugins = this.plugins;
  7265. const NewOctokit = class extends this {
  7266. static {
  7267. this.plugins = currentPlugins.concat(
  7268. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7269. );
  7270. }
  7271. };
  7272. return NewOctokit;
  7273. }
  7274. constructor(options = {}) {
  7275. const hook = new import_before_after_hook.Collection();
  7276. const requestDefaults = {
  7277. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7278. headers: {},
  7279. request: Object.assign({}, options.request, {
  7280. // @ts-ignore internal usage only, no need to type
  7281. hook: hook.bind(null, "request")
  7282. }),
  7283. mediaType: {
  7284. previews: [],
  7285. format: ""
  7286. }
  7287. };
  7288. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7289. if (options.baseUrl) {
  7290. requestDefaults.baseUrl = options.baseUrl;
  7291. }
  7292. if (options.previews) {
  7293. requestDefaults.mediaType.previews = options.previews;
  7294. }
  7295. if (options.timeZone) {
  7296. requestDefaults.headers["time-zone"] = options.timeZone;
  7297. }
  7298. this.request = import_request.request.defaults(requestDefaults);
  7299. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7300. this.log = Object.assign(
  7301. {
  7302. debug: noop,
  7303. info: noop,
  7304. warn: consoleWarn,
  7305. error: consoleError
  7306. },
  7307. options.log
  7308. );
  7309. this.hook = hook;
  7310. if (!options.authStrategy) {
  7311. if (!options.auth) {
  7312. this.auth = async () => ({
  7313. type: "unauthenticated"
  7314. });
  7315. } else {
  7316. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7317. hook.wrap("request", auth.hook);
  7318. this.auth = auth;
  7319. }
  7320. } else {
  7321. const { authStrategy, ...otherOptions } = options;
  7322. const auth = authStrategy(
  7323. Object.assign(
  7324. {
  7325. request: this.request,
  7326. log: this.log,
  7327. // we pass the current octokit instance as well as its constructor options
  7328. // to allow for authentication strategies that return a new octokit instance
  7329. // that shares the same internal state as the current one. The original
  7330. // requirement for this was the "event-octokit" authentication strategy
  7331. // of https://github.com/probot/octokit-auth-probot.
  7332. octokit: this,
  7333. octokitOptions: otherOptions
  7334. },
  7335. options.auth
  7336. )
  7337. );
  7338. hook.wrap("request", auth.hook);
  7339. this.auth = auth;
  7340. }
  7341. const classConstructor = this.constructor;
  7342. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7343. Object.assign(this, classConstructor.plugins[i](this, options));
  7344. }
  7345. }
  7346. };
  7347. // Annotate the CommonJS export names for ESM import in node:
  7348. 0 && (0);
  7349. /***/ }),
  7350. /***/ 9440:
  7351. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7352. "use strict";
  7353. var __defProp = Object.defineProperty;
  7354. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7355. var __getOwnPropNames = Object.getOwnPropertyNames;
  7356. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7357. var __export = (target, all) => {
  7358. for (var name in all)
  7359. __defProp(target, name, { get: all[name], enumerable: true });
  7360. };
  7361. var __copyProps = (to, from, except, desc) => {
  7362. if (from && typeof from === "object" || typeof from === "function") {
  7363. for (let key of __getOwnPropNames(from))
  7364. if (!__hasOwnProp.call(to, key) && key !== except)
  7365. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7366. }
  7367. return to;
  7368. };
  7369. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7370. // pkg/dist-src/index.js
  7371. var dist_src_exports = {};
  7372. __export(dist_src_exports, {
  7373. endpoint: () => endpoint
  7374. });
  7375. module.exports = __toCommonJS(dist_src_exports);
  7376. // pkg/dist-src/defaults.js
  7377. var import_universal_user_agent = __nccwpck_require__(5030);
  7378. // pkg/dist-src/version.js
  7379. var VERSION = "9.0.5";
  7380. // pkg/dist-src/defaults.js
  7381. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7382. var DEFAULTS = {
  7383. method: "GET",
  7384. baseUrl: "https://api.github.com",
  7385. headers: {
  7386. accept: "application/vnd.github.v3+json",
  7387. "user-agent": userAgent
  7388. },
  7389. mediaType: {
  7390. format: ""
  7391. }
  7392. };
  7393. // pkg/dist-src/util/lowercase-keys.js
  7394. function lowercaseKeys(object) {
  7395. if (!object) {
  7396. return {};
  7397. }
  7398. return Object.keys(object).reduce((newObj, key) => {
  7399. newObj[key.toLowerCase()] = object[key];
  7400. return newObj;
  7401. }, {});
  7402. }
  7403. // pkg/dist-src/util/is-plain-object.js
  7404. function isPlainObject(value) {
  7405. if (typeof value !== "object" || value === null)
  7406. return false;
  7407. if (Object.prototype.toString.call(value) !== "[object Object]")
  7408. return false;
  7409. const proto = Object.getPrototypeOf(value);
  7410. if (proto === null)
  7411. return true;
  7412. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7413. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7414. }
  7415. // pkg/dist-src/util/merge-deep.js
  7416. function mergeDeep(defaults, options) {
  7417. const result = Object.assign({}, defaults);
  7418. Object.keys(options).forEach((key) => {
  7419. if (isPlainObject(options[key])) {
  7420. if (!(key in defaults))
  7421. Object.assign(result, { [key]: options[key] });
  7422. else
  7423. result[key] = mergeDeep(defaults[key], options[key]);
  7424. } else {
  7425. Object.assign(result, { [key]: options[key] });
  7426. }
  7427. });
  7428. return result;
  7429. }
  7430. // pkg/dist-src/util/remove-undefined-properties.js
  7431. function removeUndefinedProperties(obj) {
  7432. for (const key in obj) {
  7433. if (obj[key] === void 0) {
  7434. delete obj[key];
  7435. }
  7436. }
  7437. return obj;
  7438. }
  7439. // pkg/dist-src/merge.js
  7440. function merge(defaults, route, options) {
  7441. if (typeof route === "string") {
  7442. let [method, url] = route.split(" ");
  7443. options = Object.assign(url ? { method, url } : { url: method }, options);
  7444. } else {
  7445. options = Object.assign({}, route);
  7446. }
  7447. options.headers = lowercaseKeys(options.headers);
  7448. removeUndefinedProperties(options);
  7449. removeUndefinedProperties(options.headers);
  7450. const mergedOptions = mergeDeep(defaults || {}, options);
  7451. if (options.url === "/graphql") {
  7452. if (defaults && defaults.mediaType.previews?.length) {
  7453. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7454. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7455. ).concat(mergedOptions.mediaType.previews);
  7456. }
  7457. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7458. }
  7459. return mergedOptions;
  7460. }
  7461. // pkg/dist-src/util/add-query-parameters.js
  7462. function addQueryParameters(url, parameters) {
  7463. const separator = /\?/.test(url) ? "&" : "?";
  7464. const names = Object.keys(parameters);
  7465. if (names.length === 0) {
  7466. return url;
  7467. }
  7468. return url + separator + names.map((name) => {
  7469. if (name === "q") {
  7470. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7471. }
  7472. return `${name}=${encodeURIComponent(parameters[name])}`;
  7473. }).join("&");
  7474. }
  7475. // pkg/dist-src/util/extract-url-variable-names.js
  7476. var urlVariableRegex = /\{[^}]+\}/g;
  7477. function removeNonChars(variableName) {
  7478. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  7479. }
  7480. function extractUrlVariableNames(url) {
  7481. const matches = url.match(urlVariableRegex);
  7482. if (!matches) {
  7483. return [];
  7484. }
  7485. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7486. }
  7487. // pkg/dist-src/util/omit.js
  7488. function omit(object, keysToOmit) {
  7489. const result = { __proto__: null };
  7490. for (const key of Object.keys(object)) {
  7491. if (keysToOmit.indexOf(key) === -1) {
  7492. result[key] = object[key];
  7493. }
  7494. }
  7495. return result;
  7496. }
  7497. // pkg/dist-src/util/url-template.js
  7498. function encodeReserved(str) {
  7499. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7500. if (!/%[0-9A-Fa-f]/.test(part)) {
  7501. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7502. }
  7503. return part;
  7504. }).join("");
  7505. }
  7506. function encodeUnreserved(str) {
  7507. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7508. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7509. });
  7510. }
  7511. function encodeValue(operator, value, key) {
  7512. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7513. if (key) {
  7514. return encodeUnreserved(key) + "=" + value;
  7515. } else {
  7516. return value;
  7517. }
  7518. }
  7519. function isDefined(value) {
  7520. return value !== void 0 && value !== null;
  7521. }
  7522. function isKeyOperator(operator) {
  7523. return operator === ";" || operator === "&" || operator === "?";
  7524. }
  7525. function getValues(context, operator, key, modifier) {
  7526. var value = context[key], result = [];
  7527. if (isDefined(value) && value !== "") {
  7528. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7529. value = value.toString();
  7530. if (modifier && modifier !== "*") {
  7531. value = value.substring(0, parseInt(modifier, 10));
  7532. }
  7533. result.push(
  7534. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7535. );
  7536. } else {
  7537. if (modifier === "*") {
  7538. if (Array.isArray(value)) {
  7539. value.filter(isDefined).forEach(function(value2) {
  7540. result.push(
  7541. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7542. );
  7543. });
  7544. } else {
  7545. Object.keys(value).forEach(function(k) {
  7546. if (isDefined(value[k])) {
  7547. result.push(encodeValue(operator, value[k], k));
  7548. }
  7549. });
  7550. }
  7551. } else {
  7552. const tmp = [];
  7553. if (Array.isArray(value)) {
  7554. value.filter(isDefined).forEach(function(value2) {
  7555. tmp.push(encodeValue(operator, value2));
  7556. });
  7557. } else {
  7558. Object.keys(value).forEach(function(k) {
  7559. if (isDefined(value[k])) {
  7560. tmp.push(encodeUnreserved(k));
  7561. tmp.push(encodeValue(operator, value[k].toString()));
  7562. }
  7563. });
  7564. }
  7565. if (isKeyOperator(operator)) {
  7566. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7567. } else if (tmp.length !== 0) {
  7568. result.push(tmp.join(","));
  7569. }
  7570. }
  7571. }
  7572. } else {
  7573. if (operator === ";") {
  7574. if (isDefined(value)) {
  7575. result.push(encodeUnreserved(key));
  7576. }
  7577. } else if (value === "" && (operator === "&" || operator === "?")) {
  7578. result.push(encodeUnreserved(key) + "=");
  7579. } else if (value === "") {
  7580. result.push("");
  7581. }
  7582. }
  7583. return result;
  7584. }
  7585. function parseUrl(template) {
  7586. return {
  7587. expand: expand.bind(null, template)
  7588. };
  7589. }
  7590. function expand(template, context) {
  7591. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7592. template = template.replace(
  7593. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7594. function(_, expression, literal) {
  7595. if (expression) {
  7596. let operator = "";
  7597. const values = [];
  7598. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7599. operator = expression.charAt(0);
  7600. expression = expression.substr(1);
  7601. }
  7602. expression.split(/,/g).forEach(function(variable) {
  7603. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7604. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7605. });
  7606. if (operator && operator !== "+") {
  7607. var separator = ",";
  7608. if (operator === "?") {
  7609. separator = "&";
  7610. } else if (operator !== "#") {
  7611. separator = operator;
  7612. }
  7613. return (values.length !== 0 ? operator : "") + values.join(separator);
  7614. } else {
  7615. return values.join(",");
  7616. }
  7617. } else {
  7618. return encodeReserved(literal);
  7619. }
  7620. }
  7621. );
  7622. if (template === "/") {
  7623. return template;
  7624. } else {
  7625. return template.replace(/\/$/, "");
  7626. }
  7627. }
  7628. // pkg/dist-src/parse.js
  7629. function parse(options) {
  7630. let method = options.method.toUpperCase();
  7631. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7632. let headers = Object.assign({}, options.headers);
  7633. let body;
  7634. let parameters = omit(options, [
  7635. "method",
  7636. "baseUrl",
  7637. "url",
  7638. "headers",
  7639. "request",
  7640. "mediaType"
  7641. ]);
  7642. const urlVariableNames = extractUrlVariableNames(url);
  7643. url = parseUrl(url).expand(parameters);
  7644. if (!/^http/.test(url)) {
  7645. url = options.baseUrl + url;
  7646. }
  7647. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7648. const remainingParameters = omit(parameters, omittedParameters);
  7649. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7650. if (!isBinaryRequest) {
  7651. if (options.mediaType.format) {
  7652. headers.accept = headers.accept.split(/,/).map(
  7653. (format) => format.replace(
  7654. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7655. `application/vnd$1$2.${options.mediaType.format}`
  7656. )
  7657. ).join(",");
  7658. }
  7659. if (url.endsWith("/graphql")) {
  7660. if (options.mediaType.previews?.length) {
  7661. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  7662. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7663. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7664. return `application/vnd.github.${preview}-preview${format}`;
  7665. }).join(",");
  7666. }
  7667. }
  7668. }
  7669. if (["GET", "HEAD"].includes(method)) {
  7670. url = addQueryParameters(url, remainingParameters);
  7671. } else {
  7672. if ("data" in remainingParameters) {
  7673. body = remainingParameters.data;
  7674. } else {
  7675. if (Object.keys(remainingParameters).length) {
  7676. body = remainingParameters;
  7677. }
  7678. }
  7679. }
  7680. if (!headers["content-type"] && typeof body !== "undefined") {
  7681. headers["content-type"] = "application/json; charset=utf-8";
  7682. }
  7683. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7684. body = "";
  7685. }
  7686. return Object.assign(
  7687. { method, url, headers },
  7688. typeof body !== "undefined" ? { body } : null,
  7689. options.request ? { request: options.request } : null
  7690. );
  7691. }
  7692. // pkg/dist-src/endpoint-with-defaults.js
  7693. function endpointWithDefaults(defaults, route, options) {
  7694. return parse(merge(defaults, route, options));
  7695. }
  7696. // pkg/dist-src/with-defaults.js
  7697. function withDefaults(oldDefaults, newDefaults) {
  7698. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7699. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7700. return Object.assign(endpoint2, {
  7701. DEFAULTS: DEFAULTS2,
  7702. defaults: withDefaults.bind(null, DEFAULTS2),
  7703. merge: merge.bind(null, DEFAULTS2),
  7704. parse
  7705. });
  7706. }
  7707. // pkg/dist-src/index.js
  7708. var endpoint = withDefaults(null, DEFAULTS);
  7709. // Annotate the CommonJS export names for ESM import in node:
  7710. 0 && (0);
  7711. /***/ }),
  7712. /***/ 8467:
  7713. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7714. "use strict";
  7715. var __defProp = Object.defineProperty;
  7716. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7717. var __getOwnPropNames = Object.getOwnPropertyNames;
  7718. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7719. var __export = (target, all) => {
  7720. for (var name in all)
  7721. __defProp(target, name, { get: all[name], enumerable: true });
  7722. };
  7723. var __copyProps = (to, from, except, desc) => {
  7724. if (from && typeof from === "object" || typeof from === "function") {
  7725. for (let key of __getOwnPropNames(from))
  7726. if (!__hasOwnProp.call(to, key) && key !== except)
  7727. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7728. }
  7729. return to;
  7730. };
  7731. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7732. // pkg/dist-src/index.js
  7733. var dist_src_exports = {};
  7734. __export(dist_src_exports, {
  7735. GraphqlResponseError: () => GraphqlResponseError,
  7736. graphql: () => graphql2,
  7737. withCustomRequest: () => withCustomRequest
  7738. });
  7739. module.exports = __toCommonJS(dist_src_exports);
  7740. var import_request3 = __nccwpck_require__(6234);
  7741. var import_universal_user_agent = __nccwpck_require__(5030);
  7742. // pkg/dist-src/version.js
  7743. var VERSION = "7.1.0";
  7744. // pkg/dist-src/with-defaults.js
  7745. var import_request2 = __nccwpck_require__(6234);
  7746. // pkg/dist-src/graphql.js
  7747. var import_request = __nccwpck_require__(6234);
  7748. // pkg/dist-src/error.js
  7749. function _buildMessageForResponseErrors(data) {
  7750. return `Request failed due to following response errors:
  7751. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  7752. }
  7753. var GraphqlResponseError = class extends Error {
  7754. constructor(request2, headers, response) {
  7755. super(_buildMessageForResponseErrors(response));
  7756. this.request = request2;
  7757. this.headers = headers;
  7758. this.response = response;
  7759. this.name = "GraphqlResponseError";
  7760. this.errors = response.errors;
  7761. this.data = response.data;
  7762. if (Error.captureStackTrace) {
  7763. Error.captureStackTrace(this, this.constructor);
  7764. }
  7765. }
  7766. };
  7767. // pkg/dist-src/graphql.js
  7768. var NON_VARIABLE_OPTIONS = [
  7769. "method",
  7770. "baseUrl",
  7771. "url",
  7772. "headers",
  7773. "request",
  7774. "query",
  7775. "mediaType"
  7776. ];
  7777. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  7778. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  7779. function graphql(request2, query, options) {
  7780. if (options) {
  7781. if (typeof query === "string" && "query" in options) {
  7782. return Promise.reject(
  7783. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  7784. );
  7785. }
  7786. for (const key in options) {
  7787. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  7788. continue;
  7789. return Promise.reject(
  7790. new Error(
  7791. `[@octokit/graphql] "${key}" cannot be used as variable name`
  7792. )
  7793. );
  7794. }
  7795. }
  7796. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  7797. const requestOptions = Object.keys(
  7798. parsedOptions
  7799. ).reduce((result, key) => {
  7800. if (NON_VARIABLE_OPTIONS.includes(key)) {
  7801. result[key] = parsedOptions[key];
  7802. return result;
  7803. }
  7804. if (!result.variables) {
  7805. result.variables = {};
  7806. }
  7807. result.variables[key] = parsedOptions[key];
  7808. return result;
  7809. }, {});
  7810. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  7811. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  7812. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  7813. }
  7814. return request2(requestOptions).then((response) => {
  7815. if (response.data.errors) {
  7816. const headers = {};
  7817. for (const key of Object.keys(response.headers)) {
  7818. headers[key] = response.headers[key];
  7819. }
  7820. throw new GraphqlResponseError(
  7821. requestOptions,
  7822. headers,
  7823. response.data
  7824. );
  7825. }
  7826. return response.data.data;
  7827. });
  7828. }
  7829. // pkg/dist-src/with-defaults.js
  7830. function withDefaults(request2, newDefaults) {
  7831. const newRequest = request2.defaults(newDefaults);
  7832. const newApi = (query, options) => {
  7833. return graphql(newRequest, query, options);
  7834. };
  7835. return Object.assign(newApi, {
  7836. defaults: withDefaults.bind(null, newRequest),
  7837. endpoint: newRequest.endpoint
  7838. });
  7839. }
  7840. // pkg/dist-src/index.js
  7841. var graphql2 = withDefaults(import_request3.request, {
  7842. headers: {
  7843. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  7844. },
  7845. method: "POST",
  7846. url: "/graphql"
  7847. });
  7848. function withCustomRequest(customRequest) {
  7849. return withDefaults(customRequest, {
  7850. method: "POST",
  7851. url: "/graphql"
  7852. });
  7853. }
  7854. // Annotate the CommonJS export names for ESM import in node:
  7855. 0 && (0);
  7856. /***/ }),
  7857. /***/ 4193:
  7858. /***/ ((module) => {
  7859. "use strict";
  7860. var __defProp = Object.defineProperty;
  7861. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7862. var __getOwnPropNames = Object.getOwnPropertyNames;
  7863. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7864. var __export = (target, all) => {
  7865. for (var name in all)
  7866. __defProp(target, name, { get: all[name], enumerable: true });
  7867. };
  7868. var __copyProps = (to, from, except, desc) => {
  7869. if (from && typeof from === "object" || typeof from === "function") {
  7870. for (let key of __getOwnPropNames(from))
  7871. if (!__hasOwnProp.call(to, key) && key !== except)
  7872. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7873. }
  7874. return to;
  7875. };
  7876. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7877. // pkg/dist-src/index.js
  7878. var dist_src_exports = {};
  7879. __export(dist_src_exports, {
  7880. composePaginateRest: () => composePaginateRest,
  7881. isPaginatingEndpoint: () => isPaginatingEndpoint,
  7882. paginateRest: () => paginateRest,
  7883. paginatingEndpoints: () => paginatingEndpoints
  7884. });
  7885. module.exports = __toCommonJS(dist_src_exports);
  7886. // pkg/dist-src/version.js
  7887. var VERSION = "9.2.1";
  7888. // pkg/dist-src/normalize-paginated-list-response.js
  7889. function normalizePaginatedListResponse(response) {
  7890. if (!response.data) {
  7891. return {
  7892. ...response,
  7893. data: []
  7894. };
  7895. }
  7896. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  7897. if (!responseNeedsNormalization)
  7898. return response;
  7899. const incompleteResults = response.data.incomplete_results;
  7900. const repositorySelection = response.data.repository_selection;
  7901. const totalCount = response.data.total_count;
  7902. delete response.data.incomplete_results;
  7903. delete response.data.repository_selection;
  7904. delete response.data.total_count;
  7905. const namespaceKey = Object.keys(response.data)[0];
  7906. const data = response.data[namespaceKey];
  7907. response.data = data;
  7908. if (typeof incompleteResults !== "undefined") {
  7909. response.data.incomplete_results = incompleteResults;
  7910. }
  7911. if (typeof repositorySelection !== "undefined") {
  7912. response.data.repository_selection = repositorySelection;
  7913. }
  7914. response.data.total_count = totalCount;
  7915. return response;
  7916. }
  7917. // pkg/dist-src/iterator.js
  7918. function iterator(octokit, route, parameters) {
  7919. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  7920. const requestMethod = typeof route === "function" ? route : octokit.request;
  7921. const method = options.method;
  7922. const headers = options.headers;
  7923. let url = options.url;
  7924. return {
  7925. [Symbol.asyncIterator]: () => ({
  7926. async next() {
  7927. if (!url)
  7928. return { done: true };
  7929. try {
  7930. const response = await requestMethod({ method, url, headers });
  7931. const normalizedResponse = normalizePaginatedListResponse(response);
  7932. url = ((normalizedResponse.headers.link || "").match(
  7933. /<([^>]+)>;\s*rel="next"/
  7934. ) || [])[1];
  7935. return { value: normalizedResponse };
  7936. } catch (error) {
  7937. if (error.status !== 409)
  7938. throw error;
  7939. url = "";
  7940. return {
  7941. value: {
  7942. status: 200,
  7943. headers: {},
  7944. data: []
  7945. }
  7946. };
  7947. }
  7948. }
  7949. })
  7950. };
  7951. }
  7952. // pkg/dist-src/paginate.js
  7953. function paginate(octokit, route, parameters, mapFn) {
  7954. if (typeof parameters === "function") {
  7955. mapFn = parameters;
  7956. parameters = void 0;
  7957. }
  7958. return gather(
  7959. octokit,
  7960. [],
  7961. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  7962. mapFn
  7963. );
  7964. }
  7965. function gather(octokit, results, iterator2, mapFn) {
  7966. return iterator2.next().then((result) => {
  7967. if (result.done) {
  7968. return results;
  7969. }
  7970. let earlyExit = false;
  7971. function done() {
  7972. earlyExit = true;
  7973. }
  7974. results = results.concat(
  7975. mapFn ? mapFn(result.value, done) : result.value.data
  7976. );
  7977. if (earlyExit) {
  7978. return results;
  7979. }
  7980. return gather(octokit, results, iterator2, mapFn);
  7981. });
  7982. }
  7983. // pkg/dist-src/compose-paginate.js
  7984. var composePaginateRest = Object.assign(paginate, {
  7985. iterator
  7986. });
  7987. // pkg/dist-src/generated/paginating-endpoints.js
  7988. var paginatingEndpoints = [
  7989. "GET /advisories",
  7990. "GET /app/hook/deliveries",
  7991. "GET /app/installation-requests",
  7992. "GET /app/installations",
  7993. "GET /assignments/{assignment_id}/accepted_assignments",
  7994. "GET /classrooms",
  7995. "GET /classrooms/{classroom_id}/assignments",
  7996. "GET /enterprises/{enterprise}/dependabot/alerts",
  7997. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  7998. "GET /events",
  7999. "GET /gists",
  8000. "GET /gists/public",
  8001. "GET /gists/starred",
  8002. "GET /gists/{gist_id}/comments",
  8003. "GET /gists/{gist_id}/commits",
  8004. "GET /gists/{gist_id}/forks",
  8005. "GET /installation/repositories",
  8006. "GET /issues",
  8007. "GET /licenses",
  8008. "GET /marketplace_listing/plans",
  8009. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8010. "GET /marketplace_listing/stubbed/plans",
  8011. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8012. "GET /networks/{owner}/{repo}/events",
  8013. "GET /notifications",
  8014. "GET /organizations",
  8015. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8016. "GET /orgs/{org}/actions/permissions/repositories",
  8017. "GET /orgs/{org}/actions/runners",
  8018. "GET /orgs/{org}/actions/secrets",
  8019. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8020. "GET /orgs/{org}/actions/variables",
  8021. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8022. "GET /orgs/{org}/blocks",
  8023. "GET /orgs/{org}/code-scanning/alerts",
  8024. "GET /orgs/{org}/codespaces",
  8025. "GET /orgs/{org}/codespaces/secrets",
  8026. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8027. "GET /orgs/{org}/copilot/billing/seats",
  8028. "GET /orgs/{org}/dependabot/alerts",
  8029. "GET /orgs/{org}/dependabot/secrets",
  8030. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8031. "GET /orgs/{org}/events",
  8032. "GET /orgs/{org}/failed_invitations",
  8033. "GET /orgs/{org}/hooks",
  8034. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8035. "GET /orgs/{org}/installations",
  8036. "GET /orgs/{org}/invitations",
  8037. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8038. "GET /orgs/{org}/issues",
  8039. "GET /orgs/{org}/members",
  8040. "GET /orgs/{org}/members/{username}/codespaces",
  8041. "GET /orgs/{org}/migrations",
  8042. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8043. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8044. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8045. "GET /orgs/{org}/outside_collaborators",
  8046. "GET /orgs/{org}/packages",
  8047. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8048. "GET /orgs/{org}/personal-access-token-requests",
  8049. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8050. "GET /orgs/{org}/personal-access-tokens",
  8051. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8052. "GET /orgs/{org}/projects",
  8053. "GET /orgs/{org}/properties/values",
  8054. "GET /orgs/{org}/public_members",
  8055. "GET /orgs/{org}/repos",
  8056. "GET /orgs/{org}/rulesets",
  8057. "GET /orgs/{org}/rulesets/rule-suites",
  8058. "GET /orgs/{org}/secret-scanning/alerts",
  8059. "GET /orgs/{org}/security-advisories",
  8060. "GET /orgs/{org}/teams",
  8061. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8062. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8063. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8064. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8065. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8066. "GET /orgs/{org}/teams/{team_slug}/members",
  8067. "GET /orgs/{org}/teams/{team_slug}/projects",
  8068. "GET /orgs/{org}/teams/{team_slug}/repos",
  8069. "GET /orgs/{org}/teams/{team_slug}/teams",
  8070. "GET /projects/columns/{column_id}/cards",
  8071. "GET /projects/{project_id}/collaborators",
  8072. "GET /projects/{project_id}/columns",
  8073. "GET /repos/{owner}/{repo}/actions/artifacts",
  8074. "GET /repos/{owner}/{repo}/actions/caches",
  8075. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8076. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8077. "GET /repos/{owner}/{repo}/actions/runners",
  8078. "GET /repos/{owner}/{repo}/actions/runs",
  8079. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8080. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8081. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8082. "GET /repos/{owner}/{repo}/actions/secrets",
  8083. "GET /repos/{owner}/{repo}/actions/variables",
  8084. "GET /repos/{owner}/{repo}/actions/workflows",
  8085. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8086. "GET /repos/{owner}/{repo}/activity",
  8087. "GET /repos/{owner}/{repo}/assignees",
  8088. "GET /repos/{owner}/{repo}/branches",
  8089. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8090. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8091. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8092. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8093. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8094. "GET /repos/{owner}/{repo}/codespaces",
  8095. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8096. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8097. "GET /repos/{owner}/{repo}/collaborators",
  8098. "GET /repos/{owner}/{repo}/comments",
  8099. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8100. "GET /repos/{owner}/{repo}/commits",
  8101. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8102. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8103. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8104. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8105. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8106. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8107. "GET /repos/{owner}/{repo}/contributors",
  8108. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8109. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8110. "GET /repos/{owner}/{repo}/deployments",
  8111. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8112. "GET /repos/{owner}/{repo}/environments",
  8113. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8114. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8115. "GET /repos/{owner}/{repo}/events",
  8116. "GET /repos/{owner}/{repo}/forks",
  8117. "GET /repos/{owner}/{repo}/hooks",
  8118. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8119. "GET /repos/{owner}/{repo}/invitations",
  8120. "GET /repos/{owner}/{repo}/issues",
  8121. "GET /repos/{owner}/{repo}/issues/comments",
  8122. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8123. "GET /repos/{owner}/{repo}/issues/events",
  8124. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8125. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8126. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8127. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8128. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8129. "GET /repos/{owner}/{repo}/keys",
  8130. "GET /repos/{owner}/{repo}/labels",
  8131. "GET /repos/{owner}/{repo}/milestones",
  8132. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8133. "GET /repos/{owner}/{repo}/notifications",
  8134. "GET /repos/{owner}/{repo}/pages/builds",
  8135. "GET /repos/{owner}/{repo}/projects",
  8136. "GET /repos/{owner}/{repo}/pulls",
  8137. "GET /repos/{owner}/{repo}/pulls/comments",
  8138. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8139. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8140. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8141. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8142. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8143. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8144. "GET /repos/{owner}/{repo}/releases",
  8145. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8146. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8147. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8148. "GET /repos/{owner}/{repo}/rulesets",
  8149. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8150. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8151. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8152. "GET /repos/{owner}/{repo}/security-advisories",
  8153. "GET /repos/{owner}/{repo}/stargazers",
  8154. "GET /repos/{owner}/{repo}/subscribers",
  8155. "GET /repos/{owner}/{repo}/tags",
  8156. "GET /repos/{owner}/{repo}/teams",
  8157. "GET /repos/{owner}/{repo}/topics",
  8158. "GET /repositories",
  8159. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8160. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8161. "GET /search/code",
  8162. "GET /search/commits",
  8163. "GET /search/issues",
  8164. "GET /search/labels",
  8165. "GET /search/repositories",
  8166. "GET /search/topics",
  8167. "GET /search/users",
  8168. "GET /teams/{team_id}/discussions",
  8169. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8170. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8171. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8172. "GET /teams/{team_id}/invitations",
  8173. "GET /teams/{team_id}/members",
  8174. "GET /teams/{team_id}/projects",
  8175. "GET /teams/{team_id}/repos",
  8176. "GET /teams/{team_id}/teams",
  8177. "GET /user/blocks",
  8178. "GET /user/codespaces",
  8179. "GET /user/codespaces/secrets",
  8180. "GET /user/emails",
  8181. "GET /user/followers",
  8182. "GET /user/following",
  8183. "GET /user/gpg_keys",
  8184. "GET /user/installations",
  8185. "GET /user/installations/{installation_id}/repositories",
  8186. "GET /user/issues",
  8187. "GET /user/keys",
  8188. "GET /user/marketplace_purchases",
  8189. "GET /user/marketplace_purchases/stubbed",
  8190. "GET /user/memberships/orgs",
  8191. "GET /user/migrations",
  8192. "GET /user/migrations/{migration_id}/repositories",
  8193. "GET /user/orgs",
  8194. "GET /user/packages",
  8195. "GET /user/packages/{package_type}/{package_name}/versions",
  8196. "GET /user/public_emails",
  8197. "GET /user/repos",
  8198. "GET /user/repository_invitations",
  8199. "GET /user/social_accounts",
  8200. "GET /user/ssh_signing_keys",
  8201. "GET /user/starred",
  8202. "GET /user/subscriptions",
  8203. "GET /user/teams",
  8204. "GET /users",
  8205. "GET /users/{username}/events",
  8206. "GET /users/{username}/events/orgs/{org}",
  8207. "GET /users/{username}/events/public",
  8208. "GET /users/{username}/followers",
  8209. "GET /users/{username}/following",
  8210. "GET /users/{username}/gists",
  8211. "GET /users/{username}/gpg_keys",
  8212. "GET /users/{username}/keys",
  8213. "GET /users/{username}/orgs",
  8214. "GET /users/{username}/packages",
  8215. "GET /users/{username}/projects",
  8216. "GET /users/{username}/received_events",
  8217. "GET /users/{username}/received_events/public",
  8218. "GET /users/{username}/repos",
  8219. "GET /users/{username}/social_accounts",
  8220. "GET /users/{username}/ssh_signing_keys",
  8221. "GET /users/{username}/starred",
  8222. "GET /users/{username}/subscriptions"
  8223. ];
  8224. // pkg/dist-src/paginating-endpoints.js
  8225. function isPaginatingEndpoint(arg) {
  8226. if (typeof arg === "string") {
  8227. return paginatingEndpoints.includes(arg);
  8228. } else {
  8229. return false;
  8230. }
  8231. }
  8232. // pkg/dist-src/index.js
  8233. function paginateRest(octokit) {
  8234. return {
  8235. paginate: Object.assign(paginate.bind(null, octokit), {
  8236. iterator: iterator.bind(null, octokit)
  8237. })
  8238. };
  8239. }
  8240. paginateRest.VERSION = VERSION;
  8241. // Annotate the CommonJS export names for ESM import in node:
  8242. 0 && (0);
  8243. /***/ }),
  8244. /***/ 3044:
  8245. /***/ ((module) => {
  8246. "use strict";
  8247. var __defProp = Object.defineProperty;
  8248. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8249. var __getOwnPropNames = Object.getOwnPropertyNames;
  8250. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8251. var __export = (target, all) => {
  8252. for (var name in all)
  8253. __defProp(target, name, { get: all[name], enumerable: true });
  8254. };
  8255. var __copyProps = (to, from, except, desc) => {
  8256. if (from && typeof from === "object" || typeof from === "function") {
  8257. for (let key of __getOwnPropNames(from))
  8258. if (!__hasOwnProp.call(to, key) && key !== except)
  8259. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8260. }
  8261. return to;
  8262. };
  8263. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8264. // pkg/dist-src/index.js
  8265. var dist_src_exports = {};
  8266. __export(dist_src_exports, {
  8267. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8268. restEndpointMethods: () => restEndpointMethods
  8269. });
  8270. module.exports = __toCommonJS(dist_src_exports);
  8271. // pkg/dist-src/version.js
  8272. var VERSION = "10.4.1";
  8273. // pkg/dist-src/generated/endpoints.js
  8274. var Endpoints = {
  8275. actions: {
  8276. addCustomLabelsToSelfHostedRunnerForOrg: [
  8277. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8278. ],
  8279. addCustomLabelsToSelfHostedRunnerForRepo: [
  8280. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8281. ],
  8282. addSelectedRepoToOrgSecret: [
  8283. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8284. ],
  8285. addSelectedRepoToOrgVariable: [
  8286. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8287. ],
  8288. approveWorkflowRun: [
  8289. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8290. ],
  8291. cancelWorkflowRun: [
  8292. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8293. ],
  8294. createEnvironmentVariable: [
  8295. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8296. ],
  8297. createOrUpdateEnvironmentSecret: [
  8298. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8299. ],
  8300. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8301. createOrUpdateRepoSecret: [
  8302. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8303. ],
  8304. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8305. createRegistrationTokenForOrg: [
  8306. "POST /orgs/{org}/actions/runners/registration-token"
  8307. ],
  8308. createRegistrationTokenForRepo: [
  8309. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8310. ],
  8311. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8312. createRemoveTokenForRepo: [
  8313. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8314. ],
  8315. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8316. createWorkflowDispatch: [
  8317. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8318. ],
  8319. deleteActionsCacheById: [
  8320. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8321. ],
  8322. deleteActionsCacheByKey: [
  8323. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8324. ],
  8325. deleteArtifact: [
  8326. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8327. ],
  8328. deleteEnvironmentSecret: [
  8329. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8330. ],
  8331. deleteEnvironmentVariable: [
  8332. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8333. ],
  8334. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8335. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8336. deleteRepoSecret: [
  8337. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8338. ],
  8339. deleteRepoVariable: [
  8340. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8341. ],
  8342. deleteSelfHostedRunnerFromOrg: [
  8343. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8344. ],
  8345. deleteSelfHostedRunnerFromRepo: [
  8346. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8347. ],
  8348. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8349. deleteWorkflowRunLogs: [
  8350. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8351. ],
  8352. disableSelectedRepositoryGithubActionsOrganization: [
  8353. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8354. ],
  8355. disableWorkflow: [
  8356. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8357. ],
  8358. downloadArtifact: [
  8359. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8360. ],
  8361. downloadJobLogsForWorkflowRun: [
  8362. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8363. ],
  8364. downloadWorkflowRunAttemptLogs: [
  8365. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8366. ],
  8367. downloadWorkflowRunLogs: [
  8368. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8369. ],
  8370. enableSelectedRepositoryGithubActionsOrganization: [
  8371. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8372. ],
  8373. enableWorkflow: [
  8374. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8375. ],
  8376. forceCancelWorkflowRun: [
  8377. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8378. ],
  8379. generateRunnerJitconfigForOrg: [
  8380. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8381. ],
  8382. generateRunnerJitconfigForRepo: [
  8383. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8384. ],
  8385. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8386. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8387. getActionsCacheUsageByRepoForOrg: [
  8388. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8389. ],
  8390. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8391. getAllowedActionsOrganization: [
  8392. "GET /orgs/{org}/actions/permissions/selected-actions"
  8393. ],
  8394. getAllowedActionsRepository: [
  8395. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8396. ],
  8397. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8398. getCustomOidcSubClaimForRepo: [
  8399. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8400. ],
  8401. getEnvironmentPublicKey: [
  8402. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8403. ],
  8404. getEnvironmentSecret: [
  8405. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8406. ],
  8407. getEnvironmentVariable: [
  8408. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8409. ],
  8410. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8411. "GET /orgs/{org}/actions/permissions/workflow"
  8412. ],
  8413. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8414. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8415. ],
  8416. getGithubActionsPermissionsOrganization: [
  8417. "GET /orgs/{org}/actions/permissions"
  8418. ],
  8419. getGithubActionsPermissionsRepository: [
  8420. "GET /repos/{owner}/{repo}/actions/permissions"
  8421. ],
  8422. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8423. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8424. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8425. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8426. getPendingDeploymentsForRun: [
  8427. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8428. ],
  8429. getRepoPermissions: [
  8430. "GET /repos/{owner}/{repo}/actions/permissions",
  8431. {},
  8432. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8433. ],
  8434. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8435. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8436. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8437. getReviewsForRun: [
  8438. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8439. ],
  8440. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8441. getSelfHostedRunnerForRepo: [
  8442. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8443. ],
  8444. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8445. getWorkflowAccessToRepository: [
  8446. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8447. ],
  8448. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8449. getWorkflowRunAttempt: [
  8450. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8451. ],
  8452. getWorkflowRunUsage: [
  8453. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8454. ],
  8455. getWorkflowUsage: [
  8456. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8457. ],
  8458. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8459. listEnvironmentSecrets: [
  8460. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8461. ],
  8462. listEnvironmentVariables: [
  8463. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8464. ],
  8465. listJobsForWorkflowRun: [
  8466. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8467. ],
  8468. listJobsForWorkflowRunAttempt: [
  8469. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8470. ],
  8471. listLabelsForSelfHostedRunnerForOrg: [
  8472. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8473. ],
  8474. listLabelsForSelfHostedRunnerForRepo: [
  8475. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8476. ],
  8477. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8478. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8479. listRepoOrganizationSecrets: [
  8480. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8481. ],
  8482. listRepoOrganizationVariables: [
  8483. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8484. ],
  8485. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8486. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8487. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8488. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8489. listRunnerApplicationsForRepo: [
  8490. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8491. ],
  8492. listSelectedReposForOrgSecret: [
  8493. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8494. ],
  8495. listSelectedReposForOrgVariable: [
  8496. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8497. ],
  8498. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8499. "GET /orgs/{org}/actions/permissions/repositories"
  8500. ],
  8501. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8502. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8503. listWorkflowRunArtifacts: [
  8504. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8505. ],
  8506. listWorkflowRuns: [
  8507. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8508. ],
  8509. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8510. reRunJobForWorkflowRun: [
  8511. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8512. ],
  8513. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8514. reRunWorkflowFailedJobs: [
  8515. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8516. ],
  8517. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8518. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8519. ],
  8520. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8521. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8522. ],
  8523. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8524. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8525. ],
  8526. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8527. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8528. ],
  8529. removeSelectedRepoFromOrgSecret: [
  8530. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8531. ],
  8532. removeSelectedRepoFromOrgVariable: [
  8533. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8534. ],
  8535. reviewCustomGatesForRun: [
  8536. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8537. ],
  8538. reviewPendingDeploymentsForRun: [
  8539. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8540. ],
  8541. setAllowedActionsOrganization: [
  8542. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8543. ],
  8544. setAllowedActionsRepository: [
  8545. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8546. ],
  8547. setCustomLabelsForSelfHostedRunnerForOrg: [
  8548. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8549. ],
  8550. setCustomLabelsForSelfHostedRunnerForRepo: [
  8551. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8552. ],
  8553. setCustomOidcSubClaimForRepo: [
  8554. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8555. ],
  8556. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8557. "PUT /orgs/{org}/actions/permissions/workflow"
  8558. ],
  8559. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8560. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8561. ],
  8562. setGithubActionsPermissionsOrganization: [
  8563. "PUT /orgs/{org}/actions/permissions"
  8564. ],
  8565. setGithubActionsPermissionsRepository: [
  8566. "PUT /repos/{owner}/{repo}/actions/permissions"
  8567. ],
  8568. setSelectedReposForOrgSecret: [
  8569. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8570. ],
  8571. setSelectedReposForOrgVariable: [
  8572. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8573. ],
  8574. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8575. "PUT /orgs/{org}/actions/permissions/repositories"
  8576. ],
  8577. setWorkflowAccessToRepository: [
  8578. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8579. ],
  8580. updateEnvironmentVariable: [
  8581. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8582. ],
  8583. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8584. updateRepoVariable: [
  8585. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8586. ]
  8587. },
  8588. activity: {
  8589. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8590. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8591. deleteThreadSubscription: [
  8592. "DELETE /notifications/threads/{thread_id}/subscription"
  8593. ],
  8594. getFeeds: ["GET /feeds"],
  8595. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8596. getThread: ["GET /notifications/threads/{thread_id}"],
  8597. getThreadSubscriptionForAuthenticatedUser: [
  8598. "GET /notifications/threads/{thread_id}/subscription"
  8599. ],
  8600. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8601. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8602. listOrgEventsForAuthenticatedUser: [
  8603. "GET /users/{username}/events/orgs/{org}"
  8604. ],
  8605. listPublicEvents: ["GET /events"],
  8606. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8607. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8608. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8609. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8610. listReceivedPublicEventsForUser: [
  8611. "GET /users/{username}/received_events/public"
  8612. ],
  8613. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8614. listRepoNotificationsForAuthenticatedUser: [
  8615. "GET /repos/{owner}/{repo}/notifications"
  8616. ],
  8617. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8618. listReposStarredByUser: ["GET /users/{username}/starred"],
  8619. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8620. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8621. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8622. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8623. markNotificationsAsRead: ["PUT /notifications"],
  8624. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8625. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8626. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8627. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8628. setThreadSubscription: [
  8629. "PUT /notifications/threads/{thread_id}/subscription"
  8630. ],
  8631. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8632. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8633. },
  8634. apps: {
  8635. addRepoToInstallation: [
  8636. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8637. {},
  8638. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8639. ],
  8640. addRepoToInstallationForAuthenticatedUser: [
  8641. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8642. ],
  8643. checkToken: ["POST /applications/{client_id}/token"],
  8644. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8645. createInstallationAccessToken: [
  8646. "POST /app/installations/{installation_id}/access_tokens"
  8647. ],
  8648. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8649. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8650. deleteToken: ["DELETE /applications/{client_id}/token"],
  8651. getAuthenticated: ["GET /app"],
  8652. getBySlug: ["GET /apps/{app_slug}"],
  8653. getInstallation: ["GET /app/installations/{installation_id}"],
  8654. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8655. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8656. getSubscriptionPlanForAccount: [
  8657. "GET /marketplace_listing/accounts/{account_id}"
  8658. ],
  8659. getSubscriptionPlanForAccountStubbed: [
  8660. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8661. ],
  8662. getUserInstallation: ["GET /users/{username}/installation"],
  8663. getWebhookConfigForApp: ["GET /app/hook/config"],
  8664. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8665. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8666. listAccountsForPlanStubbed: [
  8667. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8668. ],
  8669. listInstallationReposForAuthenticatedUser: [
  8670. "GET /user/installations/{installation_id}/repositories"
  8671. ],
  8672. listInstallationRequestsForAuthenticatedApp: [
  8673. "GET /app/installation-requests"
  8674. ],
  8675. listInstallations: ["GET /app/installations"],
  8676. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8677. listPlans: ["GET /marketplace_listing/plans"],
  8678. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8679. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8680. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8681. listSubscriptionsForAuthenticatedUserStubbed: [
  8682. "GET /user/marketplace_purchases/stubbed"
  8683. ],
  8684. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8685. redeliverWebhookDelivery: [
  8686. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8687. ],
  8688. removeRepoFromInstallation: [
  8689. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8690. {},
  8691. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8692. ],
  8693. removeRepoFromInstallationForAuthenticatedUser: [
  8694. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8695. ],
  8696. resetToken: ["PATCH /applications/{client_id}/token"],
  8697. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8698. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8699. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8700. unsuspendInstallation: [
  8701. "DELETE /app/installations/{installation_id}/suspended"
  8702. ],
  8703. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8704. },
  8705. billing: {
  8706. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8707. getGithubActionsBillingUser: [
  8708. "GET /users/{username}/settings/billing/actions"
  8709. ],
  8710. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8711. getGithubPackagesBillingUser: [
  8712. "GET /users/{username}/settings/billing/packages"
  8713. ],
  8714. getSharedStorageBillingOrg: [
  8715. "GET /orgs/{org}/settings/billing/shared-storage"
  8716. ],
  8717. getSharedStorageBillingUser: [
  8718. "GET /users/{username}/settings/billing/shared-storage"
  8719. ]
  8720. },
  8721. checks: {
  8722. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8723. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8724. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8725. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8726. listAnnotations: [
  8727. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8728. ],
  8729. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  8730. listForSuite: [
  8731. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  8732. ],
  8733. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  8734. rerequestRun: [
  8735. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  8736. ],
  8737. rerequestSuite: [
  8738. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  8739. ],
  8740. setSuitesPreferences: [
  8741. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  8742. ],
  8743. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  8744. },
  8745. codeScanning: {
  8746. deleteAnalysis: [
  8747. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  8748. ],
  8749. getAlert: [
  8750. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  8751. {},
  8752. { renamedParameters: { alert_id: "alert_number" } }
  8753. ],
  8754. getAnalysis: [
  8755. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  8756. ],
  8757. getCodeqlDatabase: [
  8758. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  8759. ],
  8760. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  8761. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  8762. listAlertInstances: [
  8763. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  8764. ],
  8765. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  8766. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  8767. listAlertsInstances: [
  8768. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8769. {},
  8770. { renamed: ["codeScanning", "listAlertInstances"] }
  8771. ],
  8772. listCodeqlDatabases: [
  8773. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  8774. ],
  8775. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  8776. updateAlert: [
  8777. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  8778. ],
  8779. updateDefaultSetup: [
  8780. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  8781. ],
  8782. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  8783. },
  8784. codesOfConduct: {
  8785. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  8786. getConductCode: ["GET /codes_of_conduct/{key}"]
  8787. },
  8788. codespaces: {
  8789. addRepositoryForSecretForAuthenticatedUser: [
  8790. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8791. ],
  8792. addSelectedRepoToOrgSecret: [
  8793. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8794. ],
  8795. checkPermissionsForDevcontainer: [
  8796. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  8797. ],
  8798. codespaceMachinesForAuthenticatedUser: [
  8799. "GET /user/codespaces/{codespace_name}/machines"
  8800. ],
  8801. createForAuthenticatedUser: ["POST /user/codespaces"],
  8802. createOrUpdateOrgSecret: [
  8803. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  8804. ],
  8805. createOrUpdateRepoSecret: [
  8806. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8807. ],
  8808. createOrUpdateSecretForAuthenticatedUser: [
  8809. "PUT /user/codespaces/secrets/{secret_name}"
  8810. ],
  8811. createWithPrForAuthenticatedUser: [
  8812. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  8813. ],
  8814. createWithRepoForAuthenticatedUser: [
  8815. "POST /repos/{owner}/{repo}/codespaces"
  8816. ],
  8817. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  8818. deleteFromOrganization: [
  8819. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  8820. ],
  8821. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  8822. deleteRepoSecret: [
  8823. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8824. ],
  8825. deleteSecretForAuthenticatedUser: [
  8826. "DELETE /user/codespaces/secrets/{secret_name}"
  8827. ],
  8828. exportForAuthenticatedUser: [
  8829. "POST /user/codespaces/{codespace_name}/exports"
  8830. ],
  8831. getCodespacesForUserInOrg: [
  8832. "GET /orgs/{org}/members/{username}/codespaces"
  8833. ],
  8834. getExportDetailsForAuthenticatedUser: [
  8835. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  8836. ],
  8837. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  8838. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  8839. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  8840. getPublicKeyForAuthenticatedUser: [
  8841. "GET /user/codespaces/secrets/public-key"
  8842. ],
  8843. getRepoPublicKey: [
  8844. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  8845. ],
  8846. getRepoSecret: [
  8847. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8848. ],
  8849. getSecretForAuthenticatedUser: [
  8850. "GET /user/codespaces/secrets/{secret_name}"
  8851. ],
  8852. listDevcontainersInRepositoryForAuthenticatedUser: [
  8853. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  8854. ],
  8855. listForAuthenticatedUser: ["GET /user/codespaces"],
  8856. listInOrganization: [
  8857. "GET /orgs/{org}/codespaces",
  8858. {},
  8859. { renamedParameters: { org_id: "org" } }
  8860. ],
  8861. listInRepositoryForAuthenticatedUser: [
  8862. "GET /repos/{owner}/{repo}/codespaces"
  8863. ],
  8864. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  8865. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  8866. listRepositoriesForSecretForAuthenticatedUser: [
  8867. "GET /user/codespaces/secrets/{secret_name}/repositories"
  8868. ],
  8869. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  8870. listSelectedReposForOrgSecret: [
  8871. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8872. ],
  8873. preFlightWithRepoForAuthenticatedUser: [
  8874. "GET /repos/{owner}/{repo}/codespaces/new"
  8875. ],
  8876. publishForAuthenticatedUser: [
  8877. "POST /user/codespaces/{codespace_name}/publish"
  8878. ],
  8879. removeRepositoryForSecretForAuthenticatedUser: [
  8880. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8881. ],
  8882. removeSelectedRepoFromOrgSecret: [
  8883. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8884. ],
  8885. repoMachinesForAuthenticatedUser: [
  8886. "GET /repos/{owner}/{repo}/codespaces/machines"
  8887. ],
  8888. setRepositoriesForSecretForAuthenticatedUser: [
  8889. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  8890. ],
  8891. setSelectedReposForOrgSecret: [
  8892. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8893. ],
  8894. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  8895. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  8896. stopInOrganization: [
  8897. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  8898. ],
  8899. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  8900. },
  8901. copilot: {
  8902. addCopilotSeatsForTeams: [
  8903. "POST /orgs/{org}/copilot/billing/selected_teams"
  8904. ],
  8905. addCopilotSeatsForUsers: [
  8906. "POST /orgs/{org}/copilot/billing/selected_users"
  8907. ],
  8908. cancelCopilotSeatAssignmentForTeams: [
  8909. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  8910. ],
  8911. cancelCopilotSeatAssignmentForUsers: [
  8912. "DELETE /orgs/{org}/copilot/billing/selected_users"
  8913. ],
  8914. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  8915. getCopilotSeatDetailsForUser: [
  8916. "GET /orgs/{org}/members/{username}/copilot"
  8917. ],
  8918. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  8919. },
  8920. dependabot: {
  8921. addSelectedRepoToOrgSecret: [
  8922. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8923. ],
  8924. createOrUpdateOrgSecret: [
  8925. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  8926. ],
  8927. createOrUpdateRepoSecret: [
  8928. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8929. ],
  8930. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  8931. deleteRepoSecret: [
  8932. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8933. ],
  8934. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  8935. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  8936. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  8937. getRepoPublicKey: [
  8938. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  8939. ],
  8940. getRepoSecret: [
  8941. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8942. ],
  8943. listAlertsForEnterprise: [
  8944. "GET /enterprises/{enterprise}/dependabot/alerts"
  8945. ],
  8946. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  8947. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  8948. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  8949. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  8950. listSelectedReposForOrgSecret: [
  8951. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8952. ],
  8953. removeSelectedRepoFromOrgSecret: [
  8954. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8955. ],
  8956. setSelectedReposForOrgSecret: [
  8957. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8958. ],
  8959. updateAlert: [
  8960. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  8961. ]
  8962. },
  8963. dependencyGraph: {
  8964. createRepositorySnapshot: [
  8965. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  8966. ],
  8967. diffRange: [
  8968. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  8969. ],
  8970. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  8971. },
  8972. emojis: { get: ["GET /emojis"] },
  8973. gists: {
  8974. checkIsStarred: ["GET /gists/{gist_id}/star"],
  8975. create: ["POST /gists"],
  8976. createComment: ["POST /gists/{gist_id}/comments"],
  8977. delete: ["DELETE /gists/{gist_id}"],
  8978. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  8979. fork: ["POST /gists/{gist_id}/forks"],
  8980. get: ["GET /gists/{gist_id}"],
  8981. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  8982. getRevision: ["GET /gists/{gist_id}/{sha}"],
  8983. list: ["GET /gists"],
  8984. listComments: ["GET /gists/{gist_id}/comments"],
  8985. listCommits: ["GET /gists/{gist_id}/commits"],
  8986. listForUser: ["GET /users/{username}/gists"],
  8987. listForks: ["GET /gists/{gist_id}/forks"],
  8988. listPublic: ["GET /gists/public"],
  8989. listStarred: ["GET /gists/starred"],
  8990. star: ["PUT /gists/{gist_id}/star"],
  8991. unstar: ["DELETE /gists/{gist_id}/star"],
  8992. update: ["PATCH /gists/{gist_id}"],
  8993. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  8994. },
  8995. git: {
  8996. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  8997. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  8998. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  8999. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9000. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9001. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9002. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9003. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9004. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9005. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9006. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9007. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9008. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9009. },
  9010. gitignore: {
  9011. getAllTemplates: ["GET /gitignore/templates"],
  9012. getTemplate: ["GET /gitignore/templates/{name}"]
  9013. },
  9014. interactions: {
  9015. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9016. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9017. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9018. getRestrictionsForYourPublicRepos: [
  9019. "GET /user/interaction-limits",
  9020. {},
  9021. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9022. ],
  9023. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9024. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9025. removeRestrictionsForRepo: [
  9026. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9027. ],
  9028. removeRestrictionsForYourPublicRepos: [
  9029. "DELETE /user/interaction-limits",
  9030. {},
  9031. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9032. ],
  9033. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9034. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9035. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9036. setRestrictionsForYourPublicRepos: [
  9037. "PUT /user/interaction-limits",
  9038. {},
  9039. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9040. ]
  9041. },
  9042. issues: {
  9043. addAssignees: [
  9044. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9045. ],
  9046. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9047. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9048. checkUserCanBeAssignedToIssue: [
  9049. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9050. ],
  9051. create: ["POST /repos/{owner}/{repo}/issues"],
  9052. createComment: [
  9053. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9054. ],
  9055. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9056. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9057. deleteComment: [
  9058. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9059. ],
  9060. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9061. deleteMilestone: [
  9062. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9063. ],
  9064. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9065. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9066. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9067. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9068. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9069. list: ["GET /issues"],
  9070. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9071. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9072. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9073. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9074. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9075. listEventsForTimeline: [
  9076. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9077. ],
  9078. listForAuthenticatedUser: ["GET /user/issues"],
  9079. listForOrg: ["GET /orgs/{org}/issues"],
  9080. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9081. listLabelsForMilestone: [
  9082. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9083. ],
  9084. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9085. listLabelsOnIssue: [
  9086. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9087. ],
  9088. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9089. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9090. removeAllLabels: [
  9091. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9092. ],
  9093. removeAssignees: [
  9094. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9095. ],
  9096. removeLabel: [
  9097. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9098. ],
  9099. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9100. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9101. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9102. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9103. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9104. updateMilestone: [
  9105. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9106. ]
  9107. },
  9108. licenses: {
  9109. get: ["GET /licenses/{license}"],
  9110. getAllCommonlyUsed: ["GET /licenses"],
  9111. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9112. },
  9113. markdown: {
  9114. render: ["POST /markdown"],
  9115. renderRaw: [
  9116. "POST /markdown/raw",
  9117. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9118. ]
  9119. },
  9120. meta: {
  9121. get: ["GET /meta"],
  9122. getAllVersions: ["GET /versions"],
  9123. getOctocat: ["GET /octocat"],
  9124. getZen: ["GET /zen"],
  9125. root: ["GET /"]
  9126. },
  9127. migrations: {
  9128. cancelImport: [
  9129. "DELETE /repos/{owner}/{repo}/import",
  9130. {},
  9131. {
  9132. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9133. }
  9134. ],
  9135. deleteArchiveForAuthenticatedUser: [
  9136. "DELETE /user/migrations/{migration_id}/archive"
  9137. ],
  9138. deleteArchiveForOrg: [
  9139. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9140. ],
  9141. downloadArchiveForOrg: [
  9142. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9143. ],
  9144. getArchiveForAuthenticatedUser: [
  9145. "GET /user/migrations/{migration_id}/archive"
  9146. ],
  9147. getCommitAuthors: [
  9148. "GET /repos/{owner}/{repo}/import/authors",
  9149. {},
  9150. {
  9151. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9152. }
  9153. ],
  9154. getImportStatus: [
  9155. "GET /repos/{owner}/{repo}/import",
  9156. {},
  9157. {
  9158. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9159. }
  9160. ],
  9161. getLargeFiles: [
  9162. "GET /repos/{owner}/{repo}/import/large_files",
  9163. {},
  9164. {
  9165. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9166. }
  9167. ],
  9168. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9169. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9170. listForAuthenticatedUser: ["GET /user/migrations"],
  9171. listForOrg: ["GET /orgs/{org}/migrations"],
  9172. listReposForAuthenticatedUser: [
  9173. "GET /user/migrations/{migration_id}/repositories"
  9174. ],
  9175. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9176. listReposForUser: [
  9177. "GET /user/migrations/{migration_id}/repositories",
  9178. {},
  9179. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9180. ],
  9181. mapCommitAuthor: [
  9182. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9183. {},
  9184. {
  9185. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9186. }
  9187. ],
  9188. setLfsPreference: [
  9189. "PATCH /repos/{owner}/{repo}/import/lfs",
  9190. {},
  9191. {
  9192. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9193. }
  9194. ],
  9195. startForAuthenticatedUser: ["POST /user/migrations"],
  9196. startForOrg: ["POST /orgs/{org}/migrations"],
  9197. startImport: [
  9198. "PUT /repos/{owner}/{repo}/import",
  9199. {},
  9200. {
  9201. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9202. }
  9203. ],
  9204. unlockRepoForAuthenticatedUser: [
  9205. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9206. ],
  9207. unlockRepoForOrg: [
  9208. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9209. ],
  9210. updateImport: [
  9211. "PATCH /repos/{owner}/{repo}/import",
  9212. {},
  9213. {
  9214. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9215. }
  9216. ]
  9217. },
  9218. oidc: {
  9219. getOidcCustomSubTemplateForOrg: [
  9220. "GET /orgs/{org}/actions/oidc/customization/sub"
  9221. ],
  9222. updateOidcCustomSubTemplateForOrg: [
  9223. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9224. ]
  9225. },
  9226. orgs: {
  9227. addSecurityManagerTeam: [
  9228. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9229. ],
  9230. assignTeamToOrgRole: [
  9231. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9232. ],
  9233. assignUserToOrgRole: [
  9234. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9235. ],
  9236. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9237. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9238. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9239. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9240. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9241. convertMemberToOutsideCollaborator: [
  9242. "PUT /orgs/{org}/outside_collaborators/{username}"
  9243. ],
  9244. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9245. createInvitation: ["POST /orgs/{org}/invitations"],
  9246. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9247. createOrUpdateCustomPropertiesValuesForRepos: [
  9248. "PATCH /orgs/{org}/properties/values"
  9249. ],
  9250. createOrUpdateCustomProperty: [
  9251. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9252. ],
  9253. createWebhook: ["POST /orgs/{org}/hooks"],
  9254. delete: ["DELETE /orgs/{org}"],
  9255. deleteCustomOrganizationRole: [
  9256. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9257. ],
  9258. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9259. enableOrDisableSecurityProductOnAllOrgRepos: [
  9260. "POST /orgs/{org}/{security_product}/{enablement}"
  9261. ],
  9262. get: ["GET /orgs/{org}"],
  9263. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9264. getCustomProperty: [
  9265. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9266. ],
  9267. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9268. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9269. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9270. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9271. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9272. getWebhookDelivery: [
  9273. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9274. ],
  9275. list: ["GET /organizations"],
  9276. listAppInstallations: ["GET /orgs/{org}/installations"],
  9277. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9278. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9279. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9280. listForAuthenticatedUser: ["GET /user/orgs"],
  9281. listForUser: ["GET /users/{username}/orgs"],
  9282. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9283. listMembers: ["GET /orgs/{org}/members"],
  9284. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9285. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9286. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9287. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9288. listOrganizationFineGrainedPermissions: [
  9289. "GET /orgs/{org}/organization-fine-grained-permissions"
  9290. ],
  9291. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9292. listPatGrantRepositories: [
  9293. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9294. ],
  9295. listPatGrantRequestRepositories: [
  9296. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9297. ],
  9298. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9299. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9300. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9301. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9302. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9303. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9304. listWebhooks: ["GET /orgs/{org}/hooks"],
  9305. patchCustomOrganizationRole: [
  9306. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9307. ],
  9308. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9309. redeliverWebhookDelivery: [
  9310. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9311. ],
  9312. removeCustomProperty: [
  9313. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9314. ],
  9315. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9316. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9317. removeOutsideCollaborator: [
  9318. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9319. ],
  9320. removePublicMembershipForAuthenticatedUser: [
  9321. "DELETE /orgs/{org}/public_members/{username}"
  9322. ],
  9323. removeSecurityManagerTeam: [
  9324. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9325. ],
  9326. reviewPatGrantRequest: [
  9327. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9328. ],
  9329. reviewPatGrantRequestsInBulk: [
  9330. "POST /orgs/{org}/personal-access-token-requests"
  9331. ],
  9332. revokeAllOrgRolesTeam: [
  9333. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9334. ],
  9335. revokeAllOrgRolesUser: [
  9336. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9337. ],
  9338. revokeOrgRoleTeam: [
  9339. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9340. ],
  9341. revokeOrgRoleUser: [
  9342. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9343. ],
  9344. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9345. setPublicMembershipForAuthenticatedUser: [
  9346. "PUT /orgs/{org}/public_members/{username}"
  9347. ],
  9348. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9349. update: ["PATCH /orgs/{org}"],
  9350. updateMembershipForAuthenticatedUser: [
  9351. "PATCH /user/memberships/orgs/{org}"
  9352. ],
  9353. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9354. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9355. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9356. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9357. },
  9358. packages: {
  9359. deletePackageForAuthenticatedUser: [
  9360. "DELETE /user/packages/{package_type}/{package_name}"
  9361. ],
  9362. deletePackageForOrg: [
  9363. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9364. ],
  9365. deletePackageForUser: [
  9366. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9367. ],
  9368. deletePackageVersionForAuthenticatedUser: [
  9369. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9370. ],
  9371. deletePackageVersionForOrg: [
  9372. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9373. ],
  9374. deletePackageVersionForUser: [
  9375. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9376. ],
  9377. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9378. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9379. {},
  9380. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9381. ],
  9382. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9383. "GET /user/packages/{package_type}/{package_name}/versions",
  9384. {},
  9385. {
  9386. renamed: [
  9387. "packages",
  9388. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9389. ]
  9390. }
  9391. ],
  9392. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9393. "GET /user/packages/{package_type}/{package_name}/versions"
  9394. ],
  9395. getAllPackageVersionsForPackageOwnedByOrg: [
  9396. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9397. ],
  9398. getAllPackageVersionsForPackageOwnedByUser: [
  9399. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9400. ],
  9401. getPackageForAuthenticatedUser: [
  9402. "GET /user/packages/{package_type}/{package_name}"
  9403. ],
  9404. getPackageForOrganization: [
  9405. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9406. ],
  9407. getPackageForUser: [
  9408. "GET /users/{username}/packages/{package_type}/{package_name}"
  9409. ],
  9410. getPackageVersionForAuthenticatedUser: [
  9411. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9412. ],
  9413. getPackageVersionForOrganization: [
  9414. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9415. ],
  9416. getPackageVersionForUser: [
  9417. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9418. ],
  9419. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9420. "GET /user/docker/conflicts"
  9421. ],
  9422. listDockerMigrationConflictingPackagesForOrganization: [
  9423. "GET /orgs/{org}/docker/conflicts"
  9424. ],
  9425. listDockerMigrationConflictingPackagesForUser: [
  9426. "GET /users/{username}/docker/conflicts"
  9427. ],
  9428. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9429. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9430. listPackagesForUser: ["GET /users/{username}/packages"],
  9431. restorePackageForAuthenticatedUser: [
  9432. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9433. ],
  9434. restorePackageForOrg: [
  9435. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9436. ],
  9437. restorePackageForUser: [
  9438. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9439. ],
  9440. restorePackageVersionForAuthenticatedUser: [
  9441. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9442. ],
  9443. restorePackageVersionForOrg: [
  9444. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9445. ],
  9446. restorePackageVersionForUser: [
  9447. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9448. ]
  9449. },
  9450. projects: {
  9451. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9452. createCard: ["POST /projects/columns/{column_id}/cards"],
  9453. createColumn: ["POST /projects/{project_id}/columns"],
  9454. createForAuthenticatedUser: ["POST /user/projects"],
  9455. createForOrg: ["POST /orgs/{org}/projects"],
  9456. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9457. delete: ["DELETE /projects/{project_id}"],
  9458. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9459. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9460. get: ["GET /projects/{project_id}"],
  9461. getCard: ["GET /projects/columns/cards/{card_id}"],
  9462. getColumn: ["GET /projects/columns/{column_id}"],
  9463. getPermissionForUser: [
  9464. "GET /projects/{project_id}/collaborators/{username}/permission"
  9465. ],
  9466. listCards: ["GET /projects/columns/{column_id}/cards"],
  9467. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9468. listColumns: ["GET /projects/{project_id}/columns"],
  9469. listForOrg: ["GET /orgs/{org}/projects"],
  9470. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9471. listForUser: ["GET /users/{username}/projects"],
  9472. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9473. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9474. removeCollaborator: [
  9475. "DELETE /projects/{project_id}/collaborators/{username}"
  9476. ],
  9477. update: ["PATCH /projects/{project_id}"],
  9478. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9479. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9480. },
  9481. pulls: {
  9482. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9483. create: ["POST /repos/{owner}/{repo}/pulls"],
  9484. createReplyForReviewComment: [
  9485. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9486. ],
  9487. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9488. createReviewComment: [
  9489. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9490. ],
  9491. deletePendingReview: [
  9492. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9493. ],
  9494. deleteReviewComment: [
  9495. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9496. ],
  9497. dismissReview: [
  9498. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9499. ],
  9500. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9501. getReview: [
  9502. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9503. ],
  9504. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9505. list: ["GET /repos/{owner}/{repo}/pulls"],
  9506. listCommentsForReview: [
  9507. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9508. ],
  9509. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9510. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9511. listRequestedReviewers: [
  9512. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9513. ],
  9514. listReviewComments: [
  9515. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9516. ],
  9517. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9518. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9519. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9520. removeRequestedReviewers: [
  9521. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9522. ],
  9523. requestReviewers: [
  9524. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9525. ],
  9526. submitReview: [
  9527. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9528. ],
  9529. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9530. updateBranch: [
  9531. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9532. ],
  9533. updateReview: [
  9534. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9535. ],
  9536. updateReviewComment: [
  9537. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9538. ]
  9539. },
  9540. rateLimit: { get: ["GET /rate_limit"] },
  9541. reactions: {
  9542. createForCommitComment: [
  9543. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9544. ],
  9545. createForIssue: [
  9546. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9547. ],
  9548. createForIssueComment: [
  9549. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9550. ],
  9551. createForPullRequestReviewComment: [
  9552. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9553. ],
  9554. createForRelease: [
  9555. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9556. ],
  9557. createForTeamDiscussionCommentInOrg: [
  9558. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9559. ],
  9560. createForTeamDiscussionInOrg: [
  9561. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9562. ],
  9563. deleteForCommitComment: [
  9564. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9565. ],
  9566. deleteForIssue: [
  9567. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9568. ],
  9569. deleteForIssueComment: [
  9570. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9571. ],
  9572. deleteForPullRequestComment: [
  9573. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9574. ],
  9575. deleteForRelease: [
  9576. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9577. ],
  9578. deleteForTeamDiscussion: [
  9579. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9580. ],
  9581. deleteForTeamDiscussionComment: [
  9582. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9583. ],
  9584. listForCommitComment: [
  9585. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9586. ],
  9587. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9588. listForIssueComment: [
  9589. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9590. ],
  9591. listForPullRequestReviewComment: [
  9592. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9593. ],
  9594. listForRelease: [
  9595. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9596. ],
  9597. listForTeamDiscussionCommentInOrg: [
  9598. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9599. ],
  9600. listForTeamDiscussionInOrg: [
  9601. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9602. ]
  9603. },
  9604. repos: {
  9605. acceptInvitation: [
  9606. "PATCH /user/repository_invitations/{invitation_id}",
  9607. {},
  9608. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9609. ],
  9610. acceptInvitationForAuthenticatedUser: [
  9611. "PATCH /user/repository_invitations/{invitation_id}"
  9612. ],
  9613. addAppAccessRestrictions: [
  9614. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9615. {},
  9616. { mapToData: "apps" }
  9617. ],
  9618. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9619. addStatusCheckContexts: [
  9620. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9621. {},
  9622. { mapToData: "contexts" }
  9623. ],
  9624. addTeamAccessRestrictions: [
  9625. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9626. {},
  9627. { mapToData: "teams" }
  9628. ],
  9629. addUserAccessRestrictions: [
  9630. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9631. {},
  9632. { mapToData: "users" }
  9633. ],
  9634. cancelPagesDeployment: [
  9635. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9636. ],
  9637. checkAutomatedSecurityFixes: [
  9638. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9639. ],
  9640. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9641. checkVulnerabilityAlerts: [
  9642. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9643. ],
  9644. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9645. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9646. compareCommitsWithBasehead: [
  9647. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9648. ],
  9649. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9650. createCommitComment: [
  9651. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9652. ],
  9653. createCommitSignatureProtection: [
  9654. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9655. ],
  9656. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9657. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9658. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9659. createDeploymentBranchPolicy: [
  9660. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9661. ],
  9662. createDeploymentProtectionRule: [
  9663. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9664. ],
  9665. createDeploymentStatus: [
  9666. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9667. ],
  9668. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9669. createForAuthenticatedUser: ["POST /user/repos"],
  9670. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9671. createInOrg: ["POST /orgs/{org}/repos"],
  9672. createOrUpdateCustomPropertiesValues: [
  9673. "PATCH /repos/{owner}/{repo}/properties/values"
  9674. ],
  9675. createOrUpdateEnvironment: [
  9676. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9677. ],
  9678. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9679. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9680. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9681. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9682. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9683. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9684. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9685. createUsingTemplate: [
  9686. "POST /repos/{template_owner}/{template_repo}/generate"
  9687. ],
  9688. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9689. declineInvitation: [
  9690. "DELETE /user/repository_invitations/{invitation_id}",
  9691. {},
  9692. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9693. ],
  9694. declineInvitationForAuthenticatedUser: [
  9695. "DELETE /user/repository_invitations/{invitation_id}"
  9696. ],
  9697. delete: ["DELETE /repos/{owner}/{repo}"],
  9698. deleteAccessRestrictions: [
  9699. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9700. ],
  9701. deleteAdminBranchProtection: [
  9702. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9703. ],
  9704. deleteAnEnvironment: [
  9705. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9706. ],
  9707. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9708. deleteBranchProtection: [
  9709. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9710. ],
  9711. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9712. deleteCommitSignatureProtection: [
  9713. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9714. ],
  9715. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9716. deleteDeployment: [
  9717. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9718. ],
  9719. deleteDeploymentBranchPolicy: [
  9720. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9721. ],
  9722. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9723. deleteInvitation: [
  9724. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9725. ],
  9726. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9727. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9728. deletePullRequestReviewProtection: [
  9729. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9730. ],
  9731. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  9732. deleteReleaseAsset: [
  9733. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9734. ],
  9735. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9736. deleteTagProtection: [
  9737. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  9738. ],
  9739. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  9740. disableAutomatedSecurityFixes: [
  9741. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  9742. ],
  9743. disableDeploymentProtectionRule: [
  9744. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9745. ],
  9746. disablePrivateVulnerabilityReporting: [
  9747. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  9748. ],
  9749. disableVulnerabilityAlerts: [
  9750. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  9751. ],
  9752. downloadArchive: [
  9753. "GET /repos/{owner}/{repo}/zipball/{ref}",
  9754. {},
  9755. { renamed: ["repos", "downloadZipballArchive"] }
  9756. ],
  9757. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  9758. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  9759. enableAutomatedSecurityFixes: [
  9760. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  9761. ],
  9762. enablePrivateVulnerabilityReporting: [
  9763. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  9764. ],
  9765. enableVulnerabilityAlerts: [
  9766. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  9767. ],
  9768. generateReleaseNotes: [
  9769. "POST /repos/{owner}/{repo}/releases/generate-notes"
  9770. ],
  9771. get: ["GET /repos/{owner}/{repo}"],
  9772. getAccessRestrictions: [
  9773. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9774. ],
  9775. getAdminBranchProtection: [
  9776. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9777. ],
  9778. getAllDeploymentProtectionRules: [
  9779. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9780. ],
  9781. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  9782. getAllStatusCheckContexts: [
  9783. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  9784. ],
  9785. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  9786. getAppsWithAccessToProtectedBranch: [
  9787. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  9788. ],
  9789. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9790. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  9791. getBranchProtection: [
  9792. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  9793. ],
  9794. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  9795. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  9796. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  9797. getCollaboratorPermissionLevel: [
  9798. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  9799. ],
  9800. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  9801. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  9802. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  9803. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  9804. getCommitSignatureProtection: [
  9805. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9806. ],
  9807. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  9808. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  9809. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  9810. getCustomDeploymentProtectionRule: [
  9811. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9812. ],
  9813. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  9814. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  9815. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  9816. getDeploymentBranchPolicy: [
  9817. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9818. ],
  9819. getDeploymentStatus: [
  9820. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  9821. ],
  9822. getEnvironment: [
  9823. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  9824. ],
  9825. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  9826. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  9827. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  9828. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  9829. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  9830. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  9831. getPages: ["GET /repos/{owner}/{repo}/pages"],
  9832. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  9833. getPagesDeployment: [
  9834. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  9835. ],
  9836. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  9837. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  9838. getPullRequestReviewProtection: [
  9839. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9840. ],
  9841. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  9842. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  9843. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  9844. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  9845. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  9846. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  9847. getRepoRuleSuite: [
  9848. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  9849. ],
  9850. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  9851. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9852. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  9853. getStatusChecksProtection: [
  9854. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9855. ],
  9856. getTeamsWithAccessToProtectedBranch: [
  9857. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  9858. ],
  9859. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  9860. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  9861. getUsersWithAccessToProtectedBranch: [
  9862. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  9863. ],
  9864. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  9865. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  9866. getWebhookConfigForRepo: [
  9867. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  9868. ],
  9869. getWebhookDelivery: [
  9870. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  9871. ],
  9872. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  9873. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  9874. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  9875. listBranchesForHeadCommit: [
  9876. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  9877. ],
  9878. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  9879. listCommentsForCommit: [
  9880. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9881. ],
  9882. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  9883. listCommitStatusesForRef: [
  9884. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  9885. ],
  9886. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  9887. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  9888. listCustomDeploymentRuleIntegrations: [
  9889. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  9890. ],
  9891. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  9892. listDeploymentBranchPolicies: [
  9893. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9894. ],
  9895. listDeploymentStatuses: [
  9896. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9897. ],
  9898. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  9899. listForAuthenticatedUser: ["GET /user/repos"],
  9900. listForOrg: ["GET /orgs/{org}/repos"],
  9901. listForUser: ["GET /users/{username}/repos"],
  9902. listForks: ["GET /repos/{owner}/{repo}/forks"],
  9903. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  9904. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  9905. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  9906. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  9907. listPublic: ["GET /repositories"],
  9908. listPullRequestsAssociatedWithCommit: [
  9909. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  9910. ],
  9911. listReleaseAssets: [
  9912. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  9913. ],
  9914. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  9915. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  9916. listTags: ["GET /repos/{owner}/{repo}/tags"],
  9917. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  9918. listWebhookDeliveries: [
  9919. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  9920. ],
  9921. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  9922. merge: ["POST /repos/{owner}/{repo}/merges"],
  9923. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  9924. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  9925. redeliverWebhookDelivery: [
  9926. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9927. ],
  9928. removeAppAccessRestrictions: [
  9929. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9930. {},
  9931. { mapToData: "apps" }
  9932. ],
  9933. removeCollaborator: [
  9934. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  9935. ],
  9936. removeStatusCheckContexts: [
  9937. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9938. {},
  9939. { mapToData: "contexts" }
  9940. ],
  9941. removeStatusCheckProtection: [
  9942. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9943. ],
  9944. removeTeamAccessRestrictions: [
  9945. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9946. {},
  9947. { mapToData: "teams" }
  9948. ],
  9949. removeUserAccessRestrictions: [
  9950. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9951. {},
  9952. { mapToData: "users" }
  9953. ],
  9954. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  9955. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  9956. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  9957. setAdminBranchProtection: [
  9958. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9959. ],
  9960. setAppAccessRestrictions: [
  9961. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9962. {},
  9963. { mapToData: "apps" }
  9964. ],
  9965. setStatusCheckContexts: [
  9966. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9967. {},
  9968. { mapToData: "contexts" }
  9969. ],
  9970. setTeamAccessRestrictions: [
  9971. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9972. {},
  9973. { mapToData: "teams" }
  9974. ],
  9975. setUserAccessRestrictions: [
  9976. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9977. {},
  9978. { mapToData: "users" }
  9979. ],
  9980. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  9981. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  9982. update: ["PATCH /repos/{owner}/{repo}"],
  9983. updateBranchProtection: [
  9984. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  9985. ],
  9986. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  9987. updateDeploymentBranchPolicy: [
  9988. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9989. ],
  9990. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  9991. updateInvitation: [
  9992. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  9993. ],
  9994. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  9995. updatePullRequestReviewProtection: [
  9996. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9997. ],
  9998. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  9999. updateReleaseAsset: [
  10000. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10001. ],
  10002. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10003. updateStatusCheckPotection: [
  10004. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10005. {},
  10006. { renamed: ["repos", "updateStatusCheckProtection"] }
  10007. ],
  10008. updateStatusCheckProtection: [
  10009. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10010. ],
  10011. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10012. updateWebhookConfigForRepo: [
  10013. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10014. ],
  10015. uploadReleaseAsset: [
  10016. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10017. { baseUrl: "https://uploads.github.com" }
  10018. ]
  10019. },
  10020. search: {
  10021. code: ["GET /search/code"],
  10022. commits: ["GET /search/commits"],
  10023. issuesAndPullRequests: ["GET /search/issues"],
  10024. labels: ["GET /search/labels"],
  10025. repos: ["GET /search/repositories"],
  10026. topics: ["GET /search/topics"],
  10027. users: ["GET /search/users"]
  10028. },
  10029. secretScanning: {
  10030. getAlert: [
  10031. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10032. ],
  10033. listAlertsForEnterprise: [
  10034. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10035. ],
  10036. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10037. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10038. listLocationsForAlert: [
  10039. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10040. ],
  10041. updateAlert: [
  10042. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10043. ]
  10044. },
  10045. securityAdvisories: {
  10046. createFork: [
  10047. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10048. ],
  10049. createPrivateVulnerabilityReport: [
  10050. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10051. ],
  10052. createRepositoryAdvisory: [
  10053. "POST /repos/{owner}/{repo}/security-advisories"
  10054. ],
  10055. createRepositoryAdvisoryCveRequest: [
  10056. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10057. ],
  10058. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10059. getRepositoryAdvisory: [
  10060. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10061. ],
  10062. listGlobalAdvisories: ["GET /advisories"],
  10063. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10064. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10065. updateRepositoryAdvisory: [
  10066. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10067. ]
  10068. },
  10069. teams: {
  10070. addOrUpdateMembershipForUserInOrg: [
  10071. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10072. ],
  10073. addOrUpdateProjectPermissionsInOrg: [
  10074. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10075. ],
  10076. addOrUpdateRepoPermissionsInOrg: [
  10077. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10078. ],
  10079. checkPermissionsForProjectInOrg: [
  10080. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10081. ],
  10082. checkPermissionsForRepoInOrg: [
  10083. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10084. ],
  10085. create: ["POST /orgs/{org}/teams"],
  10086. createDiscussionCommentInOrg: [
  10087. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10088. ],
  10089. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10090. deleteDiscussionCommentInOrg: [
  10091. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10092. ],
  10093. deleteDiscussionInOrg: [
  10094. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10095. ],
  10096. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10097. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10098. getDiscussionCommentInOrg: [
  10099. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10100. ],
  10101. getDiscussionInOrg: [
  10102. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10103. ],
  10104. getMembershipForUserInOrg: [
  10105. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10106. ],
  10107. list: ["GET /orgs/{org}/teams"],
  10108. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10109. listDiscussionCommentsInOrg: [
  10110. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10111. ],
  10112. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10113. listForAuthenticatedUser: ["GET /user/teams"],
  10114. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10115. listPendingInvitationsInOrg: [
  10116. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10117. ],
  10118. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10119. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10120. removeMembershipForUserInOrg: [
  10121. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10122. ],
  10123. removeProjectInOrg: [
  10124. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10125. ],
  10126. removeRepoInOrg: [
  10127. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10128. ],
  10129. updateDiscussionCommentInOrg: [
  10130. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10131. ],
  10132. updateDiscussionInOrg: [
  10133. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10134. ],
  10135. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10136. },
  10137. users: {
  10138. addEmailForAuthenticated: [
  10139. "POST /user/emails",
  10140. {},
  10141. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10142. ],
  10143. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10144. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10145. block: ["PUT /user/blocks/{username}"],
  10146. checkBlocked: ["GET /user/blocks/{username}"],
  10147. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10148. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10149. createGpgKeyForAuthenticated: [
  10150. "POST /user/gpg_keys",
  10151. {},
  10152. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10153. ],
  10154. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10155. createPublicSshKeyForAuthenticated: [
  10156. "POST /user/keys",
  10157. {},
  10158. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10159. ],
  10160. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10161. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10162. deleteEmailForAuthenticated: [
  10163. "DELETE /user/emails",
  10164. {},
  10165. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10166. ],
  10167. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10168. deleteGpgKeyForAuthenticated: [
  10169. "DELETE /user/gpg_keys/{gpg_key_id}",
  10170. {},
  10171. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10172. ],
  10173. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10174. deletePublicSshKeyForAuthenticated: [
  10175. "DELETE /user/keys/{key_id}",
  10176. {},
  10177. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10178. ],
  10179. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10180. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10181. deleteSshSigningKeyForAuthenticatedUser: [
  10182. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10183. ],
  10184. follow: ["PUT /user/following/{username}"],
  10185. getAuthenticated: ["GET /user"],
  10186. getByUsername: ["GET /users/{username}"],
  10187. getContextForUser: ["GET /users/{username}/hovercard"],
  10188. getGpgKeyForAuthenticated: [
  10189. "GET /user/gpg_keys/{gpg_key_id}",
  10190. {},
  10191. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10192. ],
  10193. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10194. getPublicSshKeyForAuthenticated: [
  10195. "GET /user/keys/{key_id}",
  10196. {},
  10197. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10198. ],
  10199. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10200. getSshSigningKeyForAuthenticatedUser: [
  10201. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10202. ],
  10203. list: ["GET /users"],
  10204. listBlockedByAuthenticated: [
  10205. "GET /user/blocks",
  10206. {},
  10207. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10208. ],
  10209. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10210. listEmailsForAuthenticated: [
  10211. "GET /user/emails",
  10212. {},
  10213. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10214. ],
  10215. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10216. listFollowedByAuthenticated: [
  10217. "GET /user/following",
  10218. {},
  10219. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10220. ],
  10221. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10222. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10223. listFollowersForUser: ["GET /users/{username}/followers"],
  10224. listFollowingForUser: ["GET /users/{username}/following"],
  10225. listGpgKeysForAuthenticated: [
  10226. "GET /user/gpg_keys",
  10227. {},
  10228. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10229. ],
  10230. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10231. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10232. listPublicEmailsForAuthenticated: [
  10233. "GET /user/public_emails",
  10234. {},
  10235. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10236. ],
  10237. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10238. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10239. listPublicSshKeysForAuthenticated: [
  10240. "GET /user/keys",
  10241. {},
  10242. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10243. ],
  10244. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10245. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10246. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10247. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10248. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10249. setPrimaryEmailVisibilityForAuthenticated: [
  10250. "PATCH /user/email/visibility",
  10251. {},
  10252. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10253. ],
  10254. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10255. "PATCH /user/email/visibility"
  10256. ],
  10257. unblock: ["DELETE /user/blocks/{username}"],
  10258. unfollow: ["DELETE /user/following/{username}"],
  10259. updateAuthenticated: ["PATCH /user"]
  10260. }
  10261. };
  10262. var endpoints_default = Endpoints;
  10263. // pkg/dist-src/endpoints-to-methods.js
  10264. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10265. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10266. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10267. const [route, defaults, decorations] = endpoint;
  10268. const [method, url] = route.split(/ /);
  10269. const endpointDefaults = Object.assign(
  10270. {
  10271. method,
  10272. url
  10273. },
  10274. defaults
  10275. );
  10276. if (!endpointMethodsMap.has(scope)) {
  10277. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10278. }
  10279. endpointMethodsMap.get(scope).set(methodName, {
  10280. scope,
  10281. methodName,
  10282. endpointDefaults,
  10283. decorations
  10284. });
  10285. }
  10286. }
  10287. var handler = {
  10288. has({ scope }, methodName) {
  10289. return endpointMethodsMap.get(scope).has(methodName);
  10290. },
  10291. getOwnPropertyDescriptor(target, methodName) {
  10292. return {
  10293. value: this.get(target, methodName),
  10294. // ensures method is in the cache
  10295. configurable: true,
  10296. writable: true,
  10297. enumerable: true
  10298. };
  10299. },
  10300. defineProperty(target, methodName, descriptor) {
  10301. Object.defineProperty(target.cache, methodName, descriptor);
  10302. return true;
  10303. },
  10304. deleteProperty(target, methodName) {
  10305. delete target.cache[methodName];
  10306. return true;
  10307. },
  10308. ownKeys({ scope }) {
  10309. return [...endpointMethodsMap.get(scope).keys()];
  10310. },
  10311. set(target, methodName, value) {
  10312. return target.cache[methodName] = value;
  10313. },
  10314. get({ octokit, scope, cache }, methodName) {
  10315. if (cache[methodName]) {
  10316. return cache[methodName];
  10317. }
  10318. const method = endpointMethodsMap.get(scope).get(methodName);
  10319. if (!method) {
  10320. return void 0;
  10321. }
  10322. const { endpointDefaults, decorations } = method;
  10323. if (decorations) {
  10324. cache[methodName] = decorate(
  10325. octokit,
  10326. scope,
  10327. methodName,
  10328. endpointDefaults,
  10329. decorations
  10330. );
  10331. } else {
  10332. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10333. }
  10334. return cache[methodName];
  10335. }
  10336. };
  10337. function endpointsToMethods(octokit) {
  10338. const newMethods = {};
  10339. for (const scope of endpointMethodsMap.keys()) {
  10340. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10341. }
  10342. return newMethods;
  10343. }
  10344. function decorate(octokit, scope, methodName, defaults, decorations) {
  10345. const requestWithDefaults = octokit.request.defaults(defaults);
  10346. function withDecorations(...args) {
  10347. let options = requestWithDefaults.endpoint.merge(...args);
  10348. if (decorations.mapToData) {
  10349. options = Object.assign({}, options, {
  10350. data: options[decorations.mapToData],
  10351. [decorations.mapToData]: void 0
  10352. });
  10353. return requestWithDefaults(options);
  10354. }
  10355. if (decorations.renamed) {
  10356. const [newScope, newMethodName] = decorations.renamed;
  10357. octokit.log.warn(
  10358. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10359. );
  10360. }
  10361. if (decorations.deprecated) {
  10362. octokit.log.warn(decorations.deprecated);
  10363. }
  10364. if (decorations.renamedParameters) {
  10365. const options2 = requestWithDefaults.endpoint.merge(...args);
  10366. for (const [name, alias] of Object.entries(
  10367. decorations.renamedParameters
  10368. )) {
  10369. if (name in options2) {
  10370. octokit.log.warn(
  10371. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10372. );
  10373. if (!(alias in options2)) {
  10374. options2[alias] = options2[name];
  10375. }
  10376. delete options2[name];
  10377. }
  10378. }
  10379. return requestWithDefaults(options2);
  10380. }
  10381. return requestWithDefaults(...args);
  10382. }
  10383. return Object.assign(withDecorations, requestWithDefaults);
  10384. }
  10385. // pkg/dist-src/index.js
  10386. function restEndpointMethods(octokit) {
  10387. const api = endpointsToMethods(octokit);
  10388. return {
  10389. rest: api
  10390. };
  10391. }
  10392. restEndpointMethods.VERSION = VERSION;
  10393. function legacyRestEndpointMethods(octokit) {
  10394. const api = endpointsToMethods(octokit);
  10395. return {
  10396. ...api,
  10397. rest: api
  10398. };
  10399. }
  10400. legacyRestEndpointMethods.VERSION = VERSION;
  10401. // Annotate the CommonJS export names for ESM import in node:
  10402. 0 && (0);
  10403. /***/ }),
  10404. /***/ 537:
  10405. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10406. "use strict";
  10407. var __create = Object.create;
  10408. var __defProp = Object.defineProperty;
  10409. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10410. var __getOwnPropNames = Object.getOwnPropertyNames;
  10411. var __getProtoOf = Object.getPrototypeOf;
  10412. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10413. var __export = (target, all) => {
  10414. for (var name in all)
  10415. __defProp(target, name, { get: all[name], enumerable: true });
  10416. };
  10417. var __copyProps = (to, from, except, desc) => {
  10418. if (from && typeof from === "object" || typeof from === "function") {
  10419. for (let key of __getOwnPropNames(from))
  10420. if (!__hasOwnProp.call(to, key) && key !== except)
  10421. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10422. }
  10423. return to;
  10424. };
  10425. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10426. // If the importer is in node compatibility mode or this is not an ESM
  10427. // file that has been converted to a CommonJS file using a Babel-
  10428. // compatible transform (i.e. "__esModule" has not been set), then set
  10429. // "default" to the CommonJS "module.exports" for node compatibility.
  10430. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10431. mod
  10432. ));
  10433. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10434. // pkg/dist-src/index.js
  10435. var dist_src_exports = {};
  10436. __export(dist_src_exports, {
  10437. RequestError: () => RequestError
  10438. });
  10439. module.exports = __toCommonJS(dist_src_exports);
  10440. var import_deprecation = __nccwpck_require__(8932);
  10441. var import_once = __toESM(__nccwpck_require__(1223));
  10442. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10443. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10444. var RequestError = class extends Error {
  10445. constructor(message, statusCode, options) {
  10446. super(message);
  10447. if (Error.captureStackTrace) {
  10448. Error.captureStackTrace(this, this.constructor);
  10449. }
  10450. this.name = "HttpError";
  10451. this.status = statusCode;
  10452. let headers;
  10453. if ("headers" in options && typeof options.headers !== "undefined") {
  10454. headers = options.headers;
  10455. }
  10456. if ("response" in options) {
  10457. this.response = options.response;
  10458. headers = options.response.headers;
  10459. }
  10460. const requestCopy = Object.assign({}, options.request);
  10461. if (options.request.headers.authorization) {
  10462. requestCopy.headers = Object.assign({}, options.request.headers, {
  10463. authorization: options.request.headers.authorization.replace(
  10464. / .*$/,
  10465. " [REDACTED]"
  10466. )
  10467. });
  10468. }
  10469. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10470. this.request = requestCopy;
  10471. Object.defineProperty(this, "code", {
  10472. get() {
  10473. logOnceCode(
  10474. new import_deprecation.Deprecation(
  10475. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10476. )
  10477. );
  10478. return statusCode;
  10479. }
  10480. });
  10481. Object.defineProperty(this, "headers", {
  10482. get() {
  10483. logOnceHeaders(
  10484. new import_deprecation.Deprecation(
  10485. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10486. )
  10487. );
  10488. return headers || {};
  10489. }
  10490. });
  10491. }
  10492. };
  10493. // Annotate the CommonJS export names for ESM import in node:
  10494. 0 && (0);
  10495. /***/ }),
  10496. /***/ 6234:
  10497. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10498. "use strict";
  10499. var __defProp = Object.defineProperty;
  10500. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10501. var __getOwnPropNames = Object.getOwnPropertyNames;
  10502. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10503. var __export = (target, all) => {
  10504. for (var name in all)
  10505. __defProp(target, name, { get: all[name], enumerable: true });
  10506. };
  10507. var __copyProps = (to, from, except, desc) => {
  10508. if (from && typeof from === "object" || typeof from === "function") {
  10509. for (let key of __getOwnPropNames(from))
  10510. if (!__hasOwnProp.call(to, key) && key !== except)
  10511. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10512. }
  10513. return to;
  10514. };
  10515. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10516. // pkg/dist-src/index.js
  10517. var dist_src_exports = {};
  10518. __export(dist_src_exports, {
  10519. request: () => request
  10520. });
  10521. module.exports = __toCommonJS(dist_src_exports);
  10522. var import_endpoint = __nccwpck_require__(9440);
  10523. var import_universal_user_agent = __nccwpck_require__(5030);
  10524. // pkg/dist-src/version.js
  10525. var VERSION = "8.4.0";
  10526. // pkg/dist-src/is-plain-object.js
  10527. function isPlainObject(value) {
  10528. if (typeof value !== "object" || value === null)
  10529. return false;
  10530. if (Object.prototype.toString.call(value) !== "[object Object]")
  10531. return false;
  10532. const proto = Object.getPrototypeOf(value);
  10533. if (proto === null)
  10534. return true;
  10535. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10536. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10537. }
  10538. // pkg/dist-src/fetch-wrapper.js
  10539. var import_request_error = __nccwpck_require__(537);
  10540. // pkg/dist-src/get-buffer-response.js
  10541. function getBufferResponse(response) {
  10542. return response.arrayBuffer();
  10543. }
  10544. // pkg/dist-src/fetch-wrapper.js
  10545. function fetchWrapper(requestOptions) {
  10546. var _a, _b, _c, _d;
  10547. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10548. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10549. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10550. requestOptions.body = JSON.stringify(requestOptions.body);
  10551. }
  10552. let headers = {};
  10553. let status;
  10554. let url;
  10555. let { fetch } = globalThis;
  10556. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10557. fetch = requestOptions.request.fetch;
  10558. }
  10559. if (!fetch) {
  10560. throw new Error(
  10561. "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"
  10562. );
  10563. }
  10564. return fetch(requestOptions.url, {
  10565. method: requestOptions.method,
  10566. body: requestOptions.body,
  10567. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10568. headers: requestOptions.headers,
  10569. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10570. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10571. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10572. ...requestOptions.body && { duplex: "half" }
  10573. }).then(async (response) => {
  10574. url = response.url;
  10575. status = response.status;
  10576. for (const keyAndValue of response.headers) {
  10577. headers[keyAndValue[0]] = keyAndValue[1];
  10578. }
  10579. if ("deprecation" in headers) {
  10580. const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
  10581. const deprecationLink = matches && matches.pop();
  10582. log.warn(
  10583. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10584. );
  10585. }
  10586. if (status === 204 || status === 205) {
  10587. return;
  10588. }
  10589. if (requestOptions.method === "HEAD") {
  10590. if (status < 400) {
  10591. return;
  10592. }
  10593. throw new import_request_error.RequestError(response.statusText, status, {
  10594. response: {
  10595. url,
  10596. status,
  10597. headers,
  10598. data: void 0
  10599. },
  10600. request: requestOptions
  10601. });
  10602. }
  10603. if (status === 304) {
  10604. throw new import_request_error.RequestError("Not modified", status, {
  10605. response: {
  10606. url,
  10607. status,
  10608. headers,
  10609. data: await getResponseData(response)
  10610. },
  10611. request: requestOptions
  10612. });
  10613. }
  10614. if (status >= 400) {
  10615. const data = await getResponseData(response);
  10616. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10617. response: {
  10618. url,
  10619. status,
  10620. headers,
  10621. data
  10622. },
  10623. request: requestOptions
  10624. });
  10625. throw error;
  10626. }
  10627. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10628. }).then((data) => {
  10629. return {
  10630. status,
  10631. url,
  10632. headers,
  10633. data
  10634. };
  10635. }).catch((error) => {
  10636. if (error instanceof import_request_error.RequestError)
  10637. throw error;
  10638. else if (error.name === "AbortError")
  10639. throw error;
  10640. let message = error.message;
  10641. if (error.name === "TypeError" && "cause" in error) {
  10642. if (error.cause instanceof Error) {
  10643. message = error.cause.message;
  10644. } else if (typeof error.cause === "string") {
  10645. message = error.cause;
  10646. }
  10647. }
  10648. throw new import_request_error.RequestError(message, 500, {
  10649. request: requestOptions
  10650. });
  10651. });
  10652. }
  10653. async function getResponseData(response) {
  10654. const contentType = response.headers.get("content-type");
  10655. if (/application\/json/.test(contentType)) {
  10656. return response.json().catch(() => response.text()).catch(() => "");
  10657. }
  10658. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10659. return response.text();
  10660. }
  10661. return getBufferResponse(response);
  10662. }
  10663. function toErrorMessage(data) {
  10664. if (typeof data === "string")
  10665. return data;
  10666. let suffix;
  10667. if ("documentation_url" in data) {
  10668. suffix = ` - ${data.documentation_url}`;
  10669. } else {
  10670. suffix = "";
  10671. }
  10672. if ("message" in data) {
  10673. if (Array.isArray(data.errors)) {
  10674. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10675. }
  10676. return `${data.message}${suffix}`;
  10677. }
  10678. return `Unknown error: ${JSON.stringify(data)}`;
  10679. }
  10680. // pkg/dist-src/with-defaults.js
  10681. function withDefaults(oldEndpoint, newDefaults) {
  10682. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10683. const newApi = function(route, parameters) {
  10684. const endpointOptions = endpoint2.merge(route, parameters);
  10685. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10686. return fetchWrapper(endpoint2.parse(endpointOptions));
  10687. }
  10688. const request2 = (route2, parameters2) => {
  10689. return fetchWrapper(
  10690. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10691. );
  10692. };
  10693. Object.assign(request2, {
  10694. endpoint: endpoint2,
  10695. defaults: withDefaults.bind(null, endpoint2)
  10696. });
  10697. return endpointOptions.request.hook(request2, endpointOptions);
  10698. };
  10699. return Object.assign(newApi, {
  10700. endpoint: endpoint2,
  10701. defaults: withDefaults.bind(null, endpoint2)
  10702. });
  10703. }
  10704. // pkg/dist-src/index.js
  10705. var request = withDefaults(import_endpoint.endpoint, {
  10706. headers: {
  10707. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10708. }
  10709. });
  10710. // Annotate the CommonJS export names for ESM import in node:
  10711. 0 && (0);
  10712. /***/ }),
  10713. /***/ 3682:
  10714. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10715. var register = __nccwpck_require__(4670);
  10716. var addHook = __nccwpck_require__(5549);
  10717. var removeHook = __nccwpck_require__(6819);
  10718. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10719. var bind = Function.bind;
  10720. var bindable = bind.bind(bind);
  10721. function bindApi(hook, state, name) {
  10722. var removeHookRef = bindable(removeHook, null).apply(
  10723. null,
  10724. name ? [state, name] : [state]
  10725. );
  10726. hook.api = { remove: removeHookRef };
  10727. hook.remove = removeHookRef;
  10728. ["before", "error", "after", "wrap"].forEach(function (kind) {
  10729. var args = name ? [state, kind, name] : [state, kind];
  10730. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  10731. });
  10732. }
  10733. function HookSingular() {
  10734. var singularHookName = "h";
  10735. var singularHookState = {
  10736. registry: {},
  10737. };
  10738. var singularHook = register.bind(null, singularHookState, singularHookName);
  10739. bindApi(singularHook, singularHookState, singularHookName);
  10740. return singularHook;
  10741. }
  10742. function HookCollection() {
  10743. var state = {
  10744. registry: {},
  10745. };
  10746. var hook = register.bind(null, state);
  10747. bindApi(hook, state);
  10748. return hook;
  10749. }
  10750. var collectionHookDeprecationMessageDisplayed = false;
  10751. function Hook() {
  10752. if (!collectionHookDeprecationMessageDisplayed) {
  10753. console.warn(
  10754. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  10755. );
  10756. collectionHookDeprecationMessageDisplayed = true;
  10757. }
  10758. return HookCollection();
  10759. }
  10760. Hook.Singular = HookSingular.bind();
  10761. Hook.Collection = HookCollection.bind();
  10762. module.exports = Hook;
  10763. // expose constructors as a named property for TypeScript
  10764. module.exports.Hook = Hook;
  10765. module.exports.Singular = Hook.Singular;
  10766. module.exports.Collection = Hook.Collection;
  10767. /***/ }),
  10768. /***/ 5549:
  10769. /***/ ((module) => {
  10770. module.exports = addHook;
  10771. function addHook(state, kind, name, hook) {
  10772. var orig = hook;
  10773. if (!state.registry[name]) {
  10774. state.registry[name] = [];
  10775. }
  10776. if (kind === "before") {
  10777. hook = function (method, options) {
  10778. return Promise.resolve()
  10779. .then(orig.bind(null, options))
  10780. .then(method.bind(null, options));
  10781. };
  10782. }
  10783. if (kind === "after") {
  10784. hook = function (method, options) {
  10785. var result;
  10786. return Promise.resolve()
  10787. .then(method.bind(null, options))
  10788. .then(function (result_) {
  10789. result = result_;
  10790. return orig(result, options);
  10791. })
  10792. .then(function () {
  10793. return result;
  10794. });
  10795. };
  10796. }
  10797. if (kind === "error") {
  10798. hook = function (method, options) {
  10799. return Promise.resolve()
  10800. .then(method.bind(null, options))
  10801. .catch(function (error) {
  10802. return orig(error, options);
  10803. });
  10804. };
  10805. }
  10806. state.registry[name].push({
  10807. hook: hook,
  10808. orig: orig,
  10809. });
  10810. }
  10811. /***/ }),
  10812. /***/ 4670:
  10813. /***/ ((module) => {
  10814. module.exports = register;
  10815. function register(state, name, method, options) {
  10816. if (typeof method !== "function") {
  10817. throw new Error("method for before hook must be a function");
  10818. }
  10819. if (!options) {
  10820. options = {};
  10821. }
  10822. if (Array.isArray(name)) {
  10823. return name.reverse().reduce(function (callback, name) {
  10824. return register.bind(null, state, name, callback, options);
  10825. }, method)();
  10826. }
  10827. return Promise.resolve().then(function () {
  10828. if (!state.registry[name]) {
  10829. return method(options);
  10830. }
  10831. return state.registry[name].reduce(function (method, registered) {
  10832. return registered.hook.bind(null, method, options);
  10833. }, method)();
  10834. });
  10835. }
  10836. /***/ }),
  10837. /***/ 6819:
  10838. /***/ ((module) => {
  10839. module.exports = removeHook;
  10840. function removeHook(state, name, method) {
  10841. if (!state.registry[name]) {
  10842. return;
  10843. }
  10844. var index = state.registry[name]
  10845. .map(function (registered) {
  10846. return registered.orig;
  10847. })
  10848. .indexOf(method);
  10849. if (index === -1) {
  10850. return;
  10851. }
  10852. state.registry[name].splice(index, 1);
  10853. }
  10854. /***/ }),
  10855. /***/ 8932:
  10856. /***/ ((__unused_webpack_module, exports) => {
  10857. "use strict";
  10858. Object.defineProperty(exports, "__esModule", ({ value: true }));
  10859. class Deprecation extends Error {
  10860. constructor(message) {
  10861. super(message); // Maintains proper stack trace (only available on V8)
  10862. /* istanbul ignore next */
  10863. if (Error.captureStackTrace) {
  10864. Error.captureStackTrace(this, this.constructor);
  10865. }
  10866. this.name = 'Deprecation';
  10867. }
  10868. }
  10869. exports.Deprecation = Deprecation;
  10870. /***/ }),
  10871. /***/ 1223:
  10872. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10873. var wrappy = __nccwpck_require__(2940)
  10874. module.exports = wrappy(once)
  10875. module.exports.strict = wrappy(onceStrict)
  10876. once.proto = once(function () {
  10877. Object.defineProperty(Function.prototype, 'once', {
  10878. value: function () {
  10879. return once(this)
  10880. },
  10881. configurable: true
  10882. })
  10883. Object.defineProperty(Function.prototype, 'onceStrict', {
  10884. value: function () {
  10885. return onceStrict(this)
  10886. },
  10887. configurable: true
  10888. })
  10889. })
  10890. function once (fn) {
  10891. var f = function () {
  10892. if (f.called) return f.value
  10893. f.called = true
  10894. return f.value = fn.apply(this, arguments)
  10895. }
  10896. f.called = false
  10897. return f
  10898. }
  10899. function onceStrict (fn) {
  10900. var f = function () {
  10901. if (f.called)
  10902. throw new Error(f.onceError)
  10903. f.called = true
  10904. return f.value = fn.apply(this, arguments)
  10905. }
  10906. var name = fn.name || 'Function wrapped with `once`'
  10907. f.onceError = name + " shouldn't be called more than once"
  10908. f.called = false
  10909. return f
  10910. }
  10911. /***/ }),
  10912. /***/ 5911:
  10913. /***/ ((module, exports) => {
  10914. exports = module.exports = SemVer
  10915. var debug
  10916. /* istanbul ignore next */
  10917. if (typeof process === 'object' &&
  10918. process.env &&
  10919. process.env.NODE_DEBUG &&
  10920. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10921. debug = function () {
  10922. var args = Array.prototype.slice.call(arguments, 0)
  10923. args.unshift('SEMVER')
  10924. console.log.apply(console, args)
  10925. }
  10926. } else {
  10927. debug = function () {}
  10928. }
  10929. // Note: this is the semver.org version of the spec that it implements
  10930. // Not necessarily the package version of this code.
  10931. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10932. var MAX_LENGTH = 256
  10933. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10934. /* istanbul ignore next */ 9007199254740991
  10935. // Max safe segment length for coercion.
  10936. var MAX_SAFE_COMPONENT_LENGTH = 16
  10937. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  10938. // The actual regexps go on exports.re
  10939. var re = exports.re = []
  10940. var safeRe = exports.safeRe = []
  10941. var src = exports.src = []
  10942. var t = exports.tokens = {}
  10943. var R = 0
  10944. function tok (n) {
  10945. t[n] = R++
  10946. }
  10947. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  10948. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  10949. // used internally via the safeRe object since all inputs in this library get
  10950. // normalized first to trim and collapse all extra whitespace. The original
  10951. // regexes are exported for userland consumption and lower level usage. A
  10952. // future breaking change could export the safer regex only with a note that
  10953. // all input should have extra whitespace removed.
  10954. var safeRegexReplacements = [
  10955. ['\\s', 1],
  10956. ['\\d', MAX_LENGTH],
  10957. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  10958. ]
  10959. function makeSafeRe (value) {
  10960. for (var i = 0; i < safeRegexReplacements.length; i++) {
  10961. var token = safeRegexReplacements[i][0]
  10962. var max = safeRegexReplacements[i][1]
  10963. value = value
  10964. .split(token + '*').join(token + '{0,' + max + '}')
  10965. .split(token + '+').join(token + '{1,' + max + '}')
  10966. }
  10967. return value
  10968. }
  10969. // The following Regular Expressions can be used for tokenizing,
  10970. // validating, and parsing SemVer version strings.
  10971. // ## Numeric Identifier
  10972. // A single `0`, or a non-zero digit followed by zero or more digits.
  10973. tok('NUMERICIDENTIFIER')
  10974. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10975. tok('NUMERICIDENTIFIERLOOSE')
  10976. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  10977. // ## Non-numeric Identifier
  10978. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10979. // more letters, digits, or hyphens.
  10980. tok('NONNUMERICIDENTIFIER')
  10981. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  10982. // ## Main Version
  10983. // Three dot-separated numeric identifiers.
  10984. tok('MAINVERSION')
  10985. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10986. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10987. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10988. tok('MAINVERSIONLOOSE')
  10989. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10990. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10991. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10992. // ## Pre-release Version Identifier
  10993. // A numeric identifier, or a non-numeric identifier.
  10994. tok('PRERELEASEIDENTIFIER')
  10995. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10996. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10997. tok('PRERELEASEIDENTIFIERLOOSE')
  10998. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10999. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11000. // ## Pre-release Version
  11001. // Hyphen, followed by one or more dot-separated pre-release version
  11002. // identifiers.
  11003. tok('PRERELEASE')
  11004. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11005. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11006. tok('PRERELEASELOOSE')
  11007. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11008. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11009. // ## Build Metadata Identifier
  11010. // Any combination of digits, letters, or hyphens.
  11011. tok('BUILDIDENTIFIER')
  11012. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11013. // ## Build Metadata
  11014. // Plus sign, followed by one or more period-separated build metadata
  11015. // identifiers.
  11016. tok('BUILD')
  11017. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11018. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11019. // ## Full Version String
  11020. // A main version, followed optionally by a pre-release version and
  11021. // build metadata.
  11022. // Note that the only major, minor, patch, and pre-release sections of
  11023. // the version string are capturing groups. The build metadata is not a
  11024. // capturing group, because it should not ever be used in version
  11025. // comparison.
  11026. tok('FULL')
  11027. tok('FULLPLAIN')
  11028. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11029. src[t.PRERELEASE] + '?' +
  11030. src[t.BUILD] + '?'
  11031. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11032. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11033. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11034. // common in the npm registry.
  11035. tok('LOOSEPLAIN')
  11036. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11037. src[t.PRERELEASELOOSE] + '?' +
  11038. src[t.BUILD] + '?'
  11039. tok('LOOSE')
  11040. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11041. tok('GTLT')
  11042. src[t.GTLT] = '((?:<|>)?=?)'
  11043. // Something like "2.*" or "1.2.x".
  11044. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11045. // Only the first item is strictly required.
  11046. tok('XRANGEIDENTIFIERLOOSE')
  11047. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11048. tok('XRANGEIDENTIFIER')
  11049. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11050. tok('XRANGEPLAIN')
  11051. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11052. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11053. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11054. '(?:' + src[t.PRERELEASE] + ')?' +
  11055. src[t.BUILD] + '?' +
  11056. ')?)?'
  11057. tok('XRANGEPLAINLOOSE')
  11058. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11059. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11060. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11061. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11062. src[t.BUILD] + '?' +
  11063. ')?)?'
  11064. tok('XRANGE')
  11065. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11066. tok('XRANGELOOSE')
  11067. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11068. // Coercion.
  11069. // Extract anything that could conceivably be a part of a valid semver
  11070. tok('COERCE')
  11071. src[t.COERCE] = '(^|[^\\d])' +
  11072. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11073. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11074. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11075. '(?:$|[^\\d])'
  11076. tok('COERCERTL')
  11077. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11078. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11079. // Tilde ranges.
  11080. // Meaning is "reasonably at or greater than"
  11081. tok('LONETILDE')
  11082. src[t.LONETILDE] = '(?:~>?)'
  11083. tok('TILDETRIM')
  11084. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11085. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11086. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11087. var tildeTrimReplace = '$1~'
  11088. tok('TILDE')
  11089. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11090. tok('TILDELOOSE')
  11091. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11092. // Caret ranges.
  11093. // Meaning is "at least and backwards compatible with"
  11094. tok('LONECARET')
  11095. src[t.LONECARET] = '(?:\\^)'
  11096. tok('CARETTRIM')
  11097. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11098. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11099. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11100. var caretTrimReplace = '$1^'
  11101. tok('CARET')
  11102. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11103. tok('CARETLOOSE')
  11104. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11105. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11106. tok('COMPARATORLOOSE')
  11107. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11108. tok('COMPARATOR')
  11109. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11110. // An expression to strip any whitespace between the gtlt and the thing
  11111. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11112. tok('COMPARATORTRIM')
  11113. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11114. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11115. // this one has to use the /g flag
  11116. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11117. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11118. var comparatorTrimReplace = '$1$2$3'
  11119. // Something like `1.2.3 - 1.2.4`
  11120. // Note that these all use the loose form, because they'll be
  11121. // checked against either the strict or loose comparator form
  11122. // later.
  11123. tok('HYPHENRANGE')
  11124. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11125. '\\s+-\\s+' +
  11126. '(' + src[t.XRANGEPLAIN] + ')' +
  11127. '\\s*$'
  11128. tok('HYPHENRANGELOOSE')
  11129. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11130. '\\s+-\\s+' +
  11131. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11132. '\\s*$'
  11133. // Star ranges basically just allow anything at all.
  11134. tok('STAR')
  11135. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11136. // Compile to actual regexp objects.
  11137. // All are flag-free, unless they were created above with a flag.
  11138. for (var i = 0; i < R; i++) {
  11139. debug(i, src[i])
  11140. if (!re[i]) {
  11141. re[i] = new RegExp(src[i])
  11142. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11143. // used internally via the safeRe object since all inputs in this library get
  11144. // normalized first to trim and collapse all extra whitespace. The original
  11145. // regexes are exported for userland consumption and lower level usage. A
  11146. // future breaking change could export the safer regex only with a note that
  11147. // all input should have extra whitespace removed.
  11148. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11149. }
  11150. }
  11151. exports.parse = parse
  11152. function parse (version, options) {
  11153. if (!options || typeof options !== 'object') {
  11154. options = {
  11155. loose: !!options,
  11156. includePrerelease: false
  11157. }
  11158. }
  11159. if (version instanceof SemVer) {
  11160. return version
  11161. }
  11162. if (typeof version !== 'string') {
  11163. return null
  11164. }
  11165. if (version.length > MAX_LENGTH) {
  11166. return null
  11167. }
  11168. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11169. if (!r.test(version)) {
  11170. return null
  11171. }
  11172. try {
  11173. return new SemVer(version, options)
  11174. } catch (er) {
  11175. return null
  11176. }
  11177. }
  11178. exports.valid = valid
  11179. function valid (version, options) {
  11180. var v = parse(version, options)
  11181. return v ? v.version : null
  11182. }
  11183. exports.clean = clean
  11184. function clean (version, options) {
  11185. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11186. return s ? s.version : null
  11187. }
  11188. exports.SemVer = SemVer
  11189. function SemVer (version, options) {
  11190. if (!options || typeof options !== 'object') {
  11191. options = {
  11192. loose: !!options,
  11193. includePrerelease: false
  11194. }
  11195. }
  11196. if (version instanceof SemVer) {
  11197. if (version.loose === options.loose) {
  11198. return version
  11199. } else {
  11200. version = version.version
  11201. }
  11202. } else if (typeof version !== 'string') {
  11203. throw new TypeError('Invalid Version: ' + version)
  11204. }
  11205. if (version.length > MAX_LENGTH) {
  11206. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11207. }
  11208. if (!(this instanceof SemVer)) {
  11209. return new SemVer(version, options)
  11210. }
  11211. debug('SemVer', version, options)
  11212. this.options = options
  11213. this.loose = !!options.loose
  11214. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11215. if (!m) {
  11216. throw new TypeError('Invalid Version: ' + version)
  11217. }
  11218. this.raw = version
  11219. // these are actually numbers
  11220. this.major = +m[1]
  11221. this.minor = +m[2]
  11222. this.patch = +m[3]
  11223. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11224. throw new TypeError('Invalid major version')
  11225. }
  11226. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11227. throw new TypeError('Invalid minor version')
  11228. }
  11229. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11230. throw new TypeError('Invalid patch version')
  11231. }
  11232. // numberify any prerelease numeric ids
  11233. if (!m[4]) {
  11234. this.prerelease = []
  11235. } else {
  11236. this.prerelease = m[4].split('.').map(function (id) {
  11237. if (/^[0-9]+$/.test(id)) {
  11238. var num = +id
  11239. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11240. return num
  11241. }
  11242. }
  11243. return id
  11244. })
  11245. }
  11246. this.build = m[5] ? m[5].split('.') : []
  11247. this.format()
  11248. }
  11249. SemVer.prototype.format = function () {
  11250. this.version = this.major + '.' + this.minor + '.' + this.patch
  11251. if (this.prerelease.length) {
  11252. this.version += '-' + this.prerelease.join('.')
  11253. }
  11254. return this.version
  11255. }
  11256. SemVer.prototype.toString = function () {
  11257. return this.version
  11258. }
  11259. SemVer.prototype.compare = function (other) {
  11260. debug('SemVer.compare', this.version, this.options, other)
  11261. if (!(other instanceof SemVer)) {
  11262. other = new SemVer(other, this.options)
  11263. }
  11264. return this.compareMain(other) || this.comparePre(other)
  11265. }
  11266. SemVer.prototype.compareMain = function (other) {
  11267. if (!(other instanceof SemVer)) {
  11268. other = new SemVer(other, this.options)
  11269. }
  11270. return compareIdentifiers(this.major, other.major) ||
  11271. compareIdentifiers(this.minor, other.minor) ||
  11272. compareIdentifiers(this.patch, other.patch)
  11273. }
  11274. SemVer.prototype.comparePre = function (other) {
  11275. if (!(other instanceof SemVer)) {
  11276. other = new SemVer(other, this.options)
  11277. }
  11278. // NOT having a prerelease is > having one
  11279. if (this.prerelease.length && !other.prerelease.length) {
  11280. return -1
  11281. } else if (!this.prerelease.length && other.prerelease.length) {
  11282. return 1
  11283. } else if (!this.prerelease.length && !other.prerelease.length) {
  11284. return 0
  11285. }
  11286. var i = 0
  11287. do {
  11288. var a = this.prerelease[i]
  11289. var b = other.prerelease[i]
  11290. debug('prerelease compare', i, a, b)
  11291. if (a === undefined && b === undefined) {
  11292. return 0
  11293. } else if (b === undefined) {
  11294. return 1
  11295. } else if (a === undefined) {
  11296. return -1
  11297. } else if (a === b) {
  11298. continue
  11299. } else {
  11300. return compareIdentifiers(a, b)
  11301. }
  11302. } while (++i)
  11303. }
  11304. SemVer.prototype.compareBuild = function (other) {
  11305. if (!(other instanceof SemVer)) {
  11306. other = new SemVer(other, this.options)
  11307. }
  11308. var i = 0
  11309. do {
  11310. var a = this.build[i]
  11311. var b = other.build[i]
  11312. debug('prerelease compare', i, a, b)
  11313. if (a === undefined && b === undefined) {
  11314. return 0
  11315. } else if (b === undefined) {
  11316. return 1
  11317. } else if (a === undefined) {
  11318. return -1
  11319. } else if (a === b) {
  11320. continue
  11321. } else {
  11322. return compareIdentifiers(a, b)
  11323. }
  11324. } while (++i)
  11325. }
  11326. // preminor will bump the version up to the next minor release, and immediately
  11327. // down to pre-release. premajor and prepatch work the same way.
  11328. SemVer.prototype.inc = function (release, identifier) {
  11329. switch (release) {
  11330. case 'premajor':
  11331. this.prerelease.length = 0
  11332. this.patch = 0
  11333. this.minor = 0
  11334. this.major++
  11335. this.inc('pre', identifier)
  11336. break
  11337. case 'preminor':
  11338. this.prerelease.length = 0
  11339. this.patch = 0
  11340. this.minor++
  11341. this.inc('pre', identifier)
  11342. break
  11343. case 'prepatch':
  11344. // If this is already a prerelease, it will bump to the next version
  11345. // drop any prereleases that might already exist, since they are not
  11346. // relevant at this point.
  11347. this.prerelease.length = 0
  11348. this.inc('patch', identifier)
  11349. this.inc('pre', identifier)
  11350. break
  11351. // If the input is a non-prerelease version, this acts the same as
  11352. // prepatch.
  11353. case 'prerelease':
  11354. if (this.prerelease.length === 0) {
  11355. this.inc('patch', identifier)
  11356. }
  11357. this.inc('pre', identifier)
  11358. break
  11359. case 'major':
  11360. // If this is a pre-major version, bump up to the same major version.
  11361. // Otherwise increment major.
  11362. // 1.0.0-5 bumps to 1.0.0
  11363. // 1.1.0 bumps to 2.0.0
  11364. if (this.minor !== 0 ||
  11365. this.patch !== 0 ||
  11366. this.prerelease.length === 0) {
  11367. this.major++
  11368. }
  11369. this.minor = 0
  11370. this.patch = 0
  11371. this.prerelease = []
  11372. break
  11373. case 'minor':
  11374. // If this is a pre-minor version, bump up to the same minor version.
  11375. // Otherwise increment minor.
  11376. // 1.2.0-5 bumps to 1.2.0
  11377. // 1.2.1 bumps to 1.3.0
  11378. if (this.patch !== 0 || this.prerelease.length === 0) {
  11379. this.minor++
  11380. }
  11381. this.patch = 0
  11382. this.prerelease = []
  11383. break
  11384. case 'patch':
  11385. // If this is not a pre-release version, it will increment the patch.
  11386. // If it is a pre-release it will bump up to the same patch version.
  11387. // 1.2.0-5 patches to 1.2.0
  11388. // 1.2.0 patches to 1.2.1
  11389. if (this.prerelease.length === 0) {
  11390. this.patch++
  11391. }
  11392. this.prerelease = []
  11393. break
  11394. // This probably shouldn't be used publicly.
  11395. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11396. case 'pre':
  11397. if (this.prerelease.length === 0) {
  11398. this.prerelease = [0]
  11399. } else {
  11400. var i = this.prerelease.length
  11401. while (--i >= 0) {
  11402. if (typeof this.prerelease[i] === 'number') {
  11403. this.prerelease[i]++
  11404. i = -2
  11405. }
  11406. }
  11407. if (i === -1) {
  11408. // didn't increment anything
  11409. this.prerelease.push(0)
  11410. }
  11411. }
  11412. if (identifier) {
  11413. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11414. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11415. if (this.prerelease[0] === identifier) {
  11416. if (isNaN(this.prerelease[1])) {
  11417. this.prerelease = [identifier, 0]
  11418. }
  11419. } else {
  11420. this.prerelease = [identifier, 0]
  11421. }
  11422. }
  11423. break
  11424. default:
  11425. throw new Error('invalid increment argument: ' + release)
  11426. }
  11427. this.format()
  11428. this.raw = this.version
  11429. return this
  11430. }
  11431. exports.inc = inc
  11432. function inc (version, release, loose, identifier) {
  11433. if (typeof (loose) === 'string') {
  11434. identifier = loose
  11435. loose = undefined
  11436. }
  11437. try {
  11438. return new SemVer(version, loose).inc(release, identifier).version
  11439. } catch (er) {
  11440. return null
  11441. }
  11442. }
  11443. exports.diff = diff
  11444. function diff (version1, version2) {
  11445. if (eq(version1, version2)) {
  11446. return null
  11447. } else {
  11448. var v1 = parse(version1)
  11449. var v2 = parse(version2)
  11450. var prefix = ''
  11451. if (v1.prerelease.length || v2.prerelease.length) {
  11452. prefix = 'pre'
  11453. var defaultResult = 'prerelease'
  11454. }
  11455. for (var key in v1) {
  11456. if (key === 'major' || key === 'minor' || key === 'patch') {
  11457. if (v1[key] !== v2[key]) {
  11458. return prefix + key
  11459. }
  11460. }
  11461. }
  11462. return defaultResult // may be undefined
  11463. }
  11464. }
  11465. exports.compareIdentifiers = compareIdentifiers
  11466. var numeric = /^[0-9]+$/
  11467. function compareIdentifiers (a, b) {
  11468. var anum = numeric.test(a)
  11469. var bnum = numeric.test(b)
  11470. if (anum && bnum) {
  11471. a = +a
  11472. b = +b
  11473. }
  11474. return a === b ? 0
  11475. : (anum && !bnum) ? -1
  11476. : (bnum && !anum) ? 1
  11477. : a < b ? -1
  11478. : 1
  11479. }
  11480. exports.rcompareIdentifiers = rcompareIdentifiers
  11481. function rcompareIdentifiers (a, b) {
  11482. return compareIdentifiers(b, a)
  11483. }
  11484. exports.major = major
  11485. function major (a, loose) {
  11486. return new SemVer(a, loose).major
  11487. }
  11488. exports.minor = minor
  11489. function minor (a, loose) {
  11490. return new SemVer(a, loose).minor
  11491. }
  11492. exports.patch = patch
  11493. function patch (a, loose) {
  11494. return new SemVer(a, loose).patch
  11495. }
  11496. exports.compare = compare
  11497. function compare (a, b, loose) {
  11498. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11499. }
  11500. exports.compareLoose = compareLoose
  11501. function compareLoose (a, b) {
  11502. return compare(a, b, true)
  11503. }
  11504. exports.compareBuild = compareBuild
  11505. function compareBuild (a, b, loose) {
  11506. var versionA = new SemVer(a, loose)
  11507. var versionB = new SemVer(b, loose)
  11508. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11509. }
  11510. exports.rcompare = rcompare
  11511. function rcompare (a, b, loose) {
  11512. return compare(b, a, loose)
  11513. }
  11514. exports.sort = sort
  11515. function sort (list, loose) {
  11516. return list.sort(function (a, b) {
  11517. return exports.compareBuild(a, b, loose)
  11518. })
  11519. }
  11520. exports.rsort = rsort
  11521. function rsort (list, loose) {
  11522. return list.sort(function (a, b) {
  11523. return exports.compareBuild(b, a, loose)
  11524. })
  11525. }
  11526. exports.gt = gt
  11527. function gt (a, b, loose) {
  11528. return compare(a, b, loose) > 0
  11529. }
  11530. exports.lt = lt
  11531. function lt (a, b, loose) {
  11532. return compare(a, b, loose) < 0
  11533. }
  11534. exports.eq = eq
  11535. function eq (a, b, loose) {
  11536. return compare(a, b, loose) === 0
  11537. }
  11538. exports.neq = neq
  11539. function neq (a, b, loose) {
  11540. return compare(a, b, loose) !== 0
  11541. }
  11542. exports.gte = gte
  11543. function gte (a, b, loose) {
  11544. return compare(a, b, loose) >= 0
  11545. }
  11546. exports.lte = lte
  11547. function lte (a, b, loose) {
  11548. return compare(a, b, loose) <= 0
  11549. }
  11550. exports.cmp = cmp
  11551. function cmp (a, op, b, loose) {
  11552. switch (op) {
  11553. case '===':
  11554. if (typeof a === 'object')
  11555. a = a.version
  11556. if (typeof b === 'object')
  11557. b = b.version
  11558. return a === b
  11559. case '!==':
  11560. if (typeof a === 'object')
  11561. a = a.version
  11562. if (typeof b === 'object')
  11563. b = b.version
  11564. return a !== b
  11565. case '':
  11566. case '=':
  11567. case '==':
  11568. return eq(a, b, loose)
  11569. case '!=':
  11570. return neq(a, b, loose)
  11571. case '>':
  11572. return gt(a, b, loose)
  11573. case '>=':
  11574. return gte(a, b, loose)
  11575. case '<':
  11576. return lt(a, b, loose)
  11577. case '<=':
  11578. return lte(a, b, loose)
  11579. default:
  11580. throw new TypeError('Invalid operator: ' + op)
  11581. }
  11582. }
  11583. exports.Comparator = Comparator
  11584. function Comparator (comp, options) {
  11585. if (!options || typeof options !== 'object') {
  11586. options = {
  11587. loose: !!options,
  11588. includePrerelease: false
  11589. }
  11590. }
  11591. if (comp instanceof Comparator) {
  11592. if (comp.loose === !!options.loose) {
  11593. return comp
  11594. } else {
  11595. comp = comp.value
  11596. }
  11597. }
  11598. if (!(this instanceof Comparator)) {
  11599. return new Comparator(comp, options)
  11600. }
  11601. comp = comp.trim().split(/\s+/).join(' ')
  11602. debug('comparator', comp, options)
  11603. this.options = options
  11604. this.loose = !!options.loose
  11605. this.parse(comp)
  11606. if (this.semver === ANY) {
  11607. this.value = ''
  11608. } else {
  11609. this.value = this.operator + this.semver.version
  11610. }
  11611. debug('comp', this)
  11612. }
  11613. var ANY = {}
  11614. Comparator.prototype.parse = function (comp) {
  11615. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11616. var m = comp.match(r)
  11617. if (!m) {
  11618. throw new TypeError('Invalid comparator: ' + comp)
  11619. }
  11620. this.operator = m[1] !== undefined ? m[1] : ''
  11621. if (this.operator === '=') {
  11622. this.operator = ''
  11623. }
  11624. // if it literally is just '>' or '' then allow anything.
  11625. if (!m[2]) {
  11626. this.semver = ANY
  11627. } else {
  11628. this.semver = new SemVer(m[2], this.options.loose)
  11629. }
  11630. }
  11631. Comparator.prototype.toString = function () {
  11632. return this.value
  11633. }
  11634. Comparator.prototype.test = function (version) {
  11635. debug('Comparator.test', version, this.options.loose)
  11636. if (this.semver === ANY || version === ANY) {
  11637. return true
  11638. }
  11639. if (typeof version === 'string') {
  11640. try {
  11641. version = new SemVer(version, this.options)
  11642. } catch (er) {
  11643. return false
  11644. }
  11645. }
  11646. return cmp(version, this.operator, this.semver, this.options)
  11647. }
  11648. Comparator.prototype.intersects = function (comp, options) {
  11649. if (!(comp instanceof Comparator)) {
  11650. throw new TypeError('a Comparator is required')
  11651. }
  11652. if (!options || typeof options !== 'object') {
  11653. options = {
  11654. loose: !!options,
  11655. includePrerelease: false
  11656. }
  11657. }
  11658. var rangeTmp
  11659. if (this.operator === '') {
  11660. if (this.value === '') {
  11661. return true
  11662. }
  11663. rangeTmp = new Range(comp.value, options)
  11664. return satisfies(this.value, rangeTmp, options)
  11665. } else if (comp.operator === '') {
  11666. if (comp.value === '') {
  11667. return true
  11668. }
  11669. rangeTmp = new Range(this.value, options)
  11670. return satisfies(comp.semver, rangeTmp, options)
  11671. }
  11672. var sameDirectionIncreasing =
  11673. (this.operator === '>=' || this.operator === '>') &&
  11674. (comp.operator === '>=' || comp.operator === '>')
  11675. var sameDirectionDecreasing =
  11676. (this.operator === '<=' || this.operator === '<') &&
  11677. (comp.operator === '<=' || comp.operator === '<')
  11678. var sameSemVer = this.semver.version === comp.semver.version
  11679. var differentDirectionsInclusive =
  11680. (this.operator === '>=' || this.operator === '<=') &&
  11681. (comp.operator === '>=' || comp.operator === '<=')
  11682. var oppositeDirectionsLessThan =
  11683. cmp(this.semver, '<', comp.semver, options) &&
  11684. ((this.operator === '>=' || this.operator === '>') &&
  11685. (comp.operator === '<=' || comp.operator === '<'))
  11686. var oppositeDirectionsGreaterThan =
  11687. cmp(this.semver, '>', comp.semver, options) &&
  11688. ((this.operator === '<=' || this.operator === '<') &&
  11689. (comp.operator === '>=' || comp.operator === '>'))
  11690. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11691. (sameSemVer && differentDirectionsInclusive) ||
  11692. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11693. }
  11694. exports.Range = Range
  11695. function Range (range, options) {
  11696. if (!options || typeof options !== 'object') {
  11697. options = {
  11698. loose: !!options,
  11699. includePrerelease: false
  11700. }
  11701. }
  11702. if (range instanceof Range) {
  11703. if (range.loose === !!options.loose &&
  11704. range.includePrerelease === !!options.includePrerelease) {
  11705. return range
  11706. } else {
  11707. return new Range(range.raw, options)
  11708. }
  11709. }
  11710. if (range instanceof Comparator) {
  11711. return new Range(range.value, options)
  11712. }
  11713. if (!(this instanceof Range)) {
  11714. return new Range(range, options)
  11715. }
  11716. this.options = options
  11717. this.loose = !!options.loose
  11718. this.includePrerelease = !!options.includePrerelease
  11719. // First reduce all whitespace as much as possible so we do not have to rely
  11720. // on potentially slow regexes like \s*. This is then stored and used for
  11721. // future error messages as well.
  11722. this.raw = range
  11723. .trim()
  11724. .split(/\s+/)
  11725. .join(' ')
  11726. // First, split based on boolean or ||
  11727. this.set = this.raw.split('||').map(function (range) {
  11728. return this.parseRange(range.trim())
  11729. }, this).filter(function (c) {
  11730. // throw out any that are not relevant for whatever reason
  11731. return c.length
  11732. })
  11733. if (!this.set.length) {
  11734. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  11735. }
  11736. this.format()
  11737. }
  11738. Range.prototype.format = function () {
  11739. this.range = this.set.map(function (comps) {
  11740. return comps.join(' ').trim()
  11741. }).join('||').trim()
  11742. return this.range
  11743. }
  11744. Range.prototype.toString = function () {
  11745. return this.range
  11746. }
  11747. Range.prototype.parseRange = function (range) {
  11748. var loose = this.options.loose
  11749. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11750. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  11751. range = range.replace(hr, hyphenReplace)
  11752. debug('hyphen replace', range)
  11753. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11754. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  11755. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  11756. // `~ 1.2.3` => `~1.2.3`
  11757. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  11758. // `^ 1.2.3` => `^1.2.3`
  11759. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  11760. // normalize spaces
  11761. range = range.split(/\s+/).join(' ')
  11762. // At this point, the range is completely trimmed and
  11763. // ready to be split into comparators.
  11764. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11765. var set = range.split(' ').map(function (comp) {
  11766. return parseComparator(comp, this.options)
  11767. }, this).join(' ').split(/\s+/)
  11768. if (this.options.loose) {
  11769. // in loose mode, throw out any that are not valid comparators
  11770. set = set.filter(function (comp) {
  11771. return !!comp.match(compRe)
  11772. })
  11773. }
  11774. set = set.map(function (comp) {
  11775. return new Comparator(comp, this.options)
  11776. }, this)
  11777. return set
  11778. }
  11779. Range.prototype.intersects = function (range, options) {
  11780. if (!(range instanceof Range)) {
  11781. throw new TypeError('a Range is required')
  11782. }
  11783. return this.set.some(function (thisComparators) {
  11784. return (
  11785. isSatisfiable(thisComparators, options) &&
  11786. range.set.some(function (rangeComparators) {
  11787. return (
  11788. isSatisfiable(rangeComparators, options) &&
  11789. thisComparators.every(function (thisComparator) {
  11790. return rangeComparators.every(function (rangeComparator) {
  11791. return thisComparator.intersects(rangeComparator, options)
  11792. })
  11793. })
  11794. )
  11795. })
  11796. )
  11797. })
  11798. }
  11799. // take a set of comparators and determine whether there
  11800. // exists a version which can satisfy it
  11801. function isSatisfiable (comparators, options) {
  11802. var result = true
  11803. var remainingComparators = comparators.slice()
  11804. var testComparator = remainingComparators.pop()
  11805. while (result && remainingComparators.length) {
  11806. result = remainingComparators.every(function (otherComparator) {
  11807. return testComparator.intersects(otherComparator, options)
  11808. })
  11809. testComparator = remainingComparators.pop()
  11810. }
  11811. return result
  11812. }
  11813. // Mostly just for testing and legacy API reasons
  11814. exports.toComparators = toComparators
  11815. function toComparators (range, options) {
  11816. return new Range(range, options).set.map(function (comp) {
  11817. return comp.map(function (c) {
  11818. return c.value
  11819. }).join(' ').trim().split(' ')
  11820. })
  11821. }
  11822. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11823. // already replaced the hyphen ranges
  11824. // turn into a set of JUST comparators.
  11825. function parseComparator (comp, options) {
  11826. debug('comp', comp, options)
  11827. comp = replaceCarets(comp, options)
  11828. debug('caret', comp)
  11829. comp = replaceTildes(comp, options)
  11830. debug('tildes', comp)
  11831. comp = replaceXRanges(comp, options)
  11832. debug('xrange', comp)
  11833. comp = replaceStars(comp, options)
  11834. debug('stars', comp)
  11835. return comp
  11836. }
  11837. function isX (id) {
  11838. return !id || id.toLowerCase() === 'x' || id === '*'
  11839. }
  11840. // ~, ~> --> * (any, kinda silly)
  11841. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11842. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11843. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11844. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11845. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11846. function replaceTildes (comp, options) {
  11847. return comp.trim().split(/\s+/).map(function (comp) {
  11848. return replaceTilde(comp, options)
  11849. }).join(' ')
  11850. }
  11851. function replaceTilde (comp, options) {
  11852. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  11853. return comp.replace(r, function (_, M, m, p, pr) {
  11854. debug('tilde', comp, _, M, m, p, pr)
  11855. var ret
  11856. if (isX(M)) {
  11857. ret = ''
  11858. } else if (isX(m)) {
  11859. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11860. } else if (isX(p)) {
  11861. // ~1.2 == >=1.2.0 <1.3.0
  11862. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11863. } else if (pr) {
  11864. debug('replaceTilde pr', pr)
  11865. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11866. ' <' + M + '.' + (+m + 1) + '.0'
  11867. } else {
  11868. // ~1.2.3 == >=1.2.3 <1.3.0
  11869. ret = '>=' + M + '.' + m + '.' + p +
  11870. ' <' + M + '.' + (+m + 1) + '.0'
  11871. }
  11872. debug('tilde return', ret)
  11873. return ret
  11874. })
  11875. }
  11876. // ^ --> * (any, kinda silly)
  11877. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11878. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11879. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11880. // ^1.2.3 --> >=1.2.3 <2.0.0
  11881. // ^1.2.0 --> >=1.2.0 <2.0.0
  11882. function replaceCarets (comp, options) {
  11883. return comp.trim().split(/\s+/).map(function (comp) {
  11884. return replaceCaret(comp, options)
  11885. }).join(' ')
  11886. }
  11887. function replaceCaret (comp, options) {
  11888. debug('caret', comp, options)
  11889. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  11890. return comp.replace(r, function (_, M, m, p, pr) {
  11891. debug('caret', comp, _, M, m, p, pr)
  11892. var ret
  11893. if (isX(M)) {
  11894. ret = ''
  11895. } else if (isX(m)) {
  11896. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11897. } else if (isX(p)) {
  11898. if (M === '0') {
  11899. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11900. } else {
  11901. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11902. }
  11903. } else if (pr) {
  11904. debug('replaceCaret pr', pr)
  11905. if (M === '0') {
  11906. if (m === '0') {
  11907. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11908. ' <' + M + '.' + m + '.' + (+p + 1)
  11909. } else {
  11910. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11911. ' <' + M + '.' + (+m + 1) + '.0'
  11912. }
  11913. } else {
  11914. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11915. ' <' + (+M + 1) + '.0.0'
  11916. }
  11917. } else {
  11918. debug('no pr')
  11919. if (M === '0') {
  11920. if (m === '0') {
  11921. ret = '>=' + M + '.' + m + '.' + p +
  11922. ' <' + M + '.' + m + '.' + (+p + 1)
  11923. } else {
  11924. ret = '>=' + M + '.' + m + '.' + p +
  11925. ' <' + M + '.' + (+m + 1) + '.0'
  11926. }
  11927. } else {
  11928. ret = '>=' + M + '.' + m + '.' + p +
  11929. ' <' + (+M + 1) + '.0.0'
  11930. }
  11931. }
  11932. debug('caret return', ret)
  11933. return ret
  11934. })
  11935. }
  11936. function replaceXRanges (comp, options) {
  11937. debug('replaceXRanges', comp, options)
  11938. return comp.split(/\s+/).map(function (comp) {
  11939. return replaceXRange(comp, options)
  11940. }).join(' ')
  11941. }
  11942. function replaceXRange (comp, options) {
  11943. comp = comp.trim()
  11944. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  11945. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11946. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11947. var xM = isX(M)
  11948. var xm = xM || isX(m)
  11949. var xp = xm || isX(p)
  11950. var anyX = xp
  11951. if (gtlt === '=' && anyX) {
  11952. gtlt = ''
  11953. }
  11954. // if we're including prereleases in the match, then we need
  11955. // to fix this to -0, the lowest possible prerelease value
  11956. pr = options.includePrerelease ? '-0' : ''
  11957. if (xM) {
  11958. if (gtlt === '>' || gtlt === '<') {
  11959. // nothing is allowed
  11960. ret = '<0.0.0-0'
  11961. } else {
  11962. // nothing is forbidden
  11963. ret = '*'
  11964. }
  11965. } else if (gtlt && anyX) {
  11966. // we know patch is an x, because we have any x at all.
  11967. // replace X with 0
  11968. if (xm) {
  11969. m = 0
  11970. }
  11971. p = 0
  11972. if (gtlt === '>') {
  11973. // >1 => >=2.0.0
  11974. // >1.2 => >=1.3.0
  11975. // >1.2.3 => >= 1.2.4
  11976. gtlt = '>='
  11977. if (xm) {
  11978. M = +M + 1
  11979. m = 0
  11980. p = 0
  11981. } else {
  11982. m = +m + 1
  11983. p = 0
  11984. }
  11985. } else if (gtlt === '<=') {
  11986. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11987. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11988. gtlt = '<'
  11989. if (xm) {
  11990. M = +M + 1
  11991. } else {
  11992. m = +m + 1
  11993. }
  11994. }
  11995. ret = gtlt + M + '.' + m + '.' + p + pr
  11996. } else if (xm) {
  11997. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11998. } else if (xp) {
  11999. ret = '>=' + M + '.' + m + '.0' + pr +
  12000. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12001. }
  12002. debug('xRange return', ret)
  12003. return ret
  12004. })
  12005. }
  12006. // Because * is AND-ed with everything else in the comparator,
  12007. // and '' means "any version", just remove the *s entirely.
  12008. function replaceStars (comp, options) {
  12009. debug('replaceStars', comp, options)
  12010. // Looseness is ignored here. star is always as loose as it gets!
  12011. return comp.trim().replace(safeRe[t.STAR], '')
  12012. }
  12013. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12014. // M, m, patch, prerelease, build
  12015. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12016. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12017. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12018. function hyphenReplace ($0,
  12019. from, fM, fm, fp, fpr, fb,
  12020. to, tM, tm, tp, tpr, tb) {
  12021. if (isX(fM)) {
  12022. from = ''
  12023. } else if (isX(fm)) {
  12024. from = '>=' + fM + '.0.0'
  12025. } else if (isX(fp)) {
  12026. from = '>=' + fM + '.' + fm + '.0'
  12027. } else {
  12028. from = '>=' + from
  12029. }
  12030. if (isX(tM)) {
  12031. to = ''
  12032. } else if (isX(tm)) {
  12033. to = '<' + (+tM + 1) + '.0.0'
  12034. } else if (isX(tp)) {
  12035. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12036. } else if (tpr) {
  12037. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12038. } else {
  12039. to = '<=' + to
  12040. }
  12041. return (from + ' ' + to).trim()
  12042. }
  12043. // if ANY of the sets match ALL of its comparators, then pass
  12044. Range.prototype.test = function (version) {
  12045. if (!version) {
  12046. return false
  12047. }
  12048. if (typeof version === 'string') {
  12049. try {
  12050. version = new SemVer(version, this.options)
  12051. } catch (er) {
  12052. return false
  12053. }
  12054. }
  12055. for (var i = 0; i < this.set.length; i++) {
  12056. if (testSet(this.set[i], version, this.options)) {
  12057. return true
  12058. }
  12059. }
  12060. return false
  12061. }
  12062. function testSet (set, version, options) {
  12063. for (var i = 0; i < set.length; i++) {
  12064. if (!set[i].test(version)) {
  12065. return false
  12066. }
  12067. }
  12068. if (version.prerelease.length && !options.includePrerelease) {
  12069. // Find the set of versions that are allowed to have prereleases
  12070. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12071. // That should allow `1.2.3-pr.2` to pass.
  12072. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12073. // even though it's within the range set by the comparators.
  12074. for (i = 0; i < set.length; i++) {
  12075. debug(set[i].semver)
  12076. if (set[i].semver === ANY) {
  12077. continue
  12078. }
  12079. if (set[i].semver.prerelease.length > 0) {
  12080. var allowed = set[i].semver
  12081. if (allowed.major === version.major &&
  12082. allowed.minor === version.minor &&
  12083. allowed.patch === version.patch) {
  12084. return true
  12085. }
  12086. }
  12087. }
  12088. // Version has a -pre, but it's not one of the ones we like.
  12089. return false
  12090. }
  12091. return true
  12092. }
  12093. exports.satisfies = satisfies
  12094. function satisfies (version, range, options) {
  12095. try {
  12096. range = new Range(range, options)
  12097. } catch (er) {
  12098. return false
  12099. }
  12100. return range.test(version)
  12101. }
  12102. exports.maxSatisfying = maxSatisfying
  12103. function maxSatisfying (versions, range, options) {
  12104. var max = null
  12105. var maxSV = null
  12106. try {
  12107. var rangeObj = new Range(range, options)
  12108. } catch (er) {
  12109. return null
  12110. }
  12111. versions.forEach(function (v) {
  12112. if (rangeObj.test(v)) {
  12113. // satisfies(v, range, options)
  12114. if (!max || maxSV.compare(v) === -1) {
  12115. // compare(max, v, true)
  12116. max = v
  12117. maxSV = new SemVer(max, options)
  12118. }
  12119. }
  12120. })
  12121. return max
  12122. }
  12123. exports.minSatisfying = minSatisfying
  12124. function minSatisfying (versions, range, options) {
  12125. var min = null
  12126. var minSV = null
  12127. try {
  12128. var rangeObj = new Range(range, options)
  12129. } catch (er) {
  12130. return null
  12131. }
  12132. versions.forEach(function (v) {
  12133. if (rangeObj.test(v)) {
  12134. // satisfies(v, range, options)
  12135. if (!min || minSV.compare(v) === 1) {
  12136. // compare(min, v, true)
  12137. min = v
  12138. minSV = new SemVer(min, options)
  12139. }
  12140. }
  12141. })
  12142. return min
  12143. }
  12144. exports.minVersion = minVersion
  12145. function minVersion (range, loose) {
  12146. range = new Range(range, loose)
  12147. var minver = new SemVer('0.0.0')
  12148. if (range.test(minver)) {
  12149. return minver
  12150. }
  12151. minver = new SemVer('0.0.0-0')
  12152. if (range.test(minver)) {
  12153. return minver
  12154. }
  12155. minver = null
  12156. for (var i = 0; i < range.set.length; ++i) {
  12157. var comparators = range.set[i]
  12158. comparators.forEach(function (comparator) {
  12159. // Clone to avoid manipulating the comparator's semver object.
  12160. var compver = new SemVer(comparator.semver.version)
  12161. switch (comparator.operator) {
  12162. case '>':
  12163. if (compver.prerelease.length === 0) {
  12164. compver.patch++
  12165. } else {
  12166. compver.prerelease.push(0)
  12167. }
  12168. compver.raw = compver.format()
  12169. /* fallthrough */
  12170. case '':
  12171. case '>=':
  12172. if (!minver || gt(minver, compver)) {
  12173. minver = compver
  12174. }
  12175. break
  12176. case '<':
  12177. case '<=':
  12178. /* Ignore maximum versions */
  12179. break
  12180. /* istanbul ignore next */
  12181. default:
  12182. throw new Error('Unexpected operation: ' + comparator.operator)
  12183. }
  12184. })
  12185. }
  12186. if (minver && range.test(minver)) {
  12187. return minver
  12188. }
  12189. return null
  12190. }
  12191. exports.validRange = validRange
  12192. function validRange (range, options) {
  12193. try {
  12194. // Return '*' instead of '' so that truthiness works.
  12195. // This will throw if it's invalid anyway
  12196. return new Range(range, options).range || '*'
  12197. } catch (er) {
  12198. return null
  12199. }
  12200. }
  12201. // Determine if version is less than all the versions possible in the range
  12202. exports.ltr = ltr
  12203. function ltr (version, range, options) {
  12204. return outside(version, range, '<', options)
  12205. }
  12206. // Determine if version is greater than all the versions possible in the range.
  12207. exports.gtr = gtr
  12208. function gtr (version, range, options) {
  12209. return outside(version, range, '>', options)
  12210. }
  12211. exports.outside = outside
  12212. function outside (version, range, hilo, options) {
  12213. version = new SemVer(version, options)
  12214. range = new Range(range, options)
  12215. var gtfn, ltefn, ltfn, comp, ecomp
  12216. switch (hilo) {
  12217. case '>':
  12218. gtfn = gt
  12219. ltefn = lte
  12220. ltfn = lt
  12221. comp = '>'
  12222. ecomp = '>='
  12223. break
  12224. case '<':
  12225. gtfn = lt
  12226. ltefn = gte
  12227. ltfn = gt
  12228. comp = '<'
  12229. ecomp = '<='
  12230. break
  12231. default:
  12232. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12233. }
  12234. // If it satisifes the range it is not outside
  12235. if (satisfies(version, range, options)) {
  12236. return false
  12237. }
  12238. // From now on, variable terms are as if we're in "gtr" mode.
  12239. // but note that everything is flipped for the "ltr" function.
  12240. for (var i = 0; i < range.set.length; ++i) {
  12241. var comparators = range.set[i]
  12242. var high = null
  12243. var low = null
  12244. comparators.forEach(function (comparator) {
  12245. if (comparator.semver === ANY) {
  12246. comparator = new Comparator('>=0.0.0')
  12247. }
  12248. high = high || comparator
  12249. low = low || comparator
  12250. if (gtfn(comparator.semver, high.semver, options)) {
  12251. high = comparator
  12252. } else if (ltfn(comparator.semver, low.semver, options)) {
  12253. low = comparator
  12254. }
  12255. })
  12256. // If the edge version comparator has a operator then our version
  12257. // isn't outside it
  12258. if (high.operator === comp || high.operator === ecomp) {
  12259. return false
  12260. }
  12261. // If the lowest version comparator has an operator and our version
  12262. // is less than it then it isn't higher than the range
  12263. if ((!low.operator || low.operator === comp) &&
  12264. ltefn(version, low.semver)) {
  12265. return false
  12266. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12267. return false
  12268. }
  12269. }
  12270. return true
  12271. }
  12272. exports.prerelease = prerelease
  12273. function prerelease (version, options) {
  12274. var parsed = parse(version, options)
  12275. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12276. }
  12277. exports.intersects = intersects
  12278. function intersects (r1, r2, options) {
  12279. r1 = new Range(r1, options)
  12280. r2 = new Range(r2, options)
  12281. return r1.intersects(r2)
  12282. }
  12283. exports.coerce = coerce
  12284. function coerce (version, options) {
  12285. if (version instanceof SemVer) {
  12286. return version
  12287. }
  12288. if (typeof version === 'number') {
  12289. version = String(version)
  12290. }
  12291. if (typeof version !== 'string') {
  12292. return null
  12293. }
  12294. options = options || {}
  12295. var match = null
  12296. if (!options.rtl) {
  12297. match = version.match(safeRe[t.COERCE])
  12298. } else {
  12299. // Find the right-most coercible string that does not share
  12300. // a terminus with a more left-ward coercible string.
  12301. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12302. //
  12303. // Walk through the string checking with a /g regexp
  12304. // Manually set the index so as to pick up overlapping matches.
  12305. // Stop when we get a match that ends at the string end, since no
  12306. // coercible string can be more right-ward without the same terminus.
  12307. var next
  12308. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12309. (!match || match.index + match[0].length !== version.length)
  12310. ) {
  12311. if (!match ||
  12312. next.index + next[0].length !== match.index + match[0].length) {
  12313. match = next
  12314. }
  12315. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12316. }
  12317. // leave it in a clean state
  12318. safeRe[t.COERCERTL].lastIndex = -1
  12319. }
  12320. if (match === null) {
  12321. return null
  12322. }
  12323. return parse(match[2] +
  12324. '.' + (match[3] || '0') +
  12325. '.' + (match[4] || '0'), options)
  12326. }
  12327. /***/ }),
  12328. /***/ 4294:
  12329. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12330. module.exports = __nccwpck_require__(4219);
  12331. /***/ }),
  12332. /***/ 4219:
  12333. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12334. "use strict";
  12335. var net = __nccwpck_require__(1808);
  12336. var tls = __nccwpck_require__(4404);
  12337. var http = __nccwpck_require__(3685);
  12338. var https = __nccwpck_require__(5687);
  12339. var events = __nccwpck_require__(2361);
  12340. var assert = __nccwpck_require__(9491);
  12341. var util = __nccwpck_require__(3837);
  12342. exports.httpOverHttp = httpOverHttp;
  12343. exports.httpsOverHttp = httpsOverHttp;
  12344. exports.httpOverHttps = httpOverHttps;
  12345. exports.httpsOverHttps = httpsOverHttps;
  12346. function httpOverHttp(options) {
  12347. var agent = new TunnelingAgent(options);
  12348. agent.request = http.request;
  12349. return agent;
  12350. }
  12351. function httpsOverHttp(options) {
  12352. var agent = new TunnelingAgent(options);
  12353. agent.request = http.request;
  12354. agent.createSocket = createSecureSocket;
  12355. agent.defaultPort = 443;
  12356. return agent;
  12357. }
  12358. function httpOverHttps(options) {
  12359. var agent = new TunnelingAgent(options);
  12360. agent.request = https.request;
  12361. return agent;
  12362. }
  12363. function httpsOverHttps(options) {
  12364. var agent = new TunnelingAgent(options);
  12365. agent.request = https.request;
  12366. agent.createSocket = createSecureSocket;
  12367. agent.defaultPort = 443;
  12368. return agent;
  12369. }
  12370. function TunnelingAgent(options) {
  12371. var self = this;
  12372. self.options = options || {};
  12373. self.proxyOptions = self.options.proxy || {};
  12374. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12375. self.requests = [];
  12376. self.sockets = [];
  12377. self.on('free', function onFree(socket, host, port, localAddress) {
  12378. var options = toOptions(host, port, localAddress);
  12379. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12380. var pending = self.requests[i];
  12381. if (pending.host === options.host && pending.port === options.port) {
  12382. // Detect the request to connect same origin server,
  12383. // reuse the connection.
  12384. self.requests.splice(i, 1);
  12385. pending.request.onSocket(socket);
  12386. return;
  12387. }
  12388. }
  12389. socket.destroy();
  12390. self.removeSocket(socket);
  12391. });
  12392. }
  12393. util.inherits(TunnelingAgent, events.EventEmitter);
  12394. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12395. var self = this;
  12396. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12397. if (self.sockets.length >= this.maxSockets) {
  12398. // We are over limit so we'll add it to the queue.
  12399. self.requests.push(options);
  12400. return;
  12401. }
  12402. // If we are under maxSockets create a new one.
  12403. self.createSocket(options, function(socket) {
  12404. socket.on('free', onFree);
  12405. socket.on('close', onCloseOrRemove);
  12406. socket.on('agentRemove', onCloseOrRemove);
  12407. req.onSocket(socket);
  12408. function onFree() {
  12409. self.emit('free', socket, options);
  12410. }
  12411. function onCloseOrRemove(err) {
  12412. self.removeSocket(socket);
  12413. socket.removeListener('free', onFree);
  12414. socket.removeListener('close', onCloseOrRemove);
  12415. socket.removeListener('agentRemove', onCloseOrRemove);
  12416. }
  12417. });
  12418. };
  12419. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12420. var self = this;
  12421. var placeholder = {};
  12422. self.sockets.push(placeholder);
  12423. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12424. method: 'CONNECT',
  12425. path: options.host + ':' + options.port,
  12426. agent: false,
  12427. headers: {
  12428. host: options.host + ':' + options.port
  12429. }
  12430. });
  12431. if (options.localAddress) {
  12432. connectOptions.localAddress = options.localAddress;
  12433. }
  12434. if (connectOptions.proxyAuth) {
  12435. connectOptions.headers = connectOptions.headers || {};
  12436. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12437. new Buffer(connectOptions.proxyAuth).toString('base64');
  12438. }
  12439. debug('making CONNECT request');
  12440. var connectReq = self.request(connectOptions);
  12441. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12442. connectReq.once('response', onResponse); // for v0.6
  12443. connectReq.once('upgrade', onUpgrade); // for v0.6
  12444. connectReq.once('connect', onConnect); // for v0.7 or later
  12445. connectReq.once('error', onError);
  12446. connectReq.end();
  12447. function onResponse(res) {
  12448. // Very hacky. This is necessary to avoid http-parser leaks.
  12449. res.upgrade = true;
  12450. }
  12451. function onUpgrade(res, socket, head) {
  12452. // Hacky.
  12453. process.nextTick(function() {
  12454. onConnect(res, socket, head);
  12455. });
  12456. }
  12457. function onConnect(res, socket, head) {
  12458. connectReq.removeAllListeners();
  12459. socket.removeAllListeners();
  12460. if (res.statusCode !== 200) {
  12461. debug('tunneling socket could not be established, statusCode=%d',
  12462. res.statusCode);
  12463. socket.destroy();
  12464. var error = new Error('tunneling socket could not be established, ' +
  12465. 'statusCode=' + res.statusCode);
  12466. error.code = 'ECONNRESET';
  12467. options.request.emit('error', error);
  12468. self.removeSocket(placeholder);
  12469. return;
  12470. }
  12471. if (head.length > 0) {
  12472. debug('got illegal response body from proxy');
  12473. socket.destroy();
  12474. var error = new Error('got illegal response body from proxy');
  12475. error.code = 'ECONNRESET';
  12476. options.request.emit('error', error);
  12477. self.removeSocket(placeholder);
  12478. return;
  12479. }
  12480. debug('tunneling connection has established');
  12481. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12482. return cb(socket);
  12483. }
  12484. function onError(cause) {
  12485. connectReq.removeAllListeners();
  12486. debug('tunneling socket could not be established, cause=%s\n',
  12487. cause.message, cause.stack);
  12488. var error = new Error('tunneling socket could not be established, ' +
  12489. 'cause=' + cause.message);
  12490. error.code = 'ECONNRESET';
  12491. options.request.emit('error', error);
  12492. self.removeSocket(placeholder);
  12493. }
  12494. };
  12495. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12496. var pos = this.sockets.indexOf(socket)
  12497. if (pos === -1) {
  12498. return;
  12499. }
  12500. this.sockets.splice(pos, 1);
  12501. var pending = this.requests.shift();
  12502. if (pending) {
  12503. // If we have pending requests and a socket gets closed a new one
  12504. // needs to be created to take over in the pool for the one that closed.
  12505. this.createSocket(pending, function(socket) {
  12506. pending.request.onSocket(socket);
  12507. });
  12508. }
  12509. };
  12510. function createSecureSocket(options, cb) {
  12511. var self = this;
  12512. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12513. var hostHeader = options.request.getHeader('host');
  12514. var tlsOptions = mergeOptions({}, self.options, {
  12515. socket: socket,
  12516. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12517. });
  12518. // 0 is dummy port for v0.6
  12519. var secureSocket = tls.connect(0, tlsOptions);
  12520. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12521. cb(secureSocket);
  12522. });
  12523. }
  12524. function toOptions(host, port, localAddress) {
  12525. if (typeof host === 'string') { // since v0.10
  12526. return {
  12527. host: host,
  12528. port: port,
  12529. localAddress: localAddress
  12530. };
  12531. }
  12532. return host; // for v0.11 or later
  12533. }
  12534. function mergeOptions(target) {
  12535. for (var i = 1, len = arguments.length; i < len; ++i) {
  12536. var overrides = arguments[i];
  12537. if (typeof overrides === 'object') {
  12538. var keys = Object.keys(overrides);
  12539. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12540. var k = keys[j];
  12541. if (overrides[k] !== undefined) {
  12542. target[k] = overrides[k];
  12543. }
  12544. }
  12545. }
  12546. }
  12547. return target;
  12548. }
  12549. var debug;
  12550. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12551. debug = function() {
  12552. var args = Array.prototype.slice.call(arguments);
  12553. if (typeof args[0] === 'string') {
  12554. args[0] = 'TUNNEL: ' + args[0];
  12555. } else {
  12556. args.unshift('TUNNEL:');
  12557. }
  12558. console.error.apply(console, args);
  12559. }
  12560. } else {
  12561. debug = function() {};
  12562. }
  12563. exports.debug = debug; // for test
  12564. /***/ }),
  12565. /***/ 1773:
  12566. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12567. "use strict";
  12568. const Client = __nccwpck_require__(3598)
  12569. const Dispatcher = __nccwpck_require__(412)
  12570. const errors = __nccwpck_require__(8045)
  12571. const Pool = __nccwpck_require__(4634)
  12572. const BalancedPool = __nccwpck_require__(7931)
  12573. const Agent = __nccwpck_require__(7890)
  12574. const util = __nccwpck_require__(3983)
  12575. const { InvalidArgumentError } = errors
  12576. const api = __nccwpck_require__(4059)
  12577. const buildConnector = __nccwpck_require__(2067)
  12578. const MockClient = __nccwpck_require__(8687)
  12579. const MockAgent = __nccwpck_require__(6771)
  12580. const MockPool = __nccwpck_require__(6193)
  12581. const mockErrors = __nccwpck_require__(888)
  12582. const ProxyAgent = __nccwpck_require__(7858)
  12583. const RetryHandler = __nccwpck_require__(2286)
  12584. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12585. const DecoratorHandler = __nccwpck_require__(6930)
  12586. const RedirectHandler = __nccwpck_require__(2860)
  12587. const createRedirectInterceptor = __nccwpck_require__(8861)
  12588. let hasCrypto
  12589. try {
  12590. __nccwpck_require__(6113)
  12591. hasCrypto = true
  12592. } catch {
  12593. hasCrypto = false
  12594. }
  12595. Object.assign(Dispatcher.prototype, api)
  12596. module.exports.Dispatcher = Dispatcher
  12597. module.exports.Client = Client
  12598. module.exports.Pool = Pool
  12599. module.exports.BalancedPool = BalancedPool
  12600. module.exports.Agent = Agent
  12601. module.exports.ProxyAgent = ProxyAgent
  12602. module.exports.RetryHandler = RetryHandler
  12603. module.exports.DecoratorHandler = DecoratorHandler
  12604. module.exports.RedirectHandler = RedirectHandler
  12605. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12606. module.exports.buildConnector = buildConnector
  12607. module.exports.errors = errors
  12608. function makeDispatcher (fn) {
  12609. return (url, opts, handler) => {
  12610. if (typeof opts === 'function') {
  12611. handler = opts
  12612. opts = null
  12613. }
  12614. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12615. throw new InvalidArgumentError('invalid url')
  12616. }
  12617. if (opts != null && typeof opts !== 'object') {
  12618. throw new InvalidArgumentError('invalid opts')
  12619. }
  12620. if (opts && opts.path != null) {
  12621. if (typeof opts.path !== 'string') {
  12622. throw new InvalidArgumentError('invalid opts.path')
  12623. }
  12624. let path = opts.path
  12625. if (!opts.path.startsWith('/')) {
  12626. path = `/${path}`
  12627. }
  12628. url = new URL(util.parseOrigin(url).origin + path)
  12629. } else {
  12630. if (!opts) {
  12631. opts = typeof url === 'object' ? url : {}
  12632. }
  12633. url = util.parseURL(url)
  12634. }
  12635. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12636. if (agent) {
  12637. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12638. }
  12639. return fn.call(dispatcher, {
  12640. ...opts,
  12641. origin: url.origin,
  12642. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12643. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12644. }, handler)
  12645. }
  12646. }
  12647. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12648. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12649. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12650. let fetchImpl = null
  12651. module.exports.fetch = async function fetch (resource) {
  12652. if (!fetchImpl) {
  12653. fetchImpl = (__nccwpck_require__(4881).fetch)
  12654. }
  12655. try {
  12656. return await fetchImpl(...arguments)
  12657. } catch (err) {
  12658. if (typeof err === 'object') {
  12659. Error.captureStackTrace(err, this)
  12660. }
  12661. throw err
  12662. }
  12663. }
  12664. module.exports.Headers = __nccwpck_require__(554).Headers
  12665. module.exports.Response = __nccwpck_require__(7823).Response
  12666. module.exports.Request = __nccwpck_require__(8359).Request
  12667. module.exports.FormData = __nccwpck_require__(2015).FormData
  12668. module.exports.File = __nccwpck_require__(8511).File
  12669. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12670. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12671. module.exports.setGlobalOrigin = setGlobalOrigin
  12672. module.exports.getGlobalOrigin = getGlobalOrigin
  12673. const { CacheStorage } = __nccwpck_require__(7907)
  12674. const { kConstruct } = __nccwpck_require__(9174)
  12675. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12676. // in an older version of Node, it doesn't have any use without fetch.
  12677. module.exports.caches = new CacheStorage(kConstruct)
  12678. }
  12679. if (util.nodeMajor >= 16) {
  12680. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12681. module.exports.deleteCookie = deleteCookie
  12682. module.exports.getCookies = getCookies
  12683. module.exports.getSetCookies = getSetCookies
  12684. module.exports.setCookie = setCookie
  12685. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12686. module.exports.parseMIMEType = parseMIMEType
  12687. module.exports.serializeAMimeType = serializeAMimeType
  12688. }
  12689. if (util.nodeMajor >= 18 && hasCrypto) {
  12690. const { WebSocket } = __nccwpck_require__(4284)
  12691. module.exports.WebSocket = WebSocket
  12692. }
  12693. module.exports.request = makeDispatcher(api.request)
  12694. module.exports.stream = makeDispatcher(api.stream)
  12695. module.exports.pipeline = makeDispatcher(api.pipeline)
  12696. module.exports.connect = makeDispatcher(api.connect)
  12697. module.exports.upgrade = makeDispatcher(api.upgrade)
  12698. module.exports.MockClient = MockClient
  12699. module.exports.MockPool = MockPool
  12700. module.exports.MockAgent = MockAgent
  12701. module.exports.mockErrors = mockErrors
  12702. /***/ }),
  12703. /***/ 7890:
  12704. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12705. "use strict";
  12706. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12707. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12708. const DispatcherBase = __nccwpck_require__(4839)
  12709. const Pool = __nccwpck_require__(4634)
  12710. const Client = __nccwpck_require__(3598)
  12711. const util = __nccwpck_require__(3983)
  12712. const createRedirectInterceptor = __nccwpck_require__(8861)
  12713. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12714. const kOnConnect = Symbol('onConnect')
  12715. const kOnDisconnect = Symbol('onDisconnect')
  12716. const kOnConnectionError = Symbol('onConnectionError')
  12717. const kMaxRedirections = Symbol('maxRedirections')
  12718. const kOnDrain = Symbol('onDrain')
  12719. const kFactory = Symbol('factory')
  12720. const kFinalizer = Symbol('finalizer')
  12721. const kOptions = Symbol('options')
  12722. function defaultFactory (origin, opts) {
  12723. return opts && opts.connections === 1
  12724. ? new Client(origin, opts)
  12725. : new Pool(origin, opts)
  12726. }
  12727. class Agent extends DispatcherBase {
  12728. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  12729. super()
  12730. if (typeof factory !== 'function') {
  12731. throw new InvalidArgumentError('factory must be a function.')
  12732. }
  12733. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  12734. throw new InvalidArgumentError('connect must be a function or an object')
  12735. }
  12736. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  12737. throw new InvalidArgumentError('maxRedirections must be a positive number')
  12738. }
  12739. if (connect && typeof connect !== 'function') {
  12740. connect = { ...connect }
  12741. }
  12742. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  12743. ? options.interceptors.Agent
  12744. : [createRedirectInterceptor({ maxRedirections })]
  12745. this[kOptions] = { ...util.deepClone(options), connect }
  12746. this[kOptions].interceptors = options.interceptors
  12747. ? { ...options.interceptors }
  12748. : undefined
  12749. this[kMaxRedirections] = maxRedirections
  12750. this[kFactory] = factory
  12751. this[kClients] = new Map()
  12752. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  12753. const ref = this[kClients].get(key)
  12754. if (ref !== undefined && ref.deref() === undefined) {
  12755. this[kClients].delete(key)
  12756. }
  12757. })
  12758. const agent = this
  12759. this[kOnDrain] = (origin, targets) => {
  12760. agent.emit('drain', origin, [agent, ...targets])
  12761. }
  12762. this[kOnConnect] = (origin, targets) => {
  12763. agent.emit('connect', origin, [agent, ...targets])
  12764. }
  12765. this[kOnDisconnect] = (origin, targets, err) => {
  12766. agent.emit('disconnect', origin, [agent, ...targets], err)
  12767. }
  12768. this[kOnConnectionError] = (origin, targets, err) => {
  12769. agent.emit('connectionError', origin, [agent, ...targets], err)
  12770. }
  12771. }
  12772. get [kRunning] () {
  12773. let ret = 0
  12774. for (const ref of this[kClients].values()) {
  12775. const client = ref.deref()
  12776. /* istanbul ignore next: gc is undeterministic */
  12777. if (client) {
  12778. ret += client[kRunning]
  12779. }
  12780. }
  12781. return ret
  12782. }
  12783. [kDispatch] (opts, handler) {
  12784. let key
  12785. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  12786. key = String(opts.origin)
  12787. } else {
  12788. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  12789. }
  12790. const ref = this[kClients].get(key)
  12791. let dispatcher = ref ? ref.deref() : null
  12792. if (!dispatcher) {
  12793. dispatcher = this[kFactory](opts.origin, this[kOptions])
  12794. .on('drain', this[kOnDrain])
  12795. .on('connect', this[kOnConnect])
  12796. .on('disconnect', this[kOnDisconnect])
  12797. .on('connectionError', this[kOnConnectionError])
  12798. this[kClients].set(key, new WeakRef(dispatcher))
  12799. this[kFinalizer].register(dispatcher, key)
  12800. }
  12801. return dispatcher.dispatch(opts, handler)
  12802. }
  12803. async [kClose] () {
  12804. const closePromises = []
  12805. for (const ref of this[kClients].values()) {
  12806. const client = ref.deref()
  12807. /* istanbul ignore else: gc is undeterministic */
  12808. if (client) {
  12809. closePromises.push(client.close())
  12810. }
  12811. }
  12812. await Promise.all(closePromises)
  12813. }
  12814. async [kDestroy] (err) {
  12815. const destroyPromises = []
  12816. for (const ref of this[kClients].values()) {
  12817. const client = ref.deref()
  12818. /* istanbul ignore else: gc is undeterministic */
  12819. if (client) {
  12820. destroyPromises.push(client.destroy(err))
  12821. }
  12822. }
  12823. await Promise.all(destroyPromises)
  12824. }
  12825. }
  12826. module.exports = Agent
  12827. /***/ }),
  12828. /***/ 7032:
  12829. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12830. const { addAbortListener } = __nccwpck_require__(3983)
  12831. const { RequestAbortedError } = __nccwpck_require__(8045)
  12832. const kListener = Symbol('kListener')
  12833. const kSignal = Symbol('kSignal')
  12834. function abort (self) {
  12835. if (self.abort) {
  12836. self.abort()
  12837. } else {
  12838. self.onError(new RequestAbortedError())
  12839. }
  12840. }
  12841. function addSignal (self, signal) {
  12842. self[kSignal] = null
  12843. self[kListener] = null
  12844. if (!signal) {
  12845. return
  12846. }
  12847. if (signal.aborted) {
  12848. abort(self)
  12849. return
  12850. }
  12851. self[kSignal] = signal
  12852. self[kListener] = () => {
  12853. abort(self)
  12854. }
  12855. addAbortListener(self[kSignal], self[kListener])
  12856. }
  12857. function removeSignal (self) {
  12858. if (!self[kSignal]) {
  12859. return
  12860. }
  12861. if ('removeEventListener' in self[kSignal]) {
  12862. self[kSignal].removeEventListener('abort', self[kListener])
  12863. } else {
  12864. self[kSignal].removeListener('abort', self[kListener])
  12865. }
  12866. self[kSignal] = null
  12867. self[kListener] = null
  12868. }
  12869. module.exports = {
  12870. addSignal,
  12871. removeSignal
  12872. }
  12873. /***/ }),
  12874. /***/ 9744:
  12875. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12876. "use strict";
  12877. const { AsyncResource } = __nccwpck_require__(852)
  12878. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  12879. const util = __nccwpck_require__(3983)
  12880. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12881. class ConnectHandler extends AsyncResource {
  12882. constructor (opts, callback) {
  12883. if (!opts || typeof opts !== 'object') {
  12884. throw new InvalidArgumentError('invalid opts')
  12885. }
  12886. if (typeof callback !== 'function') {
  12887. throw new InvalidArgumentError('invalid callback')
  12888. }
  12889. const { signal, opaque, responseHeaders } = opts
  12890. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  12891. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  12892. }
  12893. super('UNDICI_CONNECT')
  12894. this.opaque = opaque || null
  12895. this.responseHeaders = responseHeaders || null
  12896. this.callback = callback
  12897. this.abort = null
  12898. addSignal(this, signal)
  12899. }
  12900. onConnect (abort, context) {
  12901. if (!this.callback) {
  12902. throw new RequestAbortedError()
  12903. }
  12904. this.abort = abort
  12905. this.context = context
  12906. }
  12907. onHeaders () {
  12908. throw new SocketError('bad connect', null)
  12909. }
  12910. onUpgrade (statusCode, rawHeaders, socket) {
  12911. const { callback, opaque, context } = this
  12912. removeSignal(this)
  12913. this.callback = null
  12914. let headers = rawHeaders
  12915. // Indicates is an HTTP2Session
  12916. if (headers != null) {
  12917. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  12918. }
  12919. this.runInAsyncScope(callback, null, null, {
  12920. statusCode,
  12921. headers,
  12922. socket,
  12923. opaque,
  12924. context
  12925. })
  12926. }
  12927. onError (err) {
  12928. const { callback, opaque } = this
  12929. removeSignal(this)
  12930. if (callback) {
  12931. this.callback = null
  12932. queueMicrotask(() => {
  12933. this.runInAsyncScope(callback, null, err, { opaque })
  12934. })
  12935. }
  12936. }
  12937. }
  12938. function connect (opts, callback) {
  12939. if (callback === undefined) {
  12940. return new Promise((resolve, reject) => {
  12941. connect.call(this, opts, (err, data) => {
  12942. return err ? reject(err) : resolve(data)
  12943. })
  12944. })
  12945. }
  12946. try {
  12947. const connectHandler = new ConnectHandler(opts, callback)
  12948. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  12949. } catch (err) {
  12950. if (typeof callback !== 'function') {
  12951. throw err
  12952. }
  12953. const opaque = opts && opts.opaque
  12954. queueMicrotask(() => callback(err, { opaque }))
  12955. }
  12956. }
  12957. module.exports = connect
  12958. /***/ }),
  12959. /***/ 8752:
  12960. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12961. "use strict";
  12962. const {
  12963. Readable,
  12964. Duplex,
  12965. PassThrough
  12966. } = __nccwpck_require__(2781)
  12967. const {
  12968. InvalidArgumentError,
  12969. InvalidReturnValueError,
  12970. RequestAbortedError
  12971. } = __nccwpck_require__(8045)
  12972. const util = __nccwpck_require__(3983)
  12973. const { AsyncResource } = __nccwpck_require__(852)
  12974. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12975. const assert = __nccwpck_require__(9491)
  12976. const kResume = Symbol('resume')
  12977. class PipelineRequest extends Readable {
  12978. constructor () {
  12979. super({ autoDestroy: true })
  12980. this[kResume] = null
  12981. }
  12982. _read () {
  12983. const { [kResume]: resume } = this
  12984. if (resume) {
  12985. this[kResume] = null
  12986. resume()
  12987. }
  12988. }
  12989. _destroy (err, callback) {
  12990. this._read()
  12991. callback(err)
  12992. }
  12993. }
  12994. class PipelineResponse extends Readable {
  12995. constructor (resume) {
  12996. super({ autoDestroy: true })
  12997. this[kResume] = resume
  12998. }
  12999. _read () {
  13000. this[kResume]()
  13001. }
  13002. _destroy (err, callback) {
  13003. if (!err && !this._readableState.endEmitted) {
  13004. err = new RequestAbortedError()
  13005. }
  13006. callback(err)
  13007. }
  13008. }
  13009. class PipelineHandler extends AsyncResource {
  13010. constructor (opts, handler) {
  13011. if (!opts || typeof opts !== 'object') {
  13012. throw new InvalidArgumentError('invalid opts')
  13013. }
  13014. if (typeof handler !== 'function') {
  13015. throw new InvalidArgumentError('invalid handler')
  13016. }
  13017. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13018. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13019. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13020. }
  13021. if (method === 'CONNECT') {
  13022. throw new InvalidArgumentError('invalid method')
  13023. }
  13024. if (onInfo && typeof onInfo !== 'function') {
  13025. throw new InvalidArgumentError('invalid onInfo callback')
  13026. }
  13027. super('UNDICI_PIPELINE')
  13028. this.opaque = opaque || null
  13029. this.responseHeaders = responseHeaders || null
  13030. this.handler = handler
  13031. this.abort = null
  13032. this.context = null
  13033. this.onInfo = onInfo || null
  13034. this.req = new PipelineRequest().on('error', util.nop)
  13035. this.ret = new Duplex({
  13036. readableObjectMode: opts.objectMode,
  13037. autoDestroy: true,
  13038. read: () => {
  13039. const { body } = this
  13040. if (body && body.resume) {
  13041. body.resume()
  13042. }
  13043. },
  13044. write: (chunk, encoding, callback) => {
  13045. const { req } = this
  13046. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13047. callback()
  13048. } else {
  13049. req[kResume] = callback
  13050. }
  13051. },
  13052. destroy: (err, callback) => {
  13053. const { body, req, res, ret, abort } = this
  13054. if (!err && !ret._readableState.endEmitted) {
  13055. err = new RequestAbortedError()
  13056. }
  13057. if (abort && err) {
  13058. abort()
  13059. }
  13060. util.destroy(body, err)
  13061. util.destroy(req, err)
  13062. util.destroy(res, err)
  13063. removeSignal(this)
  13064. callback(err)
  13065. }
  13066. }).on('prefinish', () => {
  13067. const { req } = this
  13068. // Node < 15 does not call _final in same tick.
  13069. req.push(null)
  13070. })
  13071. this.res = null
  13072. addSignal(this, signal)
  13073. }
  13074. onConnect (abort, context) {
  13075. const { ret, res } = this
  13076. assert(!res, 'pipeline cannot be retried')
  13077. if (ret.destroyed) {
  13078. throw new RequestAbortedError()
  13079. }
  13080. this.abort = abort
  13081. this.context = context
  13082. }
  13083. onHeaders (statusCode, rawHeaders, resume) {
  13084. const { opaque, handler, context } = this
  13085. if (statusCode < 200) {
  13086. if (this.onInfo) {
  13087. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13088. this.onInfo({ statusCode, headers })
  13089. }
  13090. return
  13091. }
  13092. this.res = new PipelineResponse(resume)
  13093. let body
  13094. try {
  13095. this.handler = null
  13096. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13097. body = this.runInAsyncScope(handler, null, {
  13098. statusCode,
  13099. headers,
  13100. opaque,
  13101. body: this.res,
  13102. context
  13103. })
  13104. } catch (err) {
  13105. this.res.on('error', util.nop)
  13106. throw err
  13107. }
  13108. if (!body || typeof body.on !== 'function') {
  13109. throw new InvalidReturnValueError('expected Readable')
  13110. }
  13111. body
  13112. .on('data', (chunk) => {
  13113. const { ret, body } = this
  13114. if (!ret.push(chunk) && body.pause) {
  13115. body.pause()
  13116. }
  13117. })
  13118. .on('error', (err) => {
  13119. const { ret } = this
  13120. util.destroy(ret, err)
  13121. })
  13122. .on('end', () => {
  13123. const { ret } = this
  13124. ret.push(null)
  13125. })
  13126. .on('close', () => {
  13127. const { ret } = this
  13128. if (!ret._readableState.ended) {
  13129. util.destroy(ret, new RequestAbortedError())
  13130. }
  13131. })
  13132. this.body = body
  13133. }
  13134. onData (chunk) {
  13135. const { res } = this
  13136. return res.push(chunk)
  13137. }
  13138. onComplete (trailers) {
  13139. const { res } = this
  13140. res.push(null)
  13141. }
  13142. onError (err) {
  13143. const { ret } = this
  13144. this.handler = null
  13145. util.destroy(ret, err)
  13146. }
  13147. }
  13148. function pipeline (opts, handler) {
  13149. try {
  13150. const pipelineHandler = new PipelineHandler(opts, handler)
  13151. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13152. return pipelineHandler.ret
  13153. } catch (err) {
  13154. return new PassThrough().destroy(err)
  13155. }
  13156. }
  13157. module.exports = pipeline
  13158. /***/ }),
  13159. /***/ 5448:
  13160. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13161. "use strict";
  13162. const Readable = __nccwpck_require__(3858)
  13163. const {
  13164. InvalidArgumentError,
  13165. RequestAbortedError
  13166. } = __nccwpck_require__(8045)
  13167. const util = __nccwpck_require__(3983)
  13168. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13169. const { AsyncResource } = __nccwpck_require__(852)
  13170. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13171. class RequestHandler extends AsyncResource {
  13172. constructor (opts, callback) {
  13173. if (!opts || typeof opts !== 'object') {
  13174. throw new InvalidArgumentError('invalid opts')
  13175. }
  13176. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13177. try {
  13178. if (typeof callback !== 'function') {
  13179. throw new InvalidArgumentError('invalid callback')
  13180. }
  13181. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13182. throw new InvalidArgumentError('invalid highWaterMark')
  13183. }
  13184. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13185. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13186. }
  13187. if (method === 'CONNECT') {
  13188. throw new InvalidArgumentError('invalid method')
  13189. }
  13190. if (onInfo && typeof onInfo !== 'function') {
  13191. throw new InvalidArgumentError('invalid onInfo callback')
  13192. }
  13193. super('UNDICI_REQUEST')
  13194. } catch (err) {
  13195. if (util.isStream(body)) {
  13196. util.destroy(body.on('error', util.nop), err)
  13197. }
  13198. throw err
  13199. }
  13200. this.responseHeaders = responseHeaders || null
  13201. this.opaque = opaque || null
  13202. this.callback = callback
  13203. this.res = null
  13204. this.abort = null
  13205. this.body = body
  13206. this.trailers = {}
  13207. this.context = null
  13208. this.onInfo = onInfo || null
  13209. this.throwOnError = throwOnError
  13210. this.highWaterMark = highWaterMark
  13211. if (util.isStream(body)) {
  13212. body.on('error', (err) => {
  13213. this.onError(err)
  13214. })
  13215. }
  13216. addSignal(this, signal)
  13217. }
  13218. onConnect (abort, context) {
  13219. if (!this.callback) {
  13220. throw new RequestAbortedError()
  13221. }
  13222. this.abort = abort
  13223. this.context = context
  13224. }
  13225. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13226. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13227. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13228. if (statusCode < 200) {
  13229. if (this.onInfo) {
  13230. this.onInfo({ statusCode, headers })
  13231. }
  13232. return
  13233. }
  13234. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13235. const contentType = parsedHeaders['content-type']
  13236. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13237. this.callback = null
  13238. this.res = body
  13239. if (callback !== null) {
  13240. if (this.throwOnError && statusCode >= 400) {
  13241. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13242. { callback, body, contentType, statusCode, statusMessage, headers }
  13243. )
  13244. } else {
  13245. this.runInAsyncScope(callback, null, null, {
  13246. statusCode,
  13247. headers,
  13248. trailers: this.trailers,
  13249. opaque,
  13250. body,
  13251. context
  13252. })
  13253. }
  13254. }
  13255. }
  13256. onData (chunk) {
  13257. const { res } = this
  13258. return res.push(chunk)
  13259. }
  13260. onComplete (trailers) {
  13261. const { res } = this
  13262. removeSignal(this)
  13263. util.parseHeaders(trailers, this.trailers)
  13264. res.push(null)
  13265. }
  13266. onError (err) {
  13267. const { res, callback, body, opaque } = this
  13268. removeSignal(this)
  13269. if (callback) {
  13270. // TODO: Does this need queueMicrotask?
  13271. this.callback = null
  13272. queueMicrotask(() => {
  13273. this.runInAsyncScope(callback, null, err, { opaque })
  13274. })
  13275. }
  13276. if (res) {
  13277. this.res = null
  13278. // Ensure all queued handlers are invoked before destroying res.
  13279. queueMicrotask(() => {
  13280. util.destroy(res, err)
  13281. })
  13282. }
  13283. if (body) {
  13284. this.body = null
  13285. util.destroy(body, err)
  13286. }
  13287. }
  13288. }
  13289. function request (opts, callback) {
  13290. if (callback === undefined) {
  13291. return new Promise((resolve, reject) => {
  13292. request.call(this, opts, (err, data) => {
  13293. return err ? reject(err) : resolve(data)
  13294. })
  13295. })
  13296. }
  13297. try {
  13298. this.dispatch(opts, new RequestHandler(opts, callback))
  13299. } catch (err) {
  13300. if (typeof callback !== 'function') {
  13301. throw err
  13302. }
  13303. const opaque = opts && opts.opaque
  13304. queueMicrotask(() => callback(err, { opaque }))
  13305. }
  13306. }
  13307. module.exports = request
  13308. module.exports.RequestHandler = RequestHandler
  13309. /***/ }),
  13310. /***/ 5395:
  13311. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13312. "use strict";
  13313. const { finished, PassThrough } = __nccwpck_require__(2781)
  13314. const {
  13315. InvalidArgumentError,
  13316. InvalidReturnValueError,
  13317. RequestAbortedError
  13318. } = __nccwpck_require__(8045)
  13319. const util = __nccwpck_require__(3983)
  13320. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13321. const { AsyncResource } = __nccwpck_require__(852)
  13322. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13323. class StreamHandler extends AsyncResource {
  13324. constructor (opts, factory, callback) {
  13325. if (!opts || typeof opts !== 'object') {
  13326. throw new InvalidArgumentError('invalid opts')
  13327. }
  13328. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13329. try {
  13330. if (typeof callback !== 'function') {
  13331. throw new InvalidArgumentError('invalid callback')
  13332. }
  13333. if (typeof factory !== 'function') {
  13334. throw new InvalidArgumentError('invalid factory')
  13335. }
  13336. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13337. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13338. }
  13339. if (method === 'CONNECT') {
  13340. throw new InvalidArgumentError('invalid method')
  13341. }
  13342. if (onInfo && typeof onInfo !== 'function') {
  13343. throw new InvalidArgumentError('invalid onInfo callback')
  13344. }
  13345. super('UNDICI_STREAM')
  13346. } catch (err) {
  13347. if (util.isStream(body)) {
  13348. util.destroy(body.on('error', util.nop), err)
  13349. }
  13350. throw err
  13351. }
  13352. this.responseHeaders = responseHeaders || null
  13353. this.opaque = opaque || null
  13354. this.factory = factory
  13355. this.callback = callback
  13356. this.res = null
  13357. this.abort = null
  13358. this.context = null
  13359. this.trailers = null
  13360. this.body = body
  13361. this.onInfo = onInfo || null
  13362. this.throwOnError = throwOnError || false
  13363. if (util.isStream(body)) {
  13364. body.on('error', (err) => {
  13365. this.onError(err)
  13366. })
  13367. }
  13368. addSignal(this, signal)
  13369. }
  13370. onConnect (abort, context) {
  13371. if (!this.callback) {
  13372. throw new RequestAbortedError()
  13373. }
  13374. this.abort = abort
  13375. this.context = context
  13376. }
  13377. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13378. const { factory, opaque, context, callback, responseHeaders } = this
  13379. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13380. if (statusCode < 200) {
  13381. if (this.onInfo) {
  13382. this.onInfo({ statusCode, headers })
  13383. }
  13384. return
  13385. }
  13386. this.factory = null
  13387. let res
  13388. if (this.throwOnError && statusCode >= 400) {
  13389. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13390. const contentType = parsedHeaders['content-type']
  13391. res = new PassThrough()
  13392. this.callback = null
  13393. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13394. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13395. )
  13396. } else {
  13397. if (factory === null) {
  13398. return
  13399. }
  13400. res = this.runInAsyncScope(factory, null, {
  13401. statusCode,
  13402. headers,
  13403. opaque,
  13404. context
  13405. })
  13406. if (
  13407. !res ||
  13408. typeof res.write !== 'function' ||
  13409. typeof res.end !== 'function' ||
  13410. typeof res.on !== 'function'
  13411. ) {
  13412. throw new InvalidReturnValueError('expected Writable')
  13413. }
  13414. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13415. finished(res, { readable: false }, (err) => {
  13416. const { callback, res, opaque, trailers, abort } = this
  13417. this.res = null
  13418. if (err || !res.readable) {
  13419. util.destroy(res, err)
  13420. }
  13421. this.callback = null
  13422. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13423. if (err) {
  13424. abort()
  13425. }
  13426. })
  13427. }
  13428. res.on('drain', resume)
  13429. this.res = res
  13430. const needDrain = res.writableNeedDrain !== undefined
  13431. ? res.writableNeedDrain
  13432. : res._writableState && res._writableState.needDrain
  13433. return needDrain !== true
  13434. }
  13435. onData (chunk) {
  13436. const { res } = this
  13437. return res ? res.write(chunk) : true
  13438. }
  13439. onComplete (trailers) {
  13440. const { res } = this
  13441. removeSignal(this)
  13442. if (!res) {
  13443. return
  13444. }
  13445. this.trailers = util.parseHeaders(trailers)
  13446. res.end()
  13447. }
  13448. onError (err) {
  13449. const { res, callback, opaque, body } = this
  13450. removeSignal(this)
  13451. this.factory = null
  13452. if (res) {
  13453. this.res = null
  13454. util.destroy(res, err)
  13455. } else if (callback) {
  13456. this.callback = null
  13457. queueMicrotask(() => {
  13458. this.runInAsyncScope(callback, null, err, { opaque })
  13459. })
  13460. }
  13461. if (body) {
  13462. this.body = null
  13463. util.destroy(body, err)
  13464. }
  13465. }
  13466. }
  13467. function stream (opts, factory, callback) {
  13468. if (callback === undefined) {
  13469. return new Promise((resolve, reject) => {
  13470. stream.call(this, opts, factory, (err, data) => {
  13471. return err ? reject(err) : resolve(data)
  13472. })
  13473. })
  13474. }
  13475. try {
  13476. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13477. } catch (err) {
  13478. if (typeof callback !== 'function') {
  13479. throw err
  13480. }
  13481. const opaque = opts && opts.opaque
  13482. queueMicrotask(() => callback(err, { opaque }))
  13483. }
  13484. }
  13485. module.exports = stream
  13486. /***/ }),
  13487. /***/ 6923:
  13488. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13489. "use strict";
  13490. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13491. const { AsyncResource } = __nccwpck_require__(852)
  13492. const util = __nccwpck_require__(3983)
  13493. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13494. const assert = __nccwpck_require__(9491)
  13495. class UpgradeHandler extends AsyncResource {
  13496. constructor (opts, callback) {
  13497. if (!opts || typeof opts !== 'object') {
  13498. throw new InvalidArgumentError('invalid opts')
  13499. }
  13500. if (typeof callback !== 'function') {
  13501. throw new InvalidArgumentError('invalid callback')
  13502. }
  13503. const { signal, opaque, responseHeaders } = opts
  13504. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13505. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13506. }
  13507. super('UNDICI_UPGRADE')
  13508. this.responseHeaders = responseHeaders || null
  13509. this.opaque = opaque || null
  13510. this.callback = callback
  13511. this.abort = null
  13512. this.context = null
  13513. addSignal(this, signal)
  13514. }
  13515. onConnect (abort, context) {
  13516. if (!this.callback) {
  13517. throw new RequestAbortedError()
  13518. }
  13519. this.abort = abort
  13520. this.context = null
  13521. }
  13522. onHeaders () {
  13523. throw new SocketError('bad upgrade', null)
  13524. }
  13525. onUpgrade (statusCode, rawHeaders, socket) {
  13526. const { callback, opaque, context } = this
  13527. assert.strictEqual(statusCode, 101)
  13528. removeSignal(this)
  13529. this.callback = null
  13530. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13531. this.runInAsyncScope(callback, null, null, {
  13532. headers,
  13533. socket,
  13534. opaque,
  13535. context
  13536. })
  13537. }
  13538. onError (err) {
  13539. const { callback, opaque } = this
  13540. removeSignal(this)
  13541. if (callback) {
  13542. this.callback = null
  13543. queueMicrotask(() => {
  13544. this.runInAsyncScope(callback, null, err, { opaque })
  13545. })
  13546. }
  13547. }
  13548. }
  13549. function upgrade (opts, callback) {
  13550. if (callback === undefined) {
  13551. return new Promise((resolve, reject) => {
  13552. upgrade.call(this, opts, (err, data) => {
  13553. return err ? reject(err) : resolve(data)
  13554. })
  13555. })
  13556. }
  13557. try {
  13558. const upgradeHandler = new UpgradeHandler(opts, callback)
  13559. this.dispatch({
  13560. ...opts,
  13561. method: opts.method || 'GET',
  13562. upgrade: opts.protocol || 'Websocket'
  13563. }, upgradeHandler)
  13564. } catch (err) {
  13565. if (typeof callback !== 'function') {
  13566. throw err
  13567. }
  13568. const opaque = opts && opts.opaque
  13569. queueMicrotask(() => callback(err, { opaque }))
  13570. }
  13571. }
  13572. module.exports = upgrade
  13573. /***/ }),
  13574. /***/ 4059:
  13575. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13576. "use strict";
  13577. module.exports.request = __nccwpck_require__(5448)
  13578. module.exports.stream = __nccwpck_require__(5395)
  13579. module.exports.pipeline = __nccwpck_require__(8752)
  13580. module.exports.upgrade = __nccwpck_require__(6923)
  13581. module.exports.connect = __nccwpck_require__(9744)
  13582. /***/ }),
  13583. /***/ 3858:
  13584. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13585. "use strict";
  13586. // Ported from https://github.com/nodejs/undici/pull/907
  13587. const assert = __nccwpck_require__(9491)
  13588. const { Readable } = __nccwpck_require__(2781)
  13589. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13590. const util = __nccwpck_require__(3983)
  13591. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13592. let Blob
  13593. const kConsume = Symbol('kConsume')
  13594. const kReading = Symbol('kReading')
  13595. const kBody = Symbol('kBody')
  13596. const kAbort = Symbol('abort')
  13597. const kContentType = Symbol('kContentType')
  13598. const noop = () => {}
  13599. module.exports = class BodyReadable extends Readable {
  13600. constructor ({
  13601. resume,
  13602. abort,
  13603. contentType = '',
  13604. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13605. }) {
  13606. super({
  13607. autoDestroy: true,
  13608. read: resume,
  13609. highWaterMark
  13610. })
  13611. this._readableState.dataEmitted = false
  13612. this[kAbort] = abort
  13613. this[kConsume] = null
  13614. this[kBody] = null
  13615. this[kContentType] = contentType
  13616. // Is stream being consumed through Readable API?
  13617. // This is an optimization so that we avoid checking
  13618. // for 'data' and 'readable' listeners in the hot path
  13619. // inside push().
  13620. this[kReading] = false
  13621. }
  13622. destroy (err) {
  13623. if (this.destroyed) {
  13624. // Node < 16
  13625. return this
  13626. }
  13627. if (!err && !this._readableState.endEmitted) {
  13628. err = new RequestAbortedError()
  13629. }
  13630. if (err) {
  13631. this[kAbort]()
  13632. }
  13633. return super.destroy(err)
  13634. }
  13635. emit (ev, ...args) {
  13636. if (ev === 'data') {
  13637. // Node < 16.7
  13638. this._readableState.dataEmitted = true
  13639. } else if (ev === 'error') {
  13640. // Node < 16
  13641. this._readableState.errorEmitted = true
  13642. }
  13643. return super.emit(ev, ...args)
  13644. }
  13645. on (ev, ...args) {
  13646. if (ev === 'data' || ev === 'readable') {
  13647. this[kReading] = true
  13648. }
  13649. return super.on(ev, ...args)
  13650. }
  13651. addListener (ev, ...args) {
  13652. return this.on(ev, ...args)
  13653. }
  13654. off (ev, ...args) {
  13655. const ret = super.off(ev, ...args)
  13656. if (ev === 'data' || ev === 'readable') {
  13657. this[kReading] = (
  13658. this.listenerCount('data') > 0 ||
  13659. this.listenerCount('readable') > 0
  13660. )
  13661. }
  13662. return ret
  13663. }
  13664. removeListener (ev, ...args) {
  13665. return this.off(ev, ...args)
  13666. }
  13667. push (chunk) {
  13668. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13669. consumePush(this[kConsume], chunk)
  13670. return this[kReading] ? super.push(chunk) : true
  13671. }
  13672. return super.push(chunk)
  13673. }
  13674. // https://fetch.spec.whatwg.org/#dom-body-text
  13675. async text () {
  13676. return consume(this, 'text')
  13677. }
  13678. // https://fetch.spec.whatwg.org/#dom-body-json
  13679. async json () {
  13680. return consume(this, 'json')
  13681. }
  13682. // https://fetch.spec.whatwg.org/#dom-body-blob
  13683. async blob () {
  13684. return consume(this, 'blob')
  13685. }
  13686. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13687. async arrayBuffer () {
  13688. return consume(this, 'arrayBuffer')
  13689. }
  13690. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13691. async formData () {
  13692. // TODO: Implement.
  13693. throw new NotSupportedError()
  13694. }
  13695. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13696. get bodyUsed () {
  13697. return util.isDisturbed(this)
  13698. }
  13699. // https://fetch.spec.whatwg.org/#dom-body-body
  13700. get body () {
  13701. if (!this[kBody]) {
  13702. this[kBody] = ReadableStreamFrom(this)
  13703. if (this[kConsume]) {
  13704. // TODO: Is this the best way to force a lock?
  13705. this[kBody].getReader() // Ensure stream is locked.
  13706. assert(this[kBody].locked)
  13707. }
  13708. }
  13709. return this[kBody]
  13710. }
  13711. dump (opts) {
  13712. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13713. const signal = opts && opts.signal
  13714. if (signal) {
  13715. try {
  13716. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13717. throw new InvalidArgumentError('signal must be an AbortSignal')
  13718. }
  13719. util.throwIfAborted(signal)
  13720. } catch (err) {
  13721. return Promise.reject(err)
  13722. }
  13723. }
  13724. if (this.closed) {
  13725. return Promise.resolve(null)
  13726. }
  13727. return new Promise((resolve, reject) => {
  13728. const signalListenerCleanup = signal
  13729. ? util.addAbortListener(signal, () => {
  13730. this.destroy()
  13731. })
  13732. : noop
  13733. this
  13734. .on('close', function () {
  13735. signalListenerCleanup()
  13736. if (signal && signal.aborted) {
  13737. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  13738. } else {
  13739. resolve(null)
  13740. }
  13741. })
  13742. .on('error', noop)
  13743. .on('data', function (chunk) {
  13744. limit -= chunk.length
  13745. if (limit <= 0) {
  13746. this.destroy()
  13747. }
  13748. })
  13749. .resume()
  13750. })
  13751. }
  13752. }
  13753. // https://streams.spec.whatwg.org/#readablestream-locked
  13754. function isLocked (self) {
  13755. // Consume is an implicit lock.
  13756. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  13757. }
  13758. // https://fetch.spec.whatwg.org/#body-unusable
  13759. function isUnusable (self) {
  13760. return util.isDisturbed(self) || isLocked(self)
  13761. }
  13762. async function consume (stream, type) {
  13763. if (isUnusable(stream)) {
  13764. throw new TypeError('unusable')
  13765. }
  13766. assert(!stream[kConsume])
  13767. return new Promise((resolve, reject) => {
  13768. stream[kConsume] = {
  13769. type,
  13770. stream,
  13771. resolve,
  13772. reject,
  13773. length: 0,
  13774. body: []
  13775. }
  13776. stream
  13777. .on('error', function (err) {
  13778. consumeFinish(this[kConsume], err)
  13779. })
  13780. .on('close', function () {
  13781. if (this[kConsume].body !== null) {
  13782. consumeFinish(this[kConsume], new RequestAbortedError())
  13783. }
  13784. })
  13785. process.nextTick(consumeStart, stream[kConsume])
  13786. })
  13787. }
  13788. function consumeStart (consume) {
  13789. if (consume.body === null) {
  13790. return
  13791. }
  13792. const { _readableState: state } = consume.stream
  13793. for (const chunk of state.buffer) {
  13794. consumePush(consume, chunk)
  13795. }
  13796. if (state.endEmitted) {
  13797. consumeEnd(this[kConsume])
  13798. } else {
  13799. consume.stream.on('end', function () {
  13800. consumeEnd(this[kConsume])
  13801. })
  13802. }
  13803. consume.stream.resume()
  13804. while (consume.stream.read() != null) {
  13805. // Loop
  13806. }
  13807. }
  13808. function consumeEnd (consume) {
  13809. const { type, body, resolve, stream, length } = consume
  13810. try {
  13811. if (type === 'text') {
  13812. resolve(toUSVString(Buffer.concat(body)))
  13813. } else if (type === 'json') {
  13814. resolve(JSON.parse(Buffer.concat(body)))
  13815. } else if (type === 'arrayBuffer') {
  13816. const dst = new Uint8Array(length)
  13817. let pos = 0
  13818. for (const buf of body) {
  13819. dst.set(buf, pos)
  13820. pos += buf.byteLength
  13821. }
  13822. resolve(dst.buffer)
  13823. } else if (type === 'blob') {
  13824. if (!Blob) {
  13825. Blob = (__nccwpck_require__(4300).Blob)
  13826. }
  13827. resolve(new Blob(body, { type: stream[kContentType] }))
  13828. }
  13829. consumeFinish(consume)
  13830. } catch (err) {
  13831. stream.destroy(err)
  13832. }
  13833. }
  13834. function consumePush (consume, chunk) {
  13835. consume.length += chunk.length
  13836. consume.body.push(chunk)
  13837. }
  13838. function consumeFinish (consume, err) {
  13839. if (consume.body === null) {
  13840. return
  13841. }
  13842. if (err) {
  13843. consume.reject(err)
  13844. } else {
  13845. consume.resolve()
  13846. }
  13847. consume.type = null
  13848. consume.stream = null
  13849. consume.resolve = null
  13850. consume.reject = null
  13851. consume.length = 0
  13852. consume.body = null
  13853. }
  13854. /***/ }),
  13855. /***/ 7474:
  13856. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13857. const assert = __nccwpck_require__(9491)
  13858. const {
  13859. ResponseStatusCodeError
  13860. } = __nccwpck_require__(8045)
  13861. const { toUSVString } = __nccwpck_require__(3983)
  13862. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  13863. assert(body)
  13864. let chunks = []
  13865. let limit = 0
  13866. for await (const chunk of body) {
  13867. chunks.push(chunk)
  13868. limit += chunk.length
  13869. if (limit > 128 * 1024) {
  13870. chunks = null
  13871. break
  13872. }
  13873. }
  13874. if (statusCode === 204 || !contentType || !chunks) {
  13875. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13876. return
  13877. }
  13878. try {
  13879. if (contentType.startsWith('application/json')) {
  13880. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  13881. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13882. return
  13883. }
  13884. if (contentType.startsWith('text/')) {
  13885. const payload = toUSVString(Buffer.concat(chunks))
  13886. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13887. return
  13888. }
  13889. } catch (err) {
  13890. // Process in a fallback if error
  13891. }
  13892. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13893. }
  13894. module.exports = { getResolveErrorBodyCallback }
  13895. /***/ }),
  13896. /***/ 7931:
  13897. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13898. "use strict";
  13899. const {
  13900. BalancedPoolMissingUpstreamError,
  13901. InvalidArgumentError
  13902. } = __nccwpck_require__(8045)
  13903. const {
  13904. PoolBase,
  13905. kClients,
  13906. kNeedDrain,
  13907. kAddClient,
  13908. kRemoveClient,
  13909. kGetDispatcher
  13910. } = __nccwpck_require__(3198)
  13911. const Pool = __nccwpck_require__(4634)
  13912. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  13913. const { parseOrigin } = __nccwpck_require__(3983)
  13914. const kFactory = Symbol('factory')
  13915. const kOptions = Symbol('options')
  13916. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  13917. const kCurrentWeight = Symbol('kCurrentWeight')
  13918. const kIndex = Symbol('kIndex')
  13919. const kWeight = Symbol('kWeight')
  13920. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  13921. const kErrorPenalty = Symbol('kErrorPenalty')
  13922. function getGreatestCommonDivisor (a, b) {
  13923. if (b === 0) return a
  13924. return getGreatestCommonDivisor(b, a % b)
  13925. }
  13926. function defaultFactory (origin, opts) {
  13927. return new Pool(origin, opts)
  13928. }
  13929. class BalancedPool extends PoolBase {
  13930. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  13931. super()
  13932. this[kOptions] = opts
  13933. this[kIndex] = -1
  13934. this[kCurrentWeight] = 0
  13935. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  13936. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  13937. if (!Array.isArray(upstreams)) {
  13938. upstreams = [upstreams]
  13939. }
  13940. if (typeof factory !== 'function') {
  13941. throw new InvalidArgumentError('factory must be a function.')
  13942. }
  13943. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  13944. ? opts.interceptors.BalancedPool
  13945. : []
  13946. this[kFactory] = factory
  13947. for (const upstream of upstreams) {
  13948. this.addUpstream(upstream)
  13949. }
  13950. this._updateBalancedPoolStats()
  13951. }
  13952. addUpstream (upstream) {
  13953. const upstreamOrigin = parseOrigin(upstream).origin
  13954. if (this[kClients].find((pool) => (
  13955. pool[kUrl].origin === upstreamOrigin &&
  13956. pool.closed !== true &&
  13957. pool.destroyed !== true
  13958. ))) {
  13959. return this
  13960. }
  13961. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  13962. this[kAddClient](pool)
  13963. pool.on('connect', () => {
  13964. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  13965. })
  13966. pool.on('connectionError', () => {
  13967. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13968. this._updateBalancedPoolStats()
  13969. })
  13970. pool.on('disconnect', (...args) => {
  13971. const err = args[2]
  13972. if (err && err.code === 'UND_ERR_SOCKET') {
  13973. // decrease the weight of the pool.
  13974. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13975. this._updateBalancedPoolStats()
  13976. }
  13977. })
  13978. for (const client of this[kClients]) {
  13979. client[kWeight] = this[kMaxWeightPerServer]
  13980. }
  13981. this._updateBalancedPoolStats()
  13982. return this
  13983. }
  13984. _updateBalancedPoolStats () {
  13985. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  13986. }
  13987. removeUpstream (upstream) {
  13988. const upstreamOrigin = parseOrigin(upstream).origin
  13989. const pool = this[kClients].find((pool) => (
  13990. pool[kUrl].origin === upstreamOrigin &&
  13991. pool.closed !== true &&
  13992. pool.destroyed !== true
  13993. ))
  13994. if (pool) {
  13995. this[kRemoveClient](pool)
  13996. }
  13997. return this
  13998. }
  13999. get upstreams () {
  14000. return this[kClients]
  14001. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14002. .map((p) => p[kUrl].origin)
  14003. }
  14004. [kGetDispatcher] () {
  14005. // We validate that pools is greater than 0,
  14006. // otherwise we would have to wait until an upstream
  14007. // is added, which might never happen.
  14008. if (this[kClients].length === 0) {
  14009. throw new BalancedPoolMissingUpstreamError()
  14010. }
  14011. const dispatcher = this[kClients].find(dispatcher => (
  14012. !dispatcher[kNeedDrain] &&
  14013. dispatcher.closed !== true &&
  14014. dispatcher.destroyed !== true
  14015. ))
  14016. if (!dispatcher) {
  14017. return
  14018. }
  14019. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14020. if (allClientsBusy) {
  14021. return
  14022. }
  14023. let counter = 0
  14024. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14025. while (counter++ < this[kClients].length) {
  14026. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14027. const pool = this[kClients][this[kIndex]]
  14028. // find pool index with the largest weight
  14029. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14030. maxWeightIndex = this[kIndex]
  14031. }
  14032. // decrease the current weight every `this[kClients].length`.
  14033. if (this[kIndex] === 0) {
  14034. // Set the current weight to the next lower weight.
  14035. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14036. if (this[kCurrentWeight] <= 0) {
  14037. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14038. }
  14039. }
  14040. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14041. return pool
  14042. }
  14043. }
  14044. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14045. this[kIndex] = maxWeightIndex
  14046. return this[kClients][maxWeightIndex]
  14047. }
  14048. }
  14049. module.exports = BalancedPool
  14050. /***/ }),
  14051. /***/ 6101:
  14052. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14053. "use strict";
  14054. const { kConstruct } = __nccwpck_require__(9174)
  14055. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14056. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14057. const { kHeadersList } = __nccwpck_require__(2785)
  14058. const { webidl } = __nccwpck_require__(1744)
  14059. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14060. const { Request } = __nccwpck_require__(8359)
  14061. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14062. const { fetching } = __nccwpck_require__(4881)
  14063. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14064. const assert = __nccwpck_require__(9491)
  14065. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14066. /**
  14067. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14068. * @typedef {Object} CacheBatchOperation
  14069. * @property {'delete' | 'put'} type
  14070. * @property {any} request
  14071. * @property {any} response
  14072. * @property {import('../../types/cache').CacheQueryOptions} options
  14073. */
  14074. /**
  14075. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14076. * @typedef {[any, any][]} requestResponseList
  14077. */
  14078. class Cache {
  14079. /**
  14080. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14081. * @type {requestResponseList}
  14082. */
  14083. #relevantRequestResponseList
  14084. constructor () {
  14085. if (arguments[0] !== kConstruct) {
  14086. webidl.illegalConstructor()
  14087. }
  14088. this.#relevantRequestResponseList = arguments[1]
  14089. }
  14090. async match (request, options = {}) {
  14091. webidl.brandCheck(this, Cache)
  14092. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14093. request = webidl.converters.RequestInfo(request)
  14094. options = webidl.converters.CacheQueryOptions(options)
  14095. const p = await this.matchAll(request, options)
  14096. if (p.length === 0) {
  14097. return
  14098. }
  14099. return p[0]
  14100. }
  14101. async matchAll (request = undefined, options = {}) {
  14102. webidl.brandCheck(this, Cache)
  14103. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14104. options = webidl.converters.CacheQueryOptions(options)
  14105. // 1.
  14106. let r = null
  14107. // 2.
  14108. if (request !== undefined) {
  14109. if (request instanceof Request) {
  14110. // 2.1.1
  14111. r = request[kState]
  14112. // 2.1.2
  14113. if (r.method !== 'GET' && !options.ignoreMethod) {
  14114. return []
  14115. }
  14116. } else if (typeof request === 'string') {
  14117. // 2.2.1
  14118. r = new Request(request)[kState]
  14119. }
  14120. }
  14121. // 5.
  14122. // 5.1
  14123. const responses = []
  14124. // 5.2
  14125. if (request === undefined) {
  14126. // 5.2.1
  14127. for (const requestResponse of this.#relevantRequestResponseList) {
  14128. responses.push(requestResponse[1])
  14129. }
  14130. } else { // 5.3
  14131. // 5.3.1
  14132. const requestResponses = this.#queryCache(r, options)
  14133. // 5.3.2
  14134. for (const requestResponse of requestResponses) {
  14135. responses.push(requestResponse[1])
  14136. }
  14137. }
  14138. // 5.4
  14139. // We don't implement CORs so we don't need to loop over the responses, yay!
  14140. // 5.5.1
  14141. const responseList = []
  14142. // 5.5.2
  14143. for (const response of responses) {
  14144. // 5.5.2.1
  14145. const responseObject = new Response(response.body?.source ?? null)
  14146. const body = responseObject[kState].body
  14147. responseObject[kState] = response
  14148. responseObject[kState].body = body
  14149. responseObject[kHeaders][kHeadersList] = response.headersList
  14150. responseObject[kHeaders][kGuard] = 'immutable'
  14151. responseList.push(responseObject)
  14152. }
  14153. // 6.
  14154. return Object.freeze(responseList)
  14155. }
  14156. async add (request) {
  14157. webidl.brandCheck(this, Cache)
  14158. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14159. request = webidl.converters.RequestInfo(request)
  14160. // 1.
  14161. const requests = [request]
  14162. // 2.
  14163. const responseArrayPromise = this.addAll(requests)
  14164. // 3.
  14165. return await responseArrayPromise
  14166. }
  14167. async addAll (requests) {
  14168. webidl.brandCheck(this, Cache)
  14169. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14170. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14171. // 1.
  14172. const responsePromises = []
  14173. // 2.
  14174. const requestList = []
  14175. // 3.
  14176. for (const request of requests) {
  14177. if (typeof request === 'string') {
  14178. continue
  14179. }
  14180. // 3.1
  14181. const r = request[kState]
  14182. // 3.2
  14183. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14184. throw webidl.errors.exception({
  14185. header: 'Cache.addAll',
  14186. message: 'Expected http/s scheme when method is not GET.'
  14187. })
  14188. }
  14189. }
  14190. // 4.
  14191. /** @type {ReturnType<typeof fetching>[]} */
  14192. const fetchControllers = []
  14193. // 5.
  14194. for (const request of requests) {
  14195. // 5.1
  14196. const r = new Request(request)[kState]
  14197. // 5.2
  14198. if (!urlIsHttpHttpsScheme(r.url)) {
  14199. throw webidl.errors.exception({
  14200. header: 'Cache.addAll',
  14201. message: 'Expected http/s scheme.'
  14202. })
  14203. }
  14204. // 5.4
  14205. r.initiator = 'fetch'
  14206. r.destination = 'subresource'
  14207. // 5.5
  14208. requestList.push(r)
  14209. // 5.6
  14210. const responsePromise = createDeferredPromise()
  14211. // 5.7
  14212. fetchControllers.push(fetching({
  14213. request: r,
  14214. dispatcher: getGlobalDispatcher(),
  14215. processResponse (response) {
  14216. // 1.
  14217. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14218. responsePromise.reject(webidl.errors.exception({
  14219. header: 'Cache.addAll',
  14220. message: 'Received an invalid status code or the request failed.'
  14221. }))
  14222. } else if (response.headersList.contains('vary')) { // 2.
  14223. // 2.1
  14224. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14225. // 2.2
  14226. for (const fieldValue of fieldValues) {
  14227. // 2.2.1
  14228. if (fieldValue === '*') {
  14229. responsePromise.reject(webidl.errors.exception({
  14230. header: 'Cache.addAll',
  14231. message: 'invalid vary field value'
  14232. }))
  14233. for (const controller of fetchControllers) {
  14234. controller.abort()
  14235. }
  14236. return
  14237. }
  14238. }
  14239. }
  14240. },
  14241. processResponseEndOfBody (response) {
  14242. // 1.
  14243. if (response.aborted) {
  14244. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14245. return
  14246. }
  14247. // 2.
  14248. responsePromise.resolve(response)
  14249. }
  14250. }))
  14251. // 5.8
  14252. responsePromises.push(responsePromise.promise)
  14253. }
  14254. // 6.
  14255. const p = Promise.all(responsePromises)
  14256. // 7.
  14257. const responses = await p
  14258. // 7.1
  14259. const operations = []
  14260. // 7.2
  14261. let index = 0
  14262. // 7.3
  14263. for (const response of responses) {
  14264. // 7.3.1
  14265. /** @type {CacheBatchOperation} */
  14266. const operation = {
  14267. type: 'put', // 7.3.2
  14268. request: requestList[index], // 7.3.3
  14269. response // 7.3.4
  14270. }
  14271. operations.push(operation) // 7.3.5
  14272. index++ // 7.3.6
  14273. }
  14274. // 7.5
  14275. const cacheJobPromise = createDeferredPromise()
  14276. // 7.6.1
  14277. let errorData = null
  14278. // 7.6.2
  14279. try {
  14280. this.#batchCacheOperations(operations)
  14281. } catch (e) {
  14282. errorData = e
  14283. }
  14284. // 7.6.3
  14285. queueMicrotask(() => {
  14286. // 7.6.3.1
  14287. if (errorData === null) {
  14288. cacheJobPromise.resolve(undefined)
  14289. } else {
  14290. // 7.6.3.2
  14291. cacheJobPromise.reject(errorData)
  14292. }
  14293. })
  14294. // 7.7
  14295. return cacheJobPromise.promise
  14296. }
  14297. async put (request, response) {
  14298. webidl.brandCheck(this, Cache)
  14299. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14300. request = webidl.converters.RequestInfo(request)
  14301. response = webidl.converters.Response(response)
  14302. // 1.
  14303. let innerRequest = null
  14304. // 2.
  14305. if (request instanceof Request) {
  14306. innerRequest = request[kState]
  14307. } else { // 3.
  14308. innerRequest = new Request(request)[kState]
  14309. }
  14310. // 4.
  14311. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14312. throw webidl.errors.exception({
  14313. header: 'Cache.put',
  14314. message: 'Expected an http/s scheme when method is not GET'
  14315. })
  14316. }
  14317. // 5.
  14318. const innerResponse = response[kState]
  14319. // 6.
  14320. if (innerResponse.status === 206) {
  14321. throw webidl.errors.exception({
  14322. header: 'Cache.put',
  14323. message: 'Got 206 status'
  14324. })
  14325. }
  14326. // 7.
  14327. if (innerResponse.headersList.contains('vary')) {
  14328. // 7.1.
  14329. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14330. // 7.2.
  14331. for (const fieldValue of fieldValues) {
  14332. // 7.2.1
  14333. if (fieldValue === '*') {
  14334. throw webidl.errors.exception({
  14335. header: 'Cache.put',
  14336. message: 'Got * vary field value'
  14337. })
  14338. }
  14339. }
  14340. }
  14341. // 8.
  14342. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14343. throw webidl.errors.exception({
  14344. header: 'Cache.put',
  14345. message: 'Response body is locked or disturbed'
  14346. })
  14347. }
  14348. // 9.
  14349. const clonedResponse = cloneResponse(innerResponse)
  14350. // 10.
  14351. const bodyReadPromise = createDeferredPromise()
  14352. // 11.
  14353. if (innerResponse.body != null) {
  14354. // 11.1
  14355. const stream = innerResponse.body.stream
  14356. // 11.2
  14357. const reader = stream.getReader()
  14358. // 11.3
  14359. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14360. } else {
  14361. bodyReadPromise.resolve(undefined)
  14362. }
  14363. // 12.
  14364. /** @type {CacheBatchOperation[]} */
  14365. const operations = []
  14366. // 13.
  14367. /** @type {CacheBatchOperation} */
  14368. const operation = {
  14369. type: 'put', // 14.
  14370. request: innerRequest, // 15.
  14371. response: clonedResponse // 16.
  14372. }
  14373. // 17.
  14374. operations.push(operation)
  14375. // 19.
  14376. const bytes = await bodyReadPromise.promise
  14377. if (clonedResponse.body != null) {
  14378. clonedResponse.body.source = bytes
  14379. }
  14380. // 19.1
  14381. const cacheJobPromise = createDeferredPromise()
  14382. // 19.2.1
  14383. let errorData = null
  14384. // 19.2.2
  14385. try {
  14386. this.#batchCacheOperations(operations)
  14387. } catch (e) {
  14388. errorData = e
  14389. }
  14390. // 19.2.3
  14391. queueMicrotask(() => {
  14392. // 19.2.3.1
  14393. if (errorData === null) {
  14394. cacheJobPromise.resolve()
  14395. } else { // 19.2.3.2
  14396. cacheJobPromise.reject(errorData)
  14397. }
  14398. })
  14399. return cacheJobPromise.promise
  14400. }
  14401. async delete (request, options = {}) {
  14402. webidl.brandCheck(this, Cache)
  14403. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14404. request = webidl.converters.RequestInfo(request)
  14405. options = webidl.converters.CacheQueryOptions(options)
  14406. /**
  14407. * @type {Request}
  14408. */
  14409. let r = null
  14410. if (request instanceof Request) {
  14411. r = request[kState]
  14412. if (r.method !== 'GET' && !options.ignoreMethod) {
  14413. return false
  14414. }
  14415. } else {
  14416. assert(typeof request === 'string')
  14417. r = new Request(request)[kState]
  14418. }
  14419. /** @type {CacheBatchOperation[]} */
  14420. const operations = []
  14421. /** @type {CacheBatchOperation} */
  14422. const operation = {
  14423. type: 'delete',
  14424. request: r,
  14425. options
  14426. }
  14427. operations.push(operation)
  14428. const cacheJobPromise = createDeferredPromise()
  14429. let errorData = null
  14430. let requestResponses
  14431. try {
  14432. requestResponses = this.#batchCacheOperations(operations)
  14433. } catch (e) {
  14434. errorData = e
  14435. }
  14436. queueMicrotask(() => {
  14437. if (errorData === null) {
  14438. cacheJobPromise.resolve(!!requestResponses?.length)
  14439. } else {
  14440. cacheJobPromise.reject(errorData)
  14441. }
  14442. })
  14443. return cacheJobPromise.promise
  14444. }
  14445. /**
  14446. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14447. * @param {any} request
  14448. * @param {import('../../types/cache').CacheQueryOptions} options
  14449. * @returns {readonly Request[]}
  14450. */
  14451. async keys (request = undefined, options = {}) {
  14452. webidl.brandCheck(this, Cache)
  14453. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14454. options = webidl.converters.CacheQueryOptions(options)
  14455. // 1.
  14456. let r = null
  14457. // 2.
  14458. if (request !== undefined) {
  14459. // 2.1
  14460. if (request instanceof Request) {
  14461. // 2.1.1
  14462. r = request[kState]
  14463. // 2.1.2
  14464. if (r.method !== 'GET' && !options.ignoreMethod) {
  14465. return []
  14466. }
  14467. } else if (typeof request === 'string') { // 2.2
  14468. r = new Request(request)[kState]
  14469. }
  14470. }
  14471. // 4.
  14472. const promise = createDeferredPromise()
  14473. // 5.
  14474. // 5.1
  14475. const requests = []
  14476. // 5.2
  14477. if (request === undefined) {
  14478. // 5.2.1
  14479. for (const requestResponse of this.#relevantRequestResponseList) {
  14480. // 5.2.1.1
  14481. requests.push(requestResponse[0])
  14482. }
  14483. } else { // 5.3
  14484. // 5.3.1
  14485. const requestResponses = this.#queryCache(r, options)
  14486. // 5.3.2
  14487. for (const requestResponse of requestResponses) {
  14488. // 5.3.2.1
  14489. requests.push(requestResponse[0])
  14490. }
  14491. }
  14492. // 5.4
  14493. queueMicrotask(() => {
  14494. // 5.4.1
  14495. const requestList = []
  14496. // 5.4.2
  14497. for (const request of requests) {
  14498. const requestObject = new Request('https://a')
  14499. requestObject[kState] = request
  14500. requestObject[kHeaders][kHeadersList] = request.headersList
  14501. requestObject[kHeaders][kGuard] = 'immutable'
  14502. requestObject[kRealm] = request.client
  14503. // 5.4.2.1
  14504. requestList.push(requestObject)
  14505. }
  14506. // 5.4.3
  14507. promise.resolve(Object.freeze(requestList))
  14508. })
  14509. return promise.promise
  14510. }
  14511. /**
  14512. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14513. * @param {CacheBatchOperation[]} operations
  14514. * @returns {requestResponseList}
  14515. */
  14516. #batchCacheOperations (operations) {
  14517. // 1.
  14518. const cache = this.#relevantRequestResponseList
  14519. // 2.
  14520. const backupCache = [...cache]
  14521. // 3.
  14522. const addedItems = []
  14523. // 4.1
  14524. const resultList = []
  14525. try {
  14526. // 4.2
  14527. for (const operation of operations) {
  14528. // 4.2.1
  14529. if (operation.type !== 'delete' && operation.type !== 'put') {
  14530. throw webidl.errors.exception({
  14531. header: 'Cache.#batchCacheOperations',
  14532. message: 'operation type does not match "delete" or "put"'
  14533. })
  14534. }
  14535. // 4.2.2
  14536. if (operation.type === 'delete' && operation.response != null) {
  14537. throw webidl.errors.exception({
  14538. header: 'Cache.#batchCacheOperations',
  14539. message: 'delete operation should not have an associated response'
  14540. })
  14541. }
  14542. // 4.2.3
  14543. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14544. throw new DOMException('???', 'InvalidStateError')
  14545. }
  14546. // 4.2.4
  14547. let requestResponses
  14548. // 4.2.5
  14549. if (operation.type === 'delete') {
  14550. // 4.2.5.1
  14551. requestResponses = this.#queryCache(operation.request, operation.options)
  14552. // TODO: the spec is wrong, this is needed to pass WPTs
  14553. if (requestResponses.length === 0) {
  14554. return []
  14555. }
  14556. // 4.2.5.2
  14557. for (const requestResponse of requestResponses) {
  14558. const idx = cache.indexOf(requestResponse)
  14559. assert(idx !== -1)
  14560. // 4.2.5.2.1
  14561. cache.splice(idx, 1)
  14562. }
  14563. } else if (operation.type === 'put') { // 4.2.6
  14564. // 4.2.6.1
  14565. if (operation.response == null) {
  14566. throw webidl.errors.exception({
  14567. header: 'Cache.#batchCacheOperations',
  14568. message: 'put operation should have an associated response'
  14569. })
  14570. }
  14571. // 4.2.6.2
  14572. const r = operation.request
  14573. // 4.2.6.3
  14574. if (!urlIsHttpHttpsScheme(r.url)) {
  14575. throw webidl.errors.exception({
  14576. header: 'Cache.#batchCacheOperations',
  14577. message: 'expected http or https scheme'
  14578. })
  14579. }
  14580. // 4.2.6.4
  14581. if (r.method !== 'GET') {
  14582. throw webidl.errors.exception({
  14583. header: 'Cache.#batchCacheOperations',
  14584. message: 'not get method'
  14585. })
  14586. }
  14587. // 4.2.6.5
  14588. if (operation.options != null) {
  14589. throw webidl.errors.exception({
  14590. header: 'Cache.#batchCacheOperations',
  14591. message: 'options must not be defined'
  14592. })
  14593. }
  14594. // 4.2.6.6
  14595. requestResponses = this.#queryCache(operation.request)
  14596. // 4.2.6.7
  14597. for (const requestResponse of requestResponses) {
  14598. const idx = cache.indexOf(requestResponse)
  14599. assert(idx !== -1)
  14600. // 4.2.6.7.1
  14601. cache.splice(idx, 1)
  14602. }
  14603. // 4.2.6.8
  14604. cache.push([operation.request, operation.response])
  14605. // 4.2.6.10
  14606. addedItems.push([operation.request, operation.response])
  14607. }
  14608. // 4.2.7
  14609. resultList.push([operation.request, operation.response])
  14610. }
  14611. // 4.3
  14612. return resultList
  14613. } catch (e) { // 5.
  14614. // 5.1
  14615. this.#relevantRequestResponseList.length = 0
  14616. // 5.2
  14617. this.#relevantRequestResponseList = backupCache
  14618. // 5.3
  14619. throw e
  14620. }
  14621. }
  14622. /**
  14623. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14624. * @param {any} requestQuery
  14625. * @param {import('../../types/cache').CacheQueryOptions} options
  14626. * @param {requestResponseList} targetStorage
  14627. * @returns {requestResponseList}
  14628. */
  14629. #queryCache (requestQuery, options, targetStorage) {
  14630. /** @type {requestResponseList} */
  14631. const resultList = []
  14632. const storage = targetStorage ?? this.#relevantRequestResponseList
  14633. for (const requestResponse of storage) {
  14634. const [cachedRequest, cachedResponse] = requestResponse
  14635. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14636. resultList.push(requestResponse)
  14637. }
  14638. }
  14639. return resultList
  14640. }
  14641. /**
  14642. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14643. * @param {any} requestQuery
  14644. * @param {any} request
  14645. * @param {any | null} response
  14646. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14647. * @returns {boolean}
  14648. */
  14649. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14650. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14651. // return false
  14652. // }
  14653. const queryURL = new URL(requestQuery.url)
  14654. const cachedURL = new URL(request.url)
  14655. if (options?.ignoreSearch) {
  14656. cachedURL.search = ''
  14657. queryURL.search = ''
  14658. }
  14659. if (!urlEquals(queryURL, cachedURL, true)) {
  14660. return false
  14661. }
  14662. if (
  14663. response == null ||
  14664. options?.ignoreVary ||
  14665. !response.headersList.contains('vary')
  14666. ) {
  14667. return true
  14668. }
  14669. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14670. for (const fieldValue of fieldValues) {
  14671. if (fieldValue === '*') {
  14672. return false
  14673. }
  14674. const requestValue = request.headersList.get(fieldValue)
  14675. const queryValue = requestQuery.headersList.get(fieldValue)
  14676. // If one has the header and the other doesn't, or one has
  14677. // a different value than the other, return false
  14678. if (requestValue !== queryValue) {
  14679. return false
  14680. }
  14681. }
  14682. return true
  14683. }
  14684. }
  14685. Object.defineProperties(Cache.prototype, {
  14686. [Symbol.toStringTag]: {
  14687. value: 'Cache',
  14688. configurable: true
  14689. },
  14690. match: kEnumerableProperty,
  14691. matchAll: kEnumerableProperty,
  14692. add: kEnumerableProperty,
  14693. addAll: kEnumerableProperty,
  14694. put: kEnumerableProperty,
  14695. delete: kEnumerableProperty,
  14696. keys: kEnumerableProperty
  14697. })
  14698. const cacheQueryOptionConverters = [
  14699. {
  14700. key: 'ignoreSearch',
  14701. converter: webidl.converters.boolean,
  14702. defaultValue: false
  14703. },
  14704. {
  14705. key: 'ignoreMethod',
  14706. converter: webidl.converters.boolean,
  14707. defaultValue: false
  14708. },
  14709. {
  14710. key: 'ignoreVary',
  14711. converter: webidl.converters.boolean,
  14712. defaultValue: false
  14713. }
  14714. ]
  14715. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14716. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14717. ...cacheQueryOptionConverters,
  14718. {
  14719. key: 'cacheName',
  14720. converter: webidl.converters.DOMString
  14721. }
  14722. ])
  14723. webidl.converters.Response = webidl.interfaceConverter(Response)
  14724. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14725. webidl.converters.RequestInfo
  14726. )
  14727. module.exports = {
  14728. Cache
  14729. }
  14730. /***/ }),
  14731. /***/ 7907:
  14732. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14733. "use strict";
  14734. const { kConstruct } = __nccwpck_require__(9174)
  14735. const { Cache } = __nccwpck_require__(6101)
  14736. const { webidl } = __nccwpck_require__(1744)
  14737. const { kEnumerableProperty } = __nccwpck_require__(3983)
  14738. class CacheStorage {
  14739. /**
  14740. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  14741. * @type {Map<string, import('./cache').requestResponseList}
  14742. */
  14743. #caches = new Map()
  14744. constructor () {
  14745. if (arguments[0] !== kConstruct) {
  14746. webidl.illegalConstructor()
  14747. }
  14748. }
  14749. async match (request, options = {}) {
  14750. webidl.brandCheck(this, CacheStorage)
  14751. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  14752. request = webidl.converters.RequestInfo(request)
  14753. options = webidl.converters.MultiCacheQueryOptions(options)
  14754. // 1.
  14755. if (options.cacheName != null) {
  14756. // 1.1.1.1
  14757. if (this.#caches.has(options.cacheName)) {
  14758. // 1.1.1.1.1
  14759. const cacheList = this.#caches.get(options.cacheName)
  14760. const cache = new Cache(kConstruct, cacheList)
  14761. return await cache.match(request, options)
  14762. }
  14763. } else { // 2.
  14764. // 2.2
  14765. for (const cacheList of this.#caches.values()) {
  14766. const cache = new Cache(kConstruct, cacheList)
  14767. // 2.2.1.2
  14768. const response = await cache.match(request, options)
  14769. if (response !== undefined) {
  14770. return response
  14771. }
  14772. }
  14773. }
  14774. }
  14775. /**
  14776. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  14777. * @param {string} cacheName
  14778. * @returns {Promise<boolean>}
  14779. */
  14780. async has (cacheName) {
  14781. webidl.brandCheck(this, CacheStorage)
  14782. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  14783. cacheName = webidl.converters.DOMString(cacheName)
  14784. // 2.1.1
  14785. // 2.2
  14786. return this.#caches.has(cacheName)
  14787. }
  14788. /**
  14789. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  14790. * @param {string} cacheName
  14791. * @returns {Promise<Cache>}
  14792. */
  14793. async open (cacheName) {
  14794. webidl.brandCheck(this, CacheStorage)
  14795. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  14796. cacheName = webidl.converters.DOMString(cacheName)
  14797. // 2.1
  14798. if (this.#caches.has(cacheName)) {
  14799. // await caches.open('v1') !== await caches.open('v1')
  14800. // 2.1.1
  14801. const cache = this.#caches.get(cacheName)
  14802. // 2.1.1.1
  14803. return new Cache(kConstruct, cache)
  14804. }
  14805. // 2.2
  14806. const cache = []
  14807. // 2.3
  14808. this.#caches.set(cacheName, cache)
  14809. // 2.4
  14810. return new Cache(kConstruct, cache)
  14811. }
  14812. /**
  14813. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  14814. * @param {string} cacheName
  14815. * @returns {Promise<boolean>}
  14816. */
  14817. async delete (cacheName) {
  14818. webidl.brandCheck(this, CacheStorage)
  14819. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  14820. cacheName = webidl.converters.DOMString(cacheName)
  14821. return this.#caches.delete(cacheName)
  14822. }
  14823. /**
  14824. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  14825. * @returns {string[]}
  14826. */
  14827. async keys () {
  14828. webidl.brandCheck(this, CacheStorage)
  14829. // 2.1
  14830. const keys = this.#caches.keys()
  14831. // 2.2
  14832. return [...keys]
  14833. }
  14834. }
  14835. Object.defineProperties(CacheStorage.prototype, {
  14836. [Symbol.toStringTag]: {
  14837. value: 'CacheStorage',
  14838. configurable: true
  14839. },
  14840. match: kEnumerableProperty,
  14841. has: kEnumerableProperty,
  14842. open: kEnumerableProperty,
  14843. delete: kEnumerableProperty,
  14844. keys: kEnumerableProperty
  14845. })
  14846. module.exports = {
  14847. CacheStorage
  14848. }
  14849. /***/ }),
  14850. /***/ 9174:
  14851. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14852. "use strict";
  14853. module.exports = {
  14854. kConstruct: (__nccwpck_require__(2785).kConstruct)
  14855. }
  14856. /***/ }),
  14857. /***/ 2396:
  14858. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14859. "use strict";
  14860. const assert = __nccwpck_require__(9491)
  14861. const { URLSerializer } = __nccwpck_require__(685)
  14862. const { isValidHeaderName } = __nccwpck_require__(2538)
  14863. /**
  14864. * @see https://url.spec.whatwg.org/#concept-url-equals
  14865. * @param {URL} A
  14866. * @param {URL} B
  14867. * @param {boolean | undefined} excludeFragment
  14868. * @returns {boolean}
  14869. */
  14870. function urlEquals (A, B, excludeFragment = false) {
  14871. const serializedA = URLSerializer(A, excludeFragment)
  14872. const serializedB = URLSerializer(B, excludeFragment)
  14873. return serializedA === serializedB
  14874. }
  14875. /**
  14876. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  14877. * @param {string} header
  14878. */
  14879. function fieldValues (header) {
  14880. assert(header !== null)
  14881. const values = []
  14882. for (let value of header.split(',')) {
  14883. value = value.trim()
  14884. if (!value.length) {
  14885. continue
  14886. } else if (!isValidHeaderName(value)) {
  14887. continue
  14888. }
  14889. values.push(value)
  14890. }
  14891. return values
  14892. }
  14893. module.exports = {
  14894. urlEquals,
  14895. fieldValues
  14896. }
  14897. /***/ }),
  14898. /***/ 3598:
  14899. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14900. "use strict";
  14901. // @ts-check
  14902. /* global WebAssembly */
  14903. const assert = __nccwpck_require__(9491)
  14904. const net = __nccwpck_require__(1808)
  14905. const http = __nccwpck_require__(3685)
  14906. const { pipeline } = __nccwpck_require__(2781)
  14907. const util = __nccwpck_require__(3983)
  14908. const timers = __nccwpck_require__(9459)
  14909. const Request = __nccwpck_require__(2905)
  14910. const DispatcherBase = __nccwpck_require__(4839)
  14911. const {
  14912. RequestContentLengthMismatchError,
  14913. ResponseContentLengthMismatchError,
  14914. InvalidArgumentError,
  14915. RequestAbortedError,
  14916. HeadersTimeoutError,
  14917. HeadersOverflowError,
  14918. SocketError,
  14919. InformationalError,
  14920. BodyTimeoutError,
  14921. HTTPParserError,
  14922. ResponseExceededMaxSizeError,
  14923. ClientDestroyedError
  14924. } = __nccwpck_require__(8045)
  14925. const buildConnector = __nccwpck_require__(2067)
  14926. const {
  14927. kUrl,
  14928. kReset,
  14929. kServerName,
  14930. kClient,
  14931. kBusy,
  14932. kParser,
  14933. kConnect,
  14934. kBlocking,
  14935. kResuming,
  14936. kRunning,
  14937. kPending,
  14938. kSize,
  14939. kWriting,
  14940. kQueue,
  14941. kConnected,
  14942. kConnecting,
  14943. kNeedDrain,
  14944. kNoRef,
  14945. kKeepAliveDefaultTimeout,
  14946. kHostHeader,
  14947. kPendingIdx,
  14948. kRunningIdx,
  14949. kError,
  14950. kPipelining,
  14951. kSocket,
  14952. kKeepAliveTimeoutValue,
  14953. kMaxHeadersSize,
  14954. kKeepAliveMaxTimeout,
  14955. kKeepAliveTimeoutThreshold,
  14956. kHeadersTimeout,
  14957. kBodyTimeout,
  14958. kStrictContentLength,
  14959. kConnector,
  14960. kMaxRedirections,
  14961. kMaxRequests,
  14962. kCounter,
  14963. kClose,
  14964. kDestroy,
  14965. kDispatch,
  14966. kInterceptors,
  14967. kLocalAddress,
  14968. kMaxResponseSize,
  14969. kHTTPConnVersion,
  14970. // HTTP2
  14971. kHost,
  14972. kHTTP2Session,
  14973. kHTTP2SessionState,
  14974. kHTTP2BuildRequest,
  14975. kHTTP2CopyHeaders,
  14976. kHTTP1BuildRequest
  14977. } = __nccwpck_require__(2785)
  14978. /** @type {import('http2')} */
  14979. let http2
  14980. try {
  14981. http2 = __nccwpck_require__(5158)
  14982. } catch {
  14983. // @ts-ignore
  14984. http2 = { constants: {} }
  14985. }
  14986. const {
  14987. constants: {
  14988. HTTP2_HEADER_AUTHORITY,
  14989. HTTP2_HEADER_METHOD,
  14990. HTTP2_HEADER_PATH,
  14991. HTTP2_HEADER_SCHEME,
  14992. HTTP2_HEADER_CONTENT_LENGTH,
  14993. HTTP2_HEADER_EXPECT,
  14994. HTTP2_HEADER_STATUS
  14995. }
  14996. } = http2
  14997. // Experimental
  14998. let h2ExperimentalWarned = false
  14999. const FastBuffer = Buffer[Symbol.species]
  15000. const kClosedResolve = Symbol('kClosedResolve')
  15001. const channels = {}
  15002. try {
  15003. const diagnosticsChannel = __nccwpck_require__(7643)
  15004. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15005. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15006. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15007. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15008. } catch {
  15009. channels.sendHeaders = { hasSubscribers: false }
  15010. channels.beforeConnect = { hasSubscribers: false }
  15011. channels.connectError = { hasSubscribers: false }
  15012. channels.connected = { hasSubscribers: false }
  15013. }
  15014. /**
  15015. * @type {import('../types/client').default}
  15016. */
  15017. class Client extends DispatcherBase {
  15018. /**
  15019. *
  15020. * @param {string|URL} url
  15021. * @param {import('../types/client').Client.Options} options
  15022. */
  15023. constructor (url, {
  15024. interceptors,
  15025. maxHeaderSize,
  15026. headersTimeout,
  15027. socketTimeout,
  15028. requestTimeout,
  15029. connectTimeout,
  15030. bodyTimeout,
  15031. idleTimeout,
  15032. keepAlive,
  15033. keepAliveTimeout,
  15034. maxKeepAliveTimeout,
  15035. keepAliveMaxTimeout,
  15036. keepAliveTimeoutThreshold,
  15037. socketPath,
  15038. pipelining,
  15039. tls,
  15040. strictContentLength,
  15041. maxCachedSessions,
  15042. maxRedirections,
  15043. connect,
  15044. maxRequestsPerClient,
  15045. localAddress,
  15046. maxResponseSize,
  15047. autoSelectFamily,
  15048. autoSelectFamilyAttemptTimeout,
  15049. // h2
  15050. allowH2,
  15051. maxConcurrentStreams
  15052. } = {}) {
  15053. super()
  15054. if (keepAlive !== undefined) {
  15055. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15056. }
  15057. if (socketTimeout !== undefined) {
  15058. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15059. }
  15060. if (requestTimeout !== undefined) {
  15061. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15062. }
  15063. if (idleTimeout !== undefined) {
  15064. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15065. }
  15066. if (maxKeepAliveTimeout !== undefined) {
  15067. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15068. }
  15069. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15070. throw new InvalidArgumentError('invalid maxHeaderSize')
  15071. }
  15072. if (socketPath != null && typeof socketPath !== 'string') {
  15073. throw new InvalidArgumentError('invalid socketPath')
  15074. }
  15075. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15076. throw new InvalidArgumentError('invalid connectTimeout')
  15077. }
  15078. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15079. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15080. }
  15081. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15082. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15083. }
  15084. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15085. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15086. }
  15087. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15088. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15089. }
  15090. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15091. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15092. }
  15093. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15094. throw new InvalidArgumentError('connect must be a function or an object')
  15095. }
  15096. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15097. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15098. }
  15099. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15100. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15101. }
  15102. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15103. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15104. }
  15105. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15106. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15107. }
  15108. if (
  15109. autoSelectFamilyAttemptTimeout != null &&
  15110. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15111. ) {
  15112. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15113. }
  15114. // h2
  15115. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15116. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15117. }
  15118. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15119. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15120. }
  15121. if (typeof connect !== 'function') {
  15122. connect = buildConnector({
  15123. ...tls,
  15124. maxCachedSessions,
  15125. allowH2,
  15126. socketPath,
  15127. timeout: connectTimeout,
  15128. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15129. ...connect
  15130. })
  15131. }
  15132. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15133. ? interceptors.Client
  15134. : [createRedirectInterceptor({ maxRedirections })]
  15135. this[kUrl] = util.parseOrigin(url)
  15136. this[kConnector] = connect
  15137. this[kSocket] = null
  15138. this[kPipelining] = pipelining != null ? pipelining : 1
  15139. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15140. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15141. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15142. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15143. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15144. this[kServerName] = null
  15145. this[kLocalAddress] = localAddress != null ? localAddress : null
  15146. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15147. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15148. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15149. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15150. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15151. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15152. this[kMaxRedirections] = maxRedirections
  15153. this[kMaxRequests] = maxRequestsPerClient
  15154. this[kClosedResolve] = null
  15155. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15156. this[kHTTPConnVersion] = 'h1'
  15157. // HTTP/2
  15158. this[kHTTP2Session] = null
  15159. this[kHTTP2SessionState] = !allowH2
  15160. ? null
  15161. : {
  15162. // streams: null, // Fixed queue of streams - For future support of `push`
  15163. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15164. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15165. }
  15166. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15167. // kQueue is built up of 3 sections separated by
  15168. // the kRunningIdx and kPendingIdx indices.
  15169. // | complete | running | pending |
  15170. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15171. // kRunningIdx points to the first running element.
  15172. // kPendingIdx points to the first pending element.
  15173. // This implements a fast queue with an amortized
  15174. // time of O(1).
  15175. this[kQueue] = []
  15176. this[kRunningIdx] = 0
  15177. this[kPendingIdx] = 0
  15178. }
  15179. get pipelining () {
  15180. return this[kPipelining]
  15181. }
  15182. set pipelining (value) {
  15183. this[kPipelining] = value
  15184. resume(this, true)
  15185. }
  15186. get [kPending] () {
  15187. return this[kQueue].length - this[kPendingIdx]
  15188. }
  15189. get [kRunning] () {
  15190. return this[kPendingIdx] - this[kRunningIdx]
  15191. }
  15192. get [kSize] () {
  15193. return this[kQueue].length - this[kRunningIdx]
  15194. }
  15195. get [kConnected] () {
  15196. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15197. }
  15198. get [kBusy] () {
  15199. const socket = this[kSocket]
  15200. return (
  15201. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15202. (this[kSize] >= (this[kPipelining] || 1)) ||
  15203. this[kPending] > 0
  15204. )
  15205. }
  15206. /* istanbul ignore: only used for test */
  15207. [kConnect] (cb) {
  15208. connect(this)
  15209. this.once('connect', cb)
  15210. }
  15211. [kDispatch] (opts, handler) {
  15212. const origin = opts.origin || this[kUrl].origin
  15213. const request = this[kHTTPConnVersion] === 'h2'
  15214. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15215. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15216. this[kQueue].push(request)
  15217. if (this[kResuming]) {
  15218. // Do nothing.
  15219. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15220. // Wait a tick in case stream/iterator is ended in the same tick.
  15221. this[kResuming] = 1
  15222. process.nextTick(resume, this)
  15223. } else {
  15224. resume(this, true)
  15225. }
  15226. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15227. this[kNeedDrain] = 2
  15228. }
  15229. return this[kNeedDrain] < 2
  15230. }
  15231. async [kClose] () {
  15232. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15233. // request and close each stream.
  15234. return new Promise((resolve) => {
  15235. if (!this[kSize]) {
  15236. resolve(null)
  15237. } else {
  15238. this[kClosedResolve] = resolve
  15239. }
  15240. })
  15241. }
  15242. async [kDestroy] (err) {
  15243. return new Promise((resolve) => {
  15244. const requests = this[kQueue].splice(this[kPendingIdx])
  15245. for (let i = 0; i < requests.length; i++) {
  15246. const request = requests[i]
  15247. errorRequest(this, request, err)
  15248. }
  15249. const callback = () => {
  15250. if (this[kClosedResolve]) {
  15251. // TODO (fix): Should we error here with ClientDestroyedError?
  15252. this[kClosedResolve]()
  15253. this[kClosedResolve] = null
  15254. }
  15255. resolve()
  15256. }
  15257. if (this[kHTTP2Session] != null) {
  15258. util.destroy(this[kHTTP2Session], err)
  15259. this[kHTTP2Session] = null
  15260. this[kHTTP2SessionState] = null
  15261. }
  15262. if (!this[kSocket]) {
  15263. queueMicrotask(callback)
  15264. } else {
  15265. util.destroy(this[kSocket].on('close', callback), err)
  15266. }
  15267. resume(this)
  15268. })
  15269. }
  15270. }
  15271. function onHttp2SessionError (err) {
  15272. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15273. this[kSocket][kError] = err
  15274. onError(this[kClient], err)
  15275. }
  15276. function onHttp2FrameError (type, code, id) {
  15277. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15278. if (id === 0) {
  15279. this[kSocket][kError] = err
  15280. onError(this[kClient], err)
  15281. }
  15282. }
  15283. function onHttp2SessionEnd () {
  15284. util.destroy(this, new SocketError('other side closed'))
  15285. util.destroy(this[kSocket], new SocketError('other side closed'))
  15286. }
  15287. function onHTTP2GoAway (code) {
  15288. const client = this[kClient]
  15289. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15290. client[kSocket] = null
  15291. client[kHTTP2Session] = null
  15292. if (client.destroyed) {
  15293. assert(this[kPending] === 0)
  15294. // Fail entire queue.
  15295. const requests = client[kQueue].splice(client[kRunningIdx])
  15296. for (let i = 0; i < requests.length; i++) {
  15297. const request = requests[i]
  15298. errorRequest(this, request, err)
  15299. }
  15300. } else if (client[kRunning] > 0) {
  15301. // Fail head of pipeline.
  15302. const request = client[kQueue][client[kRunningIdx]]
  15303. client[kQueue][client[kRunningIdx]++] = null
  15304. errorRequest(client, request, err)
  15305. }
  15306. client[kPendingIdx] = client[kRunningIdx]
  15307. assert(client[kRunning] === 0)
  15308. client.emit('disconnect',
  15309. client[kUrl],
  15310. [client],
  15311. err
  15312. )
  15313. resume(client)
  15314. }
  15315. const constants = __nccwpck_require__(953)
  15316. const createRedirectInterceptor = __nccwpck_require__(8861)
  15317. const EMPTY_BUF = Buffer.alloc(0)
  15318. async function lazyllhttp () {
  15319. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15320. let mod
  15321. try {
  15322. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15323. } catch (e) {
  15324. /* istanbul ignore next */
  15325. // We could check if the error was caused by the simd option not
  15326. // being enabled, but the occurring of this other error
  15327. // * https://github.com/emscripten-core/emscripten/issues/11495
  15328. // got me to remove that check to avoid breaking Node 12.
  15329. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15330. }
  15331. return await WebAssembly.instantiate(mod, {
  15332. env: {
  15333. /* eslint-disable camelcase */
  15334. wasm_on_url: (p, at, len) => {
  15335. /* istanbul ignore next */
  15336. return 0
  15337. },
  15338. wasm_on_status: (p, at, len) => {
  15339. assert.strictEqual(currentParser.ptr, p)
  15340. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15341. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15342. },
  15343. wasm_on_message_begin: (p) => {
  15344. assert.strictEqual(currentParser.ptr, p)
  15345. return currentParser.onMessageBegin() || 0
  15346. },
  15347. wasm_on_header_field: (p, at, len) => {
  15348. assert.strictEqual(currentParser.ptr, p)
  15349. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15350. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15351. },
  15352. wasm_on_header_value: (p, at, len) => {
  15353. assert.strictEqual(currentParser.ptr, p)
  15354. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15355. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15356. },
  15357. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15358. assert.strictEqual(currentParser.ptr, p)
  15359. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15360. },
  15361. wasm_on_body: (p, at, len) => {
  15362. assert.strictEqual(currentParser.ptr, p)
  15363. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15364. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15365. },
  15366. wasm_on_message_complete: (p) => {
  15367. assert.strictEqual(currentParser.ptr, p)
  15368. return currentParser.onMessageComplete() || 0
  15369. }
  15370. /* eslint-enable camelcase */
  15371. }
  15372. })
  15373. }
  15374. let llhttpInstance = null
  15375. let llhttpPromise = lazyllhttp()
  15376. llhttpPromise.catch()
  15377. let currentParser = null
  15378. let currentBufferRef = null
  15379. let currentBufferSize = 0
  15380. let currentBufferPtr = null
  15381. const TIMEOUT_HEADERS = 1
  15382. const TIMEOUT_BODY = 2
  15383. const TIMEOUT_IDLE = 3
  15384. class Parser {
  15385. constructor (client, socket, { exports }) {
  15386. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15387. this.llhttp = exports
  15388. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15389. this.client = client
  15390. this.socket = socket
  15391. this.timeout = null
  15392. this.timeoutValue = null
  15393. this.timeoutType = null
  15394. this.statusCode = null
  15395. this.statusText = ''
  15396. this.upgrade = false
  15397. this.headers = []
  15398. this.headersSize = 0
  15399. this.headersMaxSize = client[kMaxHeadersSize]
  15400. this.shouldKeepAlive = false
  15401. this.paused = false
  15402. this.resume = this.resume.bind(this)
  15403. this.bytesRead = 0
  15404. this.keepAlive = ''
  15405. this.contentLength = ''
  15406. this.connection = ''
  15407. this.maxResponseSize = client[kMaxResponseSize]
  15408. }
  15409. setTimeout (value, type) {
  15410. this.timeoutType = type
  15411. if (value !== this.timeoutValue) {
  15412. timers.clearTimeout(this.timeout)
  15413. if (value) {
  15414. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15415. // istanbul ignore else: only for jest
  15416. if (this.timeout.unref) {
  15417. this.timeout.unref()
  15418. }
  15419. } else {
  15420. this.timeout = null
  15421. }
  15422. this.timeoutValue = value
  15423. } else if (this.timeout) {
  15424. // istanbul ignore else: only for jest
  15425. if (this.timeout.refresh) {
  15426. this.timeout.refresh()
  15427. }
  15428. }
  15429. }
  15430. resume () {
  15431. if (this.socket.destroyed || !this.paused) {
  15432. return
  15433. }
  15434. assert(this.ptr != null)
  15435. assert(currentParser == null)
  15436. this.llhttp.llhttp_resume(this.ptr)
  15437. assert(this.timeoutType === TIMEOUT_BODY)
  15438. if (this.timeout) {
  15439. // istanbul ignore else: only for jest
  15440. if (this.timeout.refresh) {
  15441. this.timeout.refresh()
  15442. }
  15443. }
  15444. this.paused = false
  15445. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15446. this.readMore()
  15447. }
  15448. readMore () {
  15449. while (!this.paused && this.ptr) {
  15450. const chunk = this.socket.read()
  15451. if (chunk === null) {
  15452. break
  15453. }
  15454. this.execute(chunk)
  15455. }
  15456. }
  15457. execute (data) {
  15458. assert(this.ptr != null)
  15459. assert(currentParser == null)
  15460. assert(!this.paused)
  15461. const { socket, llhttp } = this
  15462. if (data.length > currentBufferSize) {
  15463. if (currentBufferPtr) {
  15464. llhttp.free(currentBufferPtr)
  15465. }
  15466. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15467. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15468. }
  15469. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15470. // Call `execute` on the wasm parser.
  15471. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15472. // and finally the length of bytes to parse.
  15473. // The return value is an error code or `constants.ERROR.OK`.
  15474. try {
  15475. let ret
  15476. try {
  15477. currentBufferRef = data
  15478. currentParser = this
  15479. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15480. /* eslint-disable-next-line no-useless-catch */
  15481. } catch (err) {
  15482. /* istanbul ignore next: difficult to make a test case for */
  15483. throw err
  15484. } finally {
  15485. currentParser = null
  15486. currentBufferRef = null
  15487. }
  15488. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15489. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15490. this.onUpgrade(data.slice(offset))
  15491. } else if (ret === constants.ERROR.PAUSED) {
  15492. this.paused = true
  15493. socket.unshift(data.slice(offset))
  15494. } else if (ret !== constants.ERROR.OK) {
  15495. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15496. let message = ''
  15497. /* istanbul ignore else: difficult to make a test case for */
  15498. if (ptr) {
  15499. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15500. message =
  15501. 'Response does not match the HTTP/1.1 protocol (' +
  15502. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15503. ')'
  15504. }
  15505. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15506. }
  15507. } catch (err) {
  15508. util.destroy(socket, err)
  15509. }
  15510. }
  15511. destroy () {
  15512. assert(this.ptr != null)
  15513. assert(currentParser == null)
  15514. this.llhttp.llhttp_free(this.ptr)
  15515. this.ptr = null
  15516. timers.clearTimeout(this.timeout)
  15517. this.timeout = null
  15518. this.timeoutValue = null
  15519. this.timeoutType = null
  15520. this.paused = false
  15521. }
  15522. onStatus (buf) {
  15523. this.statusText = buf.toString()
  15524. }
  15525. onMessageBegin () {
  15526. const { socket, client } = this
  15527. /* istanbul ignore next: difficult to make a test case for */
  15528. if (socket.destroyed) {
  15529. return -1
  15530. }
  15531. const request = client[kQueue][client[kRunningIdx]]
  15532. if (!request) {
  15533. return -1
  15534. }
  15535. }
  15536. onHeaderField (buf) {
  15537. const len = this.headers.length
  15538. if ((len & 1) === 0) {
  15539. this.headers.push(buf)
  15540. } else {
  15541. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15542. }
  15543. this.trackHeader(buf.length)
  15544. }
  15545. onHeaderValue (buf) {
  15546. let len = this.headers.length
  15547. if ((len & 1) === 1) {
  15548. this.headers.push(buf)
  15549. len += 1
  15550. } else {
  15551. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15552. }
  15553. const key = this.headers[len - 2]
  15554. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15555. this.keepAlive += buf.toString()
  15556. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15557. this.connection += buf.toString()
  15558. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15559. this.contentLength += buf.toString()
  15560. }
  15561. this.trackHeader(buf.length)
  15562. }
  15563. trackHeader (len) {
  15564. this.headersSize += len
  15565. if (this.headersSize >= this.headersMaxSize) {
  15566. util.destroy(this.socket, new HeadersOverflowError())
  15567. }
  15568. }
  15569. onUpgrade (head) {
  15570. const { upgrade, client, socket, headers, statusCode } = this
  15571. assert(upgrade)
  15572. const request = client[kQueue][client[kRunningIdx]]
  15573. assert(request)
  15574. assert(!socket.destroyed)
  15575. assert(socket === client[kSocket])
  15576. assert(!this.paused)
  15577. assert(request.upgrade || request.method === 'CONNECT')
  15578. this.statusCode = null
  15579. this.statusText = ''
  15580. this.shouldKeepAlive = null
  15581. assert(this.headers.length % 2 === 0)
  15582. this.headers = []
  15583. this.headersSize = 0
  15584. socket.unshift(head)
  15585. socket[kParser].destroy()
  15586. socket[kParser] = null
  15587. socket[kClient] = null
  15588. socket[kError] = null
  15589. socket
  15590. .removeListener('error', onSocketError)
  15591. .removeListener('readable', onSocketReadable)
  15592. .removeListener('end', onSocketEnd)
  15593. .removeListener('close', onSocketClose)
  15594. client[kSocket] = null
  15595. client[kQueue][client[kRunningIdx]++] = null
  15596. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15597. try {
  15598. request.onUpgrade(statusCode, headers, socket)
  15599. } catch (err) {
  15600. util.destroy(socket, err)
  15601. }
  15602. resume(client)
  15603. }
  15604. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15605. const { client, socket, headers, statusText } = this
  15606. /* istanbul ignore next: difficult to make a test case for */
  15607. if (socket.destroyed) {
  15608. return -1
  15609. }
  15610. const request = client[kQueue][client[kRunningIdx]]
  15611. /* istanbul ignore next: difficult to make a test case for */
  15612. if (!request) {
  15613. return -1
  15614. }
  15615. assert(!this.upgrade)
  15616. assert(this.statusCode < 200)
  15617. if (statusCode === 100) {
  15618. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15619. return -1
  15620. }
  15621. /* this can only happen if server is misbehaving */
  15622. if (upgrade && !request.upgrade) {
  15623. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15624. return -1
  15625. }
  15626. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15627. this.statusCode = statusCode
  15628. this.shouldKeepAlive = (
  15629. shouldKeepAlive ||
  15630. // Override llhttp value which does not allow keepAlive for HEAD.
  15631. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15632. )
  15633. if (this.statusCode >= 200) {
  15634. const bodyTimeout = request.bodyTimeout != null
  15635. ? request.bodyTimeout
  15636. : client[kBodyTimeout]
  15637. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15638. } else if (this.timeout) {
  15639. // istanbul ignore else: only for jest
  15640. if (this.timeout.refresh) {
  15641. this.timeout.refresh()
  15642. }
  15643. }
  15644. if (request.method === 'CONNECT') {
  15645. assert(client[kRunning] === 1)
  15646. this.upgrade = true
  15647. return 2
  15648. }
  15649. if (upgrade) {
  15650. assert(client[kRunning] === 1)
  15651. this.upgrade = true
  15652. return 2
  15653. }
  15654. assert(this.headers.length % 2 === 0)
  15655. this.headers = []
  15656. this.headersSize = 0
  15657. if (this.shouldKeepAlive && client[kPipelining]) {
  15658. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15659. if (keepAliveTimeout != null) {
  15660. const timeout = Math.min(
  15661. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15662. client[kKeepAliveMaxTimeout]
  15663. )
  15664. if (timeout <= 0) {
  15665. socket[kReset] = true
  15666. } else {
  15667. client[kKeepAliveTimeoutValue] = timeout
  15668. }
  15669. } else {
  15670. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15671. }
  15672. } else {
  15673. // Stop more requests from being dispatched.
  15674. socket[kReset] = true
  15675. }
  15676. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15677. if (request.aborted) {
  15678. return -1
  15679. }
  15680. if (request.method === 'HEAD') {
  15681. return 1
  15682. }
  15683. if (statusCode < 200) {
  15684. return 1
  15685. }
  15686. if (socket[kBlocking]) {
  15687. socket[kBlocking] = false
  15688. resume(client)
  15689. }
  15690. return pause ? constants.ERROR.PAUSED : 0
  15691. }
  15692. onBody (buf) {
  15693. const { client, socket, statusCode, maxResponseSize } = this
  15694. if (socket.destroyed) {
  15695. return -1
  15696. }
  15697. const request = client[kQueue][client[kRunningIdx]]
  15698. assert(request)
  15699. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15700. if (this.timeout) {
  15701. // istanbul ignore else: only for jest
  15702. if (this.timeout.refresh) {
  15703. this.timeout.refresh()
  15704. }
  15705. }
  15706. assert(statusCode >= 200)
  15707. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15708. util.destroy(socket, new ResponseExceededMaxSizeError())
  15709. return -1
  15710. }
  15711. this.bytesRead += buf.length
  15712. if (request.onData(buf) === false) {
  15713. return constants.ERROR.PAUSED
  15714. }
  15715. }
  15716. onMessageComplete () {
  15717. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15718. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15719. return -1
  15720. }
  15721. if (upgrade) {
  15722. return
  15723. }
  15724. const request = client[kQueue][client[kRunningIdx]]
  15725. assert(request)
  15726. assert(statusCode >= 100)
  15727. this.statusCode = null
  15728. this.statusText = ''
  15729. this.bytesRead = 0
  15730. this.contentLength = ''
  15731. this.keepAlive = ''
  15732. this.connection = ''
  15733. assert(this.headers.length % 2 === 0)
  15734. this.headers = []
  15735. this.headersSize = 0
  15736. if (statusCode < 200) {
  15737. return
  15738. }
  15739. /* istanbul ignore next: should be handled by llhttp? */
  15740. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  15741. util.destroy(socket, new ResponseContentLengthMismatchError())
  15742. return -1
  15743. }
  15744. request.onComplete(headers)
  15745. client[kQueue][client[kRunningIdx]++] = null
  15746. if (socket[kWriting]) {
  15747. assert.strictEqual(client[kRunning], 0)
  15748. // Response completed before request.
  15749. util.destroy(socket, new InformationalError('reset'))
  15750. return constants.ERROR.PAUSED
  15751. } else if (!shouldKeepAlive) {
  15752. util.destroy(socket, new InformationalError('reset'))
  15753. return constants.ERROR.PAUSED
  15754. } else if (socket[kReset] && client[kRunning] === 0) {
  15755. // Destroy socket once all requests have completed.
  15756. // The request at the tail of the pipeline is the one
  15757. // that requested reset and no further requests should
  15758. // have been queued since then.
  15759. util.destroy(socket, new InformationalError('reset'))
  15760. return constants.ERROR.PAUSED
  15761. } else if (client[kPipelining] === 1) {
  15762. // We must wait a full event loop cycle to reuse this socket to make sure
  15763. // that non-spec compliant servers are not closing the connection even if they
  15764. // said they won't.
  15765. setImmediate(resume, client)
  15766. } else {
  15767. resume(client)
  15768. }
  15769. }
  15770. }
  15771. function onParserTimeout (parser) {
  15772. const { socket, timeoutType, client } = parser
  15773. /* istanbul ignore else */
  15774. if (timeoutType === TIMEOUT_HEADERS) {
  15775. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  15776. assert(!parser.paused, 'cannot be paused while waiting for headers')
  15777. util.destroy(socket, new HeadersTimeoutError())
  15778. }
  15779. } else if (timeoutType === TIMEOUT_BODY) {
  15780. if (!parser.paused) {
  15781. util.destroy(socket, new BodyTimeoutError())
  15782. }
  15783. } else if (timeoutType === TIMEOUT_IDLE) {
  15784. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  15785. util.destroy(socket, new InformationalError('socket idle timeout'))
  15786. }
  15787. }
  15788. function onSocketReadable () {
  15789. const { [kParser]: parser } = this
  15790. if (parser) {
  15791. parser.readMore()
  15792. }
  15793. }
  15794. function onSocketError (err) {
  15795. const { [kClient]: client, [kParser]: parser } = this
  15796. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15797. if (client[kHTTPConnVersion] !== 'h2') {
  15798. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  15799. // to the user.
  15800. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  15801. // We treat all incoming data so for as a valid response.
  15802. parser.onMessageComplete()
  15803. return
  15804. }
  15805. }
  15806. this[kError] = err
  15807. onError(this[kClient], err)
  15808. }
  15809. function onError (client, err) {
  15810. if (
  15811. client[kRunning] === 0 &&
  15812. err.code !== 'UND_ERR_INFO' &&
  15813. err.code !== 'UND_ERR_SOCKET'
  15814. ) {
  15815. // Error is not caused by running request and not a recoverable
  15816. // socket error.
  15817. assert(client[kPendingIdx] === client[kRunningIdx])
  15818. const requests = client[kQueue].splice(client[kRunningIdx])
  15819. for (let i = 0; i < requests.length; i++) {
  15820. const request = requests[i]
  15821. errorRequest(client, request, err)
  15822. }
  15823. assert(client[kSize] === 0)
  15824. }
  15825. }
  15826. function onSocketEnd () {
  15827. const { [kParser]: parser, [kClient]: client } = this
  15828. if (client[kHTTPConnVersion] !== 'h2') {
  15829. if (parser.statusCode && !parser.shouldKeepAlive) {
  15830. // We treat all incoming data so far as a valid response.
  15831. parser.onMessageComplete()
  15832. return
  15833. }
  15834. }
  15835. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  15836. }
  15837. function onSocketClose () {
  15838. const { [kClient]: client, [kParser]: parser } = this
  15839. if (client[kHTTPConnVersion] === 'h1' && parser) {
  15840. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  15841. // We treat all incoming data so far as a valid response.
  15842. parser.onMessageComplete()
  15843. }
  15844. this[kParser].destroy()
  15845. this[kParser] = null
  15846. }
  15847. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  15848. client[kSocket] = null
  15849. if (client.destroyed) {
  15850. assert(client[kPending] === 0)
  15851. // Fail entire queue.
  15852. const requests = client[kQueue].splice(client[kRunningIdx])
  15853. for (let i = 0; i < requests.length; i++) {
  15854. const request = requests[i]
  15855. errorRequest(client, request, err)
  15856. }
  15857. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  15858. // Fail head of pipeline.
  15859. const request = client[kQueue][client[kRunningIdx]]
  15860. client[kQueue][client[kRunningIdx]++] = null
  15861. errorRequest(client, request, err)
  15862. }
  15863. client[kPendingIdx] = client[kRunningIdx]
  15864. assert(client[kRunning] === 0)
  15865. client.emit('disconnect', client[kUrl], [client], err)
  15866. resume(client)
  15867. }
  15868. async function connect (client) {
  15869. assert(!client[kConnecting])
  15870. assert(!client[kSocket])
  15871. let { host, hostname, protocol, port } = client[kUrl]
  15872. // Resolve ipv6
  15873. if (hostname[0] === '[') {
  15874. const idx = hostname.indexOf(']')
  15875. assert(idx !== -1)
  15876. const ip = hostname.substring(1, idx)
  15877. assert(net.isIP(ip))
  15878. hostname = ip
  15879. }
  15880. client[kConnecting] = true
  15881. if (channels.beforeConnect.hasSubscribers) {
  15882. channels.beforeConnect.publish({
  15883. connectParams: {
  15884. host,
  15885. hostname,
  15886. protocol,
  15887. port,
  15888. servername: client[kServerName],
  15889. localAddress: client[kLocalAddress]
  15890. },
  15891. connector: client[kConnector]
  15892. })
  15893. }
  15894. try {
  15895. const socket = await new Promise((resolve, reject) => {
  15896. client[kConnector]({
  15897. host,
  15898. hostname,
  15899. protocol,
  15900. port,
  15901. servername: client[kServerName],
  15902. localAddress: client[kLocalAddress]
  15903. }, (err, socket) => {
  15904. if (err) {
  15905. reject(err)
  15906. } else {
  15907. resolve(socket)
  15908. }
  15909. })
  15910. })
  15911. if (client.destroyed) {
  15912. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  15913. return
  15914. }
  15915. client[kConnecting] = false
  15916. assert(socket)
  15917. const isH2 = socket.alpnProtocol === 'h2'
  15918. if (isH2) {
  15919. if (!h2ExperimentalWarned) {
  15920. h2ExperimentalWarned = true
  15921. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  15922. code: 'UNDICI-H2'
  15923. })
  15924. }
  15925. const session = http2.connect(client[kUrl], {
  15926. createConnection: () => socket,
  15927. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  15928. })
  15929. client[kHTTPConnVersion] = 'h2'
  15930. session[kClient] = client
  15931. session[kSocket] = socket
  15932. session.on('error', onHttp2SessionError)
  15933. session.on('frameError', onHttp2FrameError)
  15934. session.on('end', onHttp2SessionEnd)
  15935. session.on('goaway', onHTTP2GoAway)
  15936. session.on('close', onSocketClose)
  15937. session.unref()
  15938. client[kHTTP2Session] = session
  15939. socket[kHTTP2Session] = session
  15940. } else {
  15941. if (!llhttpInstance) {
  15942. llhttpInstance = await llhttpPromise
  15943. llhttpPromise = null
  15944. }
  15945. socket[kNoRef] = false
  15946. socket[kWriting] = false
  15947. socket[kReset] = false
  15948. socket[kBlocking] = false
  15949. socket[kParser] = new Parser(client, socket, llhttpInstance)
  15950. }
  15951. socket[kCounter] = 0
  15952. socket[kMaxRequests] = client[kMaxRequests]
  15953. socket[kClient] = client
  15954. socket[kError] = null
  15955. socket
  15956. .on('error', onSocketError)
  15957. .on('readable', onSocketReadable)
  15958. .on('end', onSocketEnd)
  15959. .on('close', onSocketClose)
  15960. client[kSocket] = socket
  15961. if (channels.connected.hasSubscribers) {
  15962. channels.connected.publish({
  15963. connectParams: {
  15964. host,
  15965. hostname,
  15966. protocol,
  15967. port,
  15968. servername: client[kServerName],
  15969. localAddress: client[kLocalAddress]
  15970. },
  15971. connector: client[kConnector],
  15972. socket
  15973. })
  15974. }
  15975. client.emit('connect', client[kUrl], [client])
  15976. } catch (err) {
  15977. if (client.destroyed) {
  15978. return
  15979. }
  15980. client[kConnecting] = false
  15981. if (channels.connectError.hasSubscribers) {
  15982. channels.connectError.publish({
  15983. connectParams: {
  15984. host,
  15985. hostname,
  15986. protocol,
  15987. port,
  15988. servername: client[kServerName],
  15989. localAddress: client[kLocalAddress]
  15990. },
  15991. connector: client[kConnector],
  15992. error: err
  15993. })
  15994. }
  15995. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  15996. assert(client[kRunning] === 0)
  15997. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  15998. const request = client[kQueue][client[kPendingIdx]++]
  15999. errorRequest(client, request, err)
  16000. }
  16001. } else {
  16002. onError(client, err)
  16003. }
  16004. client.emit('connectionError', client[kUrl], [client], err)
  16005. }
  16006. resume(client)
  16007. }
  16008. function emitDrain (client) {
  16009. client[kNeedDrain] = 0
  16010. client.emit('drain', client[kUrl], [client])
  16011. }
  16012. function resume (client, sync) {
  16013. if (client[kResuming] === 2) {
  16014. return
  16015. }
  16016. client[kResuming] = 2
  16017. _resume(client, sync)
  16018. client[kResuming] = 0
  16019. if (client[kRunningIdx] > 256) {
  16020. client[kQueue].splice(0, client[kRunningIdx])
  16021. client[kPendingIdx] -= client[kRunningIdx]
  16022. client[kRunningIdx] = 0
  16023. }
  16024. }
  16025. function _resume (client, sync) {
  16026. while (true) {
  16027. if (client.destroyed) {
  16028. assert(client[kPending] === 0)
  16029. return
  16030. }
  16031. if (client[kClosedResolve] && !client[kSize]) {
  16032. client[kClosedResolve]()
  16033. client[kClosedResolve] = null
  16034. return
  16035. }
  16036. const socket = client[kSocket]
  16037. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16038. if (client[kSize] === 0) {
  16039. if (!socket[kNoRef] && socket.unref) {
  16040. socket.unref()
  16041. socket[kNoRef] = true
  16042. }
  16043. } else if (socket[kNoRef] && socket.ref) {
  16044. socket.ref()
  16045. socket[kNoRef] = false
  16046. }
  16047. if (client[kSize] === 0) {
  16048. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16049. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16050. }
  16051. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16052. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16053. const request = client[kQueue][client[kRunningIdx]]
  16054. const headersTimeout = request.headersTimeout != null
  16055. ? request.headersTimeout
  16056. : client[kHeadersTimeout]
  16057. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16058. }
  16059. }
  16060. }
  16061. if (client[kBusy]) {
  16062. client[kNeedDrain] = 2
  16063. } else if (client[kNeedDrain] === 2) {
  16064. if (sync) {
  16065. client[kNeedDrain] = 1
  16066. process.nextTick(emitDrain, client)
  16067. } else {
  16068. emitDrain(client)
  16069. }
  16070. continue
  16071. }
  16072. if (client[kPending] === 0) {
  16073. return
  16074. }
  16075. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16076. return
  16077. }
  16078. const request = client[kQueue][client[kPendingIdx]]
  16079. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16080. if (client[kRunning] > 0) {
  16081. return
  16082. }
  16083. client[kServerName] = request.servername
  16084. if (socket && socket.servername !== request.servername) {
  16085. util.destroy(socket, new InformationalError('servername changed'))
  16086. return
  16087. }
  16088. }
  16089. if (client[kConnecting]) {
  16090. return
  16091. }
  16092. if (!socket && !client[kHTTP2Session]) {
  16093. connect(client)
  16094. return
  16095. }
  16096. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16097. return
  16098. }
  16099. if (client[kRunning] > 0 && !request.idempotent) {
  16100. // Non-idempotent request cannot be retried.
  16101. // Ensure that no other requests are inflight and
  16102. // could cause failure.
  16103. return
  16104. }
  16105. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16106. // Don't dispatch an upgrade until all preceding requests have completed.
  16107. // A misbehaving server might upgrade the connection before all pipelined
  16108. // request has completed.
  16109. return
  16110. }
  16111. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16112. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16113. // Request with stream or iterator body can error while other requests
  16114. // are inflight and indirectly error those as well.
  16115. // Ensure this doesn't happen by waiting for inflight
  16116. // to complete before dispatching.
  16117. // Request with stream or iterator body cannot be retried.
  16118. // Ensure that no other requests are inflight and
  16119. // could cause failure.
  16120. return
  16121. }
  16122. if (!request.aborted && write(client, request)) {
  16123. client[kPendingIdx]++
  16124. } else {
  16125. client[kQueue].splice(client[kPendingIdx], 1)
  16126. }
  16127. }
  16128. }
  16129. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16130. function shouldSendContentLength (method) {
  16131. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16132. }
  16133. function write (client, request) {
  16134. if (client[kHTTPConnVersion] === 'h2') {
  16135. writeH2(client, client[kHTTP2Session], request)
  16136. return
  16137. }
  16138. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16139. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16140. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16141. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16142. // Sending a payload body on a request that does not
  16143. // expect it can cause undefined behavior on some
  16144. // servers and corrupt connection state. Do not
  16145. // re-use the connection for further requests.
  16146. const expectsPayload = (
  16147. method === 'PUT' ||
  16148. method === 'POST' ||
  16149. method === 'PATCH'
  16150. )
  16151. if (body && typeof body.read === 'function') {
  16152. // Try to read EOF in order to get length.
  16153. body.read(0)
  16154. }
  16155. const bodyLength = util.bodyLength(body)
  16156. let contentLength = bodyLength
  16157. if (contentLength === null) {
  16158. contentLength = request.contentLength
  16159. }
  16160. if (contentLength === 0 && !expectsPayload) {
  16161. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16162. // A user agent SHOULD NOT send a Content-Length header field when
  16163. // the request message does not contain a payload body and the method
  16164. // semantics do not anticipate such a body.
  16165. contentLength = null
  16166. }
  16167. // https://github.com/nodejs/undici/issues/2046
  16168. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16169. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16170. if (client[kStrictContentLength]) {
  16171. errorRequest(client, request, new RequestContentLengthMismatchError())
  16172. return false
  16173. }
  16174. process.emitWarning(new RequestContentLengthMismatchError())
  16175. }
  16176. const socket = client[kSocket]
  16177. try {
  16178. request.onConnect((err) => {
  16179. if (request.aborted || request.completed) {
  16180. return
  16181. }
  16182. errorRequest(client, request, err || new RequestAbortedError())
  16183. util.destroy(socket, new InformationalError('aborted'))
  16184. })
  16185. } catch (err) {
  16186. errorRequest(client, request, err)
  16187. }
  16188. if (request.aborted) {
  16189. return false
  16190. }
  16191. if (method === 'HEAD') {
  16192. // https://github.com/mcollina/undici/issues/258
  16193. // Close after a HEAD request to interop with misbehaving servers
  16194. // that may send a body in the response.
  16195. socket[kReset] = true
  16196. }
  16197. if (upgrade || method === 'CONNECT') {
  16198. // On CONNECT or upgrade, block pipeline from dispatching further
  16199. // requests on this connection.
  16200. socket[kReset] = true
  16201. }
  16202. if (reset != null) {
  16203. socket[kReset] = reset
  16204. }
  16205. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16206. socket[kReset] = true
  16207. }
  16208. if (blocking) {
  16209. socket[kBlocking] = true
  16210. }
  16211. let header = `${method} ${path} HTTP/1.1\r\n`
  16212. if (typeof host === 'string') {
  16213. header += `host: ${host}\r\n`
  16214. } else {
  16215. header += client[kHostHeader]
  16216. }
  16217. if (upgrade) {
  16218. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16219. } else if (client[kPipelining] && !socket[kReset]) {
  16220. header += 'connection: keep-alive\r\n'
  16221. } else {
  16222. header += 'connection: close\r\n'
  16223. }
  16224. if (headers) {
  16225. header += headers
  16226. }
  16227. if (channels.sendHeaders.hasSubscribers) {
  16228. channels.sendHeaders.publish({ request, headers: header, socket })
  16229. }
  16230. /* istanbul ignore else: assertion */
  16231. if (!body || bodyLength === 0) {
  16232. if (contentLength === 0) {
  16233. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16234. } else {
  16235. assert(contentLength === null, 'no body must not have content length')
  16236. socket.write(`${header}\r\n`, 'latin1')
  16237. }
  16238. request.onRequestSent()
  16239. } else if (util.isBuffer(body)) {
  16240. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16241. socket.cork()
  16242. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16243. socket.write(body)
  16244. socket.uncork()
  16245. request.onBodySent(body)
  16246. request.onRequestSent()
  16247. if (!expectsPayload) {
  16248. socket[kReset] = true
  16249. }
  16250. } else if (util.isBlobLike(body)) {
  16251. if (typeof body.stream === 'function') {
  16252. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16253. } else {
  16254. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16255. }
  16256. } else if (util.isStream(body)) {
  16257. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16258. } else if (util.isIterable(body)) {
  16259. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16260. } else {
  16261. assert(false)
  16262. }
  16263. return true
  16264. }
  16265. function writeH2 (client, session, request) {
  16266. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16267. let headers
  16268. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16269. else headers = reqHeaders
  16270. if (upgrade) {
  16271. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16272. return false
  16273. }
  16274. try {
  16275. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16276. request.onConnect((err) => {
  16277. if (request.aborted || request.completed) {
  16278. return
  16279. }
  16280. errorRequest(client, request, err || new RequestAbortedError())
  16281. })
  16282. } catch (err) {
  16283. errorRequest(client, request, err)
  16284. }
  16285. if (request.aborted) {
  16286. return false
  16287. }
  16288. /** @type {import('node:http2').ClientHttp2Stream} */
  16289. let stream
  16290. const h2State = client[kHTTP2SessionState]
  16291. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16292. headers[HTTP2_HEADER_METHOD] = method
  16293. if (method === 'CONNECT') {
  16294. session.ref()
  16295. // we are already connected, streams are pending, first request
  16296. // will create a new stream. We trigger a request to create the stream and wait until
  16297. // `ready` event is triggered
  16298. // We disabled endStream to allow the user to write to the stream
  16299. stream = session.request(headers, { endStream: false, signal })
  16300. if (stream.id && !stream.pending) {
  16301. request.onUpgrade(null, null, stream)
  16302. ++h2State.openStreams
  16303. } else {
  16304. stream.once('ready', () => {
  16305. request.onUpgrade(null, null, stream)
  16306. ++h2State.openStreams
  16307. })
  16308. }
  16309. stream.once('close', () => {
  16310. h2State.openStreams -= 1
  16311. // TODO(HTTP/2): unref only if current streams count is 0
  16312. if (h2State.openStreams === 0) session.unref()
  16313. })
  16314. return true
  16315. }
  16316. // https://tools.ietf.org/html/rfc7540#section-8.3
  16317. // :path and :scheme headers must be omited when sending CONNECT
  16318. headers[HTTP2_HEADER_PATH] = path
  16319. headers[HTTP2_HEADER_SCHEME] = 'https'
  16320. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16321. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16322. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16323. // Sending a payload body on a request that does not
  16324. // expect it can cause undefined behavior on some
  16325. // servers and corrupt connection state. Do not
  16326. // re-use the connection for further requests.
  16327. const expectsPayload = (
  16328. method === 'PUT' ||
  16329. method === 'POST' ||
  16330. method === 'PATCH'
  16331. )
  16332. if (body && typeof body.read === 'function') {
  16333. // Try to read EOF in order to get length.
  16334. body.read(0)
  16335. }
  16336. let contentLength = util.bodyLength(body)
  16337. if (contentLength == null) {
  16338. contentLength = request.contentLength
  16339. }
  16340. if (contentLength === 0 || !expectsPayload) {
  16341. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16342. // A user agent SHOULD NOT send a Content-Length header field when
  16343. // the request message does not contain a payload body and the method
  16344. // semantics do not anticipate such a body.
  16345. contentLength = null
  16346. }
  16347. // https://github.com/nodejs/undici/issues/2046
  16348. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16349. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16350. if (client[kStrictContentLength]) {
  16351. errorRequest(client, request, new RequestContentLengthMismatchError())
  16352. return false
  16353. }
  16354. process.emitWarning(new RequestContentLengthMismatchError())
  16355. }
  16356. if (contentLength != null) {
  16357. assert(body, 'no body must not have content length')
  16358. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16359. }
  16360. session.ref()
  16361. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16362. if (expectContinue) {
  16363. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16364. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16365. stream.once('continue', writeBodyH2)
  16366. } else {
  16367. stream = session.request(headers, {
  16368. endStream: shouldEndStream,
  16369. signal
  16370. })
  16371. writeBodyH2()
  16372. }
  16373. // Increment counter as we have new several streams open
  16374. ++h2State.openStreams
  16375. stream.once('response', headers => {
  16376. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16377. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16378. stream.pause()
  16379. }
  16380. })
  16381. stream.once('end', () => {
  16382. request.onComplete([])
  16383. })
  16384. stream.on('data', (chunk) => {
  16385. if (request.onData(chunk) === false) {
  16386. stream.pause()
  16387. }
  16388. })
  16389. stream.once('close', () => {
  16390. h2State.openStreams -= 1
  16391. // TODO(HTTP/2): unref only if current streams count is 0
  16392. if (h2State.openStreams === 0) {
  16393. session.unref()
  16394. }
  16395. })
  16396. stream.once('error', function (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.once('frameError', (type, code) => {
  16403. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16404. errorRequest(client, request, err)
  16405. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16406. h2State.streams -= 1
  16407. util.destroy(stream, err)
  16408. }
  16409. })
  16410. // stream.on('aborted', () => {
  16411. // // TODO(HTTP/2): Support aborted
  16412. // })
  16413. // stream.on('timeout', () => {
  16414. // // TODO(HTTP/2): Support timeout
  16415. // })
  16416. // stream.on('push', headers => {
  16417. // // TODO(HTTP/2): Suppor push
  16418. // })
  16419. // stream.on('trailers', headers => {
  16420. // // TODO(HTTP/2): Support trailers
  16421. // })
  16422. return true
  16423. function writeBodyH2 () {
  16424. /* istanbul ignore else: assertion */
  16425. if (!body) {
  16426. request.onRequestSent()
  16427. } else if (util.isBuffer(body)) {
  16428. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16429. stream.cork()
  16430. stream.write(body)
  16431. stream.uncork()
  16432. stream.end()
  16433. request.onBodySent(body)
  16434. request.onRequestSent()
  16435. } else if (util.isBlobLike(body)) {
  16436. if (typeof body.stream === 'function') {
  16437. writeIterable({
  16438. client,
  16439. request,
  16440. contentLength,
  16441. h2stream: stream,
  16442. expectsPayload,
  16443. body: body.stream(),
  16444. socket: client[kSocket],
  16445. header: ''
  16446. })
  16447. } else {
  16448. writeBlob({
  16449. body,
  16450. client,
  16451. request,
  16452. contentLength,
  16453. expectsPayload,
  16454. h2stream: stream,
  16455. header: '',
  16456. socket: client[kSocket]
  16457. })
  16458. }
  16459. } else if (util.isStream(body)) {
  16460. writeStream({
  16461. body,
  16462. client,
  16463. request,
  16464. contentLength,
  16465. expectsPayload,
  16466. socket: client[kSocket],
  16467. h2stream: stream,
  16468. header: ''
  16469. })
  16470. } else if (util.isIterable(body)) {
  16471. writeIterable({
  16472. body,
  16473. client,
  16474. request,
  16475. contentLength,
  16476. expectsPayload,
  16477. header: '',
  16478. h2stream: stream,
  16479. socket: client[kSocket]
  16480. })
  16481. } else {
  16482. assert(false)
  16483. }
  16484. }
  16485. }
  16486. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16487. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16488. if (client[kHTTPConnVersion] === 'h2') {
  16489. // For HTTP/2, is enough to pipe the stream
  16490. const pipe = pipeline(
  16491. body,
  16492. h2stream,
  16493. (err) => {
  16494. if (err) {
  16495. util.destroy(body, err)
  16496. util.destroy(h2stream, err)
  16497. } else {
  16498. request.onRequestSent()
  16499. }
  16500. }
  16501. )
  16502. pipe.on('data', onPipeData)
  16503. pipe.once('end', () => {
  16504. pipe.removeListener('data', onPipeData)
  16505. util.destroy(pipe)
  16506. })
  16507. function onPipeData (chunk) {
  16508. request.onBodySent(chunk)
  16509. }
  16510. return
  16511. }
  16512. let finished = false
  16513. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16514. const onData = function (chunk) {
  16515. if (finished) {
  16516. return
  16517. }
  16518. try {
  16519. if (!writer.write(chunk) && this.pause) {
  16520. this.pause()
  16521. }
  16522. } catch (err) {
  16523. util.destroy(this, err)
  16524. }
  16525. }
  16526. const onDrain = function () {
  16527. if (finished) {
  16528. return
  16529. }
  16530. if (body.resume) {
  16531. body.resume()
  16532. }
  16533. }
  16534. const onAbort = function () {
  16535. if (finished) {
  16536. return
  16537. }
  16538. const err = new RequestAbortedError()
  16539. queueMicrotask(() => onFinished(err))
  16540. }
  16541. const onFinished = function (err) {
  16542. if (finished) {
  16543. return
  16544. }
  16545. finished = true
  16546. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16547. socket
  16548. .off('drain', onDrain)
  16549. .off('error', onFinished)
  16550. body
  16551. .removeListener('data', onData)
  16552. .removeListener('end', onFinished)
  16553. .removeListener('error', onFinished)
  16554. .removeListener('close', onAbort)
  16555. if (!err) {
  16556. try {
  16557. writer.end()
  16558. } catch (er) {
  16559. err = er
  16560. }
  16561. }
  16562. writer.destroy(err)
  16563. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16564. util.destroy(body, err)
  16565. } else {
  16566. util.destroy(body)
  16567. }
  16568. }
  16569. body
  16570. .on('data', onData)
  16571. .on('end', onFinished)
  16572. .on('error', onFinished)
  16573. .on('close', onAbort)
  16574. if (body.resume) {
  16575. body.resume()
  16576. }
  16577. socket
  16578. .on('drain', onDrain)
  16579. .on('error', onFinished)
  16580. }
  16581. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16582. assert(contentLength === body.size, 'blob body must have content length')
  16583. const isH2 = client[kHTTPConnVersion] === 'h2'
  16584. try {
  16585. if (contentLength != null && contentLength !== body.size) {
  16586. throw new RequestContentLengthMismatchError()
  16587. }
  16588. const buffer = Buffer.from(await body.arrayBuffer())
  16589. if (isH2) {
  16590. h2stream.cork()
  16591. h2stream.write(buffer)
  16592. h2stream.uncork()
  16593. } else {
  16594. socket.cork()
  16595. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16596. socket.write(buffer)
  16597. socket.uncork()
  16598. }
  16599. request.onBodySent(buffer)
  16600. request.onRequestSent()
  16601. if (!expectsPayload) {
  16602. socket[kReset] = true
  16603. }
  16604. resume(client)
  16605. } catch (err) {
  16606. util.destroy(isH2 ? h2stream : socket, err)
  16607. }
  16608. }
  16609. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16610. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16611. let callback = null
  16612. function onDrain () {
  16613. if (callback) {
  16614. const cb = callback
  16615. callback = null
  16616. cb()
  16617. }
  16618. }
  16619. const waitForDrain = () => new Promise((resolve, reject) => {
  16620. assert(callback === null)
  16621. if (socket[kError]) {
  16622. reject(socket[kError])
  16623. } else {
  16624. callback = resolve
  16625. }
  16626. })
  16627. if (client[kHTTPConnVersion] === 'h2') {
  16628. h2stream
  16629. .on('close', onDrain)
  16630. .on('drain', onDrain)
  16631. try {
  16632. // It's up to the user to somehow abort the async iterable.
  16633. for await (const chunk of body) {
  16634. if (socket[kError]) {
  16635. throw socket[kError]
  16636. }
  16637. const res = h2stream.write(chunk)
  16638. request.onBodySent(chunk)
  16639. if (!res) {
  16640. await waitForDrain()
  16641. }
  16642. }
  16643. } catch (err) {
  16644. h2stream.destroy(err)
  16645. } finally {
  16646. request.onRequestSent()
  16647. h2stream.end()
  16648. h2stream
  16649. .off('close', onDrain)
  16650. .off('drain', onDrain)
  16651. }
  16652. return
  16653. }
  16654. socket
  16655. .on('close', onDrain)
  16656. .on('drain', onDrain)
  16657. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16658. try {
  16659. // It's up to the user to somehow abort the async iterable.
  16660. for await (const chunk of body) {
  16661. if (socket[kError]) {
  16662. throw socket[kError]
  16663. }
  16664. if (!writer.write(chunk)) {
  16665. await waitForDrain()
  16666. }
  16667. }
  16668. writer.end()
  16669. } catch (err) {
  16670. writer.destroy(err)
  16671. } finally {
  16672. socket
  16673. .off('close', onDrain)
  16674. .off('drain', onDrain)
  16675. }
  16676. }
  16677. class AsyncWriter {
  16678. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16679. this.socket = socket
  16680. this.request = request
  16681. this.contentLength = contentLength
  16682. this.client = client
  16683. this.bytesWritten = 0
  16684. this.expectsPayload = expectsPayload
  16685. this.header = header
  16686. socket[kWriting] = true
  16687. }
  16688. write (chunk) {
  16689. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16690. if (socket[kError]) {
  16691. throw socket[kError]
  16692. }
  16693. if (socket.destroyed) {
  16694. return false
  16695. }
  16696. const len = Buffer.byteLength(chunk)
  16697. if (!len) {
  16698. return true
  16699. }
  16700. // We should defer writing chunks.
  16701. if (contentLength !== null && bytesWritten + len > contentLength) {
  16702. if (client[kStrictContentLength]) {
  16703. throw new RequestContentLengthMismatchError()
  16704. }
  16705. process.emitWarning(new RequestContentLengthMismatchError())
  16706. }
  16707. socket.cork()
  16708. if (bytesWritten === 0) {
  16709. if (!expectsPayload) {
  16710. socket[kReset] = true
  16711. }
  16712. if (contentLength === null) {
  16713. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16714. } else {
  16715. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16716. }
  16717. }
  16718. if (contentLength === null) {
  16719. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16720. }
  16721. this.bytesWritten += len
  16722. const ret = socket.write(chunk)
  16723. socket.uncork()
  16724. request.onBodySent(chunk)
  16725. if (!ret) {
  16726. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16727. // istanbul ignore else: only for jest
  16728. if (socket[kParser].timeout.refresh) {
  16729. socket[kParser].timeout.refresh()
  16730. }
  16731. }
  16732. }
  16733. return ret
  16734. }
  16735. end () {
  16736. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  16737. request.onRequestSent()
  16738. socket[kWriting] = false
  16739. if (socket[kError]) {
  16740. throw socket[kError]
  16741. }
  16742. if (socket.destroyed) {
  16743. return
  16744. }
  16745. if (bytesWritten === 0) {
  16746. if (expectsPayload) {
  16747. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16748. // A user agent SHOULD send a Content-Length in a request message when
  16749. // no Transfer-Encoding is sent and the request method defines a meaning
  16750. // for an enclosed payload body.
  16751. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16752. } else {
  16753. socket.write(`${header}\r\n`, 'latin1')
  16754. }
  16755. } else if (contentLength === null) {
  16756. socket.write('\r\n0\r\n\r\n', 'latin1')
  16757. }
  16758. if (contentLength !== null && bytesWritten !== contentLength) {
  16759. if (client[kStrictContentLength]) {
  16760. throw new RequestContentLengthMismatchError()
  16761. } else {
  16762. process.emitWarning(new RequestContentLengthMismatchError())
  16763. }
  16764. }
  16765. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16766. // istanbul ignore else: only for jest
  16767. if (socket[kParser].timeout.refresh) {
  16768. socket[kParser].timeout.refresh()
  16769. }
  16770. }
  16771. resume(client)
  16772. }
  16773. destroy (err) {
  16774. const { socket, client } = this
  16775. socket[kWriting] = false
  16776. if (err) {
  16777. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  16778. util.destroy(socket, err)
  16779. }
  16780. }
  16781. }
  16782. function errorRequest (client, request, err) {
  16783. try {
  16784. request.onError(err)
  16785. assert(request.aborted)
  16786. } catch (err) {
  16787. client.emit('error', err)
  16788. }
  16789. }
  16790. module.exports = Client
  16791. /***/ }),
  16792. /***/ 6436:
  16793. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16794. "use strict";
  16795. /* istanbul ignore file: only for Node 12 */
  16796. const { kConnected, kSize } = __nccwpck_require__(2785)
  16797. class CompatWeakRef {
  16798. constructor (value) {
  16799. this.value = value
  16800. }
  16801. deref () {
  16802. return this.value[kConnected] === 0 && this.value[kSize] === 0
  16803. ? undefined
  16804. : this.value
  16805. }
  16806. }
  16807. class CompatFinalizer {
  16808. constructor (finalizer) {
  16809. this.finalizer = finalizer
  16810. }
  16811. register (dispatcher, key) {
  16812. if (dispatcher.on) {
  16813. dispatcher.on('disconnect', () => {
  16814. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  16815. this.finalizer(key)
  16816. }
  16817. })
  16818. }
  16819. }
  16820. }
  16821. module.exports = function () {
  16822. // FIXME: remove workaround when the Node bug is fixed
  16823. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  16824. if (process.env.NODE_V8_COVERAGE) {
  16825. return {
  16826. WeakRef: CompatWeakRef,
  16827. FinalizationRegistry: CompatFinalizer
  16828. }
  16829. }
  16830. return {
  16831. WeakRef: global.WeakRef || CompatWeakRef,
  16832. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  16833. }
  16834. }
  16835. /***/ }),
  16836. /***/ 663:
  16837. /***/ ((module) => {
  16838. "use strict";
  16839. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  16840. const maxAttributeValueSize = 1024
  16841. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  16842. const maxNameValuePairSize = 4096
  16843. module.exports = {
  16844. maxAttributeValueSize,
  16845. maxNameValuePairSize
  16846. }
  16847. /***/ }),
  16848. /***/ 1724:
  16849. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16850. "use strict";
  16851. const { parseSetCookie } = __nccwpck_require__(4408)
  16852. const { stringify, getHeadersList } = __nccwpck_require__(3121)
  16853. const { webidl } = __nccwpck_require__(1744)
  16854. const { Headers } = __nccwpck_require__(554)
  16855. /**
  16856. * @typedef {Object} Cookie
  16857. * @property {string} name
  16858. * @property {string} value
  16859. * @property {Date|number|undefined} expires
  16860. * @property {number|undefined} maxAge
  16861. * @property {string|undefined} domain
  16862. * @property {string|undefined} path
  16863. * @property {boolean|undefined} secure
  16864. * @property {boolean|undefined} httpOnly
  16865. * @property {'Strict'|'Lax'|'None'} sameSite
  16866. * @property {string[]} unparsed
  16867. */
  16868. /**
  16869. * @param {Headers} headers
  16870. * @returns {Record<string, string>}
  16871. */
  16872. function getCookies (headers) {
  16873. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  16874. webidl.brandCheck(headers, Headers, { strict: false })
  16875. const cookie = headers.get('cookie')
  16876. const out = {}
  16877. if (!cookie) {
  16878. return out
  16879. }
  16880. for (const piece of cookie.split(';')) {
  16881. const [name, ...value] = piece.split('=')
  16882. out[name.trim()] = value.join('=')
  16883. }
  16884. return out
  16885. }
  16886. /**
  16887. * @param {Headers} headers
  16888. * @param {string} name
  16889. * @param {{ path?: string, domain?: string }|undefined} attributes
  16890. * @returns {void}
  16891. */
  16892. function deleteCookie (headers, name, attributes) {
  16893. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  16894. webidl.brandCheck(headers, Headers, { strict: false })
  16895. name = webidl.converters.DOMString(name)
  16896. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  16897. // Matches behavior of
  16898. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  16899. setCookie(headers, {
  16900. name,
  16901. value: '',
  16902. expires: new Date(0),
  16903. ...attributes
  16904. })
  16905. }
  16906. /**
  16907. * @param {Headers} headers
  16908. * @returns {Cookie[]}
  16909. */
  16910. function getSetCookies (headers) {
  16911. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  16912. webidl.brandCheck(headers, Headers, { strict: false })
  16913. const cookies = getHeadersList(headers).cookies
  16914. if (!cookies) {
  16915. return []
  16916. }
  16917. // In older versions of undici, cookies is a list of name:value.
  16918. return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
  16919. }
  16920. /**
  16921. * @param {Headers} headers
  16922. * @param {Cookie} cookie
  16923. * @returns {void}
  16924. */
  16925. function setCookie (headers, cookie) {
  16926. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  16927. webidl.brandCheck(headers, Headers, { strict: false })
  16928. cookie = webidl.converters.Cookie(cookie)
  16929. const str = stringify(cookie)
  16930. if (str) {
  16931. headers.append('Set-Cookie', stringify(cookie))
  16932. }
  16933. }
  16934. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  16935. {
  16936. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16937. key: 'path',
  16938. defaultValue: null
  16939. },
  16940. {
  16941. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16942. key: 'domain',
  16943. defaultValue: null
  16944. }
  16945. ])
  16946. webidl.converters.Cookie = webidl.dictionaryConverter([
  16947. {
  16948. converter: webidl.converters.DOMString,
  16949. key: 'name'
  16950. },
  16951. {
  16952. converter: webidl.converters.DOMString,
  16953. key: 'value'
  16954. },
  16955. {
  16956. converter: webidl.nullableConverter((value) => {
  16957. if (typeof value === 'number') {
  16958. return webidl.converters['unsigned long long'](value)
  16959. }
  16960. return new Date(value)
  16961. }),
  16962. key: 'expires',
  16963. defaultValue: null
  16964. },
  16965. {
  16966. converter: webidl.nullableConverter(webidl.converters['long long']),
  16967. key: 'maxAge',
  16968. defaultValue: null
  16969. },
  16970. {
  16971. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16972. key: 'domain',
  16973. defaultValue: null
  16974. },
  16975. {
  16976. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16977. key: 'path',
  16978. defaultValue: null
  16979. },
  16980. {
  16981. converter: webidl.nullableConverter(webidl.converters.boolean),
  16982. key: 'secure',
  16983. defaultValue: null
  16984. },
  16985. {
  16986. converter: webidl.nullableConverter(webidl.converters.boolean),
  16987. key: 'httpOnly',
  16988. defaultValue: null
  16989. },
  16990. {
  16991. converter: webidl.converters.USVString,
  16992. key: 'sameSite',
  16993. allowedValues: ['Strict', 'Lax', 'None']
  16994. },
  16995. {
  16996. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  16997. key: 'unparsed',
  16998. defaultValue: []
  16999. }
  17000. ])
  17001. module.exports = {
  17002. getCookies,
  17003. deleteCookie,
  17004. getSetCookies,
  17005. setCookie
  17006. }
  17007. /***/ }),
  17008. /***/ 4408:
  17009. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17010. "use strict";
  17011. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17012. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17013. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17014. const assert = __nccwpck_require__(9491)
  17015. /**
  17016. * @description Parses the field-value attributes of a set-cookie header string.
  17017. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17018. * @param {string} header
  17019. * @returns if the header is invalid, null will be returned
  17020. */
  17021. function parseSetCookie (header) {
  17022. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17023. // character (CTL characters excluding HTAB): Abort these steps and
  17024. // ignore the set-cookie-string entirely.
  17025. if (isCTLExcludingHtab(header)) {
  17026. return null
  17027. }
  17028. let nameValuePair = ''
  17029. let unparsedAttributes = ''
  17030. let name = ''
  17031. let value = ''
  17032. // 2. If the set-cookie-string contains a %x3B (";") character:
  17033. if (header.includes(';')) {
  17034. // 1. The name-value-pair string consists of the characters up to,
  17035. // but not including, the first %x3B (";"), and the unparsed-
  17036. // attributes consist of the remainder of the set-cookie-string
  17037. // (including the %x3B (";") in question).
  17038. const position = { position: 0 }
  17039. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17040. unparsedAttributes = header.slice(position.position)
  17041. } else {
  17042. // Otherwise:
  17043. // 1. The name-value-pair string consists of all the characters
  17044. // contained in the set-cookie-string, and the unparsed-
  17045. // attributes is the empty string.
  17046. nameValuePair = header
  17047. }
  17048. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17049. // the name string is empty, and the value string is the value of
  17050. // name-value-pair.
  17051. if (!nameValuePair.includes('=')) {
  17052. value = nameValuePair
  17053. } else {
  17054. // Otherwise, the name string consists of the characters up to, but
  17055. // not including, the first %x3D ("=") character, and the (possibly
  17056. // empty) value string consists of the characters after the first
  17057. // %x3D ("=") character.
  17058. const position = { position: 0 }
  17059. name = collectASequenceOfCodePointsFast(
  17060. '=',
  17061. nameValuePair,
  17062. position
  17063. )
  17064. value = nameValuePair.slice(position.position + 1)
  17065. }
  17066. // 4. Remove any leading or trailing WSP characters from the name
  17067. // string and the value string.
  17068. name = name.trim()
  17069. value = value.trim()
  17070. // 5. If the sum of the lengths of the name string and the value string
  17071. // is more than 4096 octets, abort these steps and ignore the set-
  17072. // cookie-string entirely.
  17073. if (name.length + value.length > maxNameValuePairSize) {
  17074. return null
  17075. }
  17076. // 6. The cookie-name is the name string, and the cookie-value is the
  17077. // value string.
  17078. return {
  17079. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17080. }
  17081. }
  17082. /**
  17083. * Parses the remaining attributes of a set-cookie header
  17084. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17085. * @param {string} unparsedAttributes
  17086. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17087. */
  17088. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17089. // 1. If the unparsed-attributes string is empty, skip the rest of
  17090. // these steps.
  17091. if (unparsedAttributes.length === 0) {
  17092. return cookieAttributeList
  17093. }
  17094. // 2. Discard the first character of the unparsed-attributes (which
  17095. // will be a %x3B (";") character).
  17096. assert(unparsedAttributes[0] === ';')
  17097. unparsedAttributes = unparsedAttributes.slice(1)
  17098. let cookieAv = ''
  17099. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17100. // character:
  17101. if (unparsedAttributes.includes(';')) {
  17102. // 1. Consume the characters of the unparsed-attributes up to, but
  17103. // not including, the first %x3B (";") character.
  17104. cookieAv = collectASequenceOfCodePointsFast(
  17105. ';',
  17106. unparsedAttributes,
  17107. { position: 0 }
  17108. )
  17109. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17110. } else {
  17111. // Otherwise:
  17112. // 1. Consume the remainder of the unparsed-attributes.
  17113. cookieAv = unparsedAttributes
  17114. unparsedAttributes = ''
  17115. }
  17116. // Let the cookie-av string be the characters consumed in this step.
  17117. let attributeName = ''
  17118. let attributeValue = ''
  17119. // 4. If the cookie-av string contains a %x3D ("=") character:
  17120. if (cookieAv.includes('=')) {
  17121. // 1. The (possibly empty) attribute-name string consists of the
  17122. // characters up to, but not including, the first %x3D ("=")
  17123. // character, and the (possibly empty) attribute-value string
  17124. // consists of the characters after the first %x3D ("=")
  17125. // character.
  17126. const position = { position: 0 }
  17127. attributeName = collectASequenceOfCodePointsFast(
  17128. '=',
  17129. cookieAv,
  17130. position
  17131. )
  17132. attributeValue = cookieAv.slice(position.position + 1)
  17133. } else {
  17134. // Otherwise:
  17135. // 1. The attribute-name string consists of the entire cookie-av
  17136. // string, and the attribute-value string is empty.
  17137. attributeName = cookieAv
  17138. }
  17139. // 5. Remove any leading or trailing WSP characters from the attribute-
  17140. // name string and the attribute-value string.
  17141. attributeName = attributeName.trim()
  17142. attributeValue = attributeValue.trim()
  17143. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17144. // cookie-av string and return to Step 1 of this algorithm.
  17145. if (attributeValue.length > maxAttributeValueSize) {
  17146. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17147. }
  17148. // 7. Process the attribute-name and attribute-value according to the
  17149. // requirements in the following subsections. (Notice that
  17150. // attributes with unrecognized attribute-names are ignored.)
  17151. const attributeNameLowercase = attributeName.toLowerCase()
  17152. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17153. // If the attribute-name case-insensitively matches the string
  17154. // "Expires", the user agent MUST process the cookie-av as follows.
  17155. if (attributeNameLowercase === 'expires') {
  17156. // 1. Let the expiry-time be the result of parsing the attribute-value
  17157. // as cookie-date (see Section 5.1.1).
  17158. const expiryTime = new Date(attributeValue)
  17159. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17160. // the cookie-av.
  17161. cookieAttributeList.expires = expiryTime
  17162. } else if (attributeNameLowercase === 'max-age') {
  17163. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17164. // If the attribute-name case-insensitively matches the string "Max-
  17165. // Age", the user agent MUST process the cookie-av as follows.
  17166. // 1. If the first character of the attribute-value is not a DIGIT or a
  17167. // "-" character, ignore the cookie-av.
  17168. const charCode = attributeValue.charCodeAt(0)
  17169. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17170. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17171. }
  17172. // 2. If the remainder of attribute-value contains a non-DIGIT
  17173. // character, ignore the cookie-av.
  17174. if (!/^\d+$/.test(attributeValue)) {
  17175. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17176. }
  17177. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17178. const deltaSeconds = Number(attributeValue)
  17179. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17180. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17181. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17182. // age-limit.
  17183. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17184. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17185. // time be the earliest representable date and time. Otherwise, let
  17186. // the expiry-time be the current date and time plus delta-seconds
  17187. // seconds.
  17188. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17189. // 7. Append an attribute to the cookie-attribute-list with an
  17190. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17191. cookieAttributeList.maxAge = deltaSeconds
  17192. } else if (attributeNameLowercase === 'domain') {
  17193. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17194. // If the attribute-name case-insensitively matches the string "Domain",
  17195. // the user agent MUST process the cookie-av as follows.
  17196. // 1. Let cookie-domain be the attribute-value.
  17197. let cookieDomain = attributeValue
  17198. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17199. // cookie-domain without its leading %x2E (".").
  17200. if (cookieDomain[0] === '.') {
  17201. cookieDomain = cookieDomain.slice(1)
  17202. }
  17203. // 3. Convert the cookie-domain to lower case.
  17204. cookieDomain = cookieDomain.toLowerCase()
  17205. // 4. Append an attribute to the cookie-attribute-list with an
  17206. // attribute-name of Domain and an attribute-value of cookie-domain.
  17207. cookieAttributeList.domain = cookieDomain
  17208. } else if (attributeNameLowercase === 'path') {
  17209. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17210. // If the attribute-name case-insensitively matches the string "Path",
  17211. // the user agent MUST process the cookie-av as follows.
  17212. // 1. If the attribute-value is empty or if the first character of the
  17213. // attribute-value is not %x2F ("/"):
  17214. let cookiePath = ''
  17215. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17216. // 1. Let cookie-path be the default-path.
  17217. cookiePath = '/'
  17218. } else {
  17219. // Otherwise:
  17220. // 1. Let cookie-path be the attribute-value.
  17221. cookiePath = attributeValue
  17222. }
  17223. // 2. Append an attribute to the cookie-attribute-list with an
  17224. // attribute-name of Path and an attribute-value of cookie-path.
  17225. cookieAttributeList.path = cookiePath
  17226. } else if (attributeNameLowercase === 'secure') {
  17227. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17228. // If the attribute-name case-insensitively matches the string "Secure",
  17229. // the user agent MUST append an attribute to the cookie-attribute-list
  17230. // with an attribute-name of Secure and an empty attribute-value.
  17231. cookieAttributeList.secure = true
  17232. } else if (attributeNameLowercase === 'httponly') {
  17233. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17234. // If the attribute-name case-insensitively matches the string
  17235. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17236. // attribute-list with an attribute-name of HttpOnly and an empty
  17237. // attribute-value.
  17238. cookieAttributeList.httpOnly = true
  17239. } else if (attributeNameLowercase === 'samesite') {
  17240. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17241. // If the attribute-name case-insensitively matches the string
  17242. // "SameSite", the user agent MUST process the cookie-av as follows:
  17243. // 1. Let enforcement be "Default".
  17244. let enforcement = 'Default'
  17245. const attributeValueLowercase = attributeValue.toLowerCase()
  17246. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17247. // "None", set enforcement to "None".
  17248. if (attributeValueLowercase.includes('none')) {
  17249. enforcement = 'None'
  17250. }
  17251. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17252. // "Strict", set enforcement to "Strict".
  17253. if (attributeValueLowercase.includes('strict')) {
  17254. enforcement = 'Strict'
  17255. }
  17256. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17257. // "Lax", set enforcement to "Lax".
  17258. if (attributeValueLowercase.includes('lax')) {
  17259. enforcement = 'Lax'
  17260. }
  17261. // 5. Append an attribute to the cookie-attribute-list with an
  17262. // attribute-name of "SameSite" and an attribute-value of
  17263. // enforcement.
  17264. cookieAttributeList.sameSite = enforcement
  17265. } else {
  17266. cookieAttributeList.unparsed ??= []
  17267. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17268. }
  17269. // 8. Return to Step 1 of this algorithm.
  17270. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17271. }
  17272. module.exports = {
  17273. parseSetCookie,
  17274. parseUnparsedAttributes
  17275. }
  17276. /***/ }),
  17277. /***/ 3121:
  17278. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17279. "use strict";
  17280. const assert = __nccwpck_require__(9491)
  17281. const { kHeadersList } = __nccwpck_require__(2785)
  17282. function isCTLExcludingHtab (value) {
  17283. if (value.length === 0) {
  17284. return false
  17285. }
  17286. for (const char of value) {
  17287. const code = char.charCodeAt(0)
  17288. if (
  17289. (code >= 0x00 || code <= 0x08) ||
  17290. (code >= 0x0A || code <= 0x1F) ||
  17291. code === 0x7F
  17292. ) {
  17293. return false
  17294. }
  17295. }
  17296. }
  17297. /**
  17298. CHAR = <any US-ASCII character (octets 0 - 127)>
  17299. token = 1*<any CHAR except CTLs or separators>
  17300. separators = "(" | ")" | "<" | ">" | "@"
  17301. | "," | ";" | ":" | "\" | <">
  17302. | "/" | "[" | "]" | "?" | "="
  17303. | "{" | "}" | SP | HT
  17304. * @param {string} name
  17305. */
  17306. function validateCookieName (name) {
  17307. for (const char of name) {
  17308. const code = char.charCodeAt(0)
  17309. if (
  17310. (code <= 0x20 || code > 0x7F) ||
  17311. char === '(' ||
  17312. char === ')' ||
  17313. char === '>' ||
  17314. char === '<' ||
  17315. char === '@' ||
  17316. char === ',' ||
  17317. char === ';' ||
  17318. char === ':' ||
  17319. char === '\\' ||
  17320. char === '"' ||
  17321. char === '/' ||
  17322. char === '[' ||
  17323. char === ']' ||
  17324. char === '?' ||
  17325. char === '=' ||
  17326. char === '{' ||
  17327. char === '}'
  17328. ) {
  17329. throw new Error('Invalid cookie name')
  17330. }
  17331. }
  17332. }
  17333. /**
  17334. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17335. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17336. ; US-ASCII characters excluding CTLs,
  17337. ; whitespace DQUOTE, comma, semicolon,
  17338. ; and backslash
  17339. * @param {string} value
  17340. */
  17341. function validateCookieValue (value) {
  17342. for (const char of value) {
  17343. const code = char.charCodeAt(0)
  17344. if (
  17345. code < 0x21 || // exclude CTLs (0-31)
  17346. code === 0x22 ||
  17347. code === 0x2C ||
  17348. code === 0x3B ||
  17349. code === 0x5C ||
  17350. code > 0x7E // non-ascii
  17351. ) {
  17352. throw new Error('Invalid header value')
  17353. }
  17354. }
  17355. }
  17356. /**
  17357. * path-value = <any CHAR except CTLs or ";">
  17358. * @param {string} path
  17359. */
  17360. function validateCookiePath (path) {
  17361. for (const char of path) {
  17362. const code = char.charCodeAt(0)
  17363. if (code < 0x21 || char === ';') {
  17364. throw new Error('Invalid cookie path')
  17365. }
  17366. }
  17367. }
  17368. /**
  17369. * I have no idea why these values aren't allowed to be honest,
  17370. * but Deno tests these. - Khafra
  17371. * @param {string} domain
  17372. */
  17373. function validateCookieDomain (domain) {
  17374. if (
  17375. domain.startsWith('-') ||
  17376. domain.endsWith('.') ||
  17377. domain.endsWith('-')
  17378. ) {
  17379. throw new Error('Invalid cookie domain')
  17380. }
  17381. }
  17382. /**
  17383. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17384. * @param {number|Date} date
  17385. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17386. ; fixed length/zone/capitalization subset of the format
  17387. ; see Section 3.3 of [RFC5322]
  17388. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17389. / %x54.75.65 ; "Tue", case-sensitive
  17390. / %x57.65.64 ; "Wed", case-sensitive
  17391. / %x54.68.75 ; "Thu", case-sensitive
  17392. / %x46.72.69 ; "Fri", case-sensitive
  17393. / %x53.61.74 ; "Sat", case-sensitive
  17394. / %x53.75.6E ; "Sun", case-sensitive
  17395. date1 = day SP month SP year
  17396. ; e.g., 02 Jun 1982
  17397. day = 2DIGIT
  17398. month = %x4A.61.6E ; "Jan", case-sensitive
  17399. / %x46.65.62 ; "Feb", case-sensitive
  17400. / %x4D.61.72 ; "Mar", case-sensitive
  17401. / %x41.70.72 ; "Apr", case-sensitive
  17402. / %x4D.61.79 ; "May", case-sensitive
  17403. / %x4A.75.6E ; "Jun", case-sensitive
  17404. / %x4A.75.6C ; "Jul", case-sensitive
  17405. / %x41.75.67 ; "Aug", case-sensitive
  17406. / %x53.65.70 ; "Sep", case-sensitive
  17407. / %x4F.63.74 ; "Oct", case-sensitive
  17408. / %x4E.6F.76 ; "Nov", case-sensitive
  17409. / %x44.65.63 ; "Dec", case-sensitive
  17410. year = 4DIGIT
  17411. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17412. time-of-day = hour ":" minute ":" second
  17413. ; 00:00:00 - 23:59:60 (leap second)
  17414. hour = 2DIGIT
  17415. minute = 2DIGIT
  17416. second = 2DIGIT
  17417. */
  17418. function toIMFDate (date) {
  17419. if (typeof date === 'number') {
  17420. date = new Date(date)
  17421. }
  17422. const days = [
  17423. 'Sun', 'Mon', 'Tue', 'Wed',
  17424. 'Thu', 'Fri', 'Sat'
  17425. ]
  17426. const months = [
  17427. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17428. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17429. ]
  17430. const dayName = days[date.getUTCDay()]
  17431. const day = date.getUTCDate().toString().padStart(2, '0')
  17432. const month = months[date.getUTCMonth()]
  17433. const year = date.getUTCFullYear()
  17434. const hour = date.getUTCHours().toString().padStart(2, '0')
  17435. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17436. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17437. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17438. }
  17439. /**
  17440. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17441. ; In practice, both expires-av and max-age-av
  17442. ; are limited to dates representable by the
  17443. ; user agent.
  17444. * @param {number} maxAge
  17445. */
  17446. function validateCookieMaxAge (maxAge) {
  17447. if (maxAge < 0) {
  17448. throw new Error('Invalid cookie max-age')
  17449. }
  17450. }
  17451. /**
  17452. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17453. * @param {import('./index').Cookie} cookie
  17454. */
  17455. function stringify (cookie) {
  17456. if (cookie.name.length === 0) {
  17457. return null
  17458. }
  17459. validateCookieName(cookie.name)
  17460. validateCookieValue(cookie.value)
  17461. const out = [`${cookie.name}=${cookie.value}`]
  17462. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17463. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17464. if (cookie.name.startsWith('__Secure-')) {
  17465. cookie.secure = true
  17466. }
  17467. if (cookie.name.startsWith('__Host-')) {
  17468. cookie.secure = true
  17469. cookie.domain = null
  17470. cookie.path = '/'
  17471. }
  17472. if (cookie.secure) {
  17473. out.push('Secure')
  17474. }
  17475. if (cookie.httpOnly) {
  17476. out.push('HttpOnly')
  17477. }
  17478. if (typeof cookie.maxAge === 'number') {
  17479. validateCookieMaxAge(cookie.maxAge)
  17480. out.push(`Max-Age=${cookie.maxAge}`)
  17481. }
  17482. if (cookie.domain) {
  17483. validateCookieDomain(cookie.domain)
  17484. out.push(`Domain=${cookie.domain}`)
  17485. }
  17486. if (cookie.path) {
  17487. validateCookiePath(cookie.path)
  17488. out.push(`Path=${cookie.path}`)
  17489. }
  17490. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17491. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17492. }
  17493. if (cookie.sameSite) {
  17494. out.push(`SameSite=${cookie.sameSite}`)
  17495. }
  17496. for (const part of cookie.unparsed) {
  17497. if (!part.includes('=')) {
  17498. throw new Error('Invalid unparsed')
  17499. }
  17500. const [key, ...value] = part.split('=')
  17501. out.push(`${key.trim()}=${value.join('=')}`)
  17502. }
  17503. return out.join('; ')
  17504. }
  17505. let kHeadersListNode
  17506. function getHeadersList (headers) {
  17507. if (headers[kHeadersList]) {
  17508. return headers[kHeadersList]
  17509. }
  17510. if (!kHeadersListNode) {
  17511. kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
  17512. (symbol) => symbol.description === 'headers list'
  17513. )
  17514. assert(kHeadersListNode, 'Headers cannot be parsed')
  17515. }
  17516. const headersList = headers[kHeadersListNode]
  17517. assert(headersList)
  17518. return headersList
  17519. }
  17520. module.exports = {
  17521. isCTLExcludingHtab,
  17522. stringify,
  17523. getHeadersList
  17524. }
  17525. /***/ }),
  17526. /***/ 2067:
  17527. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17528. "use strict";
  17529. const net = __nccwpck_require__(1808)
  17530. const assert = __nccwpck_require__(9491)
  17531. const util = __nccwpck_require__(3983)
  17532. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17533. let tls // include tls conditionally since it is not always available
  17534. // TODO: session re-use does not wait for the first
  17535. // connection to resolve the session and might therefore
  17536. // resolve the same servername multiple times even when
  17537. // re-use is enabled.
  17538. let SessionCache
  17539. // FIXME: remove workaround when the Node bug is fixed
  17540. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17541. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17542. SessionCache = class WeakSessionCache {
  17543. constructor (maxCachedSessions) {
  17544. this._maxCachedSessions = maxCachedSessions
  17545. this._sessionCache = new Map()
  17546. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17547. if (this._sessionCache.size < this._maxCachedSessions) {
  17548. return
  17549. }
  17550. const ref = this._sessionCache.get(key)
  17551. if (ref !== undefined && ref.deref() === undefined) {
  17552. this._sessionCache.delete(key)
  17553. }
  17554. })
  17555. }
  17556. get (sessionKey) {
  17557. const ref = this._sessionCache.get(sessionKey)
  17558. return ref ? ref.deref() : null
  17559. }
  17560. set (sessionKey, session) {
  17561. if (this._maxCachedSessions === 0) {
  17562. return
  17563. }
  17564. this._sessionCache.set(sessionKey, new WeakRef(session))
  17565. this._sessionRegistry.register(session, sessionKey)
  17566. }
  17567. }
  17568. } else {
  17569. SessionCache = class SimpleSessionCache {
  17570. constructor (maxCachedSessions) {
  17571. this._maxCachedSessions = maxCachedSessions
  17572. this._sessionCache = new Map()
  17573. }
  17574. get (sessionKey) {
  17575. return this._sessionCache.get(sessionKey)
  17576. }
  17577. set (sessionKey, session) {
  17578. if (this._maxCachedSessions === 0) {
  17579. return
  17580. }
  17581. if (this._sessionCache.size >= this._maxCachedSessions) {
  17582. // remove the oldest session
  17583. const { value: oldestKey } = this._sessionCache.keys().next()
  17584. this._sessionCache.delete(oldestKey)
  17585. }
  17586. this._sessionCache.set(sessionKey, session)
  17587. }
  17588. }
  17589. }
  17590. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17591. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17592. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17593. }
  17594. const options = { path: socketPath, ...opts }
  17595. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17596. timeout = timeout == null ? 10e3 : timeout
  17597. allowH2 = allowH2 != null ? allowH2 : false
  17598. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17599. let socket
  17600. if (protocol === 'https:') {
  17601. if (!tls) {
  17602. tls = __nccwpck_require__(4404)
  17603. }
  17604. servername = servername || options.servername || util.getServerName(host) || null
  17605. const sessionKey = servername || hostname
  17606. const session = sessionCache.get(sessionKey) || null
  17607. assert(sessionKey)
  17608. socket = tls.connect({
  17609. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17610. ...options,
  17611. servername,
  17612. session,
  17613. localAddress,
  17614. // TODO(HTTP/2): Add support for h2c
  17615. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17616. socket: httpSocket, // upgrade socket connection
  17617. port: port || 443,
  17618. host: hostname
  17619. })
  17620. socket
  17621. .on('session', function (session) {
  17622. // TODO (fix): Can a session become invalid once established? Don't think so?
  17623. sessionCache.set(sessionKey, session)
  17624. })
  17625. } else {
  17626. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17627. socket = net.connect({
  17628. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17629. ...options,
  17630. localAddress,
  17631. port: port || 80,
  17632. host: hostname
  17633. })
  17634. }
  17635. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17636. if (options.keepAlive == null || options.keepAlive) {
  17637. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17638. socket.setKeepAlive(true, keepAliveInitialDelay)
  17639. }
  17640. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17641. socket
  17642. .setNoDelay(true)
  17643. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17644. cancelTimeout()
  17645. if (callback) {
  17646. const cb = callback
  17647. callback = null
  17648. cb(null, this)
  17649. }
  17650. })
  17651. .on('error', function (err) {
  17652. cancelTimeout()
  17653. if (callback) {
  17654. const cb = callback
  17655. callback = null
  17656. cb(err)
  17657. }
  17658. })
  17659. return socket
  17660. }
  17661. }
  17662. function setupTimeout (onConnectTimeout, timeout) {
  17663. if (!timeout) {
  17664. return () => {}
  17665. }
  17666. let s1 = null
  17667. let s2 = null
  17668. const timeoutId = setTimeout(() => {
  17669. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17670. s1 = setImmediate(() => {
  17671. if (process.platform === 'win32') {
  17672. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17673. s2 = setImmediate(() => onConnectTimeout())
  17674. } else {
  17675. onConnectTimeout()
  17676. }
  17677. })
  17678. }, timeout)
  17679. return () => {
  17680. clearTimeout(timeoutId)
  17681. clearImmediate(s1)
  17682. clearImmediate(s2)
  17683. }
  17684. }
  17685. function onConnectTimeout (socket) {
  17686. util.destroy(socket, new ConnectTimeoutError())
  17687. }
  17688. module.exports = buildConnector
  17689. /***/ }),
  17690. /***/ 4462:
  17691. /***/ ((module) => {
  17692. "use strict";
  17693. /** @type {Record<string, string | undefined>} */
  17694. const headerNameLowerCasedRecord = {}
  17695. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17696. const wellknownHeaderNames = [
  17697. 'Accept',
  17698. 'Accept-Encoding',
  17699. 'Accept-Language',
  17700. 'Accept-Ranges',
  17701. 'Access-Control-Allow-Credentials',
  17702. 'Access-Control-Allow-Headers',
  17703. 'Access-Control-Allow-Methods',
  17704. 'Access-Control-Allow-Origin',
  17705. 'Access-Control-Expose-Headers',
  17706. 'Access-Control-Max-Age',
  17707. 'Access-Control-Request-Headers',
  17708. 'Access-Control-Request-Method',
  17709. 'Age',
  17710. 'Allow',
  17711. 'Alt-Svc',
  17712. 'Alt-Used',
  17713. 'Authorization',
  17714. 'Cache-Control',
  17715. 'Clear-Site-Data',
  17716. 'Connection',
  17717. 'Content-Disposition',
  17718. 'Content-Encoding',
  17719. 'Content-Language',
  17720. 'Content-Length',
  17721. 'Content-Location',
  17722. 'Content-Range',
  17723. 'Content-Security-Policy',
  17724. 'Content-Security-Policy-Report-Only',
  17725. 'Content-Type',
  17726. 'Cookie',
  17727. 'Cross-Origin-Embedder-Policy',
  17728. 'Cross-Origin-Opener-Policy',
  17729. 'Cross-Origin-Resource-Policy',
  17730. 'Date',
  17731. 'Device-Memory',
  17732. 'Downlink',
  17733. 'ECT',
  17734. 'ETag',
  17735. 'Expect',
  17736. 'Expect-CT',
  17737. 'Expires',
  17738. 'Forwarded',
  17739. 'From',
  17740. 'Host',
  17741. 'If-Match',
  17742. 'If-Modified-Since',
  17743. 'If-None-Match',
  17744. 'If-Range',
  17745. 'If-Unmodified-Since',
  17746. 'Keep-Alive',
  17747. 'Last-Modified',
  17748. 'Link',
  17749. 'Location',
  17750. 'Max-Forwards',
  17751. 'Origin',
  17752. 'Permissions-Policy',
  17753. 'Pragma',
  17754. 'Proxy-Authenticate',
  17755. 'Proxy-Authorization',
  17756. 'RTT',
  17757. 'Range',
  17758. 'Referer',
  17759. 'Referrer-Policy',
  17760. 'Refresh',
  17761. 'Retry-After',
  17762. 'Sec-WebSocket-Accept',
  17763. 'Sec-WebSocket-Extensions',
  17764. 'Sec-WebSocket-Key',
  17765. 'Sec-WebSocket-Protocol',
  17766. 'Sec-WebSocket-Version',
  17767. 'Server',
  17768. 'Server-Timing',
  17769. 'Service-Worker-Allowed',
  17770. 'Service-Worker-Navigation-Preload',
  17771. 'Set-Cookie',
  17772. 'SourceMap',
  17773. 'Strict-Transport-Security',
  17774. 'Supports-Loading-Mode',
  17775. 'TE',
  17776. 'Timing-Allow-Origin',
  17777. 'Trailer',
  17778. 'Transfer-Encoding',
  17779. 'Upgrade',
  17780. 'Upgrade-Insecure-Requests',
  17781. 'User-Agent',
  17782. 'Vary',
  17783. 'Via',
  17784. 'WWW-Authenticate',
  17785. 'X-Content-Type-Options',
  17786. 'X-DNS-Prefetch-Control',
  17787. 'X-Frame-Options',
  17788. 'X-Permitted-Cross-Domain-Policies',
  17789. 'X-Powered-By',
  17790. 'X-Requested-With',
  17791. 'X-XSS-Protection'
  17792. ]
  17793. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  17794. const key = wellknownHeaderNames[i]
  17795. const lowerCasedKey = key.toLowerCase()
  17796. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  17797. lowerCasedKey
  17798. }
  17799. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  17800. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  17801. module.exports = {
  17802. wellknownHeaderNames,
  17803. headerNameLowerCasedRecord
  17804. }
  17805. /***/ }),
  17806. /***/ 8045:
  17807. /***/ ((module) => {
  17808. "use strict";
  17809. class UndiciError extends Error {
  17810. constructor (message) {
  17811. super(message)
  17812. this.name = 'UndiciError'
  17813. this.code = 'UND_ERR'
  17814. }
  17815. }
  17816. class ConnectTimeoutError extends UndiciError {
  17817. constructor (message) {
  17818. super(message)
  17819. Error.captureStackTrace(this, ConnectTimeoutError)
  17820. this.name = 'ConnectTimeoutError'
  17821. this.message = message || 'Connect Timeout Error'
  17822. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  17823. }
  17824. }
  17825. class HeadersTimeoutError extends UndiciError {
  17826. constructor (message) {
  17827. super(message)
  17828. Error.captureStackTrace(this, HeadersTimeoutError)
  17829. this.name = 'HeadersTimeoutError'
  17830. this.message = message || 'Headers Timeout Error'
  17831. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  17832. }
  17833. }
  17834. class HeadersOverflowError extends UndiciError {
  17835. constructor (message) {
  17836. super(message)
  17837. Error.captureStackTrace(this, HeadersOverflowError)
  17838. this.name = 'HeadersOverflowError'
  17839. this.message = message || 'Headers Overflow Error'
  17840. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  17841. }
  17842. }
  17843. class BodyTimeoutError extends UndiciError {
  17844. constructor (message) {
  17845. super(message)
  17846. Error.captureStackTrace(this, BodyTimeoutError)
  17847. this.name = 'BodyTimeoutError'
  17848. this.message = message || 'Body Timeout Error'
  17849. this.code = 'UND_ERR_BODY_TIMEOUT'
  17850. }
  17851. }
  17852. class ResponseStatusCodeError extends UndiciError {
  17853. constructor (message, statusCode, headers, body) {
  17854. super(message)
  17855. Error.captureStackTrace(this, ResponseStatusCodeError)
  17856. this.name = 'ResponseStatusCodeError'
  17857. this.message = message || 'Response Status Code Error'
  17858. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  17859. this.body = body
  17860. this.status = statusCode
  17861. this.statusCode = statusCode
  17862. this.headers = headers
  17863. }
  17864. }
  17865. class InvalidArgumentError extends UndiciError {
  17866. constructor (message) {
  17867. super(message)
  17868. Error.captureStackTrace(this, InvalidArgumentError)
  17869. this.name = 'InvalidArgumentError'
  17870. this.message = message || 'Invalid Argument Error'
  17871. this.code = 'UND_ERR_INVALID_ARG'
  17872. }
  17873. }
  17874. class InvalidReturnValueError extends UndiciError {
  17875. constructor (message) {
  17876. super(message)
  17877. Error.captureStackTrace(this, InvalidReturnValueError)
  17878. this.name = 'InvalidReturnValueError'
  17879. this.message = message || 'Invalid Return Value Error'
  17880. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  17881. }
  17882. }
  17883. class RequestAbortedError extends UndiciError {
  17884. constructor (message) {
  17885. super(message)
  17886. Error.captureStackTrace(this, RequestAbortedError)
  17887. this.name = 'AbortError'
  17888. this.message = message || 'Request aborted'
  17889. this.code = 'UND_ERR_ABORTED'
  17890. }
  17891. }
  17892. class InformationalError extends UndiciError {
  17893. constructor (message) {
  17894. super(message)
  17895. Error.captureStackTrace(this, InformationalError)
  17896. this.name = 'InformationalError'
  17897. this.message = message || 'Request information'
  17898. this.code = 'UND_ERR_INFO'
  17899. }
  17900. }
  17901. class RequestContentLengthMismatchError extends UndiciError {
  17902. constructor (message) {
  17903. super(message)
  17904. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  17905. this.name = 'RequestContentLengthMismatchError'
  17906. this.message = message || 'Request body length does not match content-length header'
  17907. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  17908. }
  17909. }
  17910. class ResponseContentLengthMismatchError extends UndiciError {
  17911. constructor (message) {
  17912. super(message)
  17913. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  17914. this.name = 'ResponseContentLengthMismatchError'
  17915. this.message = message || 'Response body length does not match content-length header'
  17916. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  17917. }
  17918. }
  17919. class ClientDestroyedError extends UndiciError {
  17920. constructor (message) {
  17921. super(message)
  17922. Error.captureStackTrace(this, ClientDestroyedError)
  17923. this.name = 'ClientDestroyedError'
  17924. this.message = message || 'The client is destroyed'
  17925. this.code = 'UND_ERR_DESTROYED'
  17926. }
  17927. }
  17928. class ClientClosedError extends UndiciError {
  17929. constructor (message) {
  17930. super(message)
  17931. Error.captureStackTrace(this, ClientClosedError)
  17932. this.name = 'ClientClosedError'
  17933. this.message = message || 'The client is closed'
  17934. this.code = 'UND_ERR_CLOSED'
  17935. }
  17936. }
  17937. class SocketError extends UndiciError {
  17938. constructor (message, socket) {
  17939. super(message)
  17940. Error.captureStackTrace(this, SocketError)
  17941. this.name = 'SocketError'
  17942. this.message = message || 'Socket error'
  17943. this.code = 'UND_ERR_SOCKET'
  17944. this.socket = socket
  17945. }
  17946. }
  17947. class NotSupportedError extends UndiciError {
  17948. constructor (message) {
  17949. super(message)
  17950. Error.captureStackTrace(this, NotSupportedError)
  17951. this.name = 'NotSupportedError'
  17952. this.message = message || 'Not supported error'
  17953. this.code = 'UND_ERR_NOT_SUPPORTED'
  17954. }
  17955. }
  17956. class BalancedPoolMissingUpstreamError extends UndiciError {
  17957. constructor (message) {
  17958. super(message)
  17959. Error.captureStackTrace(this, NotSupportedError)
  17960. this.name = 'MissingUpstreamError'
  17961. this.message = message || 'No upstream has been added to the BalancedPool'
  17962. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  17963. }
  17964. }
  17965. class HTTPParserError extends Error {
  17966. constructor (message, code, data) {
  17967. super(message)
  17968. Error.captureStackTrace(this, HTTPParserError)
  17969. this.name = 'HTTPParserError'
  17970. this.code = code ? `HPE_${code}` : undefined
  17971. this.data = data ? data.toString() : undefined
  17972. }
  17973. }
  17974. class ResponseExceededMaxSizeError extends UndiciError {
  17975. constructor (message) {
  17976. super(message)
  17977. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  17978. this.name = 'ResponseExceededMaxSizeError'
  17979. this.message = message || 'Response content exceeded max size'
  17980. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  17981. }
  17982. }
  17983. class RequestRetryError extends UndiciError {
  17984. constructor (message, code, { headers, data }) {
  17985. super(message)
  17986. Error.captureStackTrace(this, RequestRetryError)
  17987. this.name = 'RequestRetryError'
  17988. this.message = message || 'Request retry error'
  17989. this.code = 'UND_ERR_REQ_RETRY'
  17990. this.statusCode = code
  17991. this.data = data
  17992. this.headers = headers
  17993. }
  17994. }
  17995. module.exports = {
  17996. HTTPParserError,
  17997. UndiciError,
  17998. HeadersTimeoutError,
  17999. HeadersOverflowError,
  18000. BodyTimeoutError,
  18001. RequestContentLengthMismatchError,
  18002. ConnectTimeoutError,
  18003. ResponseStatusCodeError,
  18004. InvalidArgumentError,
  18005. InvalidReturnValueError,
  18006. RequestAbortedError,
  18007. ClientDestroyedError,
  18008. ClientClosedError,
  18009. InformationalError,
  18010. SocketError,
  18011. NotSupportedError,
  18012. ResponseContentLengthMismatchError,
  18013. BalancedPoolMissingUpstreamError,
  18014. ResponseExceededMaxSizeError,
  18015. RequestRetryError
  18016. }
  18017. /***/ }),
  18018. /***/ 2905:
  18019. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18020. "use strict";
  18021. const {
  18022. InvalidArgumentError,
  18023. NotSupportedError
  18024. } = __nccwpck_require__(8045)
  18025. const assert = __nccwpck_require__(9491)
  18026. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18027. const util = __nccwpck_require__(3983)
  18028. // tokenRegExp and headerCharRegex have been lifted from
  18029. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18030. /**
  18031. * Verifies that the given val is a valid HTTP token
  18032. * per the rules defined in RFC 7230
  18033. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18034. */
  18035. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18036. /**
  18037. * Matches if val contains an invalid field-vchar
  18038. * field-value = *( field-content / obs-fold )
  18039. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18040. * field-vchar = VCHAR / obs-text
  18041. */
  18042. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18043. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18044. const invalidPathRegex = /[^\u0021-\u00ff]/
  18045. const kHandler = Symbol('handler')
  18046. const channels = {}
  18047. let extractBody
  18048. try {
  18049. const diagnosticsChannel = __nccwpck_require__(7643)
  18050. channels.create = diagnosticsChannel.channel('undici:request:create')
  18051. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18052. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18053. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18054. channels.error = diagnosticsChannel.channel('undici:request:error')
  18055. } catch {
  18056. channels.create = { hasSubscribers: false }
  18057. channels.bodySent = { hasSubscribers: false }
  18058. channels.headers = { hasSubscribers: false }
  18059. channels.trailers = { hasSubscribers: false }
  18060. channels.error = { hasSubscribers: false }
  18061. }
  18062. class Request {
  18063. constructor (origin, {
  18064. path,
  18065. method,
  18066. body,
  18067. headers,
  18068. query,
  18069. idempotent,
  18070. blocking,
  18071. upgrade,
  18072. headersTimeout,
  18073. bodyTimeout,
  18074. reset,
  18075. throwOnError,
  18076. expectContinue
  18077. }, handler) {
  18078. if (typeof path !== 'string') {
  18079. throw new InvalidArgumentError('path must be a string')
  18080. } else if (
  18081. path[0] !== '/' &&
  18082. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18083. method !== 'CONNECT'
  18084. ) {
  18085. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18086. } else if (invalidPathRegex.exec(path) !== null) {
  18087. throw new InvalidArgumentError('invalid request path')
  18088. }
  18089. if (typeof method !== 'string') {
  18090. throw new InvalidArgumentError('method must be a string')
  18091. } else if (tokenRegExp.exec(method) === null) {
  18092. throw new InvalidArgumentError('invalid request method')
  18093. }
  18094. if (upgrade && typeof upgrade !== 'string') {
  18095. throw new InvalidArgumentError('upgrade must be a string')
  18096. }
  18097. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18098. throw new InvalidArgumentError('invalid headersTimeout')
  18099. }
  18100. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18101. throw new InvalidArgumentError('invalid bodyTimeout')
  18102. }
  18103. if (reset != null && typeof reset !== 'boolean') {
  18104. throw new InvalidArgumentError('invalid reset')
  18105. }
  18106. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18107. throw new InvalidArgumentError('invalid expectContinue')
  18108. }
  18109. this.headersTimeout = headersTimeout
  18110. this.bodyTimeout = bodyTimeout
  18111. this.throwOnError = throwOnError === true
  18112. this.method = method
  18113. this.abort = null
  18114. if (body == null) {
  18115. this.body = null
  18116. } else if (util.isStream(body)) {
  18117. this.body = body
  18118. const rState = this.body._readableState
  18119. if (!rState || !rState.autoDestroy) {
  18120. this.endHandler = function autoDestroy () {
  18121. util.destroy(this)
  18122. }
  18123. this.body.on('end', this.endHandler)
  18124. }
  18125. this.errorHandler = err => {
  18126. if (this.abort) {
  18127. this.abort(err)
  18128. } else {
  18129. this.error = err
  18130. }
  18131. }
  18132. this.body.on('error', this.errorHandler)
  18133. } else if (util.isBuffer(body)) {
  18134. this.body = body.byteLength ? body : null
  18135. } else if (ArrayBuffer.isView(body)) {
  18136. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18137. } else if (body instanceof ArrayBuffer) {
  18138. this.body = body.byteLength ? Buffer.from(body) : null
  18139. } else if (typeof body === 'string') {
  18140. this.body = body.length ? Buffer.from(body) : null
  18141. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18142. this.body = body
  18143. } else {
  18144. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18145. }
  18146. this.completed = false
  18147. this.aborted = false
  18148. this.upgrade = upgrade || null
  18149. this.path = query ? util.buildURL(path, query) : path
  18150. this.origin = origin
  18151. this.idempotent = idempotent == null
  18152. ? method === 'HEAD' || method === 'GET'
  18153. : idempotent
  18154. this.blocking = blocking == null ? false : blocking
  18155. this.reset = reset == null ? null : reset
  18156. this.host = null
  18157. this.contentLength = null
  18158. this.contentType = null
  18159. this.headers = ''
  18160. // Only for H2
  18161. this.expectContinue = expectContinue != null ? expectContinue : false
  18162. if (Array.isArray(headers)) {
  18163. if (headers.length % 2 !== 0) {
  18164. throw new InvalidArgumentError('headers array must be even')
  18165. }
  18166. for (let i = 0; i < headers.length; i += 2) {
  18167. processHeader(this, headers[i], headers[i + 1])
  18168. }
  18169. } else if (headers && typeof headers === 'object') {
  18170. const keys = Object.keys(headers)
  18171. for (let i = 0; i < keys.length; i++) {
  18172. const key = keys[i]
  18173. processHeader(this, key, headers[key])
  18174. }
  18175. } else if (headers != null) {
  18176. throw new InvalidArgumentError('headers must be an object or an array')
  18177. }
  18178. if (util.isFormDataLike(this.body)) {
  18179. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18180. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18181. }
  18182. if (!extractBody) {
  18183. extractBody = (__nccwpck_require__(9990).extractBody)
  18184. }
  18185. const [bodyStream, contentType] = extractBody(body)
  18186. if (this.contentType == null) {
  18187. this.contentType = contentType
  18188. this.headers += `content-type: ${contentType}\r\n`
  18189. }
  18190. this.body = bodyStream.stream
  18191. this.contentLength = bodyStream.length
  18192. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18193. this.contentType = body.type
  18194. this.headers += `content-type: ${body.type}\r\n`
  18195. }
  18196. util.validateHandler(handler, method, upgrade)
  18197. this.servername = util.getServerName(this.host)
  18198. this[kHandler] = handler
  18199. if (channels.create.hasSubscribers) {
  18200. channels.create.publish({ request: this })
  18201. }
  18202. }
  18203. onBodySent (chunk) {
  18204. if (this[kHandler].onBodySent) {
  18205. try {
  18206. return this[kHandler].onBodySent(chunk)
  18207. } catch (err) {
  18208. this.abort(err)
  18209. }
  18210. }
  18211. }
  18212. onRequestSent () {
  18213. if (channels.bodySent.hasSubscribers) {
  18214. channels.bodySent.publish({ request: this })
  18215. }
  18216. if (this[kHandler].onRequestSent) {
  18217. try {
  18218. return this[kHandler].onRequestSent()
  18219. } catch (err) {
  18220. this.abort(err)
  18221. }
  18222. }
  18223. }
  18224. onConnect (abort) {
  18225. assert(!this.aborted)
  18226. assert(!this.completed)
  18227. if (this.error) {
  18228. abort(this.error)
  18229. } else {
  18230. this.abort = abort
  18231. return this[kHandler].onConnect(abort)
  18232. }
  18233. }
  18234. onHeaders (statusCode, headers, resume, statusText) {
  18235. assert(!this.aborted)
  18236. assert(!this.completed)
  18237. if (channels.headers.hasSubscribers) {
  18238. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18239. }
  18240. try {
  18241. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18242. } catch (err) {
  18243. this.abort(err)
  18244. }
  18245. }
  18246. onData (chunk) {
  18247. assert(!this.aborted)
  18248. assert(!this.completed)
  18249. try {
  18250. return this[kHandler].onData(chunk)
  18251. } catch (err) {
  18252. this.abort(err)
  18253. return false
  18254. }
  18255. }
  18256. onUpgrade (statusCode, headers, socket) {
  18257. assert(!this.aborted)
  18258. assert(!this.completed)
  18259. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18260. }
  18261. onComplete (trailers) {
  18262. this.onFinally()
  18263. assert(!this.aborted)
  18264. this.completed = true
  18265. if (channels.trailers.hasSubscribers) {
  18266. channels.trailers.publish({ request: this, trailers })
  18267. }
  18268. try {
  18269. return this[kHandler].onComplete(trailers)
  18270. } catch (err) {
  18271. // TODO (fix): This might be a bad idea?
  18272. this.onError(err)
  18273. }
  18274. }
  18275. onError (error) {
  18276. this.onFinally()
  18277. if (channels.error.hasSubscribers) {
  18278. channels.error.publish({ request: this, error })
  18279. }
  18280. if (this.aborted) {
  18281. return
  18282. }
  18283. this.aborted = true
  18284. return this[kHandler].onError(error)
  18285. }
  18286. onFinally () {
  18287. if (this.errorHandler) {
  18288. this.body.off('error', this.errorHandler)
  18289. this.errorHandler = null
  18290. }
  18291. if (this.endHandler) {
  18292. this.body.off('end', this.endHandler)
  18293. this.endHandler = null
  18294. }
  18295. }
  18296. // TODO: adjust to support H2
  18297. addHeader (key, value) {
  18298. processHeader(this, key, value)
  18299. return this
  18300. }
  18301. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18302. // TODO: Migrate header parsing here, to make Requests
  18303. // HTTP agnostic
  18304. return new Request(origin, opts, handler)
  18305. }
  18306. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18307. const headers = opts.headers
  18308. opts = { ...opts, headers: null }
  18309. const request = new Request(origin, opts, handler)
  18310. request.headers = {}
  18311. if (Array.isArray(headers)) {
  18312. if (headers.length % 2 !== 0) {
  18313. throw new InvalidArgumentError('headers array must be even')
  18314. }
  18315. for (let i = 0; i < headers.length; i += 2) {
  18316. processHeader(request, headers[i], headers[i + 1], true)
  18317. }
  18318. } else if (headers && typeof headers === 'object') {
  18319. const keys = Object.keys(headers)
  18320. for (let i = 0; i < keys.length; i++) {
  18321. const key = keys[i]
  18322. processHeader(request, key, headers[key], true)
  18323. }
  18324. } else if (headers != null) {
  18325. throw new InvalidArgumentError('headers must be an object or an array')
  18326. }
  18327. return request
  18328. }
  18329. static [kHTTP2CopyHeaders] (raw) {
  18330. const rawHeaders = raw.split('\r\n')
  18331. const headers = {}
  18332. for (const header of rawHeaders) {
  18333. const [key, value] = header.split(': ')
  18334. if (value == null || value.length === 0) continue
  18335. if (headers[key]) headers[key] += `,${value}`
  18336. else headers[key] = value
  18337. }
  18338. return headers
  18339. }
  18340. }
  18341. function processHeaderValue (key, val, skipAppend) {
  18342. if (val && typeof val === 'object') {
  18343. throw new InvalidArgumentError(`invalid ${key} header`)
  18344. }
  18345. val = val != null ? `${val}` : ''
  18346. if (headerCharRegex.exec(val) !== null) {
  18347. throw new InvalidArgumentError(`invalid ${key} header`)
  18348. }
  18349. return skipAppend ? val : `${key}: ${val}\r\n`
  18350. }
  18351. function processHeader (request, key, val, skipAppend = false) {
  18352. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18353. throw new InvalidArgumentError(`invalid ${key} header`)
  18354. } else if (val === undefined) {
  18355. return
  18356. }
  18357. if (
  18358. request.host === null &&
  18359. key.length === 4 &&
  18360. key.toLowerCase() === 'host'
  18361. ) {
  18362. if (headerCharRegex.exec(val) !== null) {
  18363. throw new InvalidArgumentError(`invalid ${key} header`)
  18364. }
  18365. // Consumed by Client
  18366. request.host = val
  18367. } else if (
  18368. request.contentLength === null &&
  18369. key.length === 14 &&
  18370. key.toLowerCase() === 'content-length'
  18371. ) {
  18372. request.contentLength = parseInt(val, 10)
  18373. if (!Number.isFinite(request.contentLength)) {
  18374. throw new InvalidArgumentError('invalid content-length header')
  18375. }
  18376. } else if (
  18377. request.contentType === null &&
  18378. key.length === 12 &&
  18379. key.toLowerCase() === 'content-type'
  18380. ) {
  18381. request.contentType = val
  18382. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18383. else request.headers += processHeaderValue(key, val)
  18384. } else if (
  18385. key.length === 17 &&
  18386. key.toLowerCase() === 'transfer-encoding'
  18387. ) {
  18388. throw new InvalidArgumentError('invalid transfer-encoding header')
  18389. } else if (
  18390. key.length === 10 &&
  18391. key.toLowerCase() === 'connection'
  18392. ) {
  18393. const value = typeof val === 'string' ? val.toLowerCase() : null
  18394. if (value !== 'close' && value !== 'keep-alive') {
  18395. throw new InvalidArgumentError('invalid connection header')
  18396. } else if (value === 'close') {
  18397. request.reset = true
  18398. }
  18399. } else if (
  18400. key.length === 10 &&
  18401. key.toLowerCase() === 'keep-alive'
  18402. ) {
  18403. throw new InvalidArgumentError('invalid keep-alive header')
  18404. } else if (
  18405. key.length === 7 &&
  18406. key.toLowerCase() === 'upgrade'
  18407. ) {
  18408. throw new InvalidArgumentError('invalid upgrade header')
  18409. } else if (
  18410. key.length === 6 &&
  18411. key.toLowerCase() === 'expect'
  18412. ) {
  18413. throw new NotSupportedError('expect header not supported')
  18414. } else if (tokenRegExp.exec(key) === null) {
  18415. throw new InvalidArgumentError('invalid header key')
  18416. } else {
  18417. if (Array.isArray(val)) {
  18418. for (let i = 0; i < val.length; i++) {
  18419. if (skipAppend) {
  18420. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18421. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18422. } else {
  18423. request.headers += processHeaderValue(key, val[i])
  18424. }
  18425. }
  18426. } else {
  18427. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18428. else request.headers += processHeaderValue(key, val)
  18429. }
  18430. }
  18431. }
  18432. module.exports = Request
  18433. /***/ }),
  18434. /***/ 2785:
  18435. /***/ ((module) => {
  18436. module.exports = {
  18437. kClose: Symbol('close'),
  18438. kDestroy: Symbol('destroy'),
  18439. kDispatch: Symbol('dispatch'),
  18440. kUrl: Symbol('url'),
  18441. kWriting: Symbol('writing'),
  18442. kResuming: Symbol('resuming'),
  18443. kQueue: Symbol('queue'),
  18444. kConnect: Symbol('connect'),
  18445. kConnecting: Symbol('connecting'),
  18446. kHeadersList: Symbol('headers list'),
  18447. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18448. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18449. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18450. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18451. kKeepAlive: Symbol('keep alive'),
  18452. kHeadersTimeout: Symbol('headers timeout'),
  18453. kBodyTimeout: Symbol('body timeout'),
  18454. kServerName: Symbol('server name'),
  18455. kLocalAddress: Symbol('local address'),
  18456. kHost: Symbol('host'),
  18457. kNoRef: Symbol('no ref'),
  18458. kBodyUsed: Symbol('used'),
  18459. kRunning: Symbol('running'),
  18460. kBlocking: Symbol('blocking'),
  18461. kPending: Symbol('pending'),
  18462. kSize: Symbol('size'),
  18463. kBusy: Symbol('busy'),
  18464. kQueued: Symbol('queued'),
  18465. kFree: Symbol('free'),
  18466. kConnected: Symbol('connected'),
  18467. kClosed: Symbol('closed'),
  18468. kNeedDrain: Symbol('need drain'),
  18469. kReset: Symbol('reset'),
  18470. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18471. kMaxHeadersSize: Symbol('max headers size'),
  18472. kRunningIdx: Symbol('running index'),
  18473. kPendingIdx: Symbol('pending index'),
  18474. kError: Symbol('error'),
  18475. kClients: Symbol('clients'),
  18476. kClient: Symbol('client'),
  18477. kParser: Symbol('parser'),
  18478. kOnDestroyed: Symbol('destroy callbacks'),
  18479. kPipelining: Symbol('pipelining'),
  18480. kSocket: Symbol('socket'),
  18481. kHostHeader: Symbol('host header'),
  18482. kConnector: Symbol('connector'),
  18483. kStrictContentLength: Symbol('strict content length'),
  18484. kMaxRedirections: Symbol('maxRedirections'),
  18485. kMaxRequests: Symbol('maxRequestsPerClient'),
  18486. kProxy: Symbol('proxy agent options'),
  18487. kCounter: Symbol('socket request counter'),
  18488. kInterceptors: Symbol('dispatch interceptors'),
  18489. kMaxResponseSize: Symbol('max response size'),
  18490. kHTTP2Session: Symbol('http2Session'),
  18491. kHTTP2SessionState: Symbol('http2Session state'),
  18492. kHTTP2BuildRequest: Symbol('http2 build request'),
  18493. kHTTP1BuildRequest: Symbol('http1 build request'),
  18494. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18495. kHTTPConnVersion: Symbol('http connection version'),
  18496. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18497. kConstruct: Symbol('constructable')
  18498. }
  18499. /***/ }),
  18500. /***/ 3983:
  18501. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18502. "use strict";
  18503. const assert = __nccwpck_require__(9491)
  18504. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18505. const { IncomingMessage } = __nccwpck_require__(3685)
  18506. const stream = __nccwpck_require__(2781)
  18507. const net = __nccwpck_require__(1808)
  18508. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18509. const { Blob } = __nccwpck_require__(4300)
  18510. const nodeUtil = __nccwpck_require__(3837)
  18511. const { stringify } = __nccwpck_require__(3477)
  18512. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18513. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18514. function nop () {}
  18515. function isStream (obj) {
  18516. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18517. }
  18518. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18519. function isBlobLike (object) {
  18520. return (Blob && object instanceof Blob) || (
  18521. object &&
  18522. typeof object === 'object' &&
  18523. (typeof object.stream === 'function' ||
  18524. typeof object.arrayBuffer === 'function') &&
  18525. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18526. )
  18527. }
  18528. function buildURL (url, queryParams) {
  18529. if (url.includes('?') || url.includes('#')) {
  18530. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18531. }
  18532. const stringified = stringify(queryParams)
  18533. if (stringified) {
  18534. url += '?' + stringified
  18535. }
  18536. return url
  18537. }
  18538. function parseURL (url) {
  18539. if (typeof url === 'string') {
  18540. url = new URL(url)
  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. return url
  18545. }
  18546. if (!url || typeof url !== 'object') {
  18547. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18548. }
  18549. if (!/^https?:/.test(url.origin || url.protocol)) {
  18550. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18551. }
  18552. if (!(url instanceof URL)) {
  18553. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18554. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18555. }
  18556. if (url.path != null && typeof url.path !== 'string') {
  18557. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18558. }
  18559. if (url.pathname != null && typeof url.pathname !== 'string') {
  18560. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18561. }
  18562. if (url.hostname != null && typeof url.hostname !== 'string') {
  18563. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18564. }
  18565. if (url.origin != null && typeof url.origin !== 'string') {
  18566. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18567. }
  18568. const port = url.port != null
  18569. ? url.port
  18570. : (url.protocol === 'https:' ? 443 : 80)
  18571. let origin = url.origin != null
  18572. ? url.origin
  18573. : `${url.protocol}//${url.hostname}:${port}`
  18574. let path = url.path != null
  18575. ? url.path
  18576. : `${url.pathname || ''}${url.search || ''}`
  18577. if (origin.endsWith('/')) {
  18578. origin = origin.substring(0, origin.length - 1)
  18579. }
  18580. if (path && !path.startsWith('/')) {
  18581. path = `/${path}`
  18582. }
  18583. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18584. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18585. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18586. // If first parameter is an absolute URL, a given second param will be ignored.
  18587. url = new URL(origin + path)
  18588. }
  18589. return url
  18590. }
  18591. function parseOrigin (url) {
  18592. url = parseURL(url)
  18593. if (url.pathname !== '/' || url.search || url.hash) {
  18594. throw new InvalidArgumentError('invalid url')
  18595. }
  18596. return url
  18597. }
  18598. function getHostname (host) {
  18599. if (host[0] === '[') {
  18600. const idx = host.indexOf(']')
  18601. assert(idx !== -1)
  18602. return host.substring(1, idx)
  18603. }
  18604. const idx = host.indexOf(':')
  18605. if (idx === -1) return host
  18606. return host.substring(0, idx)
  18607. }
  18608. // IP addresses are not valid server names per RFC6066
  18609. // > Currently, the only server names supported are DNS hostnames
  18610. function getServerName (host) {
  18611. if (!host) {
  18612. return null
  18613. }
  18614. assert.strictEqual(typeof host, 'string')
  18615. const servername = getHostname(host)
  18616. if (net.isIP(servername)) {
  18617. return ''
  18618. }
  18619. return servername
  18620. }
  18621. function deepClone (obj) {
  18622. return JSON.parse(JSON.stringify(obj))
  18623. }
  18624. function isAsyncIterable (obj) {
  18625. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18626. }
  18627. function isIterable (obj) {
  18628. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18629. }
  18630. function bodyLength (body) {
  18631. if (body == null) {
  18632. return 0
  18633. } else if (isStream(body)) {
  18634. const state = body._readableState
  18635. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18636. ? state.length
  18637. : null
  18638. } else if (isBlobLike(body)) {
  18639. return body.size != null ? body.size : null
  18640. } else if (isBuffer(body)) {
  18641. return body.byteLength
  18642. }
  18643. return null
  18644. }
  18645. function isDestroyed (stream) {
  18646. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18647. }
  18648. function isReadableAborted (stream) {
  18649. const state = stream && stream._readableState
  18650. return isDestroyed(stream) && state && !state.endEmitted
  18651. }
  18652. function destroy (stream, err) {
  18653. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18654. return
  18655. }
  18656. if (typeof stream.destroy === 'function') {
  18657. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18658. // See: https://github.com/nodejs/node/pull/38505/files
  18659. stream.socket = null
  18660. }
  18661. stream.destroy(err)
  18662. } else if (err) {
  18663. process.nextTick((stream, err) => {
  18664. stream.emit('error', err)
  18665. }, stream, err)
  18666. }
  18667. if (stream.destroyed !== true) {
  18668. stream[kDestroyed] = true
  18669. }
  18670. }
  18671. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18672. function parseKeepAliveTimeout (val) {
  18673. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18674. return m ? parseInt(m[1], 10) * 1000 : null
  18675. }
  18676. /**
  18677. * Retrieves a header name and returns its lowercase value.
  18678. * @param {string | Buffer} value Header name
  18679. * @returns {string}
  18680. */
  18681. function headerNameToString (value) {
  18682. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18683. }
  18684. function parseHeaders (headers, obj = {}) {
  18685. // For H2 support
  18686. if (!Array.isArray(headers)) return headers
  18687. for (let i = 0; i < headers.length; i += 2) {
  18688. const key = headers[i].toString().toLowerCase()
  18689. let val = obj[key]
  18690. if (!val) {
  18691. if (Array.isArray(headers[i + 1])) {
  18692. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18693. } else {
  18694. obj[key] = headers[i + 1].toString('utf8')
  18695. }
  18696. } else {
  18697. if (!Array.isArray(val)) {
  18698. val = [val]
  18699. obj[key] = val
  18700. }
  18701. val.push(headers[i + 1].toString('utf8'))
  18702. }
  18703. }
  18704. // See https://github.com/nodejs/node/pull/46528
  18705. if ('content-length' in obj && 'content-disposition' in obj) {
  18706. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18707. }
  18708. return obj
  18709. }
  18710. function parseRawHeaders (headers) {
  18711. const ret = []
  18712. let hasContentLength = false
  18713. let contentDispositionIdx = -1
  18714. for (let n = 0; n < headers.length; n += 2) {
  18715. const key = headers[n + 0].toString()
  18716. const val = headers[n + 1].toString('utf8')
  18717. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18718. ret.push(key, val)
  18719. hasContentLength = true
  18720. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18721. contentDispositionIdx = ret.push(key, val) - 1
  18722. } else {
  18723. ret.push(key, val)
  18724. }
  18725. }
  18726. // See https://github.com/nodejs/node/pull/46528
  18727. if (hasContentLength && contentDispositionIdx !== -1) {
  18728. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18729. }
  18730. return ret
  18731. }
  18732. function isBuffer (buffer) {
  18733. // See, https://github.com/mcollina/undici/pull/319
  18734. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18735. }
  18736. function validateHandler (handler, method, upgrade) {
  18737. if (!handler || typeof handler !== 'object') {
  18738. throw new InvalidArgumentError('handler must be an object')
  18739. }
  18740. if (typeof handler.onConnect !== 'function') {
  18741. throw new InvalidArgumentError('invalid onConnect method')
  18742. }
  18743. if (typeof handler.onError !== 'function') {
  18744. throw new InvalidArgumentError('invalid onError method')
  18745. }
  18746. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  18747. throw new InvalidArgumentError('invalid onBodySent method')
  18748. }
  18749. if (upgrade || method === 'CONNECT') {
  18750. if (typeof handler.onUpgrade !== 'function') {
  18751. throw new InvalidArgumentError('invalid onUpgrade method')
  18752. }
  18753. } else {
  18754. if (typeof handler.onHeaders !== 'function') {
  18755. throw new InvalidArgumentError('invalid onHeaders method')
  18756. }
  18757. if (typeof handler.onData !== 'function') {
  18758. throw new InvalidArgumentError('invalid onData method')
  18759. }
  18760. if (typeof handler.onComplete !== 'function') {
  18761. throw new InvalidArgumentError('invalid onComplete method')
  18762. }
  18763. }
  18764. }
  18765. // A body is disturbed if it has been read from and it cannot
  18766. // be re-used without losing state or data.
  18767. function isDisturbed (body) {
  18768. return !!(body && (
  18769. stream.isDisturbed
  18770. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  18771. : body[kBodyUsed] ||
  18772. body.readableDidRead ||
  18773. (body._readableState && body._readableState.dataEmitted) ||
  18774. isReadableAborted(body)
  18775. ))
  18776. }
  18777. function isErrored (body) {
  18778. return !!(body && (
  18779. stream.isErrored
  18780. ? stream.isErrored(body)
  18781. : /state: 'errored'/.test(nodeUtil.inspect(body)
  18782. )))
  18783. }
  18784. function isReadable (body) {
  18785. return !!(body && (
  18786. stream.isReadable
  18787. ? stream.isReadable(body)
  18788. : /state: 'readable'/.test(nodeUtil.inspect(body)
  18789. )))
  18790. }
  18791. function getSocketInfo (socket) {
  18792. return {
  18793. localAddress: socket.localAddress,
  18794. localPort: socket.localPort,
  18795. remoteAddress: socket.remoteAddress,
  18796. remotePort: socket.remotePort,
  18797. remoteFamily: socket.remoteFamily,
  18798. timeout: socket.timeout,
  18799. bytesWritten: socket.bytesWritten,
  18800. bytesRead: socket.bytesRead
  18801. }
  18802. }
  18803. async function * convertIterableToBuffer (iterable) {
  18804. for await (const chunk of iterable) {
  18805. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  18806. }
  18807. }
  18808. let ReadableStream
  18809. function ReadableStreamFrom (iterable) {
  18810. if (!ReadableStream) {
  18811. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  18812. }
  18813. if (ReadableStream.from) {
  18814. return ReadableStream.from(convertIterableToBuffer(iterable))
  18815. }
  18816. let iterator
  18817. return new ReadableStream(
  18818. {
  18819. async start () {
  18820. iterator = iterable[Symbol.asyncIterator]()
  18821. },
  18822. async pull (controller) {
  18823. const { done, value } = await iterator.next()
  18824. if (done) {
  18825. queueMicrotask(() => {
  18826. controller.close()
  18827. })
  18828. } else {
  18829. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  18830. controller.enqueue(new Uint8Array(buf))
  18831. }
  18832. return controller.desiredSize > 0
  18833. },
  18834. async cancel (reason) {
  18835. await iterator.return()
  18836. }
  18837. },
  18838. 0
  18839. )
  18840. }
  18841. // The chunk should be a FormData instance and contains
  18842. // all the required methods.
  18843. function isFormDataLike (object) {
  18844. return (
  18845. object &&
  18846. typeof object === 'object' &&
  18847. typeof object.append === 'function' &&
  18848. typeof object.delete === 'function' &&
  18849. typeof object.get === 'function' &&
  18850. typeof object.getAll === 'function' &&
  18851. typeof object.has === 'function' &&
  18852. typeof object.set === 'function' &&
  18853. object[Symbol.toStringTag] === 'FormData'
  18854. )
  18855. }
  18856. function throwIfAborted (signal) {
  18857. if (!signal) { return }
  18858. if (typeof signal.throwIfAborted === 'function') {
  18859. signal.throwIfAborted()
  18860. } else {
  18861. if (signal.aborted) {
  18862. // DOMException not available < v17.0.0
  18863. const err = new Error('The operation was aborted')
  18864. err.name = 'AbortError'
  18865. throw err
  18866. }
  18867. }
  18868. }
  18869. function addAbortListener (signal, listener) {
  18870. if ('addEventListener' in signal) {
  18871. signal.addEventListener('abort', listener, { once: true })
  18872. return () => signal.removeEventListener('abort', listener)
  18873. }
  18874. signal.addListener('abort', listener)
  18875. return () => signal.removeListener('abort', listener)
  18876. }
  18877. const hasToWellFormed = !!String.prototype.toWellFormed
  18878. /**
  18879. * @param {string} val
  18880. */
  18881. function toUSVString (val) {
  18882. if (hasToWellFormed) {
  18883. return `${val}`.toWellFormed()
  18884. } else if (nodeUtil.toUSVString) {
  18885. return nodeUtil.toUSVString(val)
  18886. }
  18887. return `${val}`
  18888. }
  18889. // Parsed accordingly to RFC 9110
  18890. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  18891. function parseRangeHeader (range) {
  18892. if (range == null || range === '') return { start: 0, end: null, size: null }
  18893. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  18894. return m
  18895. ? {
  18896. start: parseInt(m[1]),
  18897. end: m[2] ? parseInt(m[2]) : null,
  18898. size: m[3] ? parseInt(m[3]) : null
  18899. }
  18900. : null
  18901. }
  18902. const kEnumerableProperty = Object.create(null)
  18903. kEnumerableProperty.enumerable = true
  18904. module.exports = {
  18905. kEnumerableProperty,
  18906. nop,
  18907. isDisturbed,
  18908. isErrored,
  18909. isReadable,
  18910. toUSVString,
  18911. isReadableAborted,
  18912. isBlobLike,
  18913. parseOrigin,
  18914. parseURL,
  18915. getServerName,
  18916. isStream,
  18917. isIterable,
  18918. isAsyncIterable,
  18919. isDestroyed,
  18920. headerNameToString,
  18921. parseRawHeaders,
  18922. parseHeaders,
  18923. parseKeepAliveTimeout,
  18924. destroy,
  18925. bodyLength,
  18926. deepClone,
  18927. ReadableStreamFrom,
  18928. isBuffer,
  18929. validateHandler,
  18930. getSocketInfo,
  18931. isFormDataLike,
  18932. buildURL,
  18933. throwIfAborted,
  18934. addAbortListener,
  18935. parseRangeHeader,
  18936. nodeMajor,
  18937. nodeMinor,
  18938. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  18939. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  18940. }
  18941. /***/ }),
  18942. /***/ 4839:
  18943. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18944. "use strict";
  18945. const Dispatcher = __nccwpck_require__(412)
  18946. const {
  18947. ClientDestroyedError,
  18948. ClientClosedError,
  18949. InvalidArgumentError
  18950. } = __nccwpck_require__(8045)
  18951. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  18952. const kDestroyed = Symbol('destroyed')
  18953. const kClosed = Symbol('closed')
  18954. const kOnDestroyed = Symbol('onDestroyed')
  18955. const kOnClosed = Symbol('onClosed')
  18956. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  18957. class DispatcherBase extends Dispatcher {
  18958. constructor () {
  18959. super()
  18960. this[kDestroyed] = false
  18961. this[kOnDestroyed] = null
  18962. this[kClosed] = false
  18963. this[kOnClosed] = []
  18964. }
  18965. get destroyed () {
  18966. return this[kDestroyed]
  18967. }
  18968. get closed () {
  18969. return this[kClosed]
  18970. }
  18971. get interceptors () {
  18972. return this[kInterceptors]
  18973. }
  18974. set interceptors (newInterceptors) {
  18975. if (newInterceptors) {
  18976. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  18977. const interceptor = this[kInterceptors][i]
  18978. if (typeof interceptor !== 'function') {
  18979. throw new InvalidArgumentError('interceptor must be an function')
  18980. }
  18981. }
  18982. }
  18983. this[kInterceptors] = newInterceptors
  18984. }
  18985. close (callback) {
  18986. if (callback === undefined) {
  18987. return new Promise((resolve, reject) => {
  18988. this.close((err, data) => {
  18989. return err ? reject(err) : resolve(data)
  18990. })
  18991. })
  18992. }
  18993. if (typeof callback !== 'function') {
  18994. throw new InvalidArgumentError('invalid callback')
  18995. }
  18996. if (this[kDestroyed]) {
  18997. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  18998. return
  18999. }
  19000. if (this[kClosed]) {
  19001. if (this[kOnClosed]) {
  19002. this[kOnClosed].push(callback)
  19003. } else {
  19004. queueMicrotask(() => callback(null, null))
  19005. }
  19006. return
  19007. }
  19008. this[kClosed] = true
  19009. this[kOnClosed].push(callback)
  19010. const onClosed = () => {
  19011. const callbacks = this[kOnClosed]
  19012. this[kOnClosed] = null
  19013. for (let i = 0; i < callbacks.length; i++) {
  19014. callbacks[i](null, null)
  19015. }
  19016. }
  19017. // Should not error.
  19018. this[kClose]()
  19019. .then(() => this.destroy())
  19020. .then(() => {
  19021. queueMicrotask(onClosed)
  19022. })
  19023. }
  19024. destroy (err, callback) {
  19025. if (typeof err === 'function') {
  19026. callback = err
  19027. err = null
  19028. }
  19029. if (callback === undefined) {
  19030. return new Promise((resolve, reject) => {
  19031. this.destroy(err, (err, data) => {
  19032. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19033. })
  19034. })
  19035. }
  19036. if (typeof callback !== 'function') {
  19037. throw new InvalidArgumentError('invalid callback')
  19038. }
  19039. if (this[kDestroyed]) {
  19040. if (this[kOnDestroyed]) {
  19041. this[kOnDestroyed].push(callback)
  19042. } else {
  19043. queueMicrotask(() => callback(null, null))
  19044. }
  19045. return
  19046. }
  19047. if (!err) {
  19048. err = new ClientDestroyedError()
  19049. }
  19050. this[kDestroyed] = true
  19051. this[kOnDestroyed] = this[kOnDestroyed] || []
  19052. this[kOnDestroyed].push(callback)
  19053. const onDestroyed = () => {
  19054. const callbacks = this[kOnDestroyed]
  19055. this[kOnDestroyed] = null
  19056. for (let i = 0; i < callbacks.length; i++) {
  19057. callbacks[i](null, null)
  19058. }
  19059. }
  19060. // Should not error.
  19061. this[kDestroy](err).then(() => {
  19062. queueMicrotask(onDestroyed)
  19063. })
  19064. }
  19065. [kInterceptedDispatch] (opts, handler) {
  19066. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19067. this[kInterceptedDispatch] = this[kDispatch]
  19068. return this[kDispatch](opts, handler)
  19069. }
  19070. let dispatch = this[kDispatch].bind(this)
  19071. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19072. dispatch = this[kInterceptors][i](dispatch)
  19073. }
  19074. this[kInterceptedDispatch] = dispatch
  19075. return dispatch(opts, handler)
  19076. }
  19077. dispatch (opts, handler) {
  19078. if (!handler || typeof handler !== 'object') {
  19079. throw new InvalidArgumentError('handler must be an object')
  19080. }
  19081. try {
  19082. if (!opts || typeof opts !== 'object') {
  19083. throw new InvalidArgumentError('opts must be an object.')
  19084. }
  19085. if (this[kDestroyed] || this[kOnDestroyed]) {
  19086. throw new ClientDestroyedError()
  19087. }
  19088. if (this[kClosed]) {
  19089. throw new ClientClosedError()
  19090. }
  19091. return this[kInterceptedDispatch](opts, handler)
  19092. } catch (err) {
  19093. if (typeof handler.onError !== 'function') {
  19094. throw new InvalidArgumentError('invalid onError method')
  19095. }
  19096. handler.onError(err)
  19097. return false
  19098. }
  19099. }
  19100. }
  19101. module.exports = DispatcherBase
  19102. /***/ }),
  19103. /***/ 412:
  19104. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19105. "use strict";
  19106. const EventEmitter = __nccwpck_require__(2361)
  19107. class Dispatcher extends EventEmitter {
  19108. dispatch () {
  19109. throw new Error('not implemented')
  19110. }
  19111. close () {
  19112. throw new Error('not implemented')
  19113. }
  19114. destroy () {
  19115. throw new Error('not implemented')
  19116. }
  19117. }
  19118. module.exports = Dispatcher
  19119. /***/ }),
  19120. /***/ 9990:
  19121. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19122. "use strict";
  19123. const Busboy = __nccwpck_require__(727)
  19124. const util = __nccwpck_require__(3983)
  19125. const {
  19126. ReadableStreamFrom,
  19127. isBlobLike,
  19128. isReadableStreamLike,
  19129. readableStreamClose,
  19130. createDeferredPromise,
  19131. fullyReadBody
  19132. } = __nccwpck_require__(2538)
  19133. const { FormData } = __nccwpck_require__(2015)
  19134. const { kState } = __nccwpck_require__(5861)
  19135. const { webidl } = __nccwpck_require__(1744)
  19136. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19137. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19138. const { kBodyUsed } = __nccwpck_require__(2785)
  19139. const assert = __nccwpck_require__(9491)
  19140. const { isErrored } = __nccwpck_require__(3983)
  19141. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19142. const { File: UndiciFile } = __nccwpck_require__(8511)
  19143. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19144. let ReadableStream = globalThis.ReadableStream
  19145. /** @type {globalThis['File']} */
  19146. const File = NativeFile ?? UndiciFile
  19147. const textEncoder = new TextEncoder()
  19148. const textDecoder = new TextDecoder()
  19149. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19150. function extractBody (object, keepalive = false) {
  19151. if (!ReadableStream) {
  19152. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19153. }
  19154. // 1. Let stream be null.
  19155. let stream = null
  19156. // 2. If object is a ReadableStream object, then set stream to object.
  19157. if (object instanceof ReadableStream) {
  19158. stream = object
  19159. } else if (isBlobLike(object)) {
  19160. // 3. Otherwise, if object is a Blob object, set stream to the
  19161. // result of running object’s get stream.
  19162. stream = object.stream()
  19163. } else {
  19164. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19165. // up stream.
  19166. stream = new ReadableStream({
  19167. async pull (controller) {
  19168. controller.enqueue(
  19169. typeof source === 'string' ? textEncoder.encode(source) : source
  19170. )
  19171. queueMicrotask(() => readableStreamClose(controller))
  19172. },
  19173. start () {},
  19174. type: undefined
  19175. })
  19176. }
  19177. // 5. Assert: stream is a ReadableStream object.
  19178. assert(isReadableStreamLike(stream))
  19179. // 6. Let action be null.
  19180. let action = null
  19181. // 7. Let source be null.
  19182. let source = null
  19183. // 8. Let length be null.
  19184. let length = null
  19185. // 9. Let type be null.
  19186. let type = null
  19187. // 10. Switch on object:
  19188. if (typeof object === 'string') {
  19189. // Set source to the UTF-8 encoding of object.
  19190. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19191. source = object
  19192. // Set type to `text/plain;charset=UTF-8`.
  19193. type = 'text/plain;charset=UTF-8'
  19194. } else if (object instanceof URLSearchParams) {
  19195. // URLSearchParams
  19196. // spec says to run application/x-www-form-urlencoded on body.list
  19197. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19198. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19199. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19200. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19201. source = object.toString()
  19202. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19203. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19204. } else if (isArrayBuffer(object)) {
  19205. // BufferSource/ArrayBuffer
  19206. // Set source to a copy of the bytes held by object.
  19207. source = new Uint8Array(object.slice())
  19208. } else if (ArrayBuffer.isView(object)) {
  19209. // BufferSource/ArrayBufferView
  19210. // Set source to a copy of the bytes held by object.
  19211. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19212. } else if (util.isFormDataLike(object)) {
  19213. const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
  19214. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19215. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19216. const escape = (str) =>
  19217. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19218. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19219. // Set action to this step: run the multipart/form-data
  19220. // encoding algorithm, with object’s entry list and UTF-8.
  19221. // - This ensures that the body is immutable and can't be changed afterwords
  19222. // - That the content-length is calculated in advance.
  19223. // - And that all parts are pre-encoded and ready to be sent.
  19224. const blobParts = []
  19225. const rn = new Uint8Array([13, 10]) // '\r\n'
  19226. length = 0
  19227. let hasUnknownSizeValue = false
  19228. for (const [name, value] of object) {
  19229. if (typeof value === 'string') {
  19230. const chunk = textEncoder.encode(prefix +
  19231. `; name="${escape(normalizeLinefeeds(name))}"` +
  19232. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19233. blobParts.push(chunk)
  19234. length += chunk.byteLength
  19235. } else {
  19236. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19237. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19238. `Content-Type: ${
  19239. value.type || 'application/octet-stream'
  19240. }\r\n\r\n`)
  19241. blobParts.push(chunk, value, rn)
  19242. if (typeof value.size === 'number') {
  19243. length += chunk.byteLength + value.size + rn.byteLength
  19244. } else {
  19245. hasUnknownSizeValue = true
  19246. }
  19247. }
  19248. }
  19249. const chunk = textEncoder.encode(`--${boundary}--`)
  19250. blobParts.push(chunk)
  19251. length += chunk.byteLength
  19252. if (hasUnknownSizeValue) {
  19253. length = null
  19254. }
  19255. // Set source to object.
  19256. source = object
  19257. action = async function * () {
  19258. for (const part of blobParts) {
  19259. if (part.stream) {
  19260. yield * part.stream()
  19261. } else {
  19262. yield part
  19263. }
  19264. }
  19265. }
  19266. // Set type to `multipart/form-data; boundary=`,
  19267. // followed by the multipart/form-data boundary string generated
  19268. // by the multipart/form-data encoding algorithm.
  19269. type = 'multipart/form-data; boundary=' + boundary
  19270. } else if (isBlobLike(object)) {
  19271. // Blob
  19272. // Set source to object.
  19273. source = object
  19274. // Set length to object’s size.
  19275. length = object.size
  19276. // If object’s type attribute is not the empty byte sequence, set
  19277. // type to its value.
  19278. if (object.type) {
  19279. type = object.type
  19280. }
  19281. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19282. // If keepalive is true, then throw a TypeError.
  19283. if (keepalive) {
  19284. throw new TypeError('keepalive')
  19285. }
  19286. // If object is disturbed or locked, then throw a TypeError.
  19287. if (util.isDisturbed(object) || object.locked) {
  19288. throw new TypeError(
  19289. 'Response body object should not be disturbed or locked'
  19290. )
  19291. }
  19292. stream =
  19293. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19294. }
  19295. // 11. If source is a byte sequence, then set action to a
  19296. // step that returns source and length to source’s length.
  19297. if (typeof source === 'string' || util.isBuffer(source)) {
  19298. length = Buffer.byteLength(source)
  19299. }
  19300. // 12. If action is non-null, then run these steps in in parallel:
  19301. if (action != null) {
  19302. // Run action.
  19303. let iterator
  19304. stream = new ReadableStream({
  19305. async start () {
  19306. iterator = action(object)[Symbol.asyncIterator]()
  19307. },
  19308. async pull (controller) {
  19309. const { value, done } = await iterator.next()
  19310. if (done) {
  19311. // When running action is done, close stream.
  19312. queueMicrotask(() => {
  19313. controller.close()
  19314. })
  19315. } else {
  19316. // Whenever one or more bytes are available and stream is not errored,
  19317. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19318. // bytes into stream.
  19319. if (!isErrored(stream)) {
  19320. controller.enqueue(new Uint8Array(value))
  19321. }
  19322. }
  19323. return controller.desiredSize > 0
  19324. },
  19325. async cancel (reason) {
  19326. await iterator.return()
  19327. },
  19328. type: undefined
  19329. })
  19330. }
  19331. // 13. Let body be a body whose stream is stream, source is source,
  19332. // and length is length.
  19333. const body = { stream, source, length }
  19334. // 14. Return (body, type).
  19335. return [body, type]
  19336. }
  19337. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19338. function safelyExtractBody (object, keepalive = false) {
  19339. if (!ReadableStream) {
  19340. // istanbul ignore next
  19341. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19342. }
  19343. // To safely extract a body and a `Content-Type` value from
  19344. // a byte sequence or BodyInit object object, run these steps:
  19345. // 1. If object is a ReadableStream object, then:
  19346. if (object instanceof ReadableStream) {
  19347. // Assert: object is neither disturbed nor locked.
  19348. // istanbul ignore next
  19349. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19350. // istanbul ignore next
  19351. assert(!object.locked, 'The stream is locked.')
  19352. }
  19353. // 2. Return the results of extracting object.
  19354. return extractBody(object, keepalive)
  19355. }
  19356. function cloneBody (body) {
  19357. // To clone a body body, run these steps:
  19358. // https://fetch.spec.whatwg.org/#concept-body-clone
  19359. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19360. const [out1, out2] = body.stream.tee()
  19361. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19362. // This, for whatever reasons, unrefs out2Clone which allows
  19363. // the process to exit by itself.
  19364. const [, finalClone] = out2Clone.tee()
  19365. // 2. Set body’s stream to out1.
  19366. body.stream = out1
  19367. // 3. Return a body whose stream is out2 and other members are copied from body.
  19368. return {
  19369. stream: finalClone,
  19370. length: body.length,
  19371. source: body.source
  19372. }
  19373. }
  19374. async function * consumeBody (body) {
  19375. if (body) {
  19376. if (isUint8Array(body)) {
  19377. yield body
  19378. } else {
  19379. const stream = body.stream
  19380. if (util.isDisturbed(stream)) {
  19381. throw new TypeError('The body has already been consumed.')
  19382. }
  19383. if (stream.locked) {
  19384. throw new TypeError('The stream is locked.')
  19385. }
  19386. // Compat.
  19387. stream[kBodyUsed] = true
  19388. yield * stream
  19389. }
  19390. }
  19391. }
  19392. function throwIfAborted (state) {
  19393. if (state.aborted) {
  19394. throw new DOMException('The operation was aborted.', 'AbortError')
  19395. }
  19396. }
  19397. function bodyMixinMethods (instance) {
  19398. const methods = {
  19399. blob () {
  19400. // The blob() method steps are to return the result of
  19401. // running consume body with this and the following step
  19402. // given a byte sequence bytes: return a Blob whose
  19403. // contents are bytes and whose type attribute is this’s
  19404. // MIME type.
  19405. return specConsumeBody(this, (bytes) => {
  19406. let mimeType = bodyMimeType(this)
  19407. if (mimeType === 'failure') {
  19408. mimeType = ''
  19409. } else if (mimeType) {
  19410. mimeType = serializeAMimeType(mimeType)
  19411. }
  19412. // Return a Blob whose contents are bytes and type attribute
  19413. // is mimeType.
  19414. return new Blob([bytes], { type: mimeType })
  19415. }, instance)
  19416. },
  19417. arrayBuffer () {
  19418. // The arrayBuffer() method steps are to return the result
  19419. // of running consume body with this and the following step
  19420. // given a byte sequence bytes: return a new ArrayBuffer
  19421. // whose contents are bytes.
  19422. return specConsumeBody(this, (bytes) => {
  19423. return new Uint8Array(bytes).buffer
  19424. }, instance)
  19425. },
  19426. text () {
  19427. // The text() method steps are to return the result of running
  19428. // consume body with this and UTF-8 decode.
  19429. return specConsumeBody(this, utf8DecodeBytes, instance)
  19430. },
  19431. json () {
  19432. // The json() method steps are to return the result of running
  19433. // consume body with this and parse JSON from bytes.
  19434. return specConsumeBody(this, parseJSONFromBytes, instance)
  19435. },
  19436. async formData () {
  19437. webidl.brandCheck(this, instance)
  19438. throwIfAborted(this[kState])
  19439. const contentType = this.headers.get('Content-Type')
  19440. // If mimeType’s essence is "multipart/form-data", then:
  19441. if (/multipart\/form-data/.test(contentType)) {
  19442. const headers = {}
  19443. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19444. const responseFormData = new FormData()
  19445. let busboy
  19446. try {
  19447. busboy = new Busboy({
  19448. headers,
  19449. preservePath: true
  19450. })
  19451. } catch (err) {
  19452. throw new DOMException(`${err}`, 'AbortError')
  19453. }
  19454. busboy.on('field', (name, value) => {
  19455. responseFormData.append(name, value)
  19456. })
  19457. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19458. const chunks = []
  19459. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19460. let base64chunk = ''
  19461. value.on('data', (chunk) => {
  19462. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19463. const end = base64chunk.length - base64chunk.length % 4
  19464. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19465. base64chunk = base64chunk.slice(end)
  19466. })
  19467. value.on('end', () => {
  19468. chunks.push(Buffer.from(base64chunk, 'base64'))
  19469. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19470. })
  19471. } else {
  19472. value.on('data', (chunk) => {
  19473. chunks.push(chunk)
  19474. })
  19475. value.on('end', () => {
  19476. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19477. })
  19478. }
  19479. })
  19480. const busboyResolve = new Promise((resolve, reject) => {
  19481. busboy.on('finish', resolve)
  19482. busboy.on('error', (err) => reject(new TypeError(err)))
  19483. })
  19484. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19485. busboy.end()
  19486. await busboyResolve
  19487. return responseFormData
  19488. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19489. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19490. // 1. Let entries be the result of parsing bytes.
  19491. let entries
  19492. try {
  19493. let text = ''
  19494. // application/x-www-form-urlencoded parser will keep the BOM.
  19495. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19496. // Note that streaming decoder is stateful and cannot be reused
  19497. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19498. for await (const chunk of consumeBody(this[kState].body)) {
  19499. if (!isUint8Array(chunk)) {
  19500. throw new TypeError('Expected Uint8Array chunk')
  19501. }
  19502. text += streamingDecoder.decode(chunk, { stream: true })
  19503. }
  19504. text += streamingDecoder.decode()
  19505. entries = new URLSearchParams(text)
  19506. } catch (err) {
  19507. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19508. // 2. If entries is failure, then throw a TypeError.
  19509. throw Object.assign(new TypeError(), { cause: err })
  19510. }
  19511. // 3. Return a new FormData object whose entries are entries.
  19512. const formData = new FormData()
  19513. for (const [name, value] of entries) {
  19514. formData.append(name, value)
  19515. }
  19516. return formData
  19517. } else {
  19518. // Wait a tick before checking if the request has been aborted.
  19519. // Otherwise, a TypeError can be thrown when an AbortError should.
  19520. await Promise.resolve()
  19521. throwIfAborted(this[kState])
  19522. // Otherwise, throw a TypeError.
  19523. throw webidl.errors.exception({
  19524. header: `${instance.name}.formData`,
  19525. message: 'Could not parse content as FormData.'
  19526. })
  19527. }
  19528. }
  19529. }
  19530. return methods
  19531. }
  19532. function mixinBody (prototype) {
  19533. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19534. }
  19535. /**
  19536. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19537. * @param {Response|Request} object
  19538. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19539. * @param {Response|Request} instance
  19540. */
  19541. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19542. webidl.brandCheck(object, instance)
  19543. throwIfAborted(object[kState])
  19544. // 1. If object is unusable, then return a promise rejected
  19545. // with a TypeError.
  19546. if (bodyUnusable(object[kState].body)) {
  19547. throw new TypeError('Body is unusable')
  19548. }
  19549. // 2. Let promise be a new promise.
  19550. const promise = createDeferredPromise()
  19551. // 3. Let errorSteps given error be to reject promise with error.
  19552. const errorSteps = (error) => promise.reject(error)
  19553. // 4. Let successSteps given a byte sequence data be to resolve
  19554. // promise with the result of running convertBytesToJSValue
  19555. // with data. If that threw an exception, then run errorSteps
  19556. // with that exception.
  19557. const successSteps = (data) => {
  19558. try {
  19559. promise.resolve(convertBytesToJSValue(data))
  19560. } catch (e) {
  19561. errorSteps(e)
  19562. }
  19563. }
  19564. // 5. If object’s body is null, then run successSteps with an
  19565. // empty byte sequence.
  19566. if (object[kState].body == null) {
  19567. successSteps(new Uint8Array())
  19568. return promise.promise
  19569. }
  19570. // 6. Otherwise, fully read object’s body given successSteps,
  19571. // errorSteps, and object’s relevant global object.
  19572. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19573. // 7. Return promise.
  19574. return promise.promise
  19575. }
  19576. // https://fetch.spec.whatwg.org/#body-unusable
  19577. function bodyUnusable (body) {
  19578. // An object including the Body interface mixin is
  19579. // said to be unusable if its body is non-null and
  19580. // its body’s stream is disturbed or locked.
  19581. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19582. }
  19583. /**
  19584. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19585. * @param {Buffer} buffer
  19586. */
  19587. function utf8DecodeBytes (buffer) {
  19588. if (buffer.length === 0) {
  19589. return ''
  19590. }
  19591. // 1. Let buffer be the result of peeking three bytes from
  19592. // ioQueue, converted to a byte sequence.
  19593. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19594. // bytes from ioQueue. (Do nothing with those bytes.)
  19595. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19596. buffer = buffer.subarray(3)
  19597. }
  19598. // 3. Process a queue with an instance of UTF-8’s
  19599. // decoder, ioQueue, output, and "replacement".
  19600. const output = textDecoder.decode(buffer)
  19601. // 4. Return output.
  19602. return output
  19603. }
  19604. /**
  19605. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19606. * @param {Uint8Array} bytes
  19607. */
  19608. function parseJSONFromBytes (bytes) {
  19609. return JSON.parse(utf8DecodeBytes(bytes))
  19610. }
  19611. /**
  19612. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19613. * @param {import('./response').Response|import('./request').Request} object
  19614. */
  19615. function bodyMimeType (object) {
  19616. const { headersList } = object[kState]
  19617. const contentType = headersList.get('content-type')
  19618. if (contentType === null) {
  19619. return 'failure'
  19620. }
  19621. return parseMIMEType(contentType)
  19622. }
  19623. module.exports = {
  19624. extractBody,
  19625. safelyExtractBody,
  19626. cloneBody,
  19627. mixinBody
  19628. }
  19629. /***/ }),
  19630. /***/ 1037:
  19631. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19632. "use strict";
  19633. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19634. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19635. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19636. const nullBodyStatus = [101, 204, 205, 304]
  19637. const redirectStatus = [301, 302, 303, 307, 308]
  19638. const redirectStatusSet = new Set(redirectStatus)
  19639. // https://fetch.spec.whatwg.org/#block-bad-port
  19640. const badPorts = [
  19641. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19642. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19643. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19644. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19645. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19646. '10080'
  19647. ]
  19648. const badPortsSet = new Set(badPorts)
  19649. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19650. const referrerPolicy = [
  19651. '',
  19652. 'no-referrer',
  19653. 'no-referrer-when-downgrade',
  19654. 'same-origin',
  19655. 'origin',
  19656. 'strict-origin',
  19657. 'origin-when-cross-origin',
  19658. 'strict-origin-when-cross-origin',
  19659. 'unsafe-url'
  19660. ]
  19661. const referrerPolicySet = new Set(referrerPolicy)
  19662. const requestRedirect = ['follow', 'manual', 'error']
  19663. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19664. const safeMethodsSet = new Set(safeMethods)
  19665. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19666. const requestCredentials = ['omit', 'same-origin', 'include']
  19667. const requestCache = [
  19668. 'default',
  19669. 'no-store',
  19670. 'reload',
  19671. 'no-cache',
  19672. 'force-cache',
  19673. 'only-if-cached'
  19674. ]
  19675. // https://fetch.spec.whatwg.org/#request-body-header-name
  19676. const requestBodyHeader = [
  19677. 'content-encoding',
  19678. 'content-language',
  19679. 'content-location',
  19680. 'content-type',
  19681. // See https://github.com/nodejs/undici/issues/2021
  19682. // 'Content-Length' is a forbidden header name, which is typically
  19683. // removed in the Headers implementation. However, undici doesn't
  19684. // filter out headers, so we add it here.
  19685. 'content-length'
  19686. ]
  19687. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19688. const requestDuplex = [
  19689. 'half'
  19690. ]
  19691. // http://fetch.spec.whatwg.org/#forbidden-method
  19692. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19693. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19694. const subresource = [
  19695. 'audio',
  19696. 'audioworklet',
  19697. 'font',
  19698. 'image',
  19699. 'manifest',
  19700. 'paintworklet',
  19701. 'script',
  19702. 'style',
  19703. 'track',
  19704. 'video',
  19705. 'xslt',
  19706. ''
  19707. ]
  19708. const subresourceSet = new Set(subresource)
  19709. /** @type {globalThis['DOMException']} */
  19710. const DOMException = globalThis.DOMException ?? (() => {
  19711. // DOMException was only made a global in Node v17.0.0,
  19712. // but fetch supports >= v16.8.
  19713. try {
  19714. atob('~')
  19715. } catch (err) {
  19716. return Object.getPrototypeOf(err).constructor
  19717. }
  19718. })()
  19719. let channel
  19720. /** @type {globalThis['structuredClone']} */
  19721. const structuredClone =
  19722. globalThis.structuredClone ??
  19723. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19724. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19725. function structuredClone (value, options = undefined) {
  19726. if (arguments.length === 0) {
  19727. throw new TypeError('missing argument')
  19728. }
  19729. if (!channel) {
  19730. channel = new MessageChannel()
  19731. }
  19732. channel.port1.unref()
  19733. channel.port2.unref()
  19734. channel.port1.postMessage(value, options?.transfer)
  19735. return receiveMessageOnPort(channel.port2).message
  19736. }
  19737. module.exports = {
  19738. DOMException,
  19739. structuredClone,
  19740. subresource,
  19741. forbiddenMethods,
  19742. requestBodyHeader,
  19743. referrerPolicy,
  19744. requestRedirect,
  19745. requestMode,
  19746. requestCredentials,
  19747. requestCache,
  19748. redirectStatus,
  19749. corsSafeListedMethods,
  19750. nullBodyStatus,
  19751. safeMethods,
  19752. badPorts,
  19753. requestDuplex,
  19754. subresourceSet,
  19755. badPortsSet,
  19756. redirectStatusSet,
  19757. corsSafeListedMethodsSet,
  19758. safeMethodsSet,
  19759. forbiddenMethodsSet,
  19760. referrerPolicySet
  19761. }
  19762. /***/ }),
  19763. /***/ 685:
  19764. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19765. const assert = __nccwpck_require__(9491)
  19766. const { atob } = __nccwpck_require__(4300)
  19767. const { isomorphicDecode } = __nccwpck_require__(2538)
  19768. const encoder = new TextEncoder()
  19769. /**
  19770. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  19771. */
  19772. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  19773. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  19774. /**
  19775. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  19776. */
  19777. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  19778. // https://fetch.spec.whatwg.org/#data-url-processor
  19779. /** @param {URL} dataURL */
  19780. function dataURLProcessor (dataURL) {
  19781. // 1. Assert: dataURL’s scheme is "data".
  19782. assert(dataURL.protocol === 'data:')
  19783. // 2. Let input be the result of running the URL
  19784. // serializer on dataURL with exclude fragment
  19785. // set to true.
  19786. let input = URLSerializer(dataURL, true)
  19787. // 3. Remove the leading "data:" string from input.
  19788. input = input.slice(5)
  19789. // 4. Let position point at the start of input.
  19790. const position = { position: 0 }
  19791. // 5. Let mimeType be the result of collecting a
  19792. // sequence of code points that are not equal
  19793. // to U+002C (,), given position.
  19794. let mimeType = collectASequenceOfCodePointsFast(
  19795. ',',
  19796. input,
  19797. position
  19798. )
  19799. // 6. Strip leading and trailing ASCII whitespace
  19800. // from mimeType.
  19801. // Undici implementation note: we need to store the
  19802. // length because if the mimetype has spaces removed,
  19803. // the wrong amount will be sliced from the input in
  19804. // step #9
  19805. const mimeTypeLength = mimeType.length
  19806. mimeType = removeASCIIWhitespace(mimeType, true, true)
  19807. // 7. If position is past the end of input, then
  19808. // return failure
  19809. if (position.position >= input.length) {
  19810. return 'failure'
  19811. }
  19812. // 8. Advance position by 1.
  19813. position.position++
  19814. // 9. Let encodedBody be the remainder of input.
  19815. const encodedBody = input.slice(mimeTypeLength + 1)
  19816. // 10. Let body be the percent-decoding of encodedBody.
  19817. let body = stringPercentDecode(encodedBody)
  19818. // 11. If mimeType ends with U+003B (;), followed by
  19819. // zero or more U+0020 SPACE, followed by an ASCII
  19820. // case-insensitive match for "base64", then:
  19821. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  19822. // 1. Let stringBody be the isomorphic decode of body.
  19823. const stringBody = isomorphicDecode(body)
  19824. // 2. Set body to the forgiving-base64 decode of
  19825. // stringBody.
  19826. body = forgivingBase64(stringBody)
  19827. // 3. If body is failure, then return failure.
  19828. if (body === 'failure') {
  19829. return 'failure'
  19830. }
  19831. // 4. Remove the last 6 code points from mimeType.
  19832. mimeType = mimeType.slice(0, -6)
  19833. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  19834. // if any.
  19835. mimeType = mimeType.replace(/(\u0020)+$/, '')
  19836. // 6. Remove the last U+003B (;) code point from mimeType.
  19837. mimeType = mimeType.slice(0, -1)
  19838. }
  19839. // 12. If mimeType starts with U+003B (;), then prepend
  19840. // "text/plain" to mimeType.
  19841. if (mimeType.startsWith(';')) {
  19842. mimeType = 'text/plain' + mimeType
  19843. }
  19844. // 13. Let mimeTypeRecord be the result of parsing
  19845. // mimeType.
  19846. let mimeTypeRecord = parseMIMEType(mimeType)
  19847. // 14. If mimeTypeRecord is failure, then set
  19848. // mimeTypeRecord to text/plain;charset=US-ASCII.
  19849. if (mimeTypeRecord === 'failure') {
  19850. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  19851. }
  19852. // 15. Return a new data: URL struct whose MIME
  19853. // type is mimeTypeRecord and body is body.
  19854. // https://fetch.spec.whatwg.org/#data-url-struct
  19855. return { mimeType: mimeTypeRecord, body }
  19856. }
  19857. // https://url.spec.whatwg.org/#concept-url-serializer
  19858. /**
  19859. * @param {URL} url
  19860. * @param {boolean} excludeFragment
  19861. */
  19862. function URLSerializer (url, excludeFragment = false) {
  19863. if (!excludeFragment) {
  19864. return url.href
  19865. }
  19866. const href = url.href
  19867. const hashLength = url.hash.length
  19868. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  19869. }
  19870. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  19871. /**
  19872. * @param {(char: string) => boolean} condition
  19873. * @param {string} input
  19874. * @param {{ position: number }} position
  19875. */
  19876. function collectASequenceOfCodePoints (condition, input, position) {
  19877. // 1. Let result be the empty string.
  19878. let result = ''
  19879. // 2. While position doesn’t point past the end of input and the
  19880. // code point at position within input meets the condition condition:
  19881. while (position.position < input.length && condition(input[position.position])) {
  19882. // 1. Append that code point to the end of result.
  19883. result += input[position.position]
  19884. // 2. Advance position by 1.
  19885. position.position++
  19886. }
  19887. // 3. Return result.
  19888. return result
  19889. }
  19890. /**
  19891. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  19892. * @param {string} char
  19893. * @param {string} input
  19894. * @param {{ position: number }} position
  19895. */
  19896. function collectASequenceOfCodePointsFast (char, input, position) {
  19897. const idx = input.indexOf(char, position.position)
  19898. const start = position.position
  19899. if (idx === -1) {
  19900. position.position = input.length
  19901. return input.slice(start)
  19902. }
  19903. position.position = idx
  19904. return input.slice(start, position.position)
  19905. }
  19906. // https://url.spec.whatwg.org/#string-percent-decode
  19907. /** @param {string} input */
  19908. function stringPercentDecode (input) {
  19909. // 1. Let bytes be the UTF-8 encoding of input.
  19910. const bytes = encoder.encode(input)
  19911. // 2. Return the percent-decoding of bytes.
  19912. return percentDecode(bytes)
  19913. }
  19914. // https://url.spec.whatwg.org/#percent-decode
  19915. /** @param {Uint8Array} input */
  19916. function percentDecode (input) {
  19917. // 1. Let output be an empty byte sequence.
  19918. /** @type {number[]} */
  19919. const output = []
  19920. // 2. For each byte byte in input:
  19921. for (let i = 0; i < input.length; i++) {
  19922. const byte = input[i]
  19923. // 1. If byte is not 0x25 (%), then append byte to output.
  19924. if (byte !== 0x25) {
  19925. output.push(byte)
  19926. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  19927. // after byte in input are not in the ranges
  19928. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  19929. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  19930. // to output.
  19931. } else if (
  19932. byte === 0x25 &&
  19933. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  19934. ) {
  19935. output.push(0x25)
  19936. // 3. Otherwise:
  19937. } else {
  19938. // 1. Let bytePoint be the two bytes after byte in input,
  19939. // decoded, and then interpreted as hexadecimal number.
  19940. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  19941. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  19942. // 2. Append a byte whose value is bytePoint to output.
  19943. output.push(bytePoint)
  19944. // 3. Skip the next two bytes in input.
  19945. i += 2
  19946. }
  19947. }
  19948. // 3. Return output.
  19949. return Uint8Array.from(output)
  19950. }
  19951. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  19952. /** @param {string} input */
  19953. function parseMIMEType (input) {
  19954. // 1. Remove any leading and trailing HTTP whitespace
  19955. // from input.
  19956. input = removeHTTPWhitespace(input, true, true)
  19957. // 2. Let position be a position variable for input,
  19958. // initially pointing at the start of input.
  19959. const position = { position: 0 }
  19960. // 3. Let type be the result of collecting a sequence
  19961. // of code points that are not U+002F (/) from
  19962. // input, given position.
  19963. const type = collectASequenceOfCodePointsFast(
  19964. '/',
  19965. input,
  19966. position
  19967. )
  19968. // 4. If type is the empty string or does not solely
  19969. // contain HTTP token code points, then return failure.
  19970. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  19971. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  19972. return 'failure'
  19973. }
  19974. // 5. If position is past the end of input, then return
  19975. // failure
  19976. if (position.position > input.length) {
  19977. return 'failure'
  19978. }
  19979. // 6. Advance position by 1. (This skips past U+002F (/).)
  19980. position.position++
  19981. // 7. Let subtype be the result of collecting a sequence of
  19982. // code points that are not U+003B (;) from input, given
  19983. // position.
  19984. let subtype = collectASequenceOfCodePointsFast(
  19985. ';',
  19986. input,
  19987. position
  19988. )
  19989. // 8. Remove any trailing HTTP whitespace from subtype.
  19990. subtype = removeHTTPWhitespace(subtype, false, true)
  19991. // 9. If subtype is the empty string or does not solely
  19992. // contain HTTP token code points, then return failure.
  19993. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  19994. return 'failure'
  19995. }
  19996. const typeLowercase = type.toLowerCase()
  19997. const subtypeLowercase = subtype.toLowerCase()
  19998. // 10. Let mimeType be a new MIME type record whose type
  19999. // is type, in ASCII lowercase, and subtype is subtype,
  20000. // in ASCII lowercase.
  20001. // https://mimesniff.spec.whatwg.org/#mime-type
  20002. const mimeType = {
  20003. type: typeLowercase,
  20004. subtype: subtypeLowercase,
  20005. /** @type {Map<string, string>} */
  20006. parameters: new Map(),
  20007. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20008. essence: `${typeLowercase}/${subtypeLowercase}`
  20009. }
  20010. // 11. While position is not past the end of input:
  20011. while (position.position < input.length) {
  20012. // 1. Advance position by 1. (This skips past U+003B (;).)
  20013. position.position++
  20014. // 2. Collect a sequence of code points that are HTTP
  20015. // whitespace from input given position.
  20016. collectASequenceOfCodePoints(
  20017. // https://fetch.spec.whatwg.org/#http-whitespace
  20018. char => HTTP_WHITESPACE_REGEX.test(char),
  20019. input,
  20020. position
  20021. )
  20022. // 3. Let parameterName be the result of collecting a
  20023. // sequence of code points that are not U+003B (;)
  20024. // or U+003D (=) from input, given position.
  20025. let parameterName = collectASequenceOfCodePoints(
  20026. (char) => char !== ';' && char !== '=',
  20027. input,
  20028. position
  20029. )
  20030. // 4. Set parameterName to parameterName, in ASCII
  20031. // lowercase.
  20032. parameterName = parameterName.toLowerCase()
  20033. // 5. If position is not past the end of input, then:
  20034. if (position.position < input.length) {
  20035. // 1. If the code point at position within input is
  20036. // U+003B (;), then continue.
  20037. if (input[position.position] === ';') {
  20038. continue
  20039. }
  20040. // 2. Advance position by 1. (This skips past U+003D (=).)
  20041. position.position++
  20042. }
  20043. // 6. If position is past the end of input, then break.
  20044. if (position.position > input.length) {
  20045. break
  20046. }
  20047. // 7. Let parameterValue be null.
  20048. let parameterValue = null
  20049. // 8. If the code point at position within input is
  20050. // U+0022 ("), then:
  20051. if (input[position.position] === '"') {
  20052. // 1. Set parameterValue to the result of collecting
  20053. // an HTTP quoted string from input, given position
  20054. // and the extract-value flag.
  20055. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20056. // 2. Collect a sequence of code points that are not
  20057. // U+003B (;) from input, given position.
  20058. collectASequenceOfCodePointsFast(
  20059. ';',
  20060. input,
  20061. position
  20062. )
  20063. // 9. Otherwise:
  20064. } else {
  20065. // 1. Set parameterValue to the result of collecting
  20066. // a sequence of code points that are not U+003B (;)
  20067. // from input, given position.
  20068. parameterValue = collectASequenceOfCodePointsFast(
  20069. ';',
  20070. input,
  20071. position
  20072. )
  20073. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20074. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20075. // 3. If parameterValue is the empty string, then continue.
  20076. if (parameterValue.length === 0) {
  20077. continue
  20078. }
  20079. }
  20080. // 10. If all of the following are true
  20081. // - parameterName is not the empty string
  20082. // - parameterName solely contains HTTP token code points
  20083. // - parameterValue solely contains HTTP quoted-string token code points
  20084. // - mimeType’s parameters[parameterName] does not exist
  20085. // then set mimeType’s parameters[parameterName] to parameterValue.
  20086. if (
  20087. parameterName.length !== 0 &&
  20088. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20089. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20090. !mimeType.parameters.has(parameterName)
  20091. ) {
  20092. mimeType.parameters.set(parameterName, parameterValue)
  20093. }
  20094. }
  20095. // 12. Return mimeType.
  20096. return mimeType
  20097. }
  20098. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20099. /** @param {string} data */
  20100. function forgivingBase64 (data) {
  20101. // 1. Remove all ASCII whitespace from data.
  20102. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20103. // 2. If data’s code point length divides by 4 leaving
  20104. // no remainder, then:
  20105. if (data.length % 4 === 0) {
  20106. // 1. If data ends with one or two U+003D (=) code points,
  20107. // then remove them from data.
  20108. data = data.replace(/=?=$/, '')
  20109. }
  20110. // 3. If data’s code point length divides by 4 leaving
  20111. // a remainder of 1, then return failure.
  20112. if (data.length % 4 === 1) {
  20113. return 'failure'
  20114. }
  20115. // 4. If data contains a code point that is not one of
  20116. // U+002B (+)
  20117. // U+002F (/)
  20118. // ASCII alphanumeric
  20119. // then return failure.
  20120. if (/[^+/0-9A-Za-z]/.test(data)) {
  20121. return 'failure'
  20122. }
  20123. const binary = atob(data)
  20124. const bytes = new Uint8Array(binary.length)
  20125. for (let byte = 0; byte < binary.length; byte++) {
  20126. bytes[byte] = binary.charCodeAt(byte)
  20127. }
  20128. return bytes
  20129. }
  20130. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20131. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20132. /**
  20133. * @param {string} input
  20134. * @param {{ position: number }} position
  20135. * @param {boolean?} extractValue
  20136. */
  20137. function collectAnHTTPQuotedString (input, position, extractValue) {
  20138. // 1. Let positionStart be position.
  20139. const positionStart = position.position
  20140. // 2. Let value be the empty string.
  20141. let value = ''
  20142. // 3. Assert: the code point at position within input
  20143. // is U+0022 (").
  20144. assert(input[position.position] === '"')
  20145. // 4. Advance position by 1.
  20146. position.position++
  20147. // 5. While true:
  20148. while (true) {
  20149. // 1. Append the result of collecting a sequence of code points
  20150. // that are not U+0022 (") or U+005C (\) from input, given
  20151. // position, to value.
  20152. value += collectASequenceOfCodePoints(
  20153. (char) => char !== '"' && char !== '\\',
  20154. input,
  20155. position
  20156. )
  20157. // 2. If position is past the end of input, then break.
  20158. if (position.position >= input.length) {
  20159. break
  20160. }
  20161. // 3. Let quoteOrBackslash be the code point at position within
  20162. // input.
  20163. const quoteOrBackslash = input[position.position]
  20164. // 4. Advance position by 1.
  20165. position.position++
  20166. // 5. If quoteOrBackslash is U+005C (\), then:
  20167. if (quoteOrBackslash === '\\') {
  20168. // 1. If position is past the end of input, then append
  20169. // U+005C (\) to value and break.
  20170. if (position.position >= input.length) {
  20171. value += '\\'
  20172. break
  20173. }
  20174. // 2. Append the code point at position within input to value.
  20175. value += input[position.position]
  20176. // 3. Advance position by 1.
  20177. position.position++
  20178. // 6. Otherwise:
  20179. } else {
  20180. // 1. Assert: quoteOrBackslash is U+0022 (").
  20181. assert(quoteOrBackslash === '"')
  20182. // 2. Break.
  20183. break
  20184. }
  20185. }
  20186. // 6. If the extract-value flag is set, then return value.
  20187. if (extractValue) {
  20188. return value
  20189. }
  20190. // 7. Return the code points from positionStart to position,
  20191. // inclusive, within input.
  20192. return input.slice(positionStart, position.position)
  20193. }
  20194. /**
  20195. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20196. */
  20197. function serializeAMimeType (mimeType) {
  20198. assert(mimeType !== 'failure')
  20199. const { parameters, essence } = mimeType
  20200. // 1. Let serialization be the concatenation of mimeType’s
  20201. // type, U+002F (/), and mimeType’s subtype.
  20202. let serialization = essence
  20203. // 2. For each name → value of mimeType’s parameters:
  20204. for (let [name, value] of parameters.entries()) {
  20205. // 1. Append U+003B (;) to serialization.
  20206. serialization += ';'
  20207. // 2. Append name to serialization.
  20208. serialization += name
  20209. // 3. Append U+003D (=) to serialization.
  20210. serialization += '='
  20211. // 4. If value does not solely contain HTTP token code
  20212. // points or value is the empty string, then:
  20213. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20214. // 1. Precede each occurence of U+0022 (") or
  20215. // U+005C (\) in value with U+005C (\).
  20216. value = value.replace(/(\\|")/g, '\\$1')
  20217. // 2. Prepend U+0022 (") to value.
  20218. value = '"' + value
  20219. // 3. Append U+0022 (") to value.
  20220. value += '"'
  20221. }
  20222. // 5. Append value to serialization.
  20223. serialization += value
  20224. }
  20225. // 3. Return serialization.
  20226. return serialization
  20227. }
  20228. /**
  20229. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20230. * @param {string} char
  20231. */
  20232. function isHTTPWhiteSpace (char) {
  20233. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20234. }
  20235. /**
  20236. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20237. * @param {string} str
  20238. */
  20239. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20240. let lead = 0
  20241. let trail = str.length - 1
  20242. if (leading) {
  20243. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20244. }
  20245. if (trailing) {
  20246. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20247. }
  20248. return str.slice(lead, trail + 1)
  20249. }
  20250. /**
  20251. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20252. * @param {string} char
  20253. */
  20254. function isASCIIWhitespace (char) {
  20255. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20256. }
  20257. /**
  20258. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20259. */
  20260. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20261. let lead = 0
  20262. let trail = str.length - 1
  20263. if (leading) {
  20264. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20265. }
  20266. if (trailing) {
  20267. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20268. }
  20269. return str.slice(lead, trail + 1)
  20270. }
  20271. module.exports = {
  20272. dataURLProcessor,
  20273. URLSerializer,
  20274. collectASequenceOfCodePoints,
  20275. collectASequenceOfCodePointsFast,
  20276. stringPercentDecode,
  20277. parseMIMEType,
  20278. collectAnHTTPQuotedString,
  20279. serializeAMimeType
  20280. }
  20281. /***/ }),
  20282. /***/ 8511:
  20283. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20284. "use strict";
  20285. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20286. const { types } = __nccwpck_require__(3837)
  20287. const { kState } = __nccwpck_require__(5861)
  20288. const { isBlobLike } = __nccwpck_require__(2538)
  20289. const { webidl } = __nccwpck_require__(1744)
  20290. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20291. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20292. const encoder = new TextEncoder()
  20293. class File extends Blob {
  20294. constructor (fileBits, fileName, options = {}) {
  20295. // The File constructor is invoked with two or three parameters, depending
  20296. // on whether the optional dictionary parameter is used. When the File()
  20297. // constructor is invoked, user agents must run the following steps:
  20298. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20299. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20300. fileName = webidl.converters.USVString(fileName)
  20301. options = webidl.converters.FilePropertyBag(options)
  20302. // 1. Let bytes be the result of processing blob parts given fileBits and
  20303. // options.
  20304. // Note: Blob handles this for us
  20305. // 2. Let n be the fileName argument to the constructor.
  20306. const n = fileName
  20307. // 3. Process FilePropertyBag dictionary argument by running the following
  20308. // substeps:
  20309. // 1. If the type member is provided and is not the empty string, let t
  20310. // be set to the type dictionary member. If t contains any characters
  20311. // outside the range U+0020 to U+007E, then set t to the empty string
  20312. // and return from these substeps.
  20313. // 2. Convert every character in t to ASCII lowercase.
  20314. let t = options.type
  20315. let d
  20316. // eslint-disable-next-line no-labels
  20317. substep: {
  20318. if (t) {
  20319. t = parseMIMEType(t)
  20320. if (t === 'failure') {
  20321. t = ''
  20322. // eslint-disable-next-line no-labels
  20323. break substep
  20324. }
  20325. t = serializeAMimeType(t).toLowerCase()
  20326. }
  20327. // 3. If the lastModified member is provided, let d be set to the
  20328. // lastModified dictionary member. If it is not provided, set d to the
  20329. // current date and time represented as the number of milliseconds since
  20330. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20331. d = options.lastModified
  20332. }
  20333. // 4. Return a new File object F such that:
  20334. // F refers to the bytes byte sequence.
  20335. // F.size is set to the number of total bytes in bytes.
  20336. // F.name is set to n.
  20337. // F.type is set to t.
  20338. // F.lastModified is set to d.
  20339. super(processBlobParts(fileBits, options), { type: t })
  20340. this[kState] = {
  20341. name: n,
  20342. lastModified: d,
  20343. type: t
  20344. }
  20345. }
  20346. get name () {
  20347. webidl.brandCheck(this, File)
  20348. return this[kState].name
  20349. }
  20350. get lastModified () {
  20351. webidl.brandCheck(this, File)
  20352. return this[kState].lastModified
  20353. }
  20354. get type () {
  20355. webidl.brandCheck(this, File)
  20356. return this[kState].type
  20357. }
  20358. }
  20359. class FileLike {
  20360. constructor (blobLike, fileName, options = {}) {
  20361. // TODO: argument idl type check
  20362. // The File constructor is invoked with two or three parameters, depending
  20363. // on whether the optional dictionary parameter is used. When the File()
  20364. // constructor is invoked, user agents must run the following steps:
  20365. // 1. Let bytes be the result of processing blob parts given fileBits and
  20366. // options.
  20367. // 2. Let n be the fileName argument to the constructor.
  20368. const n = fileName
  20369. // 3. Process FilePropertyBag dictionary argument by running the following
  20370. // substeps:
  20371. // 1. If the type member is provided and is not the empty string, let t
  20372. // be set to the type dictionary member. If t contains any characters
  20373. // outside the range U+0020 to U+007E, then set t to the empty string
  20374. // and return from these substeps.
  20375. // TODO
  20376. const t = options.type
  20377. // 2. Convert every character in t to ASCII lowercase.
  20378. // TODO
  20379. // 3. If the lastModified member is provided, let d be set to the
  20380. // lastModified dictionary member. If it is not provided, set d to the
  20381. // current date and time represented as the number of milliseconds since
  20382. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20383. const d = options.lastModified ?? Date.now()
  20384. // 4. Return a new File object F such that:
  20385. // F refers to the bytes byte sequence.
  20386. // F.size is set to the number of total bytes in bytes.
  20387. // F.name is set to n.
  20388. // F.type is set to t.
  20389. // F.lastModified is set to d.
  20390. this[kState] = {
  20391. blobLike,
  20392. name: n,
  20393. type: t,
  20394. lastModified: d
  20395. }
  20396. }
  20397. stream (...args) {
  20398. webidl.brandCheck(this, FileLike)
  20399. return this[kState].blobLike.stream(...args)
  20400. }
  20401. arrayBuffer (...args) {
  20402. webidl.brandCheck(this, FileLike)
  20403. return this[kState].blobLike.arrayBuffer(...args)
  20404. }
  20405. slice (...args) {
  20406. webidl.brandCheck(this, FileLike)
  20407. return this[kState].blobLike.slice(...args)
  20408. }
  20409. text (...args) {
  20410. webidl.brandCheck(this, FileLike)
  20411. return this[kState].blobLike.text(...args)
  20412. }
  20413. get size () {
  20414. webidl.brandCheck(this, FileLike)
  20415. return this[kState].blobLike.size
  20416. }
  20417. get type () {
  20418. webidl.brandCheck(this, FileLike)
  20419. return this[kState].blobLike.type
  20420. }
  20421. get name () {
  20422. webidl.brandCheck(this, FileLike)
  20423. return this[kState].name
  20424. }
  20425. get lastModified () {
  20426. webidl.brandCheck(this, FileLike)
  20427. return this[kState].lastModified
  20428. }
  20429. get [Symbol.toStringTag] () {
  20430. return 'File'
  20431. }
  20432. }
  20433. Object.defineProperties(File.prototype, {
  20434. [Symbol.toStringTag]: {
  20435. value: 'File',
  20436. configurable: true
  20437. },
  20438. name: kEnumerableProperty,
  20439. lastModified: kEnumerableProperty
  20440. })
  20441. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20442. webidl.converters.BlobPart = function (V, opts) {
  20443. if (webidl.util.Type(V) === 'Object') {
  20444. if (isBlobLike(V)) {
  20445. return webidl.converters.Blob(V, { strict: false })
  20446. }
  20447. if (
  20448. ArrayBuffer.isView(V) ||
  20449. types.isAnyArrayBuffer(V)
  20450. ) {
  20451. return webidl.converters.BufferSource(V, opts)
  20452. }
  20453. }
  20454. return webidl.converters.USVString(V, opts)
  20455. }
  20456. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20457. webidl.converters.BlobPart
  20458. )
  20459. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20460. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20461. {
  20462. key: 'lastModified',
  20463. converter: webidl.converters['long long'],
  20464. get defaultValue () {
  20465. return Date.now()
  20466. }
  20467. },
  20468. {
  20469. key: 'type',
  20470. converter: webidl.converters.DOMString,
  20471. defaultValue: ''
  20472. },
  20473. {
  20474. key: 'endings',
  20475. converter: (value) => {
  20476. value = webidl.converters.DOMString(value)
  20477. value = value.toLowerCase()
  20478. if (value !== 'native') {
  20479. value = 'transparent'
  20480. }
  20481. return value
  20482. },
  20483. defaultValue: 'transparent'
  20484. }
  20485. ])
  20486. /**
  20487. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20488. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20489. * @param {{ type: string, endings: string }} options
  20490. */
  20491. function processBlobParts (parts, options) {
  20492. // 1. Let bytes be an empty sequence of bytes.
  20493. /** @type {NodeJS.TypedArray[]} */
  20494. const bytes = []
  20495. // 2. For each element in parts:
  20496. for (const element of parts) {
  20497. // 1. If element is a USVString, run the following substeps:
  20498. if (typeof element === 'string') {
  20499. // 1. Let s be element.
  20500. let s = element
  20501. // 2. If the endings member of options is "native", set s
  20502. // to the result of converting line endings to native
  20503. // of element.
  20504. if (options.endings === 'native') {
  20505. s = convertLineEndingsNative(s)
  20506. }
  20507. // 3. Append the result of UTF-8 encoding s to bytes.
  20508. bytes.push(encoder.encode(s))
  20509. } else if (
  20510. types.isAnyArrayBuffer(element) ||
  20511. types.isTypedArray(element)
  20512. ) {
  20513. // 2. If element is a BufferSource, get a copy of the
  20514. // bytes held by the buffer source, and append those
  20515. // bytes to bytes.
  20516. if (!element.buffer) { // ArrayBuffer
  20517. bytes.push(new Uint8Array(element))
  20518. } else {
  20519. bytes.push(
  20520. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20521. )
  20522. }
  20523. } else if (isBlobLike(element)) {
  20524. // 3. If element is a Blob, append the bytes it represents
  20525. // to bytes.
  20526. bytes.push(element)
  20527. }
  20528. }
  20529. // 3. Return bytes.
  20530. return bytes
  20531. }
  20532. /**
  20533. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20534. * @param {string} s
  20535. */
  20536. function convertLineEndingsNative (s) {
  20537. // 1. Let native line ending be be the code point U+000A LF.
  20538. let nativeLineEnding = '\n'
  20539. // 2. If the underlying platform’s conventions are to
  20540. // represent newlines as a carriage return and line feed
  20541. // sequence, set native line ending to the code point
  20542. // U+000D CR followed by the code point U+000A LF.
  20543. if (process.platform === 'win32') {
  20544. nativeLineEnding = '\r\n'
  20545. }
  20546. return s.replace(/\r?\n/g, nativeLineEnding)
  20547. }
  20548. // If this function is moved to ./util.js, some tools (such as
  20549. // rollup) will warn about circular dependencies. See:
  20550. // https://github.com/nodejs/undici/issues/1629
  20551. function isFileLike (object) {
  20552. return (
  20553. (NativeFile && object instanceof NativeFile) ||
  20554. object instanceof File || (
  20555. object &&
  20556. (typeof object.stream === 'function' ||
  20557. typeof object.arrayBuffer === 'function') &&
  20558. object[Symbol.toStringTag] === 'File'
  20559. )
  20560. )
  20561. }
  20562. module.exports = { File, FileLike, isFileLike }
  20563. /***/ }),
  20564. /***/ 2015:
  20565. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20566. "use strict";
  20567. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20568. const { kState } = __nccwpck_require__(5861)
  20569. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20570. const { webidl } = __nccwpck_require__(1744)
  20571. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20572. /** @type {globalThis['File']} */
  20573. const File = NativeFile ?? UndiciFile
  20574. // https://xhr.spec.whatwg.org/#formdata
  20575. class FormData {
  20576. constructor (form) {
  20577. if (form !== undefined) {
  20578. throw webidl.errors.conversionFailed({
  20579. prefix: 'FormData constructor',
  20580. argument: 'Argument 1',
  20581. types: ['undefined']
  20582. })
  20583. }
  20584. this[kState] = []
  20585. }
  20586. append (name, value, filename = undefined) {
  20587. webidl.brandCheck(this, FormData)
  20588. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20589. if (arguments.length === 3 && !isBlobLike(value)) {
  20590. throw new TypeError(
  20591. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20592. )
  20593. }
  20594. // 1. Let value be value if given; otherwise blobValue.
  20595. name = webidl.converters.USVString(name)
  20596. value = isBlobLike(value)
  20597. ? webidl.converters.Blob(value, { strict: false })
  20598. : webidl.converters.USVString(value)
  20599. filename = arguments.length === 3
  20600. ? webidl.converters.USVString(filename)
  20601. : undefined
  20602. // 2. Let entry be the result of creating an entry with
  20603. // name, value, and filename if given.
  20604. const entry = makeEntry(name, value, filename)
  20605. // 3. Append entry to this’s entry list.
  20606. this[kState].push(entry)
  20607. }
  20608. delete (name) {
  20609. webidl.brandCheck(this, FormData)
  20610. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20611. name = webidl.converters.USVString(name)
  20612. // The delete(name) method steps are to remove all entries whose name
  20613. // is name from this’s entry list.
  20614. this[kState] = this[kState].filter(entry => entry.name !== name)
  20615. }
  20616. get (name) {
  20617. webidl.brandCheck(this, FormData)
  20618. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20619. name = webidl.converters.USVString(name)
  20620. // 1. If there is no entry whose name is name in this’s entry list,
  20621. // then return null.
  20622. const idx = this[kState].findIndex((entry) => entry.name === name)
  20623. if (idx === -1) {
  20624. return null
  20625. }
  20626. // 2. Return the value of the first entry whose name is name from
  20627. // this’s entry list.
  20628. return this[kState][idx].value
  20629. }
  20630. getAll (name) {
  20631. webidl.brandCheck(this, FormData)
  20632. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20633. name = webidl.converters.USVString(name)
  20634. // 1. If there is no entry whose name is name in this’s entry list,
  20635. // then return the empty list.
  20636. // 2. Return the values of all entries whose name is name, in order,
  20637. // from this’s entry list.
  20638. return this[kState]
  20639. .filter((entry) => entry.name === name)
  20640. .map((entry) => entry.value)
  20641. }
  20642. has (name) {
  20643. webidl.brandCheck(this, FormData)
  20644. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20645. name = webidl.converters.USVString(name)
  20646. // The has(name) method steps are to return true if there is an entry
  20647. // whose name is name in this’s entry list; otherwise false.
  20648. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20649. }
  20650. set (name, value, filename = undefined) {
  20651. webidl.brandCheck(this, FormData)
  20652. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20653. if (arguments.length === 3 && !isBlobLike(value)) {
  20654. throw new TypeError(
  20655. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20656. )
  20657. }
  20658. // The set(name, value) and set(name, blobValue, filename) method steps
  20659. // are:
  20660. // 1. Let value be value if given; otherwise blobValue.
  20661. name = webidl.converters.USVString(name)
  20662. value = isBlobLike(value)
  20663. ? webidl.converters.Blob(value, { strict: false })
  20664. : webidl.converters.USVString(value)
  20665. filename = arguments.length === 3
  20666. ? toUSVString(filename)
  20667. : undefined
  20668. // 2. Let entry be the result of creating an entry with name, value, and
  20669. // filename if given.
  20670. const entry = makeEntry(name, value, filename)
  20671. // 3. If there are entries in this’s entry list whose name is name, then
  20672. // replace the first such entry with entry and remove the others.
  20673. const idx = this[kState].findIndex((entry) => entry.name === name)
  20674. if (idx !== -1) {
  20675. this[kState] = [
  20676. ...this[kState].slice(0, idx),
  20677. entry,
  20678. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20679. ]
  20680. } else {
  20681. // 4. Otherwise, append entry to this’s entry list.
  20682. this[kState].push(entry)
  20683. }
  20684. }
  20685. entries () {
  20686. webidl.brandCheck(this, FormData)
  20687. return makeIterator(
  20688. () => this[kState].map(pair => [pair.name, pair.value]),
  20689. 'FormData',
  20690. 'key+value'
  20691. )
  20692. }
  20693. keys () {
  20694. webidl.brandCheck(this, FormData)
  20695. return makeIterator(
  20696. () => this[kState].map(pair => [pair.name, pair.value]),
  20697. 'FormData',
  20698. 'key'
  20699. )
  20700. }
  20701. values () {
  20702. webidl.brandCheck(this, FormData)
  20703. return makeIterator(
  20704. () => this[kState].map(pair => [pair.name, pair.value]),
  20705. 'FormData',
  20706. 'value'
  20707. )
  20708. }
  20709. /**
  20710. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20711. * @param {unknown} thisArg
  20712. */
  20713. forEach (callbackFn, thisArg = globalThis) {
  20714. webidl.brandCheck(this, FormData)
  20715. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20716. if (typeof callbackFn !== 'function') {
  20717. throw new TypeError(
  20718. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20719. )
  20720. }
  20721. for (const [key, value] of this) {
  20722. callbackFn.apply(thisArg, [value, key, this])
  20723. }
  20724. }
  20725. }
  20726. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20727. Object.defineProperties(FormData.prototype, {
  20728. [Symbol.toStringTag]: {
  20729. value: 'FormData',
  20730. configurable: true
  20731. }
  20732. })
  20733. /**
  20734. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  20735. * @param {string} name
  20736. * @param {string|Blob} value
  20737. * @param {?string} filename
  20738. * @returns
  20739. */
  20740. function makeEntry (name, value, filename) {
  20741. // 1. Set name to the result of converting name into a scalar value string.
  20742. // "To convert a string into a scalar value string, replace any surrogates
  20743. // with U+FFFD."
  20744. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  20745. name = Buffer.from(name).toString('utf8')
  20746. // 2. If value is a string, then set value to the result of converting
  20747. // value into a scalar value string.
  20748. if (typeof value === 'string') {
  20749. value = Buffer.from(value).toString('utf8')
  20750. } else {
  20751. // 3. Otherwise:
  20752. // 1. If value is not a File object, then set value to a new File object,
  20753. // representing the same bytes, whose name attribute value is "blob"
  20754. if (!isFileLike(value)) {
  20755. value = value instanceof Blob
  20756. ? new File([value], 'blob', { type: value.type })
  20757. : new FileLike(value, 'blob', { type: value.type })
  20758. }
  20759. // 2. If filename is given, then set value to a new File object,
  20760. // representing the same bytes, whose name attribute is filename.
  20761. if (filename !== undefined) {
  20762. /** @type {FilePropertyBag} */
  20763. const options = {
  20764. type: value.type,
  20765. lastModified: value.lastModified
  20766. }
  20767. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  20768. ? new File([value], filename, options)
  20769. : new FileLike(value, filename, options)
  20770. }
  20771. }
  20772. // 4. Return an entry whose name is name and whose value is value.
  20773. return { name, value }
  20774. }
  20775. module.exports = { FormData }
  20776. /***/ }),
  20777. /***/ 1246:
  20778. /***/ ((module) => {
  20779. "use strict";
  20780. // In case of breaking changes, increase the version
  20781. // number to avoid conflicts.
  20782. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  20783. function getGlobalOrigin () {
  20784. return globalThis[globalOrigin]
  20785. }
  20786. function setGlobalOrigin (newOrigin) {
  20787. if (newOrigin === undefined) {
  20788. Object.defineProperty(globalThis, globalOrigin, {
  20789. value: undefined,
  20790. writable: true,
  20791. enumerable: false,
  20792. configurable: false
  20793. })
  20794. return
  20795. }
  20796. const parsedURL = new URL(newOrigin)
  20797. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  20798. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  20799. }
  20800. Object.defineProperty(globalThis, globalOrigin, {
  20801. value: parsedURL,
  20802. writable: true,
  20803. enumerable: false,
  20804. configurable: false
  20805. })
  20806. }
  20807. module.exports = {
  20808. getGlobalOrigin,
  20809. setGlobalOrigin
  20810. }
  20811. /***/ }),
  20812. /***/ 554:
  20813. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20814. "use strict";
  20815. // https://github.com/Ethan-Arrowood/undici-fetch
  20816. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  20817. const { kGuard } = __nccwpck_require__(5861)
  20818. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20819. const {
  20820. makeIterator,
  20821. isValidHeaderName,
  20822. isValidHeaderValue
  20823. } = __nccwpck_require__(2538)
  20824. const { webidl } = __nccwpck_require__(1744)
  20825. const assert = __nccwpck_require__(9491)
  20826. const kHeadersMap = Symbol('headers map')
  20827. const kHeadersSortedMap = Symbol('headers map sorted')
  20828. /**
  20829. * @param {number} code
  20830. */
  20831. function isHTTPWhiteSpaceCharCode (code) {
  20832. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  20833. }
  20834. /**
  20835. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  20836. * @param {string} potentialValue
  20837. */
  20838. function headerValueNormalize (potentialValue) {
  20839. // To normalize a byte sequence potentialValue, remove
  20840. // any leading and trailing HTTP whitespace bytes from
  20841. // potentialValue.
  20842. let i = 0; let j = potentialValue.length
  20843. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  20844. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  20845. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  20846. }
  20847. function fill (headers, object) {
  20848. // To fill a Headers object headers with a given object object, run these steps:
  20849. // 1. If object is a sequence, then for each header in object:
  20850. // Note: webidl conversion to array has already been done.
  20851. if (Array.isArray(object)) {
  20852. for (let i = 0; i < object.length; ++i) {
  20853. const header = object[i]
  20854. // 1. If header does not contain exactly two items, then throw a TypeError.
  20855. if (header.length !== 2) {
  20856. throw webidl.errors.exception({
  20857. header: 'Headers constructor',
  20858. message: `expected name/value pair to be length 2, found ${header.length}.`
  20859. })
  20860. }
  20861. // 2. Append (header’s first item, header’s second item) to headers.
  20862. appendHeader(headers, header[0], header[1])
  20863. }
  20864. } else if (typeof object === 'object' && object !== null) {
  20865. // Note: null should throw
  20866. // 2. Otherwise, object is a record, then for each key → value in object,
  20867. // append (key, value) to headers
  20868. const keys = Object.keys(object)
  20869. for (let i = 0; i < keys.length; ++i) {
  20870. appendHeader(headers, keys[i], object[keys[i]])
  20871. }
  20872. } else {
  20873. throw webidl.errors.conversionFailed({
  20874. prefix: 'Headers constructor',
  20875. argument: 'Argument 1',
  20876. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  20877. })
  20878. }
  20879. }
  20880. /**
  20881. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  20882. */
  20883. function appendHeader (headers, name, value) {
  20884. // 1. Normalize value.
  20885. value = headerValueNormalize(value)
  20886. // 2. If name is not a header name or value is not a
  20887. // header value, then throw a TypeError.
  20888. if (!isValidHeaderName(name)) {
  20889. throw webidl.errors.invalidArgument({
  20890. prefix: 'Headers.append',
  20891. value: name,
  20892. type: 'header name'
  20893. })
  20894. } else if (!isValidHeaderValue(value)) {
  20895. throw webidl.errors.invalidArgument({
  20896. prefix: 'Headers.append',
  20897. value,
  20898. type: 'header value'
  20899. })
  20900. }
  20901. // 3. If headers’s guard is "immutable", then throw a TypeError.
  20902. // 4. Otherwise, if headers’s guard is "request" and name is a
  20903. // forbidden header name, return.
  20904. // Note: undici does not implement forbidden header names
  20905. if (headers[kGuard] === 'immutable') {
  20906. throw new TypeError('immutable')
  20907. } else if (headers[kGuard] === 'request-no-cors') {
  20908. // 5. Otherwise, if headers’s guard is "request-no-cors":
  20909. // TODO
  20910. }
  20911. // 6. Otherwise, if headers’s guard is "response" and name is a
  20912. // forbidden response-header name, return.
  20913. // 7. Append (name, value) to headers’s header list.
  20914. return headers[kHeadersList].append(name, value)
  20915. // 8. If headers’s guard is "request-no-cors", then remove
  20916. // privileged no-CORS request headers from headers
  20917. }
  20918. class HeadersList {
  20919. /** @type {[string, string][]|null} */
  20920. cookies = null
  20921. constructor (init) {
  20922. if (init instanceof HeadersList) {
  20923. this[kHeadersMap] = new Map(init[kHeadersMap])
  20924. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  20925. this.cookies = init.cookies === null ? null : [...init.cookies]
  20926. } else {
  20927. this[kHeadersMap] = new Map(init)
  20928. this[kHeadersSortedMap] = null
  20929. }
  20930. }
  20931. // https://fetch.spec.whatwg.org/#header-list-contains
  20932. contains (name) {
  20933. // A header list list contains a header name name if list
  20934. // contains a header whose name is a byte-case-insensitive
  20935. // match for name.
  20936. name = name.toLowerCase()
  20937. return this[kHeadersMap].has(name)
  20938. }
  20939. clear () {
  20940. this[kHeadersMap].clear()
  20941. this[kHeadersSortedMap] = null
  20942. this.cookies = null
  20943. }
  20944. // https://fetch.spec.whatwg.org/#concept-header-list-append
  20945. append (name, value) {
  20946. this[kHeadersSortedMap] = null
  20947. // 1. If list contains name, then set name to the first such
  20948. // header’s name.
  20949. const lowercaseName = name.toLowerCase()
  20950. const exists = this[kHeadersMap].get(lowercaseName)
  20951. // 2. Append (name, value) to list.
  20952. if (exists) {
  20953. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  20954. this[kHeadersMap].set(lowercaseName, {
  20955. name: exists.name,
  20956. value: `${exists.value}${delimiter}${value}`
  20957. })
  20958. } else {
  20959. this[kHeadersMap].set(lowercaseName, { name, value })
  20960. }
  20961. if (lowercaseName === 'set-cookie') {
  20962. this.cookies ??= []
  20963. this.cookies.push(value)
  20964. }
  20965. }
  20966. // https://fetch.spec.whatwg.org/#concept-header-list-set
  20967. set (name, value) {
  20968. this[kHeadersSortedMap] = null
  20969. const lowercaseName = name.toLowerCase()
  20970. if (lowercaseName === 'set-cookie') {
  20971. this.cookies = [value]
  20972. }
  20973. // 1. If list contains name, then set the value of
  20974. // the first such header to value and remove the
  20975. // others.
  20976. // 2. Otherwise, append header (name, value) to list.
  20977. this[kHeadersMap].set(lowercaseName, { name, value })
  20978. }
  20979. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  20980. delete (name) {
  20981. this[kHeadersSortedMap] = null
  20982. name = name.toLowerCase()
  20983. if (name === 'set-cookie') {
  20984. this.cookies = null
  20985. }
  20986. this[kHeadersMap].delete(name)
  20987. }
  20988. // https://fetch.spec.whatwg.org/#concept-header-list-get
  20989. get (name) {
  20990. const value = this[kHeadersMap].get(name.toLowerCase())
  20991. // 1. If list does not contain name, then return null.
  20992. // 2. Return the values of all headers in list whose name
  20993. // is a byte-case-insensitive match for name,
  20994. // separated from each other by 0x2C 0x20, in order.
  20995. return value === undefined ? null : value.value
  20996. }
  20997. * [Symbol.iterator] () {
  20998. // use the lowercased name
  20999. for (const [name, { value }] of this[kHeadersMap]) {
  21000. yield [name, value]
  21001. }
  21002. }
  21003. get entries () {
  21004. const headers = {}
  21005. if (this[kHeadersMap].size) {
  21006. for (const { name, value } of this[kHeadersMap].values()) {
  21007. headers[name] = value
  21008. }
  21009. }
  21010. return headers
  21011. }
  21012. }
  21013. // https://fetch.spec.whatwg.org/#headers-class
  21014. class Headers {
  21015. constructor (init = undefined) {
  21016. if (init === kConstruct) {
  21017. return
  21018. }
  21019. this[kHeadersList] = new HeadersList()
  21020. // The new Headers(init) constructor steps are:
  21021. // 1. Set this’s guard to "none".
  21022. this[kGuard] = 'none'
  21023. // 2. If init is given, then fill this with init.
  21024. if (init !== undefined) {
  21025. init = webidl.converters.HeadersInit(init)
  21026. fill(this, init)
  21027. }
  21028. }
  21029. // https://fetch.spec.whatwg.org/#dom-headers-append
  21030. append (name, value) {
  21031. webidl.brandCheck(this, Headers)
  21032. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21033. name = webidl.converters.ByteString(name)
  21034. value = webidl.converters.ByteString(value)
  21035. return appendHeader(this, name, value)
  21036. }
  21037. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21038. delete (name) {
  21039. webidl.brandCheck(this, Headers)
  21040. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21041. name = webidl.converters.ByteString(name)
  21042. // 1. If name is not a header name, then throw a TypeError.
  21043. if (!isValidHeaderName(name)) {
  21044. throw webidl.errors.invalidArgument({
  21045. prefix: 'Headers.delete',
  21046. value: name,
  21047. type: 'header name'
  21048. })
  21049. }
  21050. // 2. If this’s guard is "immutable", then throw a TypeError.
  21051. // 3. Otherwise, if this’s guard is "request" and name is a
  21052. // forbidden header name, return.
  21053. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21054. // is not a no-CORS-safelisted request-header name, and
  21055. // name is not a privileged no-CORS request-header name,
  21056. // return.
  21057. // 5. Otherwise, if this’s guard is "response" and name is
  21058. // a forbidden response-header name, return.
  21059. // Note: undici does not implement forbidden header names
  21060. if (this[kGuard] === 'immutable') {
  21061. throw new TypeError('immutable')
  21062. } else if (this[kGuard] === 'request-no-cors') {
  21063. // TODO
  21064. }
  21065. // 6. If this’s header list does not contain name, then
  21066. // return.
  21067. if (!this[kHeadersList].contains(name)) {
  21068. return
  21069. }
  21070. // 7. Delete name from this’s header list.
  21071. // 8. If this’s guard is "request-no-cors", then remove
  21072. // privileged no-CORS request headers from this.
  21073. this[kHeadersList].delete(name)
  21074. }
  21075. // https://fetch.spec.whatwg.org/#dom-headers-get
  21076. get (name) {
  21077. webidl.brandCheck(this, Headers)
  21078. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21079. name = webidl.converters.ByteString(name)
  21080. // 1. If name is not a header name, then throw a TypeError.
  21081. if (!isValidHeaderName(name)) {
  21082. throw webidl.errors.invalidArgument({
  21083. prefix: 'Headers.get',
  21084. value: name,
  21085. type: 'header name'
  21086. })
  21087. }
  21088. // 2. Return the result of getting name from this’s header
  21089. // list.
  21090. return this[kHeadersList].get(name)
  21091. }
  21092. // https://fetch.spec.whatwg.org/#dom-headers-has
  21093. has (name) {
  21094. webidl.brandCheck(this, Headers)
  21095. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21096. name = webidl.converters.ByteString(name)
  21097. // 1. If name is not a header name, then throw a TypeError.
  21098. if (!isValidHeaderName(name)) {
  21099. throw webidl.errors.invalidArgument({
  21100. prefix: 'Headers.has',
  21101. value: name,
  21102. type: 'header name'
  21103. })
  21104. }
  21105. // 2. Return true if this’s header list contains name;
  21106. // otherwise false.
  21107. return this[kHeadersList].contains(name)
  21108. }
  21109. // https://fetch.spec.whatwg.org/#dom-headers-set
  21110. set (name, value) {
  21111. webidl.brandCheck(this, Headers)
  21112. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21113. name = webidl.converters.ByteString(name)
  21114. value = webidl.converters.ByteString(value)
  21115. // 1. Normalize value.
  21116. value = headerValueNormalize(value)
  21117. // 2. If name is not a header name or value is not a
  21118. // header value, then throw a TypeError.
  21119. if (!isValidHeaderName(name)) {
  21120. throw webidl.errors.invalidArgument({
  21121. prefix: 'Headers.set',
  21122. value: name,
  21123. type: 'header name'
  21124. })
  21125. } else if (!isValidHeaderValue(value)) {
  21126. throw webidl.errors.invalidArgument({
  21127. prefix: 'Headers.set',
  21128. value,
  21129. type: 'header value'
  21130. })
  21131. }
  21132. // 3. If this’s guard is "immutable", then throw a TypeError.
  21133. // 4. Otherwise, if this’s guard is "request" and name is a
  21134. // forbidden header name, return.
  21135. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21136. // name/value is not a no-CORS-safelisted request-header,
  21137. // return.
  21138. // 6. Otherwise, if this’s guard is "response" and name is a
  21139. // forbidden response-header name, return.
  21140. // Note: undici does not implement forbidden header names
  21141. if (this[kGuard] === 'immutable') {
  21142. throw new TypeError('immutable')
  21143. } else if (this[kGuard] === 'request-no-cors') {
  21144. // TODO
  21145. }
  21146. // 7. Set (name, value) in this’s header list.
  21147. // 8. If this’s guard is "request-no-cors", then remove
  21148. // privileged no-CORS request headers from this
  21149. this[kHeadersList].set(name, value)
  21150. }
  21151. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21152. getSetCookie () {
  21153. webidl.brandCheck(this, Headers)
  21154. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21155. // 2. Return the values of all headers in this’s header list whose name is
  21156. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21157. const list = this[kHeadersList].cookies
  21158. if (list) {
  21159. return [...list]
  21160. }
  21161. return []
  21162. }
  21163. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21164. get [kHeadersSortedMap] () {
  21165. if (this[kHeadersList][kHeadersSortedMap]) {
  21166. return this[kHeadersList][kHeadersSortedMap]
  21167. }
  21168. // 1. Let headers be an empty list of headers with the key being the name
  21169. // and value the value.
  21170. const headers = []
  21171. // 2. Let names be the result of convert header names to a sorted-lowercase
  21172. // set with all the names of the headers in list.
  21173. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21174. const cookies = this[kHeadersList].cookies
  21175. // 3. For each name of names:
  21176. for (let i = 0; i < names.length; ++i) {
  21177. const [name, value] = names[i]
  21178. // 1. If name is `set-cookie`, then:
  21179. if (name === 'set-cookie') {
  21180. // 1. Let values be a list of all values of headers in list whose name
  21181. // is a byte-case-insensitive match for name, in order.
  21182. // 2. For each value of values:
  21183. // 1. Append (name, value) to headers.
  21184. for (let j = 0; j < cookies.length; ++j) {
  21185. headers.push([name, cookies[j]])
  21186. }
  21187. } else {
  21188. // 2. Otherwise:
  21189. // 1. Let value be the result of getting name from list.
  21190. // 2. Assert: value is non-null.
  21191. assert(value !== null)
  21192. // 3. Append (name, value) to headers.
  21193. headers.push([name, value])
  21194. }
  21195. }
  21196. this[kHeadersList][kHeadersSortedMap] = headers
  21197. // 4. Return headers.
  21198. return headers
  21199. }
  21200. keys () {
  21201. webidl.brandCheck(this, Headers)
  21202. if (this[kGuard] === 'immutable') {
  21203. const value = this[kHeadersSortedMap]
  21204. return makeIterator(() => value, 'Headers',
  21205. 'key')
  21206. }
  21207. return makeIterator(
  21208. () => [...this[kHeadersSortedMap].values()],
  21209. 'Headers',
  21210. 'key'
  21211. )
  21212. }
  21213. values () {
  21214. webidl.brandCheck(this, Headers)
  21215. if (this[kGuard] === 'immutable') {
  21216. const value = this[kHeadersSortedMap]
  21217. return makeIterator(() => value, 'Headers',
  21218. 'value')
  21219. }
  21220. return makeIterator(
  21221. () => [...this[kHeadersSortedMap].values()],
  21222. 'Headers',
  21223. 'value'
  21224. )
  21225. }
  21226. entries () {
  21227. webidl.brandCheck(this, Headers)
  21228. if (this[kGuard] === 'immutable') {
  21229. const value = this[kHeadersSortedMap]
  21230. return makeIterator(() => value, 'Headers',
  21231. 'key+value')
  21232. }
  21233. return makeIterator(
  21234. () => [...this[kHeadersSortedMap].values()],
  21235. 'Headers',
  21236. 'key+value'
  21237. )
  21238. }
  21239. /**
  21240. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21241. * @param {unknown} thisArg
  21242. */
  21243. forEach (callbackFn, thisArg = globalThis) {
  21244. webidl.brandCheck(this, Headers)
  21245. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21246. if (typeof callbackFn !== 'function') {
  21247. throw new TypeError(
  21248. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21249. )
  21250. }
  21251. for (const [key, value] of this) {
  21252. callbackFn.apply(thisArg, [value, key, this])
  21253. }
  21254. }
  21255. [Symbol.for('nodejs.util.inspect.custom')] () {
  21256. webidl.brandCheck(this, Headers)
  21257. return this[kHeadersList]
  21258. }
  21259. }
  21260. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21261. Object.defineProperties(Headers.prototype, {
  21262. append: kEnumerableProperty,
  21263. delete: kEnumerableProperty,
  21264. get: kEnumerableProperty,
  21265. has: kEnumerableProperty,
  21266. set: kEnumerableProperty,
  21267. getSetCookie: kEnumerableProperty,
  21268. keys: kEnumerableProperty,
  21269. values: kEnumerableProperty,
  21270. entries: kEnumerableProperty,
  21271. forEach: kEnumerableProperty,
  21272. [Symbol.iterator]: { enumerable: false },
  21273. [Symbol.toStringTag]: {
  21274. value: 'Headers',
  21275. configurable: true
  21276. }
  21277. })
  21278. webidl.converters.HeadersInit = function (V) {
  21279. if (webidl.util.Type(V) === 'Object') {
  21280. if (V[Symbol.iterator]) {
  21281. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21282. }
  21283. return webidl.converters['record<ByteString, ByteString>'](V)
  21284. }
  21285. throw webidl.errors.conversionFailed({
  21286. prefix: 'Headers constructor',
  21287. argument: 'Argument 1',
  21288. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21289. })
  21290. }
  21291. module.exports = {
  21292. fill,
  21293. Headers,
  21294. HeadersList
  21295. }
  21296. /***/ }),
  21297. /***/ 4881:
  21298. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21299. "use strict";
  21300. // https://github.com/Ethan-Arrowood/undici-fetch
  21301. const {
  21302. Response,
  21303. makeNetworkError,
  21304. makeAppropriateNetworkError,
  21305. filterResponse,
  21306. makeResponse
  21307. } = __nccwpck_require__(7823)
  21308. const { Headers } = __nccwpck_require__(554)
  21309. const { Request, makeRequest } = __nccwpck_require__(8359)
  21310. const zlib = __nccwpck_require__(9796)
  21311. const {
  21312. bytesMatch,
  21313. makePolicyContainer,
  21314. clonePolicyContainer,
  21315. requestBadPort,
  21316. TAOCheck,
  21317. appendRequestOriginHeader,
  21318. responseLocationURL,
  21319. requestCurrentURL,
  21320. setRequestReferrerPolicyOnRedirect,
  21321. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21322. createOpaqueTimingInfo,
  21323. appendFetchMetadata,
  21324. corsCheck,
  21325. crossOriginResourcePolicyCheck,
  21326. determineRequestsReferrer,
  21327. coarsenedSharedCurrentTime,
  21328. createDeferredPromise,
  21329. isBlobLike,
  21330. sameOrigin,
  21331. isCancelled,
  21332. isAborted,
  21333. isErrorLike,
  21334. fullyReadBody,
  21335. readableStreamClose,
  21336. isomorphicEncode,
  21337. urlIsLocal,
  21338. urlIsHttpHttpsScheme,
  21339. urlHasHttpsScheme
  21340. } = __nccwpck_require__(2538)
  21341. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21342. const assert = __nccwpck_require__(9491)
  21343. const { safelyExtractBody } = __nccwpck_require__(9990)
  21344. const {
  21345. redirectStatusSet,
  21346. nullBodyStatus,
  21347. safeMethodsSet,
  21348. requestBodyHeader,
  21349. subresourceSet,
  21350. DOMException
  21351. } = __nccwpck_require__(1037)
  21352. const { kHeadersList } = __nccwpck_require__(2785)
  21353. const EE = __nccwpck_require__(2361)
  21354. const { Readable, pipeline } = __nccwpck_require__(2781)
  21355. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21356. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21357. const { TransformStream } = __nccwpck_require__(5356)
  21358. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21359. const { webidl } = __nccwpck_require__(1744)
  21360. const { STATUS_CODES } = __nccwpck_require__(3685)
  21361. const GET_OR_HEAD = ['GET', 'HEAD']
  21362. /** @type {import('buffer').resolveObjectURL} */
  21363. let resolveObjectURL
  21364. let ReadableStream = globalThis.ReadableStream
  21365. class Fetch extends EE {
  21366. constructor (dispatcher) {
  21367. super()
  21368. this.dispatcher = dispatcher
  21369. this.connection = null
  21370. this.dump = false
  21371. this.state = 'ongoing'
  21372. // 2 terminated listeners get added per request,
  21373. // but only 1 gets removed. If there are 20 redirects,
  21374. // 21 listeners will be added.
  21375. // See https://github.com/nodejs/undici/issues/1711
  21376. // TODO (fix): Find and fix root cause for leaked listener.
  21377. this.setMaxListeners(21)
  21378. }
  21379. terminate (reason) {
  21380. if (this.state !== 'ongoing') {
  21381. return
  21382. }
  21383. this.state = 'terminated'
  21384. this.connection?.destroy(reason)
  21385. this.emit('terminated', reason)
  21386. }
  21387. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21388. abort (error) {
  21389. if (this.state !== 'ongoing') {
  21390. return
  21391. }
  21392. // 1. Set controller’s state to "aborted".
  21393. this.state = 'aborted'
  21394. // 2. Let fallbackError be an "AbortError" DOMException.
  21395. // 3. Set error to fallbackError if it is not given.
  21396. if (!error) {
  21397. error = new DOMException('The operation was aborted.', 'AbortError')
  21398. }
  21399. // 4. Let serializedError be StructuredSerialize(error).
  21400. // If that threw an exception, catch it, and let
  21401. // serializedError be StructuredSerialize(fallbackError).
  21402. // 5. Set controller’s serialized abort reason to serializedError.
  21403. this.serializedAbortReason = error
  21404. this.connection?.destroy(error)
  21405. this.emit('terminated', error)
  21406. }
  21407. }
  21408. // https://fetch.spec.whatwg.org/#fetch-method
  21409. function fetch (input, init = {}) {
  21410. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21411. // 1. Let p be a new promise.
  21412. const p = createDeferredPromise()
  21413. // 2. Let requestObject be the result of invoking the initial value of
  21414. // Request as constructor with input and init as arguments. If this throws
  21415. // an exception, reject p with it and return p.
  21416. let requestObject
  21417. try {
  21418. requestObject = new Request(input, init)
  21419. } catch (e) {
  21420. p.reject(e)
  21421. return p.promise
  21422. }
  21423. // 3. Let request be requestObject’s request.
  21424. const request = requestObject[kState]
  21425. // 4. If requestObject’s signal’s aborted flag is set, then:
  21426. if (requestObject.signal.aborted) {
  21427. // 1. Abort the fetch() call with p, request, null, and
  21428. // requestObject’s signal’s abort reason.
  21429. abortFetch(p, request, null, requestObject.signal.reason)
  21430. // 2. Return p.
  21431. return p.promise
  21432. }
  21433. // 5. Let globalObject be request’s client’s global object.
  21434. const globalObject = request.client.globalObject
  21435. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21436. // request’s service-workers mode to "none".
  21437. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21438. request.serviceWorkers = 'none'
  21439. }
  21440. // 7. Let responseObject be null.
  21441. let responseObject = null
  21442. // 8. Let relevantRealm be this’s relevant Realm.
  21443. const relevantRealm = null
  21444. // 9. Let locallyAborted be false.
  21445. let locallyAborted = false
  21446. // 10. Let controller be null.
  21447. let controller = null
  21448. // 11. Add the following abort steps to requestObject’s signal:
  21449. addAbortListener(
  21450. requestObject.signal,
  21451. () => {
  21452. // 1. Set locallyAborted to true.
  21453. locallyAborted = true
  21454. // 2. Assert: controller is non-null.
  21455. assert(controller != null)
  21456. // 3. Abort controller with requestObject’s signal’s abort reason.
  21457. controller.abort(requestObject.signal.reason)
  21458. // 4. Abort the fetch() call with p, request, responseObject,
  21459. // and requestObject’s signal’s abort reason.
  21460. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21461. }
  21462. )
  21463. // 12. Let handleFetchDone given response response be to finalize and
  21464. // report timing with response, globalObject, and "fetch".
  21465. const handleFetchDone = (response) =>
  21466. finalizeAndReportTiming(response, 'fetch')
  21467. // 13. Set controller to the result of calling fetch given request,
  21468. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21469. // given response being these substeps:
  21470. const processResponse = (response) => {
  21471. // 1. If locallyAborted is true, terminate these substeps.
  21472. if (locallyAborted) {
  21473. return Promise.resolve()
  21474. }
  21475. // 2. If response’s aborted flag is set, then:
  21476. if (response.aborted) {
  21477. // 1. Let deserializedError be the result of deserialize a serialized
  21478. // abort reason given controller’s serialized abort reason and
  21479. // relevantRealm.
  21480. // 2. Abort the fetch() call with p, request, responseObject, and
  21481. // deserializedError.
  21482. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21483. return Promise.resolve()
  21484. }
  21485. // 3. If response is a network error, then reject p with a TypeError
  21486. // and terminate these substeps.
  21487. if (response.type === 'error') {
  21488. p.reject(
  21489. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21490. )
  21491. return Promise.resolve()
  21492. }
  21493. // 4. Set responseObject to the result of creating a Response object,
  21494. // given response, "immutable", and relevantRealm.
  21495. responseObject = new Response()
  21496. responseObject[kState] = response
  21497. responseObject[kRealm] = relevantRealm
  21498. responseObject[kHeaders][kHeadersList] = response.headersList
  21499. responseObject[kHeaders][kGuard] = 'immutable'
  21500. responseObject[kHeaders][kRealm] = relevantRealm
  21501. // 5. Resolve p with responseObject.
  21502. p.resolve(responseObject)
  21503. }
  21504. controller = fetching({
  21505. request,
  21506. processResponseEndOfBody: handleFetchDone,
  21507. processResponse,
  21508. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21509. })
  21510. // 14. Return p.
  21511. return p.promise
  21512. }
  21513. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21514. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21515. // 1. If response is an aborted network error, then return.
  21516. if (response.type === 'error' && response.aborted) {
  21517. return
  21518. }
  21519. // 2. If response’s URL list is null or empty, then return.
  21520. if (!response.urlList?.length) {
  21521. return
  21522. }
  21523. // 3. Let originalURL be response’s URL list[0].
  21524. const originalURL = response.urlList[0]
  21525. // 4. Let timingInfo be response’s timing info.
  21526. let timingInfo = response.timingInfo
  21527. // 5. Let cacheState be response’s cache state.
  21528. let cacheState = response.cacheState
  21529. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21530. if (!urlIsHttpHttpsScheme(originalURL)) {
  21531. return
  21532. }
  21533. // 7. If timingInfo is null, then return.
  21534. if (timingInfo === null) {
  21535. return
  21536. }
  21537. // 8. If response’s timing allow passed flag is not set, then:
  21538. if (!response.timingAllowPassed) {
  21539. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21540. timingInfo = createOpaqueTimingInfo({
  21541. startTime: timingInfo.startTime
  21542. })
  21543. // 2. Set cacheState to the empty string.
  21544. cacheState = ''
  21545. }
  21546. // 9. Set timingInfo’s end time to the coarsened shared current time
  21547. // given global’s relevant settings object’s cross-origin isolated
  21548. // capability.
  21549. // TODO: given global’s relevant settings object’s cross-origin isolated
  21550. // capability?
  21551. timingInfo.endTime = coarsenedSharedCurrentTime()
  21552. // 10. Set response’s timing info to timingInfo.
  21553. response.timingInfo = timingInfo
  21554. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21555. // global, and cacheState.
  21556. markResourceTiming(
  21557. timingInfo,
  21558. originalURL,
  21559. initiatorType,
  21560. globalThis,
  21561. cacheState
  21562. )
  21563. }
  21564. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21565. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21566. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21567. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21568. }
  21569. }
  21570. // https://fetch.spec.whatwg.org/#abort-fetch
  21571. function abortFetch (p, request, responseObject, error) {
  21572. // Note: AbortSignal.reason was added in node v17.2.0
  21573. // which would give us an undefined error to reject with.
  21574. // Remove this once node v16 is no longer supported.
  21575. if (!error) {
  21576. error = new DOMException('The operation was aborted.', 'AbortError')
  21577. }
  21578. // 1. Reject promise with error.
  21579. p.reject(error)
  21580. // 2. If request’s body is not null and is readable, then cancel request’s
  21581. // body with error.
  21582. if (request.body != null && isReadable(request.body?.stream)) {
  21583. request.body.stream.cancel(error).catch((err) => {
  21584. if (err.code === 'ERR_INVALID_STATE') {
  21585. // Node bug?
  21586. return
  21587. }
  21588. throw err
  21589. })
  21590. }
  21591. // 3. If responseObject is null, then return.
  21592. if (responseObject == null) {
  21593. return
  21594. }
  21595. // 4. Let response be responseObject’s response.
  21596. const response = responseObject[kState]
  21597. // 5. If response’s body is not null and is readable, then error response’s
  21598. // body with error.
  21599. if (response.body != null && isReadable(response.body?.stream)) {
  21600. response.body.stream.cancel(error).catch((err) => {
  21601. if (err.code === 'ERR_INVALID_STATE') {
  21602. // Node bug?
  21603. return
  21604. }
  21605. throw err
  21606. })
  21607. }
  21608. }
  21609. // https://fetch.spec.whatwg.org/#fetching
  21610. function fetching ({
  21611. request,
  21612. processRequestBodyChunkLength,
  21613. processRequestEndOfBody,
  21614. processResponse,
  21615. processResponseEndOfBody,
  21616. processResponseConsumeBody,
  21617. useParallelQueue = false,
  21618. dispatcher // undici
  21619. }) {
  21620. // 1. Let taskDestination be null.
  21621. let taskDestination = null
  21622. // 2. Let crossOriginIsolatedCapability be false.
  21623. let crossOriginIsolatedCapability = false
  21624. // 3. If request’s client is non-null, then:
  21625. if (request.client != null) {
  21626. // 1. Set taskDestination to request’s client’s global object.
  21627. taskDestination = request.client.globalObject
  21628. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21629. // isolated capability.
  21630. crossOriginIsolatedCapability =
  21631. request.client.crossOriginIsolatedCapability
  21632. }
  21633. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21634. // starting a new parallel queue.
  21635. // TODO
  21636. // 5. Let timingInfo be a new fetch timing info whose start time and
  21637. // post-redirect start time are the coarsened shared current time given
  21638. // crossOriginIsolatedCapability.
  21639. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21640. const timingInfo = createOpaqueTimingInfo({
  21641. startTime: currenTime
  21642. })
  21643. // 6. Let fetchParams be a new fetch params whose
  21644. // request is request,
  21645. // timing info is timingInfo,
  21646. // process request body chunk length is processRequestBodyChunkLength,
  21647. // process request end-of-body is processRequestEndOfBody,
  21648. // process response is processResponse,
  21649. // process response consume body is processResponseConsumeBody,
  21650. // process response end-of-body is processResponseEndOfBody,
  21651. // task destination is taskDestination,
  21652. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21653. const fetchParams = {
  21654. controller: new Fetch(dispatcher),
  21655. request,
  21656. timingInfo,
  21657. processRequestBodyChunkLength,
  21658. processRequestEndOfBody,
  21659. processResponse,
  21660. processResponseConsumeBody,
  21661. processResponseEndOfBody,
  21662. taskDestination,
  21663. crossOriginIsolatedCapability
  21664. }
  21665. // 7. If request’s body is a byte sequence, then set request’s body to
  21666. // request’s body as a body.
  21667. // NOTE: Since fetching is only called from fetch, body should already be
  21668. // extracted.
  21669. assert(!request.body || request.body.stream)
  21670. // 8. If request’s window is "client", then set request’s window to request’s
  21671. // client, if request’s client’s global object is a Window object; otherwise
  21672. // "no-window".
  21673. if (request.window === 'client') {
  21674. // TODO: What if request.client is null?
  21675. request.window =
  21676. request.client?.globalObject?.constructor?.name === 'Window'
  21677. ? request.client
  21678. : 'no-window'
  21679. }
  21680. // 9. If request’s origin is "client", then set request’s origin to request’s
  21681. // client’s origin.
  21682. if (request.origin === 'client') {
  21683. // TODO: What if request.client is null?
  21684. request.origin = request.client?.origin
  21685. }
  21686. // 10. If all of the following conditions are true:
  21687. // TODO
  21688. // 11. If request’s policy container is "client", then:
  21689. if (request.policyContainer === 'client') {
  21690. // 1. If request’s client is non-null, then set request’s policy
  21691. // container to a clone of request’s client’s policy container. [HTML]
  21692. if (request.client != null) {
  21693. request.policyContainer = clonePolicyContainer(
  21694. request.client.policyContainer
  21695. )
  21696. } else {
  21697. // 2. Otherwise, set request’s policy container to a new policy
  21698. // container.
  21699. request.policyContainer = makePolicyContainer()
  21700. }
  21701. }
  21702. // 12. If request’s header list does not contain `Accept`, then:
  21703. if (!request.headersList.contains('accept')) {
  21704. // 1. Let value be `*/*`.
  21705. const value = '*/*'
  21706. // 2. A user agent should set value to the first matching statement, if
  21707. // any, switching on request’s destination:
  21708. // "document"
  21709. // "frame"
  21710. // "iframe"
  21711. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21712. // "image"
  21713. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21714. // "style"
  21715. // `text/css,*/*;q=0.1`
  21716. // TODO
  21717. // 3. Append `Accept`/value to request’s header list.
  21718. request.headersList.append('accept', value)
  21719. }
  21720. // 13. If request’s header list does not contain `Accept-Language`, then
  21721. // user agents should append `Accept-Language`/an appropriate value to
  21722. // request’s header list.
  21723. if (!request.headersList.contains('accept-language')) {
  21724. request.headersList.append('accept-language', '*')
  21725. }
  21726. // 14. If request’s priority is null, then use request’s initiator and
  21727. // destination appropriately in setting request’s priority to a
  21728. // user-agent-defined object.
  21729. if (request.priority === null) {
  21730. // TODO
  21731. }
  21732. // 15. If request is a subresource request, then:
  21733. if (subresourceSet.has(request.destination)) {
  21734. // TODO
  21735. }
  21736. // 16. Run main fetch given fetchParams.
  21737. mainFetch(fetchParams)
  21738. .catch(err => {
  21739. fetchParams.controller.terminate(err)
  21740. })
  21741. // 17. Return fetchParam's controller
  21742. return fetchParams.controller
  21743. }
  21744. // https://fetch.spec.whatwg.org/#concept-main-fetch
  21745. async function mainFetch (fetchParams, recursive = false) {
  21746. // 1. Let request be fetchParams’s request.
  21747. const request = fetchParams.request
  21748. // 2. Let response be null.
  21749. let response = null
  21750. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  21751. // not local, then set response to a network error.
  21752. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  21753. response = makeNetworkError('local URLs only')
  21754. }
  21755. // 4. Run report Content Security Policy violations for request.
  21756. // TODO
  21757. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  21758. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  21759. // 6. If should request be blocked due to a bad port, should fetching request
  21760. // be blocked as mixed content, or should request be blocked by Content
  21761. // Security Policy returns blocked, then set response to a network error.
  21762. if (requestBadPort(request) === 'blocked') {
  21763. response = makeNetworkError('bad port')
  21764. }
  21765. // TODO: should fetching request be blocked as mixed content?
  21766. // TODO: should request be blocked by Content Security Policy?
  21767. // 7. If request’s referrer policy is the empty string, then set request’s
  21768. // referrer policy to request’s policy container’s referrer policy.
  21769. if (request.referrerPolicy === '') {
  21770. request.referrerPolicy = request.policyContainer.referrerPolicy
  21771. }
  21772. // 8. If request’s referrer is not "no-referrer", then set request’s
  21773. // referrer to the result of invoking determine request’s referrer.
  21774. if (request.referrer !== 'no-referrer') {
  21775. request.referrer = determineRequestsReferrer(request)
  21776. }
  21777. // 9. Set request’s current URL’s scheme to "https" if all of the following
  21778. // conditions are true:
  21779. // - request’s current URL’s scheme is "http"
  21780. // - request’s current URL’s host is a domain
  21781. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  21782. // Matching results in either a superdomain match with an asserted
  21783. // includeSubDomains directive or a congruent match (with or without an
  21784. // asserted includeSubDomains directive). [HSTS]
  21785. // TODO
  21786. // 10. If recursive is false, then run the remaining steps in parallel.
  21787. // TODO
  21788. // 11. If response is null, then set response to the result of running
  21789. // the steps corresponding to the first matching statement:
  21790. if (response === null) {
  21791. response = await (async () => {
  21792. const currentURL = requestCurrentURL(request)
  21793. if (
  21794. // - request’s current URL’s origin is same origin with request’s origin,
  21795. // and request’s response tainting is "basic"
  21796. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  21797. // request’s current URL’s scheme is "data"
  21798. (currentURL.protocol === 'data:') ||
  21799. // - request’s mode is "navigate" or "websocket"
  21800. (request.mode === 'navigate' || request.mode === 'websocket')
  21801. ) {
  21802. // 1. Set request’s response tainting to "basic".
  21803. request.responseTainting = 'basic'
  21804. // 2. Return the result of running scheme fetch given fetchParams.
  21805. return await schemeFetch(fetchParams)
  21806. }
  21807. // request’s mode is "same-origin"
  21808. if (request.mode === 'same-origin') {
  21809. // 1. Return a network error.
  21810. return makeNetworkError('request mode cannot be "same-origin"')
  21811. }
  21812. // request’s mode is "no-cors"
  21813. if (request.mode === 'no-cors') {
  21814. // 1. If request’s redirect mode is not "follow", then return a network
  21815. // error.
  21816. if (request.redirect !== 'follow') {
  21817. return makeNetworkError(
  21818. 'redirect mode cannot be "follow" for "no-cors" request'
  21819. )
  21820. }
  21821. // 2. Set request’s response tainting to "opaque".
  21822. request.responseTainting = 'opaque'
  21823. // 3. Return the result of running scheme fetch given fetchParams.
  21824. return await schemeFetch(fetchParams)
  21825. }
  21826. // request’s current URL’s scheme is not an HTTP(S) scheme
  21827. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  21828. // Return a network error.
  21829. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  21830. }
  21831. // - request’s use-CORS-preflight flag is set
  21832. // - request’s unsafe-request flag is set and either request’s method is
  21833. // not a CORS-safelisted method or CORS-unsafe request-header names with
  21834. // request’s header list is not empty
  21835. // 1. Set request’s response tainting to "cors".
  21836. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  21837. // given fetchParams and true.
  21838. // 3. If corsWithPreflightResponse is a network error, then clear cache
  21839. // entries using request.
  21840. // 4. Return corsWithPreflightResponse.
  21841. // TODO
  21842. // Otherwise
  21843. // 1. Set request’s response tainting to "cors".
  21844. request.responseTainting = 'cors'
  21845. // 2. Return the result of running HTTP fetch given fetchParams.
  21846. return await httpFetch(fetchParams)
  21847. })()
  21848. }
  21849. // 12. If recursive is true, then return response.
  21850. if (recursive) {
  21851. return response
  21852. }
  21853. // 13. If response is not a network error and response is not a filtered
  21854. // response, then:
  21855. if (response.status !== 0 && !response.internalResponse) {
  21856. // If request’s response tainting is "cors", then:
  21857. if (request.responseTainting === 'cors') {
  21858. // 1. Let headerNames be the result of extracting header list values
  21859. // given `Access-Control-Expose-Headers` and response’s header list.
  21860. // TODO
  21861. // 2. If request’s credentials mode is not "include" and headerNames
  21862. // contains `*`, then set response’s CORS-exposed header-name list to
  21863. // all unique header names in response’s header list.
  21864. // TODO
  21865. // 3. Otherwise, if headerNames is not null or failure, then set
  21866. // response’s CORS-exposed header-name list to headerNames.
  21867. // TODO
  21868. }
  21869. // Set response to the following filtered response with response as its
  21870. // internal response, depending on request’s response tainting:
  21871. if (request.responseTainting === 'basic') {
  21872. response = filterResponse(response, 'basic')
  21873. } else if (request.responseTainting === 'cors') {
  21874. response = filterResponse(response, 'cors')
  21875. } else if (request.responseTainting === 'opaque') {
  21876. response = filterResponse(response, 'opaque')
  21877. } else {
  21878. assert(false)
  21879. }
  21880. }
  21881. // 14. Let internalResponse be response, if response is a network error,
  21882. // and response’s internal response otherwise.
  21883. let internalResponse =
  21884. response.status === 0 ? response : response.internalResponse
  21885. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  21886. // request’s URL list.
  21887. if (internalResponse.urlList.length === 0) {
  21888. internalResponse.urlList.push(...request.urlList)
  21889. }
  21890. // 16. If request’s timing allow failed flag is unset, then set
  21891. // internalResponse’s timing allow passed flag.
  21892. if (!request.timingAllowFailed) {
  21893. response.timingAllowPassed = true
  21894. }
  21895. // 17. If response is not a network error and any of the following returns
  21896. // blocked
  21897. // - should internalResponse to request be blocked as mixed content
  21898. // - should internalResponse to request be blocked by Content Security Policy
  21899. // - should internalResponse to request be blocked due to its MIME type
  21900. // - should internalResponse to request be blocked due to nosniff
  21901. // TODO
  21902. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  21903. // internalResponse’s range-requested flag is set, and request’s header
  21904. // list does not contain `Range`, then set response and internalResponse
  21905. // to a network error.
  21906. if (
  21907. response.type === 'opaque' &&
  21908. internalResponse.status === 206 &&
  21909. internalResponse.rangeRequested &&
  21910. !request.headers.contains('range')
  21911. ) {
  21912. response = internalResponse = makeNetworkError()
  21913. }
  21914. // 19. If response is not a network error and either request’s method is
  21915. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  21916. // set internalResponse’s body to null and disregard any enqueuing toward
  21917. // it (if any).
  21918. if (
  21919. response.status !== 0 &&
  21920. (request.method === 'HEAD' ||
  21921. request.method === 'CONNECT' ||
  21922. nullBodyStatus.includes(internalResponse.status))
  21923. ) {
  21924. internalResponse.body = null
  21925. fetchParams.controller.dump = true
  21926. }
  21927. // 20. If request’s integrity metadata is not the empty string, then:
  21928. if (request.integrity) {
  21929. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  21930. // and a network error.
  21931. const processBodyError = (reason) =>
  21932. fetchFinale(fetchParams, makeNetworkError(reason))
  21933. // 2. If request’s response tainting is "opaque", or response’s body is null,
  21934. // then run processBodyError and abort these steps.
  21935. if (request.responseTainting === 'opaque' || response.body == null) {
  21936. processBodyError(response.error)
  21937. return
  21938. }
  21939. // 3. Let processBody given bytes be these steps:
  21940. const processBody = (bytes) => {
  21941. // 1. If bytes do not match request’s integrity metadata,
  21942. // then run processBodyError and abort these steps. [SRI]
  21943. if (!bytesMatch(bytes, request.integrity)) {
  21944. processBodyError('integrity mismatch')
  21945. return
  21946. }
  21947. // 2. Set response’s body to bytes as a body.
  21948. response.body = safelyExtractBody(bytes)[0]
  21949. // 3. Run fetch finale given fetchParams and response.
  21950. fetchFinale(fetchParams, response)
  21951. }
  21952. // 4. Fully read response’s body given processBody and processBodyError.
  21953. await fullyReadBody(response.body, processBody, processBodyError)
  21954. } else {
  21955. // 21. Otherwise, run fetch finale given fetchParams and response.
  21956. fetchFinale(fetchParams, response)
  21957. }
  21958. }
  21959. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  21960. // given a fetch params fetchParams
  21961. function schemeFetch (fetchParams) {
  21962. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  21963. // cancelled state, we do not want this condition to trigger *unless* there have been
  21964. // no redirects. See https://github.com/nodejs/undici/issues/1776
  21965. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  21966. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  21967. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  21968. }
  21969. // 2. Let request be fetchParams’s request.
  21970. const { request } = fetchParams
  21971. const { protocol: scheme } = requestCurrentURL(request)
  21972. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  21973. switch (scheme) {
  21974. case 'about:': {
  21975. // If request’s current URL’s path is the string "blank", then return a new response
  21976. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  21977. // and body is the empty byte sequence as a body.
  21978. // Otherwise, return a network error.
  21979. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  21980. }
  21981. case 'blob:': {
  21982. if (!resolveObjectURL) {
  21983. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  21984. }
  21985. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  21986. const blobURLEntry = requestCurrentURL(request)
  21987. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  21988. // Buffer.resolveObjectURL does not ignore URL queries.
  21989. if (blobURLEntry.search.length !== 0) {
  21990. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  21991. }
  21992. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  21993. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  21994. // object is not a Blob object, then return a network error.
  21995. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  21996. return Promise.resolve(makeNetworkError('invalid method'))
  21997. }
  21998. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  21999. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22000. // 4. Let body be bodyWithType’s body.
  22001. const body = bodyWithType[0]
  22002. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22003. const length = isomorphicEncode(`${body.length}`)
  22004. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22005. const type = bodyWithType[1] ?? ''
  22006. // 7. Return a new response whose status message is `OK`, header list is
  22007. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22008. const response = makeResponse({
  22009. statusText: 'OK',
  22010. headersList: [
  22011. ['content-length', { name: 'Content-Length', value: length }],
  22012. ['content-type', { name: 'Content-Type', value: type }]
  22013. ]
  22014. })
  22015. response.body = body
  22016. return Promise.resolve(response)
  22017. }
  22018. case 'data:': {
  22019. // 1. Let dataURLStruct be the result of running the
  22020. // data: URL processor on request’s current URL.
  22021. const currentURL = requestCurrentURL(request)
  22022. const dataURLStruct = dataURLProcessor(currentURL)
  22023. // 2. If dataURLStruct is failure, then return a
  22024. // network error.
  22025. if (dataURLStruct === 'failure') {
  22026. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22027. }
  22028. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22029. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22030. // 4. Return a response whose status message is `OK`,
  22031. // header list is « (`Content-Type`, mimeType) »,
  22032. // and body is dataURLStruct’s body as a body.
  22033. return Promise.resolve(makeResponse({
  22034. statusText: 'OK',
  22035. headersList: [
  22036. ['content-type', { name: 'Content-Type', value: mimeType }]
  22037. ],
  22038. body: safelyExtractBody(dataURLStruct.body)[0]
  22039. }))
  22040. }
  22041. case 'file:': {
  22042. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22043. // When in doubt, return a network error.
  22044. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22045. }
  22046. case 'http:':
  22047. case 'https:': {
  22048. // Return the result of running HTTP fetch given fetchParams.
  22049. return httpFetch(fetchParams)
  22050. .catch((err) => makeNetworkError(err))
  22051. }
  22052. default: {
  22053. return Promise.resolve(makeNetworkError('unknown scheme'))
  22054. }
  22055. }
  22056. }
  22057. // https://fetch.spec.whatwg.org/#finalize-response
  22058. function finalizeResponse (fetchParams, response) {
  22059. // 1. Set fetchParams’s request’s done flag.
  22060. fetchParams.request.done = true
  22061. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22062. // task to run fetchParams’s process response done given response, with
  22063. // fetchParams’s task destination.
  22064. if (fetchParams.processResponseDone != null) {
  22065. queueMicrotask(() => fetchParams.processResponseDone(response))
  22066. }
  22067. }
  22068. // https://fetch.spec.whatwg.org/#fetch-finale
  22069. function fetchFinale (fetchParams, response) {
  22070. // 1. If response is a network error, then:
  22071. if (response.type === 'error') {
  22072. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22073. response.urlList = [fetchParams.request.urlList[0]]
  22074. // 2. Set response’s timing info to the result of creating an opaque timing
  22075. // info for fetchParams’s timing info.
  22076. response.timingInfo = createOpaqueTimingInfo({
  22077. startTime: fetchParams.timingInfo.startTime
  22078. })
  22079. }
  22080. // 2. Let processResponseEndOfBody be the following steps:
  22081. const processResponseEndOfBody = () => {
  22082. // 1. Set fetchParams’s request’s done flag.
  22083. fetchParams.request.done = true
  22084. // If fetchParams’s process response end-of-body is not null,
  22085. // then queue a fetch task to run fetchParams’s process response
  22086. // end-of-body given response with fetchParams’s task destination.
  22087. if (fetchParams.processResponseEndOfBody != null) {
  22088. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22089. }
  22090. }
  22091. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22092. // to run fetchParams’s process response given response, with fetchParams’s
  22093. // task destination.
  22094. if (fetchParams.processResponse != null) {
  22095. queueMicrotask(() => fetchParams.processResponse(response))
  22096. }
  22097. // 4. If response’s body is null, then run processResponseEndOfBody.
  22098. if (response.body == null) {
  22099. processResponseEndOfBody()
  22100. } else {
  22101. // 5. Otherwise:
  22102. // 1. Let transformStream be a new a TransformStream.
  22103. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22104. // enqueues chunk in transformStream.
  22105. const identityTransformAlgorithm = (chunk, controller) => {
  22106. controller.enqueue(chunk)
  22107. }
  22108. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22109. // and flushAlgorithm set to processResponseEndOfBody.
  22110. const transformStream = new TransformStream({
  22111. start () {},
  22112. transform: identityTransformAlgorithm,
  22113. flush: processResponseEndOfBody
  22114. }, {
  22115. size () {
  22116. return 1
  22117. }
  22118. }, {
  22119. size () {
  22120. return 1
  22121. }
  22122. })
  22123. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22124. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22125. }
  22126. // 6. If fetchParams’s process response consume body is non-null, then:
  22127. if (fetchParams.processResponseConsumeBody != null) {
  22128. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22129. // process response consume body given response and nullOrBytes.
  22130. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22131. // 2. Let processBodyError be this step: run fetchParams’s process
  22132. // response consume body given response and failure.
  22133. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22134. // 3. If response’s body is null, then queue a fetch task to run processBody
  22135. // given null, with fetchParams’s task destination.
  22136. if (response.body == null) {
  22137. queueMicrotask(() => processBody(null))
  22138. } else {
  22139. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22140. // and fetchParams’s task destination.
  22141. return fullyReadBody(response.body, processBody, processBodyError)
  22142. }
  22143. return Promise.resolve()
  22144. }
  22145. }
  22146. // https://fetch.spec.whatwg.org/#http-fetch
  22147. async function httpFetch (fetchParams) {
  22148. // 1. Let request be fetchParams’s request.
  22149. const request = fetchParams.request
  22150. // 2. Let response be null.
  22151. let response = null
  22152. // 3. Let actualResponse be null.
  22153. let actualResponse = null
  22154. // 4. Let timingInfo be fetchParams’s timing info.
  22155. const timingInfo = fetchParams.timingInfo
  22156. // 5. If request’s service-workers mode is "all", then:
  22157. if (request.serviceWorkers === 'all') {
  22158. // TODO
  22159. }
  22160. // 6. If response is null, then:
  22161. if (response === null) {
  22162. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22163. // TODO
  22164. // 2. If request’s redirect mode is "follow", then set request’s
  22165. // service-workers mode to "none".
  22166. if (request.redirect === 'follow') {
  22167. request.serviceWorkers = 'none'
  22168. }
  22169. // 3. Set response and actualResponse to the result of running
  22170. // HTTP-network-or-cache fetch given fetchParams.
  22171. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22172. // 4. If request’s response tainting is "cors" and a CORS check
  22173. // for request and response returns failure, then return a network error.
  22174. if (
  22175. request.responseTainting === 'cors' &&
  22176. corsCheck(request, response) === 'failure'
  22177. ) {
  22178. return makeNetworkError('cors failure')
  22179. }
  22180. // 5. If the TAO check for request and response returns failure, then set
  22181. // request’s timing allow failed flag.
  22182. if (TAOCheck(request, response) === 'failure') {
  22183. request.timingAllowFailed = true
  22184. }
  22185. }
  22186. // 7. If either request’s response tainting or response’s type
  22187. // is "opaque", and the cross-origin resource policy check with
  22188. // request’s origin, request’s client, request’s destination,
  22189. // and actualResponse returns blocked, then return a network error.
  22190. if (
  22191. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22192. crossOriginResourcePolicyCheck(
  22193. request.origin,
  22194. request.client,
  22195. request.destination,
  22196. actualResponse
  22197. ) === 'blocked'
  22198. ) {
  22199. return makeNetworkError('blocked')
  22200. }
  22201. // 8. If actualResponse’s status is a redirect status, then:
  22202. if (redirectStatusSet.has(actualResponse.status)) {
  22203. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22204. // and the connection uses HTTP/2, then user agents may, and are even
  22205. // encouraged to, transmit an RST_STREAM frame.
  22206. // See, https://github.com/whatwg/fetch/issues/1288
  22207. if (request.redirect !== 'manual') {
  22208. fetchParams.controller.connection.destroy()
  22209. }
  22210. // 2. Switch on request’s redirect mode:
  22211. if (request.redirect === 'error') {
  22212. // Set response to a network error.
  22213. response = makeNetworkError('unexpected redirect')
  22214. } else if (request.redirect === 'manual') {
  22215. // Set response to an opaque-redirect filtered response whose internal
  22216. // response is actualResponse.
  22217. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22218. // but that doesn't make sense server side.
  22219. // See https://github.com/nodejs/undici/issues/1193.
  22220. response = actualResponse
  22221. } else if (request.redirect === 'follow') {
  22222. // Set response to the result of running HTTP-redirect fetch given
  22223. // fetchParams and response.
  22224. response = await httpRedirectFetch(fetchParams, response)
  22225. } else {
  22226. assert(false)
  22227. }
  22228. }
  22229. // 9. Set response’s timing info to timingInfo.
  22230. response.timingInfo = timingInfo
  22231. // 10. Return response.
  22232. return response
  22233. }
  22234. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22235. function httpRedirectFetch (fetchParams, response) {
  22236. // 1. Let request be fetchParams’s request.
  22237. const request = fetchParams.request
  22238. // 2. Let actualResponse be response, if response is not a filtered response,
  22239. // and response’s internal response otherwise.
  22240. const actualResponse = response.internalResponse
  22241. ? response.internalResponse
  22242. : response
  22243. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22244. // URL’s fragment.
  22245. let locationURL
  22246. try {
  22247. locationURL = responseLocationURL(
  22248. actualResponse,
  22249. requestCurrentURL(request).hash
  22250. )
  22251. // 4. If locationURL is null, then return response.
  22252. if (locationURL == null) {
  22253. return response
  22254. }
  22255. } catch (err) {
  22256. // 5. If locationURL is failure, then return a network error.
  22257. return Promise.resolve(makeNetworkError(err))
  22258. }
  22259. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22260. // error.
  22261. if (!urlIsHttpHttpsScheme(locationURL)) {
  22262. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22263. }
  22264. // 7. If request’s redirect count is 20, then return a network error.
  22265. if (request.redirectCount === 20) {
  22266. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22267. }
  22268. // 8. Increase request’s redirect count by 1.
  22269. request.redirectCount += 1
  22270. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22271. // request’s origin is not same origin with locationURL’s origin, then return
  22272. // a network error.
  22273. if (
  22274. request.mode === 'cors' &&
  22275. (locationURL.username || locationURL.password) &&
  22276. !sameOrigin(request, locationURL)
  22277. ) {
  22278. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22279. }
  22280. // 10. If request’s response tainting is "cors" and locationURL includes
  22281. // credentials, then return a network error.
  22282. if (
  22283. request.responseTainting === 'cors' &&
  22284. (locationURL.username || locationURL.password)
  22285. ) {
  22286. return Promise.resolve(makeNetworkError(
  22287. 'URL cannot contain credentials for request mode "cors"'
  22288. ))
  22289. }
  22290. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22291. // and request’s body’s source is null, then return a network error.
  22292. if (
  22293. actualResponse.status !== 303 &&
  22294. request.body != null &&
  22295. request.body.source == null
  22296. ) {
  22297. return Promise.resolve(makeNetworkError())
  22298. }
  22299. // 12. If one of the following is true
  22300. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22301. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22302. if (
  22303. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22304. (actualResponse.status === 303 &&
  22305. !GET_OR_HEAD.includes(request.method))
  22306. ) {
  22307. // then:
  22308. // 1. Set request’s method to `GET` and request’s body to null.
  22309. request.method = 'GET'
  22310. request.body = null
  22311. // 2. For each headerName of request-body-header name, delete headerName from
  22312. // request’s header list.
  22313. for (const headerName of requestBodyHeader) {
  22314. request.headersList.delete(headerName)
  22315. }
  22316. }
  22317. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22318. // origin, then for each headerName of CORS non-wildcard request-header name,
  22319. // delete headerName from request’s header list.
  22320. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22321. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22322. request.headersList.delete('authorization')
  22323. // https://fetch.spec.whatwg.org/#authentication-entries
  22324. request.headersList.delete('proxy-authorization', true)
  22325. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22326. request.headersList.delete('cookie')
  22327. request.headersList.delete('host')
  22328. }
  22329. // 14. If request’s body is non-null, then set request’s body to the first return
  22330. // value of safely extracting request’s body’s source.
  22331. if (request.body != null) {
  22332. assert(request.body.source != null)
  22333. request.body = safelyExtractBody(request.body.source)[0]
  22334. }
  22335. // 15. Let timingInfo be fetchParams’s timing info.
  22336. const timingInfo = fetchParams.timingInfo
  22337. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22338. // coarsened shared current time given fetchParams’s cross-origin isolated
  22339. // capability.
  22340. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22341. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22342. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22343. // redirect start time to timingInfo’s start time.
  22344. if (timingInfo.redirectStartTime === 0) {
  22345. timingInfo.redirectStartTime = timingInfo.startTime
  22346. }
  22347. // 18. Append locationURL to request’s URL list.
  22348. request.urlList.push(locationURL)
  22349. // 19. Invoke set request’s referrer policy on redirect on request and
  22350. // actualResponse.
  22351. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22352. // 20. Return the result of running main fetch given fetchParams and true.
  22353. return mainFetch(fetchParams, true)
  22354. }
  22355. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22356. async function httpNetworkOrCacheFetch (
  22357. fetchParams,
  22358. isAuthenticationFetch = false,
  22359. isNewConnectionFetch = false
  22360. ) {
  22361. // 1. Let request be fetchParams’s request.
  22362. const request = fetchParams.request
  22363. // 2. Let httpFetchParams be null.
  22364. let httpFetchParams = null
  22365. // 3. Let httpRequest be null.
  22366. let httpRequest = null
  22367. // 4. Let response be null.
  22368. let response = null
  22369. // 5. Let storedResponse be null.
  22370. // TODO: cache
  22371. // 6. Let httpCache be null.
  22372. const httpCache = null
  22373. // 7. Let the revalidatingFlag be unset.
  22374. const revalidatingFlag = false
  22375. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22376. // 1. If request’s window is "no-window" and request’s redirect mode is
  22377. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22378. // request.
  22379. if (request.window === 'no-window' && request.redirect === 'error') {
  22380. httpFetchParams = fetchParams
  22381. httpRequest = request
  22382. } else {
  22383. // Otherwise:
  22384. // 1. Set httpRequest to a clone of request.
  22385. httpRequest = makeRequest(request)
  22386. // 2. Set httpFetchParams to a copy of fetchParams.
  22387. httpFetchParams = { ...fetchParams }
  22388. // 3. Set httpFetchParams’s request to httpRequest.
  22389. httpFetchParams.request = httpRequest
  22390. }
  22391. // 3. Let includeCredentials be true if one of
  22392. const includeCredentials =
  22393. request.credentials === 'include' ||
  22394. (request.credentials === 'same-origin' &&
  22395. request.responseTainting === 'basic')
  22396. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22397. // body is non-null; otherwise null.
  22398. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22399. // 5. Let contentLengthHeaderValue be null.
  22400. let contentLengthHeaderValue = null
  22401. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22402. // `PUT`, then set contentLengthHeaderValue to `0`.
  22403. if (
  22404. httpRequest.body == null &&
  22405. ['POST', 'PUT'].includes(httpRequest.method)
  22406. ) {
  22407. contentLengthHeaderValue = '0'
  22408. }
  22409. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22410. // contentLength, serialized and isomorphic encoded.
  22411. if (contentLength != null) {
  22412. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22413. }
  22414. // 8. If contentLengthHeaderValue is non-null, then append
  22415. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22416. // list.
  22417. if (contentLengthHeaderValue != null) {
  22418. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22419. }
  22420. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22421. // contentLengthHeaderValue) to httpRequest’s header list.
  22422. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22423. // then:
  22424. if (contentLength != null && httpRequest.keepalive) {
  22425. // NOTE: keepalive is a noop outside of browser context.
  22426. }
  22427. // 11. If httpRequest’s referrer is a URL, then append
  22428. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22429. // to httpRequest’s header list.
  22430. if (httpRequest.referrer instanceof URL) {
  22431. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22432. }
  22433. // 12. Append a request `Origin` header for httpRequest.
  22434. appendRequestOriginHeader(httpRequest)
  22435. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22436. appendFetchMetadata(httpRequest)
  22437. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22438. // user agents should append `User-Agent`/default `User-Agent` value to
  22439. // httpRequest’s header list.
  22440. if (!httpRequest.headersList.contains('user-agent')) {
  22441. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22442. }
  22443. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22444. // list contains `If-Modified-Since`, `If-None-Match`,
  22445. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22446. // httpRequest’s cache mode to "no-store".
  22447. if (
  22448. httpRequest.cache === 'default' &&
  22449. (httpRequest.headersList.contains('if-modified-since') ||
  22450. httpRequest.headersList.contains('if-none-match') ||
  22451. httpRequest.headersList.contains('if-unmodified-since') ||
  22452. httpRequest.headersList.contains('if-match') ||
  22453. httpRequest.headersList.contains('if-range'))
  22454. ) {
  22455. httpRequest.cache = 'no-store'
  22456. }
  22457. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22458. // no-cache cache-control header modification flag is unset, and
  22459. // httpRequest’s header list does not contain `Cache-Control`, then append
  22460. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22461. if (
  22462. httpRequest.cache === 'no-cache' &&
  22463. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22464. !httpRequest.headersList.contains('cache-control')
  22465. ) {
  22466. httpRequest.headersList.append('cache-control', 'max-age=0')
  22467. }
  22468. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22469. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22470. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22471. // `Pragma`/`no-cache` to httpRequest’s header list.
  22472. if (!httpRequest.headersList.contains('pragma')) {
  22473. httpRequest.headersList.append('pragma', 'no-cache')
  22474. }
  22475. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22476. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22477. if (!httpRequest.headersList.contains('cache-control')) {
  22478. httpRequest.headersList.append('cache-control', 'no-cache')
  22479. }
  22480. }
  22481. // 18. If httpRequest’s header list contains `Range`, then append
  22482. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22483. if (httpRequest.headersList.contains('range')) {
  22484. httpRequest.headersList.append('accept-encoding', 'identity')
  22485. }
  22486. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22487. // header if httpRequest’s header list contains that header’s name.
  22488. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22489. if (!httpRequest.headersList.contains('accept-encoding')) {
  22490. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22491. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22492. } else {
  22493. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22494. }
  22495. }
  22496. httpRequest.headersList.delete('host')
  22497. // 20. If includeCredentials is true, then:
  22498. if (includeCredentials) {
  22499. // 1. If the user agent is not configured to block cookies for httpRequest
  22500. // (see section 7 of [COOKIES]), then:
  22501. // TODO: credentials
  22502. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22503. // TODO: credentials
  22504. }
  22505. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22506. // TODO: proxy-authentication
  22507. // 22. Set httpCache to the result of determining the HTTP cache
  22508. // partition, given httpRequest.
  22509. // TODO: cache
  22510. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22511. // "no-store".
  22512. if (httpCache == null) {
  22513. httpRequest.cache = 'no-store'
  22514. }
  22515. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22516. // then:
  22517. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22518. // TODO: cache
  22519. }
  22520. // 9. If aborted, then return the appropriate network error for fetchParams.
  22521. // TODO
  22522. // 10. If response is null, then:
  22523. if (response == null) {
  22524. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22525. // network error.
  22526. if (httpRequest.mode === 'only-if-cached') {
  22527. return makeNetworkError('only if cached')
  22528. }
  22529. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22530. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22531. const forwardResponse = await httpNetworkFetch(
  22532. httpFetchParams,
  22533. includeCredentials,
  22534. isNewConnectionFetch
  22535. )
  22536. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22537. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22538. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22539. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22540. if (
  22541. !safeMethodsSet.has(httpRequest.method) &&
  22542. forwardResponse.status >= 200 &&
  22543. forwardResponse.status <= 399
  22544. ) {
  22545. // TODO: cache
  22546. }
  22547. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22548. // then:
  22549. if (revalidatingFlag && forwardResponse.status === 304) {
  22550. // TODO: cache
  22551. }
  22552. // 5. If response is null, then:
  22553. if (response == null) {
  22554. // 1. Set response to forwardResponse.
  22555. response = forwardResponse
  22556. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22557. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22558. // TODO: cache
  22559. }
  22560. }
  22561. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22562. response.urlList = [...httpRequest.urlList]
  22563. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22564. // range-requested flag.
  22565. if (httpRequest.headersList.contains('range')) {
  22566. response.rangeRequested = true
  22567. }
  22568. // 13. Set response’s request-includes-credentials to includeCredentials.
  22569. response.requestIncludesCredentials = includeCredentials
  22570. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22571. // "cors", includeCredentials is true, and request’s window is an environment
  22572. // settings object, then:
  22573. // TODO
  22574. // 15. If response’s status is 407, then:
  22575. if (response.status === 407) {
  22576. // 1. If request’s window is "no-window", then return a network error.
  22577. if (request.window === 'no-window') {
  22578. return makeNetworkError()
  22579. }
  22580. // 2. ???
  22581. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22582. if (isCancelled(fetchParams)) {
  22583. return makeAppropriateNetworkError(fetchParams)
  22584. }
  22585. // 4. Prompt the end user as appropriate in request’s window and store
  22586. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22587. // TODO: Invoke some kind of callback?
  22588. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22589. // fetchParams.
  22590. // TODO
  22591. return makeNetworkError('proxy authentication required')
  22592. }
  22593. // 16. If all of the following are true
  22594. if (
  22595. // response’s status is 421
  22596. response.status === 421 &&
  22597. // isNewConnectionFetch is false
  22598. !isNewConnectionFetch &&
  22599. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22600. (request.body == null || request.body.source != null)
  22601. ) {
  22602. // then:
  22603. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22604. if (isCancelled(fetchParams)) {
  22605. return makeAppropriateNetworkError(fetchParams)
  22606. }
  22607. // 2. Set response to the result of running HTTP-network-or-cache
  22608. // fetch given fetchParams, isAuthenticationFetch, and true.
  22609. // TODO (spec): The spec doesn't specify this but we need to cancel
  22610. // the active response before we can start a new one.
  22611. // https://github.com/whatwg/fetch/issues/1293
  22612. fetchParams.controller.connection.destroy()
  22613. response = await httpNetworkOrCacheFetch(
  22614. fetchParams,
  22615. isAuthenticationFetch,
  22616. true
  22617. )
  22618. }
  22619. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22620. if (isAuthenticationFetch) {
  22621. // TODO
  22622. }
  22623. // 18. Return response.
  22624. return response
  22625. }
  22626. // https://fetch.spec.whatwg.org/#http-network-fetch
  22627. async function httpNetworkFetch (
  22628. fetchParams,
  22629. includeCredentials = false,
  22630. forceNewConnection = false
  22631. ) {
  22632. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22633. fetchParams.controller.connection = {
  22634. abort: null,
  22635. destroyed: false,
  22636. destroy (err) {
  22637. if (!this.destroyed) {
  22638. this.destroyed = true
  22639. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22640. }
  22641. }
  22642. }
  22643. // 1. Let request be fetchParams’s request.
  22644. const request = fetchParams.request
  22645. // 2. Let response be null.
  22646. let response = null
  22647. // 3. Let timingInfo be fetchParams’s timing info.
  22648. const timingInfo = fetchParams.timingInfo
  22649. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22650. // given request.
  22651. // TODO: cache
  22652. const httpCache = null
  22653. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22654. if (httpCache == null) {
  22655. request.cache = 'no-store'
  22656. }
  22657. // 6. Let networkPartitionKey be the result of determining the network
  22658. // partition key given request.
  22659. // TODO
  22660. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22661. // "no".
  22662. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22663. // 8. Switch on request’s mode:
  22664. if (request.mode === 'websocket') {
  22665. // Let connection be the result of obtaining a WebSocket connection,
  22666. // given request’s current URL.
  22667. // TODO
  22668. } else {
  22669. // Let connection be the result of obtaining a connection, given
  22670. // networkPartitionKey, request’s current URL’s origin,
  22671. // includeCredentials, and forceNewConnection.
  22672. // TODO
  22673. }
  22674. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22675. // 1. If connection is failure, then return a network error.
  22676. // 2. Set timingInfo’s final connection timing info to the result of
  22677. // calling clamp and coarsen connection timing info with connection’s
  22678. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22679. // cross-origin isolated capability.
  22680. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22681. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22682. // `chunked`) to request’s header list.
  22683. // 4. Set timingInfo’s final network-request start time to the coarsened
  22684. // shared current time given fetchParams’s cross-origin isolated
  22685. // capability.
  22686. // 5. Set response to the result of making an HTTP request over connection
  22687. // using request with the following caveats:
  22688. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22689. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22690. // - If request’s body is non-null, and request’s body’s source is null,
  22691. // then the user agent may have a buffer of up to 64 kibibytes and store
  22692. // a part of request’s body in that buffer. If the user agent reads from
  22693. // request’s body beyond that buffer’s size and the user agent needs to
  22694. // resend request, then instead return a network error.
  22695. // - Set timingInfo’s final network-response start time to the coarsened
  22696. // shared current time given fetchParams’s cross-origin isolated capability,
  22697. // immediately after the user agent’s HTTP parser receives the first byte
  22698. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22699. // line for HTTP/1.x).
  22700. // - Wait until all the headers are transmitted.
  22701. // - Any responses whose status is in the range 100 to 199, inclusive,
  22702. // and is not 101, are to be ignored, except for the purposes of setting
  22703. // timingInfo’s final network-response start time above.
  22704. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22705. // response is transferred via HTTP/1.0 or older, then return a network
  22706. // error.
  22707. // - If the HTTP request results in a TLS client certificate dialog, then:
  22708. // 1. If request’s window is an environment settings object, make the
  22709. // dialog available in request’s window.
  22710. // 2. Otherwise, return a network error.
  22711. // To transmit request’s body body, run these steps:
  22712. let requestBody = null
  22713. // 1. If body is null and fetchParams’s process request end-of-body is
  22714. // non-null, then queue a fetch task given fetchParams’s process request
  22715. // end-of-body and fetchParams’s task destination.
  22716. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22717. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22718. } else if (request.body != null) {
  22719. // 2. Otherwise, if body is non-null:
  22720. // 1. Let processBodyChunk given bytes be these steps:
  22721. const processBodyChunk = async function * (bytes) {
  22722. // 1. If the ongoing fetch is terminated, then abort these steps.
  22723. if (isCancelled(fetchParams)) {
  22724. return
  22725. }
  22726. // 2. Run this step in parallel: transmit bytes.
  22727. yield bytes
  22728. // 3. If fetchParams’s process request body is non-null, then run
  22729. // fetchParams’s process request body given bytes’s length.
  22730. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  22731. }
  22732. // 2. Let processEndOfBody be these steps:
  22733. const processEndOfBody = () => {
  22734. // 1. If fetchParams is canceled, then abort these steps.
  22735. if (isCancelled(fetchParams)) {
  22736. return
  22737. }
  22738. // 2. If fetchParams’s process request end-of-body is non-null,
  22739. // then run fetchParams’s process request end-of-body.
  22740. if (fetchParams.processRequestEndOfBody) {
  22741. fetchParams.processRequestEndOfBody()
  22742. }
  22743. }
  22744. // 3. Let processBodyError given e be these steps:
  22745. const processBodyError = (e) => {
  22746. // 1. If fetchParams is canceled, then abort these steps.
  22747. if (isCancelled(fetchParams)) {
  22748. return
  22749. }
  22750. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  22751. if (e.name === 'AbortError') {
  22752. fetchParams.controller.abort()
  22753. } else {
  22754. fetchParams.controller.terminate(e)
  22755. }
  22756. }
  22757. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  22758. // processBodyError, and fetchParams’s task destination.
  22759. requestBody = (async function * () {
  22760. try {
  22761. for await (const bytes of request.body.stream) {
  22762. yield * processBodyChunk(bytes)
  22763. }
  22764. processEndOfBody()
  22765. } catch (err) {
  22766. processBodyError(err)
  22767. }
  22768. })()
  22769. }
  22770. try {
  22771. // socket is only provided for websockets
  22772. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  22773. if (socket) {
  22774. response = makeResponse({ status, statusText, headersList, socket })
  22775. } else {
  22776. const iterator = body[Symbol.asyncIterator]()
  22777. fetchParams.controller.next = () => iterator.next()
  22778. response = makeResponse({ status, statusText, headersList })
  22779. }
  22780. } catch (err) {
  22781. // 10. If aborted, then:
  22782. if (err.name === 'AbortError') {
  22783. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22784. fetchParams.controller.connection.destroy()
  22785. // 2. Return the appropriate network error for fetchParams.
  22786. return makeAppropriateNetworkError(fetchParams, err)
  22787. }
  22788. return makeNetworkError(err)
  22789. }
  22790. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  22791. // if it is suspended.
  22792. const pullAlgorithm = () => {
  22793. fetchParams.controller.resume()
  22794. }
  22795. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  22796. // controller with reason, given reason.
  22797. const cancelAlgorithm = (reason) => {
  22798. fetchParams.controller.abort(reason)
  22799. }
  22800. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  22801. // the user agent.
  22802. // TODO
  22803. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  22804. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  22805. // TODO
  22806. // 15. Let stream be a new ReadableStream.
  22807. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  22808. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  22809. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  22810. if (!ReadableStream) {
  22811. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  22812. }
  22813. const stream = new ReadableStream(
  22814. {
  22815. async start (controller) {
  22816. fetchParams.controller.controller = controller
  22817. },
  22818. async pull (controller) {
  22819. await pullAlgorithm(controller)
  22820. },
  22821. async cancel (reason) {
  22822. await cancelAlgorithm(reason)
  22823. }
  22824. },
  22825. {
  22826. highWaterMark: 0,
  22827. size () {
  22828. return 1
  22829. }
  22830. }
  22831. )
  22832. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  22833. // 1. Set response’s body to a new body whose stream is stream.
  22834. response.body = { stream }
  22835. // 2. If response is not a network error and request’s cache mode is
  22836. // not "no-store", then update response in httpCache for request.
  22837. // TODO
  22838. // 3. If includeCredentials is true and the user agent is not configured
  22839. // to block cookies for request (see section 7 of [COOKIES]), then run the
  22840. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  22841. // the value of each header whose name is a byte-case-insensitive match for
  22842. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  22843. // TODO
  22844. // 18. If aborted, then:
  22845. // TODO
  22846. // 19. Run these steps in parallel:
  22847. // 1. Run these steps, but abort when fetchParams is canceled:
  22848. fetchParams.controller.on('terminated', onAborted)
  22849. fetchParams.controller.resume = async () => {
  22850. // 1. While true
  22851. while (true) {
  22852. // 1-3. See onData...
  22853. // 4. Set bytes to the result of handling content codings given
  22854. // codings and bytes.
  22855. let bytes
  22856. let isFailure
  22857. try {
  22858. const { done, value } = await fetchParams.controller.next()
  22859. if (isAborted(fetchParams)) {
  22860. break
  22861. }
  22862. bytes = done ? undefined : value
  22863. } catch (err) {
  22864. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  22865. // zlib doesn't like empty streams.
  22866. bytes = undefined
  22867. } else {
  22868. bytes = err
  22869. // err may be propagated from the result of calling readablestream.cancel,
  22870. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  22871. isFailure = true
  22872. }
  22873. }
  22874. if (bytes === undefined) {
  22875. // 2. Otherwise, if the bytes transmission for response’s message
  22876. // body is done normally and stream is readable, then close
  22877. // stream, finalize response for fetchParams and response, and
  22878. // abort these in-parallel steps.
  22879. readableStreamClose(fetchParams.controller.controller)
  22880. finalizeResponse(fetchParams, response)
  22881. return
  22882. }
  22883. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  22884. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  22885. // 6. If bytes is failure, then terminate fetchParams’s controller.
  22886. if (isFailure) {
  22887. fetchParams.controller.terminate(bytes)
  22888. return
  22889. }
  22890. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  22891. // into stream.
  22892. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  22893. // 8. If stream is errored, then terminate the ongoing fetch.
  22894. if (isErrored(stream)) {
  22895. fetchParams.controller.terminate()
  22896. return
  22897. }
  22898. // 9. If stream doesn’t need more data ask the user agent to suspend
  22899. // the ongoing fetch.
  22900. if (!fetchParams.controller.controller.desiredSize) {
  22901. return
  22902. }
  22903. }
  22904. }
  22905. // 2. If aborted, then:
  22906. function onAborted (reason) {
  22907. // 2. If fetchParams is aborted, then:
  22908. if (isAborted(fetchParams)) {
  22909. // 1. Set response’s aborted flag.
  22910. response.aborted = true
  22911. // 2. If stream is readable, then error stream with the result of
  22912. // deserialize a serialized abort reason given fetchParams’s
  22913. // controller’s serialized abort reason and an
  22914. // implementation-defined realm.
  22915. if (isReadable(stream)) {
  22916. fetchParams.controller.controller.error(
  22917. fetchParams.controller.serializedAbortReason
  22918. )
  22919. }
  22920. } else {
  22921. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  22922. if (isReadable(stream)) {
  22923. fetchParams.controller.controller.error(new TypeError('terminated', {
  22924. cause: isErrorLike(reason) ? reason : undefined
  22925. }))
  22926. }
  22927. }
  22928. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22929. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  22930. fetchParams.controller.connection.destroy()
  22931. }
  22932. // 20. Return response.
  22933. return response
  22934. async function dispatch ({ body }) {
  22935. const url = requestCurrentURL(request)
  22936. /** @type {import('../..').Agent} */
  22937. const agent = fetchParams.controller.dispatcher
  22938. return new Promise((resolve, reject) => agent.dispatch(
  22939. {
  22940. path: url.pathname + url.search,
  22941. origin: url.origin,
  22942. method: request.method,
  22943. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  22944. headers: request.headersList.entries,
  22945. maxRedirections: 0,
  22946. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  22947. },
  22948. {
  22949. body: null,
  22950. abort: null,
  22951. onConnect (abort) {
  22952. // TODO (fix): Do we need connection here?
  22953. const { connection } = fetchParams.controller
  22954. if (connection.destroyed) {
  22955. abort(new DOMException('The operation was aborted.', 'AbortError'))
  22956. } else {
  22957. fetchParams.controller.on('terminated', abort)
  22958. this.abort = connection.abort = abort
  22959. }
  22960. },
  22961. onHeaders (status, headersList, resume, statusText) {
  22962. if (status < 200) {
  22963. return
  22964. }
  22965. let codings = []
  22966. let location = ''
  22967. const headers = new Headers()
  22968. // For H2, the headers are a plain JS object
  22969. // We distinguish between them and iterate accordingly
  22970. if (Array.isArray(headersList)) {
  22971. for (let n = 0; n < headersList.length; n += 2) {
  22972. const key = headersList[n + 0].toString('latin1')
  22973. const val = headersList[n + 1].toString('latin1')
  22974. if (key.toLowerCase() === 'content-encoding') {
  22975. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22976. // "All content-coding values are case-insensitive..."
  22977. codings = val.toLowerCase().split(',').map((x) => x.trim())
  22978. } else if (key.toLowerCase() === 'location') {
  22979. location = val
  22980. }
  22981. headers[kHeadersList].append(key, val)
  22982. }
  22983. } else {
  22984. const keys = Object.keys(headersList)
  22985. for (const key of keys) {
  22986. const val = headersList[key]
  22987. if (key.toLowerCase() === 'content-encoding') {
  22988. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22989. // "All content-coding values are case-insensitive..."
  22990. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  22991. } else if (key.toLowerCase() === 'location') {
  22992. location = val
  22993. }
  22994. headers[kHeadersList].append(key, val)
  22995. }
  22996. }
  22997. this.body = new Readable({ read: resume })
  22998. const decoders = []
  22999. const willFollow = request.redirect === 'follow' &&
  23000. location &&
  23001. redirectStatusSet.has(status)
  23002. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23003. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23004. for (const coding of codings) {
  23005. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23006. if (coding === 'x-gzip' || coding === 'gzip') {
  23007. decoders.push(zlib.createGunzip({
  23008. // Be less strict when decoding compressed responses, since sometimes
  23009. // servers send slightly invalid responses that are still accepted
  23010. // by common browsers.
  23011. // Always using Z_SYNC_FLUSH is what cURL does.
  23012. flush: zlib.constants.Z_SYNC_FLUSH,
  23013. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23014. }))
  23015. } else if (coding === 'deflate') {
  23016. decoders.push(zlib.createInflate())
  23017. } else if (coding === 'br') {
  23018. decoders.push(zlib.createBrotliDecompress())
  23019. } else {
  23020. decoders.length = 0
  23021. break
  23022. }
  23023. }
  23024. }
  23025. resolve({
  23026. status,
  23027. statusText,
  23028. headersList: headers[kHeadersList],
  23029. body: decoders.length
  23030. ? pipeline(this.body, ...decoders, () => { })
  23031. : this.body.on('error', () => {})
  23032. })
  23033. return true
  23034. },
  23035. onData (chunk) {
  23036. if (fetchParams.controller.dump) {
  23037. return
  23038. }
  23039. // 1. If one or more bytes have been transmitted from response’s
  23040. // message body, then:
  23041. // 1. Let bytes be the transmitted bytes.
  23042. const bytes = chunk
  23043. // 2. Let codings be the result of extracting header list values
  23044. // given `Content-Encoding` and response’s header list.
  23045. // See pullAlgorithm.
  23046. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23047. timingInfo.encodedBodySize += bytes.byteLength
  23048. // 4. See pullAlgorithm...
  23049. return this.body.push(bytes)
  23050. },
  23051. onComplete () {
  23052. if (this.abort) {
  23053. fetchParams.controller.off('terminated', this.abort)
  23054. }
  23055. fetchParams.controller.ended = true
  23056. this.body.push(null)
  23057. },
  23058. onError (error) {
  23059. if (this.abort) {
  23060. fetchParams.controller.off('terminated', this.abort)
  23061. }
  23062. this.body?.destroy(error)
  23063. fetchParams.controller.terminate(error)
  23064. reject(error)
  23065. },
  23066. onUpgrade (status, headersList, socket) {
  23067. if (status !== 101) {
  23068. return
  23069. }
  23070. const headers = new Headers()
  23071. for (let n = 0; n < headersList.length; n += 2) {
  23072. const key = headersList[n + 0].toString('latin1')
  23073. const val = headersList[n + 1].toString('latin1')
  23074. headers[kHeadersList].append(key, val)
  23075. }
  23076. resolve({
  23077. status,
  23078. statusText: STATUS_CODES[status],
  23079. headersList: headers[kHeadersList],
  23080. socket
  23081. })
  23082. return true
  23083. }
  23084. }
  23085. ))
  23086. }
  23087. }
  23088. module.exports = {
  23089. fetch,
  23090. Fetch,
  23091. fetching,
  23092. finalizeAndReportTiming
  23093. }
  23094. /***/ }),
  23095. /***/ 8359:
  23096. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23097. "use strict";
  23098. /* globals AbortController */
  23099. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23100. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23101. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23102. const util = __nccwpck_require__(3983)
  23103. const {
  23104. isValidHTTPToken,
  23105. sameOrigin,
  23106. normalizeMethod,
  23107. makePolicyContainer,
  23108. normalizeMethodRecord
  23109. } = __nccwpck_require__(2538)
  23110. const {
  23111. forbiddenMethodsSet,
  23112. corsSafeListedMethodsSet,
  23113. referrerPolicy,
  23114. requestRedirect,
  23115. requestMode,
  23116. requestCredentials,
  23117. requestCache,
  23118. requestDuplex
  23119. } = __nccwpck_require__(1037)
  23120. const { kEnumerableProperty } = util
  23121. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23122. const { webidl } = __nccwpck_require__(1744)
  23123. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23124. const { URLSerializer } = __nccwpck_require__(685)
  23125. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23126. const assert = __nccwpck_require__(9491)
  23127. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23128. let TransformStream = globalThis.TransformStream
  23129. const kAbortController = Symbol('abortController')
  23130. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23131. signal.removeEventListener('abort', abort)
  23132. })
  23133. // https://fetch.spec.whatwg.org/#request-class
  23134. class Request {
  23135. // https://fetch.spec.whatwg.org/#dom-request
  23136. constructor (input, init = {}) {
  23137. if (input === kConstruct) {
  23138. return
  23139. }
  23140. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23141. input = webidl.converters.RequestInfo(input)
  23142. init = webidl.converters.RequestInit(init)
  23143. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23144. this[kRealm] = {
  23145. settingsObject: {
  23146. baseUrl: getGlobalOrigin(),
  23147. get origin () {
  23148. return this.baseUrl?.origin
  23149. },
  23150. policyContainer: makePolicyContainer()
  23151. }
  23152. }
  23153. // 1. Let request be null.
  23154. let request = null
  23155. // 2. Let fallbackMode be null.
  23156. let fallbackMode = null
  23157. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23158. const baseUrl = this[kRealm].settingsObject.baseUrl
  23159. // 4. Let signal be null.
  23160. let signal = null
  23161. // 5. If input is a string, then:
  23162. if (typeof input === 'string') {
  23163. // 1. Let parsedURL be the result of parsing input with baseURL.
  23164. // 2. If parsedURL is failure, then throw a TypeError.
  23165. let parsedURL
  23166. try {
  23167. parsedURL = new URL(input, baseUrl)
  23168. } catch (err) {
  23169. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23170. }
  23171. // 3. If parsedURL includes credentials, then throw a TypeError.
  23172. if (parsedURL.username || parsedURL.password) {
  23173. throw new TypeError(
  23174. 'Request cannot be constructed from a URL that includes credentials: ' +
  23175. input
  23176. )
  23177. }
  23178. // 4. Set request to a new request whose URL is parsedURL.
  23179. request = makeRequest({ urlList: [parsedURL] })
  23180. // 5. Set fallbackMode to "cors".
  23181. fallbackMode = 'cors'
  23182. } else {
  23183. // 6. Otherwise:
  23184. // 7. Assert: input is a Request object.
  23185. assert(input instanceof Request)
  23186. // 8. Set request to input’s request.
  23187. request = input[kState]
  23188. // 9. Set signal to input’s signal.
  23189. signal = input[kSignal]
  23190. }
  23191. // 7. Let origin be this’s relevant settings object’s origin.
  23192. const origin = this[kRealm].settingsObject.origin
  23193. // 8. Let window be "client".
  23194. let window = 'client'
  23195. // 9. If request’s window is an environment settings object and its origin
  23196. // is same origin with origin, then set window to request’s window.
  23197. if (
  23198. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23199. sameOrigin(request.window, origin)
  23200. ) {
  23201. window = request.window
  23202. }
  23203. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23204. if (init.window != null) {
  23205. throw new TypeError(`'window' option '${window}' must be null`)
  23206. }
  23207. // 11. If init["window"] exists, then set window to "no-window".
  23208. if ('window' in init) {
  23209. window = 'no-window'
  23210. }
  23211. // 12. Set request to a new request with the following properties:
  23212. request = makeRequest({
  23213. // URL request’s URL.
  23214. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23215. // method request’s method.
  23216. method: request.method,
  23217. // header list A copy of request’s header list.
  23218. // undici implementation note: headersList is cloned in makeRequest
  23219. headersList: request.headersList,
  23220. // unsafe-request flag Set.
  23221. unsafeRequest: request.unsafeRequest,
  23222. // client This’s relevant settings object.
  23223. client: this[kRealm].settingsObject,
  23224. // window window.
  23225. window,
  23226. // priority request’s priority.
  23227. priority: request.priority,
  23228. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23229. // being handled by a service worker. In this scenario a request can have an origin that is different
  23230. // from the current client.
  23231. origin: request.origin,
  23232. // referrer request’s referrer.
  23233. referrer: request.referrer,
  23234. // referrer policy request’s referrer policy.
  23235. referrerPolicy: request.referrerPolicy,
  23236. // mode request’s mode.
  23237. mode: request.mode,
  23238. // credentials mode request’s credentials mode.
  23239. credentials: request.credentials,
  23240. // cache mode request’s cache mode.
  23241. cache: request.cache,
  23242. // redirect mode request’s redirect mode.
  23243. redirect: request.redirect,
  23244. // integrity metadata request’s integrity metadata.
  23245. integrity: request.integrity,
  23246. // keepalive request’s keepalive.
  23247. keepalive: request.keepalive,
  23248. // reload-navigation flag request’s reload-navigation flag.
  23249. reloadNavigation: request.reloadNavigation,
  23250. // history-navigation flag request’s history-navigation flag.
  23251. historyNavigation: request.historyNavigation,
  23252. // URL list A clone of request’s URL list.
  23253. urlList: [...request.urlList]
  23254. })
  23255. const initHasKey = Object.keys(init).length !== 0
  23256. // 13. If init is not empty, then:
  23257. if (initHasKey) {
  23258. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23259. if (request.mode === 'navigate') {
  23260. request.mode = 'same-origin'
  23261. }
  23262. // 2. Unset request’s reload-navigation flag.
  23263. request.reloadNavigation = false
  23264. // 3. Unset request’s history-navigation flag.
  23265. request.historyNavigation = false
  23266. // 4. Set request’s origin to "client".
  23267. request.origin = 'client'
  23268. // 5. Set request’s referrer to "client"
  23269. request.referrer = 'client'
  23270. // 6. Set request’s referrer policy to the empty string.
  23271. request.referrerPolicy = ''
  23272. // 7. Set request’s URL to request’s current URL.
  23273. request.url = request.urlList[request.urlList.length - 1]
  23274. // 8. Set request’s URL list to « request’s URL ».
  23275. request.urlList = [request.url]
  23276. }
  23277. // 14. If init["referrer"] exists, then:
  23278. if (init.referrer !== undefined) {
  23279. // 1. Let referrer be init["referrer"].
  23280. const referrer = init.referrer
  23281. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23282. if (referrer === '') {
  23283. request.referrer = 'no-referrer'
  23284. } else {
  23285. // 1. Let parsedReferrer be the result of parsing referrer with
  23286. // baseURL.
  23287. // 2. If parsedReferrer is failure, then throw a TypeError.
  23288. let parsedReferrer
  23289. try {
  23290. parsedReferrer = new URL(referrer, baseUrl)
  23291. } catch (err) {
  23292. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23293. }
  23294. // 3. If one of the following is true
  23295. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23296. // - parsedReferrer’s origin is not same origin with origin
  23297. // then set request’s referrer to "client".
  23298. if (
  23299. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23300. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23301. ) {
  23302. request.referrer = 'client'
  23303. } else {
  23304. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23305. request.referrer = parsedReferrer
  23306. }
  23307. }
  23308. }
  23309. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23310. // to it.
  23311. if (init.referrerPolicy !== undefined) {
  23312. request.referrerPolicy = init.referrerPolicy
  23313. }
  23314. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23315. let mode
  23316. if (init.mode !== undefined) {
  23317. mode = init.mode
  23318. } else {
  23319. mode = fallbackMode
  23320. }
  23321. // 17. If mode is "navigate", then throw a TypeError.
  23322. if (mode === 'navigate') {
  23323. throw webidl.errors.exception({
  23324. header: 'Request constructor',
  23325. message: 'invalid request mode navigate.'
  23326. })
  23327. }
  23328. // 18. If mode is non-null, set request’s mode to mode.
  23329. if (mode != null) {
  23330. request.mode = mode
  23331. }
  23332. // 19. If init["credentials"] exists, then set request’s credentials mode
  23333. // to it.
  23334. if (init.credentials !== undefined) {
  23335. request.credentials = init.credentials
  23336. }
  23337. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23338. if (init.cache !== undefined) {
  23339. request.cache = init.cache
  23340. }
  23341. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23342. // not "same-origin", then throw a TypeError.
  23343. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23344. throw new TypeError(
  23345. "'only-if-cached' can be set only with 'same-origin' mode"
  23346. )
  23347. }
  23348. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23349. if (init.redirect !== undefined) {
  23350. request.redirect = init.redirect
  23351. }
  23352. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23353. if (init.integrity != null) {
  23354. request.integrity = String(init.integrity)
  23355. }
  23356. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23357. if (init.keepalive !== undefined) {
  23358. request.keepalive = Boolean(init.keepalive)
  23359. }
  23360. // 25. If init["method"] exists, then:
  23361. if (init.method !== undefined) {
  23362. // 1. Let method be init["method"].
  23363. let method = init.method
  23364. // 2. If method is not a method or method is a forbidden method, then
  23365. // throw a TypeError.
  23366. if (!isValidHTTPToken(method)) {
  23367. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23368. }
  23369. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23370. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23371. }
  23372. // 3. Normalize method.
  23373. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23374. // 4. Set request’s method to method.
  23375. request.method = method
  23376. }
  23377. // 26. If init["signal"] exists, then set signal to it.
  23378. if (init.signal !== undefined) {
  23379. signal = init.signal
  23380. }
  23381. // 27. Set this’s request to request.
  23382. this[kState] = request
  23383. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23384. // Realm.
  23385. // TODO: could this be simplified with AbortSignal.any
  23386. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23387. const ac = new AbortController()
  23388. this[kSignal] = ac.signal
  23389. this[kSignal][kRealm] = this[kRealm]
  23390. // 29. If signal is not null, then make this’s signal follow signal.
  23391. if (signal != null) {
  23392. if (
  23393. !signal ||
  23394. typeof signal.aborted !== 'boolean' ||
  23395. typeof signal.addEventListener !== 'function'
  23396. ) {
  23397. throw new TypeError(
  23398. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23399. )
  23400. }
  23401. if (signal.aborted) {
  23402. ac.abort(signal.reason)
  23403. } else {
  23404. // Keep a strong ref to ac while request object
  23405. // is alive. This is needed to prevent AbortController
  23406. // from being prematurely garbage collected.
  23407. // See, https://github.com/nodejs/undici/issues/1926.
  23408. this[kAbortController] = ac
  23409. const acRef = new WeakRef(ac)
  23410. const abort = function () {
  23411. const ac = acRef.deref()
  23412. if (ac !== undefined) {
  23413. ac.abort(this.reason)
  23414. }
  23415. }
  23416. // Third-party AbortControllers may not work with these.
  23417. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23418. try {
  23419. // If the max amount of listeners is equal to the default, increase it
  23420. // This is only available in node >= v19.9.0
  23421. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23422. setMaxListeners(100, signal)
  23423. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23424. setMaxListeners(100, signal)
  23425. }
  23426. } catch {}
  23427. util.addAbortListener(signal, abort)
  23428. requestFinalizer.register(ac, { signal, abort })
  23429. }
  23430. }
  23431. // 30. Set this’s headers to a new Headers object with this’s relevant
  23432. // Realm, whose header list is request’s header list and guard is
  23433. // "request".
  23434. this[kHeaders] = new Headers(kConstruct)
  23435. this[kHeaders][kHeadersList] = request.headersList
  23436. this[kHeaders][kGuard] = 'request'
  23437. this[kHeaders][kRealm] = this[kRealm]
  23438. // 31. If this’s request’s mode is "no-cors", then:
  23439. if (mode === 'no-cors') {
  23440. // 1. If this’s request’s method is not a CORS-safelisted method,
  23441. // then throw a TypeError.
  23442. if (!corsSafeListedMethodsSet.has(request.method)) {
  23443. throw new TypeError(
  23444. `'${request.method} is unsupported in no-cors mode.`
  23445. )
  23446. }
  23447. // 2. Set this’s headers’s guard to "request-no-cors".
  23448. this[kHeaders][kGuard] = 'request-no-cors'
  23449. }
  23450. // 32. If init is not empty, then:
  23451. if (initHasKey) {
  23452. /** @type {HeadersList} */
  23453. const headersList = this[kHeaders][kHeadersList]
  23454. // 1. Let headers be a copy of this’s headers and its associated header
  23455. // list.
  23456. // 2. If init["headers"] exists, then set headers to init["headers"].
  23457. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23458. // 3. Empty this’s headers’s header list.
  23459. headersList.clear()
  23460. // 4. If headers is a Headers object, then for each header in its header
  23461. // list, append header’s name/header’s value to this’s headers.
  23462. if (headers instanceof HeadersList) {
  23463. for (const [key, val] of headers) {
  23464. headersList.append(key, val)
  23465. }
  23466. // Note: Copy the `set-cookie` meta-data.
  23467. headersList.cookies = headers.cookies
  23468. } else {
  23469. // 5. Otherwise, fill this’s headers with headers.
  23470. fillHeaders(this[kHeaders], headers)
  23471. }
  23472. }
  23473. // 33. Let inputBody be input’s request’s body if input is a Request
  23474. // object; otherwise null.
  23475. const inputBody = input instanceof Request ? input[kState].body : null
  23476. // 34. If either init["body"] exists and is non-null or inputBody is
  23477. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23478. // TypeError.
  23479. if (
  23480. (init.body != null || inputBody != null) &&
  23481. (request.method === 'GET' || request.method === 'HEAD')
  23482. ) {
  23483. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23484. }
  23485. // 35. Let initBody be null.
  23486. let initBody = null
  23487. // 36. If init["body"] exists and is non-null, then:
  23488. if (init.body != null) {
  23489. // 1. Let Content-Type be null.
  23490. // 2. Set initBody and Content-Type to the result of extracting
  23491. // init["body"], with keepalive set to request’s keepalive.
  23492. const [extractedBody, contentType] = extractBody(
  23493. init.body,
  23494. request.keepalive
  23495. )
  23496. initBody = extractedBody
  23497. // 3, If Content-Type is non-null and this’s headers’s header list does
  23498. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23499. // this’s headers.
  23500. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23501. this[kHeaders].append('content-type', contentType)
  23502. }
  23503. }
  23504. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23505. // inputBody.
  23506. const inputOrInitBody = initBody ?? inputBody
  23507. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23508. // null, then:
  23509. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23510. // 1. If initBody is non-null and init["duplex"] does not exist,
  23511. // then throw a TypeError.
  23512. if (initBody != null && init.duplex == null) {
  23513. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23514. }
  23515. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23516. // then throw a TypeError.
  23517. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23518. throw new TypeError(
  23519. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23520. )
  23521. }
  23522. // 3. Set this’s request’s use-CORS-preflight flag.
  23523. request.useCORSPreflightFlag = true
  23524. }
  23525. // 39. Let finalBody be inputOrInitBody.
  23526. let finalBody = inputOrInitBody
  23527. // 40. If initBody is null and inputBody is non-null, then:
  23528. if (initBody == null && inputBody != null) {
  23529. // 1. If input is unusable, then throw a TypeError.
  23530. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23531. throw new TypeError(
  23532. 'Cannot construct a Request with a Request object that has already been used.'
  23533. )
  23534. }
  23535. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23536. if (!TransformStream) {
  23537. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23538. }
  23539. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23540. const identityTransform = new TransformStream()
  23541. inputBody.stream.pipeThrough(identityTransform)
  23542. finalBody = {
  23543. source: inputBody.source,
  23544. length: inputBody.length,
  23545. stream: identityTransform.readable
  23546. }
  23547. }
  23548. // 41. Set this’s request’s body to finalBody.
  23549. this[kState].body = finalBody
  23550. }
  23551. // Returns request’s HTTP method, which is "GET" by default.
  23552. get method () {
  23553. webidl.brandCheck(this, Request)
  23554. // The method getter steps are to return this’s request’s method.
  23555. return this[kState].method
  23556. }
  23557. // Returns the URL of request as a string.
  23558. get url () {
  23559. webidl.brandCheck(this, Request)
  23560. // The url getter steps are to return this’s request’s URL, serialized.
  23561. return URLSerializer(this[kState].url)
  23562. }
  23563. // Returns a Headers object consisting of the headers associated with request.
  23564. // Note that headers added in the network layer by the user agent will not
  23565. // be accounted for in this object, e.g., the "Host" header.
  23566. get headers () {
  23567. webidl.brandCheck(this, Request)
  23568. // The headers getter steps are to return this’s headers.
  23569. return this[kHeaders]
  23570. }
  23571. // Returns the kind of resource requested by request, e.g., "document"
  23572. // or "script".
  23573. get destination () {
  23574. webidl.brandCheck(this, Request)
  23575. // The destination getter are to return this’s request’s destination.
  23576. return this[kState].destination
  23577. }
  23578. // Returns the referrer of request. Its value can be a same-origin URL if
  23579. // explicitly set in init, the empty string to indicate no referrer, and
  23580. // "about:client" when defaulting to the global’s default. This is used
  23581. // during fetching to determine the value of the `Referer` header of the
  23582. // request being made.
  23583. get referrer () {
  23584. webidl.brandCheck(this, Request)
  23585. // 1. If this’s request’s referrer is "no-referrer", then return the
  23586. // empty string.
  23587. if (this[kState].referrer === 'no-referrer') {
  23588. return ''
  23589. }
  23590. // 2. If this’s request’s referrer is "client", then return
  23591. // "about:client".
  23592. if (this[kState].referrer === 'client') {
  23593. return 'about:client'
  23594. }
  23595. // Return this’s request’s referrer, serialized.
  23596. return this[kState].referrer.toString()
  23597. }
  23598. // Returns the referrer policy associated with request.
  23599. // This is used during fetching to compute the value of the request’s
  23600. // referrer.
  23601. get referrerPolicy () {
  23602. webidl.brandCheck(this, Request)
  23603. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23604. return this[kState].referrerPolicy
  23605. }
  23606. // Returns the mode associated with request, which is a string indicating
  23607. // whether the request will use CORS, or will be restricted to same-origin
  23608. // URLs.
  23609. get mode () {
  23610. webidl.brandCheck(this, Request)
  23611. // The mode getter steps are to return this’s request’s mode.
  23612. return this[kState].mode
  23613. }
  23614. // Returns the credentials mode associated with request,
  23615. // which is a string indicating whether credentials will be sent with the
  23616. // request always, never, or only when sent to a same-origin URL.
  23617. get credentials () {
  23618. // The credentials getter steps are to return this’s request’s credentials mode.
  23619. return this[kState].credentials
  23620. }
  23621. // Returns the cache mode associated with request,
  23622. // which is a string indicating how the request will
  23623. // interact with the browser’s cache when fetching.
  23624. get cache () {
  23625. webidl.brandCheck(this, Request)
  23626. // The cache getter steps are to return this’s request’s cache mode.
  23627. return this[kState].cache
  23628. }
  23629. // Returns the redirect mode associated with request,
  23630. // which is a string indicating how redirects for the
  23631. // request will be handled during fetching. A request
  23632. // will follow redirects by default.
  23633. get redirect () {
  23634. webidl.brandCheck(this, Request)
  23635. // The redirect getter steps are to return this’s request’s redirect mode.
  23636. return this[kState].redirect
  23637. }
  23638. // Returns request’s subresource integrity metadata, which is a
  23639. // cryptographic hash of the resource being fetched. Its value
  23640. // consists of multiple hashes separated by whitespace. [SRI]
  23641. get integrity () {
  23642. webidl.brandCheck(this, Request)
  23643. // The integrity getter steps are to return this’s request’s integrity
  23644. // metadata.
  23645. return this[kState].integrity
  23646. }
  23647. // Returns a boolean indicating whether or not request can outlive the
  23648. // global in which it was created.
  23649. get keepalive () {
  23650. webidl.brandCheck(this, Request)
  23651. // The keepalive getter steps are to return this’s request’s keepalive.
  23652. return this[kState].keepalive
  23653. }
  23654. // Returns a boolean indicating whether or not request is for a reload
  23655. // navigation.
  23656. get isReloadNavigation () {
  23657. webidl.brandCheck(this, Request)
  23658. // The isReloadNavigation getter steps are to return true if this’s
  23659. // request’s reload-navigation flag is set; otherwise false.
  23660. return this[kState].reloadNavigation
  23661. }
  23662. // Returns a boolean indicating whether or not request is for a history
  23663. // navigation (a.k.a. back-foward navigation).
  23664. get isHistoryNavigation () {
  23665. webidl.brandCheck(this, Request)
  23666. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23667. // history-navigation flag is set; otherwise false.
  23668. return this[kState].historyNavigation
  23669. }
  23670. // Returns the signal associated with request, which is an AbortSignal
  23671. // object indicating whether or not request has been aborted, and its
  23672. // abort event handler.
  23673. get signal () {
  23674. webidl.brandCheck(this, Request)
  23675. // The signal getter steps are to return this’s signal.
  23676. return this[kSignal]
  23677. }
  23678. get body () {
  23679. webidl.brandCheck(this, Request)
  23680. return this[kState].body ? this[kState].body.stream : null
  23681. }
  23682. get bodyUsed () {
  23683. webidl.brandCheck(this, Request)
  23684. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23685. }
  23686. get duplex () {
  23687. webidl.brandCheck(this, Request)
  23688. return 'half'
  23689. }
  23690. // Returns a clone of request.
  23691. clone () {
  23692. webidl.brandCheck(this, Request)
  23693. // 1. If this is unusable, then throw a TypeError.
  23694. if (this.bodyUsed || this.body?.locked) {
  23695. throw new TypeError('unusable')
  23696. }
  23697. // 2. Let clonedRequest be the result of cloning this’s request.
  23698. const clonedRequest = cloneRequest(this[kState])
  23699. // 3. Let clonedRequestObject be the result of creating a Request object,
  23700. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23701. const clonedRequestObject = new Request(kConstruct)
  23702. clonedRequestObject[kState] = clonedRequest
  23703. clonedRequestObject[kRealm] = this[kRealm]
  23704. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23705. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23706. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23707. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23708. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23709. const ac = new AbortController()
  23710. if (this.signal.aborted) {
  23711. ac.abort(this.signal.reason)
  23712. } else {
  23713. util.addAbortListener(
  23714. this.signal,
  23715. () => {
  23716. ac.abort(this.signal.reason)
  23717. }
  23718. )
  23719. }
  23720. clonedRequestObject[kSignal] = ac.signal
  23721. // 4. Return clonedRequestObject.
  23722. return clonedRequestObject
  23723. }
  23724. }
  23725. mixinBody(Request)
  23726. function makeRequest (init) {
  23727. // https://fetch.spec.whatwg.org/#requests
  23728. const request = {
  23729. method: 'GET',
  23730. localURLsOnly: false,
  23731. unsafeRequest: false,
  23732. body: null,
  23733. client: null,
  23734. reservedClient: null,
  23735. replacesClientId: '',
  23736. window: 'client',
  23737. keepalive: false,
  23738. serviceWorkers: 'all',
  23739. initiator: '',
  23740. destination: '',
  23741. priority: null,
  23742. origin: 'client',
  23743. policyContainer: 'client',
  23744. referrer: 'client',
  23745. referrerPolicy: '',
  23746. mode: 'no-cors',
  23747. useCORSPreflightFlag: false,
  23748. credentials: 'same-origin',
  23749. useCredentials: false,
  23750. cache: 'default',
  23751. redirect: 'follow',
  23752. integrity: '',
  23753. cryptoGraphicsNonceMetadata: '',
  23754. parserMetadata: '',
  23755. reloadNavigation: false,
  23756. historyNavigation: false,
  23757. userActivation: false,
  23758. taintedOrigin: false,
  23759. redirectCount: 0,
  23760. responseTainting: 'basic',
  23761. preventNoCacheCacheControlHeaderModification: false,
  23762. done: false,
  23763. timingAllowFailed: false,
  23764. ...init,
  23765. headersList: init.headersList
  23766. ? new HeadersList(init.headersList)
  23767. : new HeadersList()
  23768. }
  23769. request.url = request.urlList[0]
  23770. return request
  23771. }
  23772. // https://fetch.spec.whatwg.org/#concept-request-clone
  23773. function cloneRequest (request) {
  23774. // To clone a request request, run these steps:
  23775. // 1. Let newRequest be a copy of request, except for its body.
  23776. const newRequest = makeRequest({ ...request, body: null })
  23777. // 2. If request’s body is non-null, set newRequest’s body to the
  23778. // result of cloning request’s body.
  23779. if (request.body != null) {
  23780. newRequest.body = cloneBody(request.body)
  23781. }
  23782. // 3. Return newRequest.
  23783. return newRequest
  23784. }
  23785. Object.defineProperties(Request.prototype, {
  23786. method: kEnumerableProperty,
  23787. url: kEnumerableProperty,
  23788. headers: kEnumerableProperty,
  23789. redirect: kEnumerableProperty,
  23790. clone: kEnumerableProperty,
  23791. signal: kEnumerableProperty,
  23792. duplex: kEnumerableProperty,
  23793. destination: kEnumerableProperty,
  23794. body: kEnumerableProperty,
  23795. bodyUsed: kEnumerableProperty,
  23796. isHistoryNavigation: kEnumerableProperty,
  23797. isReloadNavigation: kEnumerableProperty,
  23798. keepalive: kEnumerableProperty,
  23799. integrity: kEnumerableProperty,
  23800. cache: kEnumerableProperty,
  23801. credentials: kEnumerableProperty,
  23802. attribute: kEnumerableProperty,
  23803. referrerPolicy: kEnumerableProperty,
  23804. referrer: kEnumerableProperty,
  23805. mode: kEnumerableProperty,
  23806. [Symbol.toStringTag]: {
  23807. value: 'Request',
  23808. configurable: true
  23809. }
  23810. })
  23811. webidl.converters.Request = webidl.interfaceConverter(
  23812. Request
  23813. )
  23814. // https://fetch.spec.whatwg.org/#requestinfo
  23815. webidl.converters.RequestInfo = function (V) {
  23816. if (typeof V === 'string') {
  23817. return webidl.converters.USVString(V)
  23818. }
  23819. if (V instanceof Request) {
  23820. return webidl.converters.Request(V)
  23821. }
  23822. return webidl.converters.USVString(V)
  23823. }
  23824. webidl.converters.AbortSignal = webidl.interfaceConverter(
  23825. AbortSignal
  23826. )
  23827. // https://fetch.spec.whatwg.org/#requestinit
  23828. webidl.converters.RequestInit = webidl.dictionaryConverter([
  23829. {
  23830. key: 'method',
  23831. converter: webidl.converters.ByteString
  23832. },
  23833. {
  23834. key: 'headers',
  23835. converter: webidl.converters.HeadersInit
  23836. },
  23837. {
  23838. key: 'body',
  23839. converter: webidl.nullableConverter(
  23840. webidl.converters.BodyInit
  23841. )
  23842. },
  23843. {
  23844. key: 'referrer',
  23845. converter: webidl.converters.USVString
  23846. },
  23847. {
  23848. key: 'referrerPolicy',
  23849. converter: webidl.converters.DOMString,
  23850. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  23851. allowedValues: referrerPolicy
  23852. },
  23853. {
  23854. key: 'mode',
  23855. converter: webidl.converters.DOMString,
  23856. // https://fetch.spec.whatwg.org/#concept-request-mode
  23857. allowedValues: requestMode
  23858. },
  23859. {
  23860. key: 'credentials',
  23861. converter: webidl.converters.DOMString,
  23862. // https://fetch.spec.whatwg.org/#requestcredentials
  23863. allowedValues: requestCredentials
  23864. },
  23865. {
  23866. key: 'cache',
  23867. converter: webidl.converters.DOMString,
  23868. // https://fetch.spec.whatwg.org/#requestcache
  23869. allowedValues: requestCache
  23870. },
  23871. {
  23872. key: 'redirect',
  23873. converter: webidl.converters.DOMString,
  23874. // https://fetch.spec.whatwg.org/#requestredirect
  23875. allowedValues: requestRedirect
  23876. },
  23877. {
  23878. key: 'integrity',
  23879. converter: webidl.converters.DOMString
  23880. },
  23881. {
  23882. key: 'keepalive',
  23883. converter: webidl.converters.boolean
  23884. },
  23885. {
  23886. key: 'signal',
  23887. converter: webidl.nullableConverter(
  23888. (signal) => webidl.converters.AbortSignal(
  23889. signal,
  23890. { strict: false }
  23891. )
  23892. )
  23893. },
  23894. {
  23895. key: 'window',
  23896. converter: webidl.converters.any
  23897. },
  23898. {
  23899. key: 'duplex',
  23900. converter: webidl.converters.DOMString,
  23901. allowedValues: requestDuplex
  23902. }
  23903. ])
  23904. module.exports = { Request, makeRequest }
  23905. /***/ }),
  23906. /***/ 7823:
  23907. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23908. "use strict";
  23909. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  23910. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  23911. const util = __nccwpck_require__(3983)
  23912. const { kEnumerableProperty } = util
  23913. const {
  23914. isValidReasonPhrase,
  23915. isCancelled,
  23916. isAborted,
  23917. isBlobLike,
  23918. serializeJavascriptValueToJSONString,
  23919. isErrorLike,
  23920. isomorphicEncode
  23921. } = __nccwpck_require__(2538)
  23922. const {
  23923. redirectStatusSet,
  23924. nullBodyStatus,
  23925. DOMException
  23926. } = __nccwpck_require__(1037)
  23927. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  23928. const { webidl } = __nccwpck_require__(1744)
  23929. const { FormData } = __nccwpck_require__(2015)
  23930. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23931. const { URLSerializer } = __nccwpck_require__(685)
  23932. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23933. const assert = __nccwpck_require__(9491)
  23934. const { types } = __nccwpck_require__(3837)
  23935. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  23936. const textEncoder = new TextEncoder('utf-8')
  23937. // https://fetch.spec.whatwg.org/#response-class
  23938. class Response {
  23939. // Creates network error Response.
  23940. static error () {
  23941. // TODO
  23942. const relevantRealm = { settingsObject: {} }
  23943. // The static error() method steps are to return the result of creating a
  23944. // Response object, given a new network error, "immutable", and this’s
  23945. // relevant Realm.
  23946. const responseObject = new Response()
  23947. responseObject[kState] = makeNetworkError()
  23948. responseObject[kRealm] = relevantRealm
  23949. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  23950. responseObject[kHeaders][kGuard] = 'immutable'
  23951. responseObject[kHeaders][kRealm] = relevantRealm
  23952. return responseObject
  23953. }
  23954. // https://fetch.spec.whatwg.org/#dom-response-json
  23955. static json (data, init = {}) {
  23956. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  23957. if (init !== null) {
  23958. init = webidl.converters.ResponseInit(init)
  23959. }
  23960. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  23961. const bytes = textEncoder.encode(
  23962. serializeJavascriptValueToJSONString(data)
  23963. )
  23964. // 2. Let body be the result of extracting bytes.
  23965. const body = extractBody(bytes)
  23966. // 3. Let responseObject be the result of creating a Response object, given a new response,
  23967. // "response", and this’s relevant Realm.
  23968. const relevantRealm = { settingsObject: {} }
  23969. const responseObject = new Response()
  23970. responseObject[kRealm] = relevantRealm
  23971. responseObject[kHeaders][kGuard] = 'response'
  23972. responseObject[kHeaders][kRealm] = relevantRealm
  23973. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  23974. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  23975. // 5. Return responseObject.
  23976. return responseObject
  23977. }
  23978. // Creates a redirect Response that redirects to url with status status.
  23979. static redirect (url, status = 302) {
  23980. const relevantRealm = { settingsObject: {} }
  23981. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  23982. url = webidl.converters.USVString(url)
  23983. status = webidl.converters['unsigned short'](status)
  23984. // 1. Let parsedURL be the result of parsing url with current settings
  23985. // object’s API base URL.
  23986. // 2. If parsedURL is failure, then throw a TypeError.
  23987. // TODO: base-URL?
  23988. let parsedURL
  23989. try {
  23990. parsedURL = new URL(url, getGlobalOrigin())
  23991. } catch (err) {
  23992. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  23993. cause: err
  23994. })
  23995. }
  23996. // 3. If status is not a redirect status, then throw a RangeError.
  23997. if (!redirectStatusSet.has(status)) {
  23998. throw new RangeError('Invalid status code ' + status)
  23999. }
  24000. // 4. Let responseObject be the result of creating a Response object,
  24001. // given a new response, "immutable", and this’s relevant Realm.
  24002. const responseObject = new Response()
  24003. responseObject[kRealm] = relevantRealm
  24004. responseObject[kHeaders][kGuard] = 'immutable'
  24005. responseObject[kHeaders][kRealm] = relevantRealm
  24006. // 5. Set responseObject’s response’s status to status.
  24007. responseObject[kState].status = status
  24008. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24009. const value = isomorphicEncode(URLSerializer(parsedURL))
  24010. // 7. Append `Location`/value to responseObject’s response’s header list.
  24011. responseObject[kState].headersList.append('location', value)
  24012. // 8. Return responseObject.
  24013. return responseObject
  24014. }
  24015. // https://fetch.spec.whatwg.org/#dom-response
  24016. constructor (body = null, init = {}) {
  24017. if (body !== null) {
  24018. body = webidl.converters.BodyInit(body)
  24019. }
  24020. init = webidl.converters.ResponseInit(init)
  24021. // TODO
  24022. this[kRealm] = { settingsObject: {} }
  24023. // 1. Set this’s response to a new response.
  24024. this[kState] = makeResponse({})
  24025. // 2. Set this’s headers to a new Headers object with this’s relevant
  24026. // Realm, whose header list is this’s response’s header list and guard
  24027. // is "response".
  24028. this[kHeaders] = new Headers(kConstruct)
  24029. this[kHeaders][kGuard] = 'response'
  24030. this[kHeaders][kHeadersList] = this[kState].headersList
  24031. this[kHeaders][kRealm] = this[kRealm]
  24032. // 3. Let bodyWithType be null.
  24033. let bodyWithType = null
  24034. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24035. if (body != null) {
  24036. const [extractedBody, type] = extractBody(body)
  24037. bodyWithType = { body: extractedBody, type }
  24038. }
  24039. // 5. Perform initialize a response given this, init, and bodyWithType.
  24040. initializeResponse(this, init, bodyWithType)
  24041. }
  24042. // Returns response’s type, e.g., "cors".
  24043. get type () {
  24044. webidl.brandCheck(this, Response)
  24045. // The type getter steps are to return this’s response’s type.
  24046. return this[kState].type
  24047. }
  24048. // Returns response’s URL, if it has one; otherwise the empty string.
  24049. get url () {
  24050. webidl.brandCheck(this, Response)
  24051. const urlList = this[kState].urlList
  24052. // The url getter steps are to return the empty string if this’s
  24053. // response’s URL is null; otherwise this’s response’s URL,
  24054. // serialized with exclude fragment set to true.
  24055. const url = urlList[urlList.length - 1] ?? null
  24056. if (url === null) {
  24057. return ''
  24058. }
  24059. return URLSerializer(url, true)
  24060. }
  24061. // Returns whether response was obtained through a redirect.
  24062. get redirected () {
  24063. webidl.brandCheck(this, Response)
  24064. // The redirected getter steps are to return true if this’s response’s URL
  24065. // list has more than one item; otherwise false.
  24066. return this[kState].urlList.length > 1
  24067. }
  24068. // Returns response’s status.
  24069. get status () {
  24070. webidl.brandCheck(this, Response)
  24071. // The status getter steps are to return this’s response’s status.
  24072. return this[kState].status
  24073. }
  24074. // Returns whether response’s status is an ok status.
  24075. get ok () {
  24076. webidl.brandCheck(this, Response)
  24077. // The ok getter steps are to return true if this’s response’s status is an
  24078. // ok status; otherwise false.
  24079. return this[kState].status >= 200 && this[kState].status <= 299
  24080. }
  24081. // Returns response’s status message.
  24082. get statusText () {
  24083. webidl.brandCheck(this, Response)
  24084. // The statusText getter steps are to return this’s response’s status
  24085. // message.
  24086. return this[kState].statusText
  24087. }
  24088. // Returns response’s headers as Headers.
  24089. get headers () {
  24090. webidl.brandCheck(this, Response)
  24091. // The headers getter steps are to return this’s headers.
  24092. return this[kHeaders]
  24093. }
  24094. get body () {
  24095. webidl.brandCheck(this, Response)
  24096. return this[kState].body ? this[kState].body.stream : null
  24097. }
  24098. get bodyUsed () {
  24099. webidl.brandCheck(this, Response)
  24100. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24101. }
  24102. // Returns a clone of response.
  24103. clone () {
  24104. webidl.brandCheck(this, Response)
  24105. // 1. If this is unusable, then throw a TypeError.
  24106. if (this.bodyUsed || (this.body && this.body.locked)) {
  24107. throw webidl.errors.exception({
  24108. header: 'Response.clone',
  24109. message: 'Body has already been consumed.'
  24110. })
  24111. }
  24112. // 2. Let clonedResponse be the result of cloning this’s response.
  24113. const clonedResponse = cloneResponse(this[kState])
  24114. // 3. Return the result of creating a Response object, given
  24115. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24116. const clonedResponseObject = new Response()
  24117. clonedResponseObject[kState] = clonedResponse
  24118. clonedResponseObject[kRealm] = this[kRealm]
  24119. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24120. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24121. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24122. return clonedResponseObject
  24123. }
  24124. }
  24125. mixinBody(Response)
  24126. Object.defineProperties(Response.prototype, {
  24127. type: kEnumerableProperty,
  24128. url: kEnumerableProperty,
  24129. status: kEnumerableProperty,
  24130. ok: kEnumerableProperty,
  24131. redirected: kEnumerableProperty,
  24132. statusText: kEnumerableProperty,
  24133. headers: kEnumerableProperty,
  24134. clone: kEnumerableProperty,
  24135. body: kEnumerableProperty,
  24136. bodyUsed: kEnumerableProperty,
  24137. [Symbol.toStringTag]: {
  24138. value: 'Response',
  24139. configurable: true
  24140. }
  24141. })
  24142. Object.defineProperties(Response, {
  24143. json: kEnumerableProperty,
  24144. redirect: kEnumerableProperty,
  24145. error: kEnumerableProperty
  24146. })
  24147. // https://fetch.spec.whatwg.org/#concept-response-clone
  24148. function cloneResponse (response) {
  24149. // To clone a response response, run these steps:
  24150. // 1. If response is a filtered response, then return a new identical
  24151. // filtered response whose internal response is a clone of response’s
  24152. // internal response.
  24153. if (response.internalResponse) {
  24154. return filterResponse(
  24155. cloneResponse(response.internalResponse),
  24156. response.type
  24157. )
  24158. }
  24159. // 2. Let newResponse be a copy of response, except for its body.
  24160. const newResponse = makeResponse({ ...response, body: null })
  24161. // 3. If response’s body is non-null, then set newResponse’s body to the
  24162. // result of cloning response’s body.
  24163. if (response.body != null) {
  24164. newResponse.body = cloneBody(response.body)
  24165. }
  24166. // 4. Return newResponse.
  24167. return newResponse
  24168. }
  24169. function makeResponse (init) {
  24170. return {
  24171. aborted: false,
  24172. rangeRequested: false,
  24173. timingAllowPassed: false,
  24174. requestIncludesCredentials: false,
  24175. type: 'default',
  24176. status: 200,
  24177. timingInfo: null,
  24178. cacheState: '',
  24179. statusText: '',
  24180. ...init,
  24181. headersList: init.headersList
  24182. ? new HeadersList(init.headersList)
  24183. : new HeadersList(),
  24184. urlList: init.urlList ? [...init.urlList] : []
  24185. }
  24186. }
  24187. function makeNetworkError (reason) {
  24188. const isError = isErrorLike(reason)
  24189. return makeResponse({
  24190. type: 'error',
  24191. status: 0,
  24192. error: isError
  24193. ? reason
  24194. : new Error(reason ? String(reason) : reason),
  24195. aborted: reason && reason.name === 'AbortError'
  24196. })
  24197. }
  24198. function makeFilteredResponse (response, state) {
  24199. state = {
  24200. internalResponse: response,
  24201. ...state
  24202. }
  24203. return new Proxy(response, {
  24204. get (target, p) {
  24205. return p in state ? state[p] : target[p]
  24206. },
  24207. set (target, p, value) {
  24208. assert(!(p in state))
  24209. target[p] = value
  24210. return true
  24211. }
  24212. })
  24213. }
  24214. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24215. function filterResponse (response, type) {
  24216. // Set response to the following filtered response with response as its
  24217. // internal response, depending on request’s response tainting:
  24218. if (type === 'basic') {
  24219. // A basic filtered response is a filtered response whose type is "basic"
  24220. // and header list excludes any headers in internal response’s header list
  24221. // whose name is a forbidden response-header name.
  24222. // Note: undici does not implement forbidden response-header names
  24223. return makeFilteredResponse(response, {
  24224. type: 'basic',
  24225. headersList: response.headersList
  24226. })
  24227. } else if (type === 'cors') {
  24228. // A CORS filtered response is a filtered response whose type is "cors"
  24229. // and header list excludes any headers in internal response’s header
  24230. // list whose name is not a CORS-safelisted response-header name, given
  24231. // internal response’s CORS-exposed header-name list.
  24232. // Note: undici does not implement CORS-safelisted response-header names
  24233. return makeFilteredResponse(response, {
  24234. type: 'cors',
  24235. headersList: response.headersList
  24236. })
  24237. } else if (type === 'opaque') {
  24238. // An opaque filtered response is a filtered response whose type is
  24239. // "opaque", URL list is the empty list, status is 0, status message
  24240. // is the empty byte sequence, header list is empty, and body is null.
  24241. return makeFilteredResponse(response, {
  24242. type: 'opaque',
  24243. urlList: Object.freeze([]),
  24244. status: 0,
  24245. statusText: '',
  24246. body: null
  24247. })
  24248. } else if (type === 'opaqueredirect') {
  24249. // An opaque-redirect filtered response is a filtered response whose type
  24250. // is "opaqueredirect", status is 0, status message is the empty byte
  24251. // sequence, header list is empty, and body is null.
  24252. return makeFilteredResponse(response, {
  24253. type: 'opaqueredirect',
  24254. status: 0,
  24255. statusText: '',
  24256. headersList: [],
  24257. body: null
  24258. })
  24259. } else {
  24260. assert(false)
  24261. }
  24262. }
  24263. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24264. function makeAppropriateNetworkError (fetchParams, err = null) {
  24265. // 1. Assert: fetchParams is canceled.
  24266. assert(isCancelled(fetchParams))
  24267. // 2. Return an aborted network error if fetchParams is aborted;
  24268. // otherwise return a network error.
  24269. return isAborted(fetchParams)
  24270. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24271. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24272. }
  24273. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24274. function initializeResponse (response, init, body) {
  24275. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24276. // throw a RangeError.
  24277. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24278. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24279. }
  24280. // 2. If init["statusText"] does not match the reason-phrase token production,
  24281. // then throw a TypeError.
  24282. if ('statusText' in init && init.statusText != null) {
  24283. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24284. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24285. if (!isValidReasonPhrase(String(init.statusText))) {
  24286. throw new TypeError('Invalid statusText')
  24287. }
  24288. }
  24289. // 3. Set response’s response’s status to init["status"].
  24290. if ('status' in init && init.status != null) {
  24291. response[kState].status = init.status
  24292. }
  24293. // 4. Set response’s response’s status message to init["statusText"].
  24294. if ('statusText' in init && init.statusText != null) {
  24295. response[kState].statusText = init.statusText
  24296. }
  24297. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24298. if ('headers' in init && init.headers != null) {
  24299. fill(response[kHeaders], init.headers)
  24300. }
  24301. // 6. If body was given, then:
  24302. if (body) {
  24303. // 1. If response's status is a null body status, then throw a TypeError.
  24304. if (nullBodyStatus.includes(response.status)) {
  24305. throw webidl.errors.exception({
  24306. header: 'Response constructor',
  24307. message: 'Invalid response status code ' + response.status
  24308. })
  24309. }
  24310. // 2. Set response's body to body's body.
  24311. response[kState].body = body.body
  24312. // 3. If body's type is non-null and response's header list does not contain
  24313. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24314. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24315. response[kState].headersList.append('content-type', body.type)
  24316. }
  24317. }
  24318. }
  24319. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24320. ReadableStream
  24321. )
  24322. webidl.converters.FormData = webidl.interfaceConverter(
  24323. FormData
  24324. )
  24325. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24326. URLSearchParams
  24327. )
  24328. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24329. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24330. if (typeof V === 'string') {
  24331. return webidl.converters.USVString(V)
  24332. }
  24333. if (isBlobLike(V)) {
  24334. return webidl.converters.Blob(V, { strict: false })
  24335. }
  24336. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24337. return webidl.converters.BufferSource(V)
  24338. }
  24339. if (util.isFormDataLike(V)) {
  24340. return webidl.converters.FormData(V, { strict: false })
  24341. }
  24342. if (V instanceof URLSearchParams) {
  24343. return webidl.converters.URLSearchParams(V)
  24344. }
  24345. return webidl.converters.DOMString(V)
  24346. }
  24347. // https://fetch.spec.whatwg.org/#bodyinit
  24348. webidl.converters.BodyInit = function (V) {
  24349. if (V instanceof ReadableStream) {
  24350. return webidl.converters.ReadableStream(V)
  24351. }
  24352. // Note: the spec doesn't include async iterables,
  24353. // this is an undici extension.
  24354. if (V?.[Symbol.asyncIterator]) {
  24355. return V
  24356. }
  24357. return webidl.converters.XMLHttpRequestBodyInit(V)
  24358. }
  24359. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24360. {
  24361. key: 'status',
  24362. converter: webidl.converters['unsigned short'],
  24363. defaultValue: 200
  24364. },
  24365. {
  24366. key: 'statusText',
  24367. converter: webidl.converters.ByteString,
  24368. defaultValue: ''
  24369. },
  24370. {
  24371. key: 'headers',
  24372. converter: webidl.converters.HeadersInit
  24373. }
  24374. ])
  24375. module.exports = {
  24376. makeNetworkError,
  24377. makeResponse,
  24378. makeAppropriateNetworkError,
  24379. filterResponse,
  24380. Response,
  24381. cloneResponse
  24382. }
  24383. /***/ }),
  24384. /***/ 5861:
  24385. /***/ ((module) => {
  24386. "use strict";
  24387. module.exports = {
  24388. kUrl: Symbol('url'),
  24389. kHeaders: Symbol('headers'),
  24390. kSignal: Symbol('signal'),
  24391. kState: Symbol('state'),
  24392. kGuard: Symbol('guard'),
  24393. kRealm: Symbol('realm')
  24394. }
  24395. /***/ }),
  24396. /***/ 2538:
  24397. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24398. "use strict";
  24399. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24400. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24401. const { performance } = __nccwpck_require__(4074)
  24402. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24403. const assert = __nccwpck_require__(9491)
  24404. const { isUint8Array } = __nccwpck_require__(9830)
  24405. let supportedHashes = []
  24406. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24407. /** @type {import('crypto')|undefined} */
  24408. let crypto
  24409. try {
  24410. crypto = __nccwpck_require__(6113)
  24411. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24412. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24413. /* c8 ignore next 3 */
  24414. } catch {
  24415. }
  24416. function responseURL (response) {
  24417. // https://fetch.spec.whatwg.org/#responses
  24418. // A response has an associated URL. It is a pointer to the last URL
  24419. // in response’s URL list and null if response’s URL list is empty.
  24420. const urlList = response.urlList
  24421. const length = urlList.length
  24422. return length === 0 ? null : urlList[length - 1].toString()
  24423. }
  24424. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24425. function responseLocationURL (response, requestFragment) {
  24426. // 1. If response’s status is not a redirect status, then return null.
  24427. if (!redirectStatusSet.has(response.status)) {
  24428. return null
  24429. }
  24430. // 2. Let location be the result of extracting header list values given
  24431. // `Location` and response’s header list.
  24432. let location = response.headersList.get('location')
  24433. // 3. If location is a header value, then set location to the result of
  24434. // parsing location with response’s URL.
  24435. if (location !== null && isValidHeaderValue(location)) {
  24436. location = new URL(location, responseURL(response))
  24437. }
  24438. // 4. If location is a URL whose fragment is null, then set location’s
  24439. // fragment to requestFragment.
  24440. if (location && !location.hash) {
  24441. location.hash = requestFragment
  24442. }
  24443. // 5. Return location.
  24444. return location
  24445. }
  24446. /** @returns {URL} */
  24447. function requestCurrentURL (request) {
  24448. return request.urlList[request.urlList.length - 1]
  24449. }
  24450. function requestBadPort (request) {
  24451. // 1. Let url be request’s current URL.
  24452. const url = requestCurrentURL(request)
  24453. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24454. // then return blocked.
  24455. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24456. return 'blocked'
  24457. }
  24458. // 3. Return allowed.
  24459. return 'allowed'
  24460. }
  24461. function isErrorLike (object) {
  24462. return object instanceof Error || (
  24463. object?.constructor?.name === 'Error' ||
  24464. object?.constructor?.name === 'DOMException'
  24465. )
  24466. }
  24467. // Check whether |statusText| is a ByteString and
  24468. // matches the Reason-Phrase token production.
  24469. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24470. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24471. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24472. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24473. function isValidReasonPhrase (statusText) {
  24474. for (let i = 0; i < statusText.length; ++i) {
  24475. const c = statusText.charCodeAt(i)
  24476. if (
  24477. !(
  24478. (
  24479. c === 0x09 || // HTAB
  24480. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24481. (c >= 0x80 && c <= 0xff)
  24482. ) // obs-text
  24483. )
  24484. ) {
  24485. return false
  24486. }
  24487. }
  24488. return true
  24489. }
  24490. /**
  24491. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24492. * @param {number} c
  24493. */
  24494. function isTokenCharCode (c) {
  24495. switch (c) {
  24496. case 0x22:
  24497. case 0x28:
  24498. case 0x29:
  24499. case 0x2c:
  24500. case 0x2f:
  24501. case 0x3a:
  24502. case 0x3b:
  24503. case 0x3c:
  24504. case 0x3d:
  24505. case 0x3e:
  24506. case 0x3f:
  24507. case 0x40:
  24508. case 0x5b:
  24509. case 0x5c:
  24510. case 0x5d:
  24511. case 0x7b:
  24512. case 0x7d:
  24513. // DQUOTE and "(),/:;<=>?@[\]{}"
  24514. return false
  24515. default:
  24516. // VCHAR %x21-7E
  24517. return c >= 0x21 && c <= 0x7e
  24518. }
  24519. }
  24520. /**
  24521. * @param {string} characters
  24522. */
  24523. function isValidHTTPToken (characters) {
  24524. if (characters.length === 0) {
  24525. return false
  24526. }
  24527. for (let i = 0; i < characters.length; ++i) {
  24528. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24529. return false
  24530. }
  24531. }
  24532. return true
  24533. }
  24534. /**
  24535. * @see https://fetch.spec.whatwg.org/#header-name
  24536. * @param {string} potentialValue
  24537. */
  24538. function isValidHeaderName (potentialValue) {
  24539. return isValidHTTPToken(potentialValue)
  24540. }
  24541. /**
  24542. * @see https://fetch.spec.whatwg.org/#header-value
  24543. * @param {string} potentialValue
  24544. */
  24545. function isValidHeaderValue (potentialValue) {
  24546. // - Has no leading or trailing HTTP tab or space bytes.
  24547. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24548. if (
  24549. potentialValue.startsWith('\t') ||
  24550. potentialValue.startsWith(' ') ||
  24551. potentialValue.endsWith('\t') ||
  24552. potentialValue.endsWith(' ')
  24553. ) {
  24554. return false
  24555. }
  24556. if (
  24557. potentialValue.includes('\0') ||
  24558. potentialValue.includes('\r') ||
  24559. potentialValue.includes('\n')
  24560. ) {
  24561. return false
  24562. }
  24563. return true
  24564. }
  24565. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24566. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24567. // Given a request request and a response actualResponse, this algorithm
  24568. // updates request’s referrer policy according to the Referrer-Policy
  24569. // header (if any) in actualResponse.
  24570. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24571. // from a Referrer-Policy header on actualResponse.
  24572. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24573. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24574. const { headersList } = actualResponse
  24575. // 2. Let policy be the empty string.
  24576. // 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.
  24577. // 4. Return policy.
  24578. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24579. // Note: As the referrer-policy can contain multiple policies
  24580. // separated by comma, we need to loop through all of them
  24581. // and pick the first valid one.
  24582. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24583. let policy = ''
  24584. if (policyHeader.length > 0) {
  24585. // The right-most policy takes precedence.
  24586. // The left-most policy is the fallback.
  24587. for (let i = policyHeader.length; i !== 0; i--) {
  24588. const token = policyHeader[i - 1].trim()
  24589. if (referrerPolicyTokens.has(token)) {
  24590. policy = token
  24591. break
  24592. }
  24593. }
  24594. }
  24595. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24596. if (policy !== '') {
  24597. request.referrerPolicy = policy
  24598. }
  24599. }
  24600. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24601. function crossOriginResourcePolicyCheck () {
  24602. // TODO
  24603. return 'allowed'
  24604. }
  24605. // https://fetch.spec.whatwg.org/#concept-cors-check
  24606. function corsCheck () {
  24607. // TODO
  24608. return 'success'
  24609. }
  24610. // https://fetch.spec.whatwg.org/#concept-tao-check
  24611. function TAOCheck () {
  24612. // TODO
  24613. return 'success'
  24614. }
  24615. function appendFetchMetadata (httpRequest) {
  24616. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24617. // TODO
  24618. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24619. // 1. Assert: r’s url is a potentially trustworthy URL.
  24620. // TODO
  24621. // 2. Let header be a Structured Header whose value is a token.
  24622. let header = null
  24623. // 3. Set header’s value to r’s mode.
  24624. header = httpRequest.mode
  24625. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24626. httpRequest.headersList.set('sec-fetch-mode', header)
  24627. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24628. // TODO
  24629. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24630. // TODO
  24631. }
  24632. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24633. function appendRequestOriginHeader (request) {
  24634. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24635. let serializedOrigin = request.origin
  24636. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24637. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24638. if (serializedOrigin) {
  24639. request.headersList.append('origin', serializedOrigin)
  24640. }
  24641. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24642. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24643. // 1. Switch on request’s referrer policy:
  24644. switch (request.referrerPolicy) {
  24645. case 'no-referrer':
  24646. // Set serializedOrigin to `null`.
  24647. serializedOrigin = null
  24648. break
  24649. case 'no-referrer-when-downgrade':
  24650. case 'strict-origin':
  24651. case 'strict-origin-when-cross-origin':
  24652. // 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`.
  24653. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24654. serializedOrigin = null
  24655. }
  24656. break
  24657. case 'same-origin':
  24658. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24659. if (!sameOrigin(request, requestCurrentURL(request))) {
  24660. serializedOrigin = null
  24661. }
  24662. break
  24663. default:
  24664. // Do nothing.
  24665. }
  24666. if (serializedOrigin) {
  24667. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24668. request.headersList.append('origin', serializedOrigin)
  24669. }
  24670. }
  24671. }
  24672. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24673. // TODO
  24674. return performance.now()
  24675. }
  24676. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24677. function createOpaqueTimingInfo (timingInfo) {
  24678. return {
  24679. startTime: timingInfo.startTime ?? 0,
  24680. redirectStartTime: 0,
  24681. redirectEndTime: 0,
  24682. postRedirectStartTime: timingInfo.startTime ?? 0,
  24683. finalServiceWorkerStartTime: 0,
  24684. finalNetworkResponseStartTime: 0,
  24685. finalNetworkRequestStartTime: 0,
  24686. endTime: 0,
  24687. encodedBodySize: 0,
  24688. decodedBodySize: 0,
  24689. finalConnectionTimingInfo: null
  24690. }
  24691. }
  24692. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24693. function makePolicyContainer () {
  24694. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24695. return {
  24696. referrerPolicy: 'strict-origin-when-cross-origin'
  24697. }
  24698. }
  24699. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24700. function clonePolicyContainer (policyContainer) {
  24701. return {
  24702. referrerPolicy: policyContainer.referrerPolicy
  24703. }
  24704. }
  24705. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24706. function determineRequestsReferrer (request) {
  24707. // 1. Let policy be request's referrer policy.
  24708. const policy = request.referrerPolicy
  24709. // Note: policy cannot (shouldn't) be null or an empty string.
  24710. assert(policy)
  24711. // 2. Let environment be request’s client.
  24712. let referrerSource = null
  24713. // 3. Switch on request’s referrer:
  24714. if (request.referrer === 'client') {
  24715. // Note: node isn't a browser and doesn't implement document/iframes,
  24716. // so we bypass this step and replace it with our own.
  24717. const globalOrigin = getGlobalOrigin()
  24718. if (!globalOrigin || globalOrigin.origin === 'null') {
  24719. return 'no-referrer'
  24720. }
  24721. // note: we need to clone it as it's mutated
  24722. referrerSource = new URL(globalOrigin)
  24723. } else if (request.referrer instanceof URL) {
  24724. // Let referrerSource be request’s referrer.
  24725. referrerSource = request.referrer
  24726. }
  24727. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24728. // use as a referrer.
  24729. let referrerURL = stripURLForReferrer(referrerSource)
  24730. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  24731. // a referrer, with the origin-only flag set to true.
  24732. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  24733. // 6. If the result of serializing referrerURL is a string whose length is
  24734. // greater than 4096, set referrerURL to referrerOrigin.
  24735. if (referrerURL.toString().length > 4096) {
  24736. referrerURL = referrerOrigin
  24737. }
  24738. const areSameOrigin = sameOrigin(request, referrerURL)
  24739. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  24740. !isURLPotentiallyTrustworthy(request.url)
  24741. // 8. Execute the switch statements corresponding to the value of policy:
  24742. switch (policy) {
  24743. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  24744. case 'unsafe-url': return referrerURL
  24745. case 'same-origin':
  24746. return areSameOrigin ? referrerOrigin : 'no-referrer'
  24747. case 'origin-when-cross-origin':
  24748. return areSameOrigin ? referrerURL : referrerOrigin
  24749. case 'strict-origin-when-cross-origin': {
  24750. const currentURL = requestCurrentURL(request)
  24751. // 1. If the origin of referrerURL and the origin of request’s current
  24752. // URL are the same, then return referrerURL.
  24753. if (sameOrigin(referrerURL, currentURL)) {
  24754. return referrerURL
  24755. }
  24756. // 2. If referrerURL is a potentially trustworthy URL and request’s
  24757. // current URL is not a potentially trustworthy URL, then return no
  24758. // referrer.
  24759. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  24760. return 'no-referrer'
  24761. }
  24762. // 3. Return referrerOrigin.
  24763. return referrerOrigin
  24764. }
  24765. case 'strict-origin': // eslint-disable-line
  24766. /**
  24767. * 1. If referrerURL is a potentially trustworthy URL and
  24768. * request’s current URL is not a potentially trustworthy URL,
  24769. * then return no referrer.
  24770. * 2. Return referrerOrigin
  24771. */
  24772. case 'no-referrer-when-downgrade': // eslint-disable-line
  24773. /**
  24774. * 1. If referrerURL is a potentially trustworthy URL and
  24775. * request’s current URL is not a potentially trustworthy URL,
  24776. * then return no referrer.
  24777. * 2. Return referrerOrigin
  24778. */
  24779. default: // eslint-disable-line
  24780. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  24781. }
  24782. }
  24783. /**
  24784. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  24785. * @param {URL} url
  24786. * @param {boolean|undefined} originOnly
  24787. */
  24788. function stripURLForReferrer (url, originOnly) {
  24789. // 1. Assert: url is a URL.
  24790. assert(url instanceof URL)
  24791. // 2. If url’s scheme is a local scheme, then return no referrer.
  24792. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  24793. return 'no-referrer'
  24794. }
  24795. // 3. Set url’s username to the empty string.
  24796. url.username = ''
  24797. // 4. Set url’s password to the empty string.
  24798. url.password = ''
  24799. // 5. Set url’s fragment to null.
  24800. url.hash = ''
  24801. // 6. If the origin-only flag is true, then:
  24802. if (originOnly) {
  24803. // 1. Set url’s path to « the empty string ».
  24804. url.pathname = ''
  24805. // 2. Set url’s query to null.
  24806. url.search = ''
  24807. }
  24808. // 7. Return url.
  24809. return url
  24810. }
  24811. function isURLPotentiallyTrustworthy (url) {
  24812. if (!(url instanceof URL)) {
  24813. return false
  24814. }
  24815. // If child of about, return true
  24816. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  24817. return true
  24818. }
  24819. // If scheme is data, return true
  24820. if (url.protocol === 'data:') return true
  24821. // If file, return true
  24822. if (url.protocol === 'file:') return true
  24823. return isOriginPotentiallyTrustworthy(url.origin)
  24824. function isOriginPotentiallyTrustworthy (origin) {
  24825. // If origin is explicitly null, return false
  24826. if (origin == null || origin === 'null') return false
  24827. const originAsURL = new URL(origin)
  24828. // If secure, return true
  24829. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  24830. return true
  24831. }
  24832. // If localhost or variants, return true
  24833. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  24834. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  24835. (originAsURL.hostname.endsWith('.localhost'))) {
  24836. return true
  24837. }
  24838. // If any other, return false
  24839. return false
  24840. }
  24841. }
  24842. /**
  24843. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  24844. * @param {Uint8Array} bytes
  24845. * @param {string} metadataList
  24846. */
  24847. function bytesMatch (bytes, metadataList) {
  24848. // If node is not built with OpenSSL support, we cannot check
  24849. // a request's integrity, so allow it by default (the spec will
  24850. // allow requests if an invalid hash is given, as precedence).
  24851. /* istanbul ignore if: only if node is built with --without-ssl */
  24852. if (crypto === undefined) {
  24853. return true
  24854. }
  24855. // 1. Let parsedMetadata be the result of parsing metadataList.
  24856. const parsedMetadata = parseMetadata(metadataList)
  24857. // 2. If parsedMetadata is no metadata, return true.
  24858. if (parsedMetadata === 'no metadata') {
  24859. return true
  24860. }
  24861. // 3. If response is not eligible for integrity validation, return false.
  24862. // TODO
  24863. // 4. If parsedMetadata is the empty set, return true.
  24864. if (parsedMetadata.length === 0) {
  24865. return true
  24866. }
  24867. // 5. Let metadata be the result of getting the strongest
  24868. // metadata from parsedMetadata.
  24869. const strongest = getStrongestMetadata(parsedMetadata)
  24870. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  24871. // 6. For each item in metadata:
  24872. for (const item of metadata) {
  24873. // 1. Let algorithm be the alg component of item.
  24874. const algorithm = item.algo
  24875. // 2. Let expectedValue be the val component of item.
  24876. const expectedValue = item.hash
  24877. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  24878. // "be liberal with padding". This is annoying, and it's not even in the spec.
  24879. // 3. Let actualValue be the result of applying algorithm to bytes.
  24880. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  24881. if (actualValue[actualValue.length - 1] === '=') {
  24882. if (actualValue[actualValue.length - 2] === '=') {
  24883. actualValue = actualValue.slice(0, -2)
  24884. } else {
  24885. actualValue = actualValue.slice(0, -1)
  24886. }
  24887. }
  24888. // 4. If actualValue is a case-sensitive match for expectedValue,
  24889. // return true.
  24890. if (compareBase64Mixed(actualValue, expectedValue)) {
  24891. return true
  24892. }
  24893. }
  24894. // 7. Return false.
  24895. return false
  24896. }
  24897. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  24898. // https://www.w3.org/TR/CSP2/#source-list-syntax
  24899. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  24900. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  24901. /**
  24902. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  24903. * @param {string} metadata
  24904. */
  24905. function parseMetadata (metadata) {
  24906. // 1. Let result be the empty set.
  24907. /** @type {{ algo: string, hash: string }[]} */
  24908. const result = []
  24909. // 2. Let empty be equal to true.
  24910. let empty = true
  24911. // 3. For each token returned by splitting metadata on spaces:
  24912. for (const token of metadata.split(' ')) {
  24913. // 1. Set empty to false.
  24914. empty = false
  24915. // 2. Parse token as a hash-with-options.
  24916. const parsedToken = parseHashWithOptions.exec(token)
  24917. // 3. If token does not parse, continue to the next token.
  24918. if (
  24919. parsedToken === null ||
  24920. parsedToken.groups === undefined ||
  24921. parsedToken.groups.algo === undefined
  24922. ) {
  24923. // Note: Chromium blocks the request at this point, but Firefox
  24924. // gives a warning that an invalid integrity was given. The
  24925. // correct behavior is to ignore these, and subsequently not
  24926. // check the integrity of the resource.
  24927. continue
  24928. }
  24929. // 4. Let algorithm be the hash-algo component of token.
  24930. const algorithm = parsedToken.groups.algo.toLowerCase()
  24931. // 5. If algorithm is a hash function recognized by the user
  24932. // agent, add the parsed token to result.
  24933. if (supportedHashes.includes(algorithm)) {
  24934. result.push(parsedToken.groups)
  24935. }
  24936. }
  24937. // 4. Return no metadata if empty is true, otherwise return result.
  24938. if (empty === true) {
  24939. return 'no metadata'
  24940. }
  24941. return result
  24942. }
  24943. /**
  24944. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  24945. */
  24946. function getStrongestMetadata (metadataList) {
  24947. // Let algorithm be the algo component of the first item in metadataList.
  24948. // Can be sha256
  24949. let algorithm = metadataList[0].algo
  24950. // If the algorithm is sha512, then it is the strongest
  24951. // and we can return immediately
  24952. if (algorithm[3] === '5') {
  24953. return algorithm
  24954. }
  24955. for (let i = 1; i < metadataList.length; ++i) {
  24956. const metadata = metadataList[i]
  24957. // If the algorithm is sha512, then it is the strongest
  24958. // and we can break the loop immediately
  24959. if (metadata.algo[3] === '5') {
  24960. algorithm = 'sha512'
  24961. break
  24962. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  24963. } else if (algorithm[3] === '3') {
  24964. continue
  24965. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  24966. // the strongest
  24967. } else if (metadata.algo[3] === '3') {
  24968. algorithm = 'sha384'
  24969. }
  24970. }
  24971. return algorithm
  24972. }
  24973. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  24974. if (metadataList.length === 1) {
  24975. return metadataList
  24976. }
  24977. let pos = 0
  24978. for (let i = 0; i < metadataList.length; ++i) {
  24979. if (metadataList[i].algo === algorithm) {
  24980. metadataList[pos++] = metadataList[i]
  24981. }
  24982. }
  24983. metadataList.length = pos
  24984. return metadataList
  24985. }
  24986. /**
  24987. * Compares two base64 strings, allowing for base64url
  24988. * in the second string.
  24989. *
  24990. * @param {string} actualValue always base64
  24991. * @param {string} expectedValue base64 or base64url
  24992. * @returns {boolean}
  24993. */
  24994. function compareBase64Mixed (actualValue, expectedValue) {
  24995. if (actualValue.length !== expectedValue.length) {
  24996. return false
  24997. }
  24998. for (let i = 0; i < actualValue.length; ++i) {
  24999. if (actualValue[i] !== expectedValue[i]) {
  25000. if (
  25001. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25002. (actualValue[i] === '/' && expectedValue[i] === '_')
  25003. ) {
  25004. continue
  25005. }
  25006. return false
  25007. }
  25008. }
  25009. return true
  25010. }
  25011. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25012. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25013. // TODO
  25014. }
  25015. /**
  25016. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25017. * @param {URL} A
  25018. * @param {URL} B
  25019. */
  25020. function sameOrigin (A, B) {
  25021. // 1. If A and B are the same opaque origin, then return true.
  25022. if (A.origin === B.origin && A.origin === 'null') {
  25023. return true
  25024. }
  25025. // 2. If A and B are both tuple origins and their schemes,
  25026. // hosts, and port are identical, then return true.
  25027. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25028. return true
  25029. }
  25030. // 3. Return false.
  25031. return false
  25032. }
  25033. function createDeferredPromise () {
  25034. let res
  25035. let rej
  25036. const promise = new Promise((resolve, reject) => {
  25037. res = resolve
  25038. rej = reject
  25039. })
  25040. return { promise, resolve: res, reject: rej }
  25041. }
  25042. function isAborted (fetchParams) {
  25043. return fetchParams.controller.state === 'aborted'
  25044. }
  25045. function isCancelled (fetchParams) {
  25046. return fetchParams.controller.state === 'aborted' ||
  25047. fetchParams.controller.state === 'terminated'
  25048. }
  25049. const normalizeMethodRecord = {
  25050. delete: 'DELETE',
  25051. DELETE: 'DELETE',
  25052. get: 'GET',
  25053. GET: 'GET',
  25054. head: 'HEAD',
  25055. HEAD: 'HEAD',
  25056. options: 'OPTIONS',
  25057. OPTIONS: 'OPTIONS',
  25058. post: 'POST',
  25059. POST: 'POST',
  25060. put: 'PUT',
  25061. PUT: 'PUT'
  25062. }
  25063. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25064. Object.setPrototypeOf(normalizeMethodRecord, null)
  25065. /**
  25066. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25067. * @param {string} method
  25068. */
  25069. function normalizeMethod (method) {
  25070. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25071. }
  25072. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25073. function serializeJavascriptValueToJSONString (value) {
  25074. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25075. const result = JSON.stringify(value)
  25076. // 2. If result is undefined, then throw a TypeError.
  25077. if (result === undefined) {
  25078. throw new TypeError('Value is not JSON serializable')
  25079. }
  25080. // 3. Assert: result is a string.
  25081. assert(typeof result === 'string')
  25082. // 4. Return result.
  25083. return result
  25084. }
  25085. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25086. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25087. /**
  25088. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25089. * @param {() => unknown[]} iterator
  25090. * @param {string} name name of the instance
  25091. * @param {'key'|'value'|'key+value'} kind
  25092. */
  25093. function makeIterator (iterator, name, kind) {
  25094. const object = {
  25095. index: 0,
  25096. kind,
  25097. target: iterator
  25098. }
  25099. const i = {
  25100. next () {
  25101. // 1. Let interface be the interface for which the iterator prototype object exists.
  25102. // 2. Let thisValue be the this value.
  25103. // 3. Let object be ? ToObject(thisValue).
  25104. // 4. If object is a platform object, then perform a security
  25105. // check, passing:
  25106. // 5. If object is not a default iterator object for interface,
  25107. // then throw a TypeError.
  25108. if (Object.getPrototypeOf(this) !== i) {
  25109. throw new TypeError(
  25110. `'next' called on an object that does not implement interface ${name} Iterator.`
  25111. )
  25112. }
  25113. // 6. Let index be object’s index.
  25114. // 7. Let kind be object’s kind.
  25115. // 8. Let values be object’s target's value pairs to iterate over.
  25116. const { index, kind, target } = object
  25117. const values = target()
  25118. // 9. Let len be the length of values.
  25119. const len = values.length
  25120. // 10. If index is greater than or equal to len, then return
  25121. // CreateIterResultObject(undefined, true).
  25122. if (index >= len) {
  25123. return { value: undefined, done: true }
  25124. }
  25125. // 11. Let pair be the entry in values at index index.
  25126. const pair = values[index]
  25127. // 12. Set object’s index to index + 1.
  25128. object.index = index + 1
  25129. // 13. Return the iterator result for pair and kind.
  25130. return iteratorResult(pair, kind)
  25131. },
  25132. // The class string of an iterator prototype object for a given interface is the
  25133. // result of concatenating the identifier of the interface and the string " Iterator".
  25134. [Symbol.toStringTag]: `${name} Iterator`
  25135. }
  25136. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25137. Object.setPrototypeOf(i, esIteratorPrototype)
  25138. // esIteratorPrototype needs to be the prototype of i
  25139. // which is the prototype of an empty object. Yes, it's confusing.
  25140. return Object.setPrototypeOf({}, i)
  25141. }
  25142. // https://webidl.spec.whatwg.org/#iterator-result
  25143. function iteratorResult (pair, kind) {
  25144. let result
  25145. // 1. Let result be a value determined by the value of kind:
  25146. switch (kind) {
  25147. case 'key': {
  25148. // 1. Let idlKey be pair’s key.
  25149. // 2. Let key be the result of converting idlKey to an
  25150. // ECMAScript value.
  25151. // 3. result is key.
  25152. result = pair[0]
  25153. break
  25154. }
  25155. case 'value': {
  25156. // 1. Let idlValue be pair’s value.
  25157. // 2. Let value be the result of converting idlValue to
  25158. // an ECMAScript value.
  25159. // 3. result is value.
  25160. result = pair[1]
  25161. break
  25162. }
  25163. case 'key+value': {
  25164. // 1. Let idlKey be pair’s key.
  25165. // 2. Let idlValue be pair’s value.
  25166. // 3. Let key be the result of converting idlKey to an
  25167. // ECMAScript value.
  25168. // 4. Let value be the result of converting idlValue to
  25169. // an ECMAScript value.
  25170. // 5. Let array be ! ArrayCreate(2).
  25171. // 6. Call ! CreateDataProperty(array, "0", key).
  25172. // 7. Call ! CreateDataProperty(array, "1", value).
  25173. // 8. result is array.
  25174. result = pair
  25175. break
  25176. }
  25177. }
  25178. // 2. Return CreateIterResultObject(result, false).
  25179. return { value: result, done: false }
  25180. }
  25181. /**
  25182. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25183. */
  25184. async function fullyReadBody (body, processBody, processBodyError) {
  25185. // 1. If taskDestination is null, then set taskDestination to
  25186. // the result of starting a new parallel queue.
  25187. // 2. Let successSteps given a byte sequence bytes be to queue a
  25188. // fetch task to run processBody given bytes, with taskDestination.
  25189. const successSteps = processBody
  25190. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25191. // with taskDestination.
  25192. const errorSteps = processBodyError
  25193. // 4. Let reader be the result of getting a reader for body’s stream.
  25194. // If that threw an exception, then run errorSteps with that
  25195. // exception and return.
  25196. let reader
  25197. try {
  25198. reader = body.stream.getReader()
  25199. } catch (e) {
  25200. errorSteps(e)
  25201. return
  25202. }
  25203. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25204. try {
  25205. const result = await readAllBytes(reader)
  25206. successSteps(result)
  25207. } catch (e) {
  25208. errorSteps(e)
  25209. }
  25210. }
  25211. /** @type {ReadableStream} */
  25212. let ReadableStream = globalThis.ReadableStream
  25213. function isReadableStreamLike (stream) {
  25214. if (!ReadableStream) {
  25215. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25216. }
  25217. return stream instanceof ReadableStream || (
  25218. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25219. typeof stream.tee === 'function'
  25220. )
  25221. }
  25222. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25223. /**
  25224. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25225. * @param {number[]|Uint8Array} input
  25226. */
  25227. function isomorphicDecode (input) {
  25228. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25229. // length is equal to input’s length and whose code points have the same values
  25230. // as the values of input’s bytes, in the same order.
  25231. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25232. return String.fromCharCode(...input)
  25233. }
  25234. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25235. }
  25236. /**
  25237. * @param {ReadableStreamController<Uint8Array>} controller
  25238. */
  25239. function readableStreamClose (controller) {
  25240. try {
  25241. controller.close()
  25242. } catch (err) {
  25243. // TODO: add comment explaining why this error occurs.
  25244. if (!err.message.includes('Controller is already closed')) {
  25245. throw err
  25246. }
  25247. }
  25248. }
  25249. /**
  25250. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25251. * @param {string} input
  25252. */
  25253. function isomorphicEncode (input) {
  25254. // 1. Assert: input contains no code points greater than U+00FF.
  25255. for (let i = 0; i < input.length; i++) {
  25256. assert(input.charCodeAt(i) <= 0xFF)
  25257. }
  25258. // 2. Return a byte sequence whose length is equal to input’s code
  25259. // point length and whose bytes have the same values as the
  25260. // values of input’s code points, in the same order
  25261. return input
  25262. }
  25263. /**
  25264. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25265. * @see https://streams.spec.whatwg.org/#read-loop
  25266. * @param {ReadableStreamDefaultReader} reader
  25267. */
  25268. async function readAllBytes (reader) {
  25269. const bytes = []
  25270. let byteLength = 0
  25271. while (true) {
  25272. const { done, value: chunk } = await reader.read()
  25273. if (done) {
  25274. // 1. Call successSteps with bytes.
  25275. return Buffer.concat(bytes, byteLength)
  25276. }
  25277. // 1. If chunk is not a Uint8Array object, call failureSteps
  25278. // with a TypeError and abort these steps.
  25279. if (!isUint8Array(chunk)) {
  25280. throw new TypeError('Received non-Uint8Array chunk')
  25281. }
  25282. // 2. Append the bytes represented by chunk to bytes.
  25283. bytes.push(chunk)
  25284. byteLength += chunk.length
  25285. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25286. }
  25287. }
  25288. /**
  25289. * @see https://fetch.spec.whatwg.org/#is-local
  25290. * @param {URL} url
  25291. */
  25292. function urlIsLocal (url) {
  25293. assert('protocol' in url) // ensure it's a url object
  25294. const protocol = url.protocol
  25295. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25296. }
  25297. /**
  25298. * @param {string|URL} url
  25299. */
  25300. function urlHasHttpsScheme (url) {
  25301. if (typeof url === 'string') {
  25302. return url.startsWith('https:')
  25303. }
  25304. return url.protocol === 'https:'
  25305. }
  25306. /**
  25307. * @see https://fetch.spec.whatwg.org/#http-scheme
  25308. * @param {URL} url
  25309. */
  25310. function urlIsHttpHttpsScheme (url) {
  25311. assert('protocol' in url) // ensure it's a url object
  25312. const protocol = url.protocol
  25313. return protocol === 'http:' || protocol === 'https:'
  25314. }
  25315. /**
  25316. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25317. */
  25318. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25319. module.exports = {
  25320. isAborted,
  25321. isCancelled,
  25322. createDeferredPromise,
  25323. ReadableStreamFrom,
  25324. toUSVString,
  25325. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25326. coarsenedSharedCurrentTime,
  25327. determineRequestsReferrer,
  25328. makePolicyContainer,
  25329. clonePolicyContainer,
  25330. appendFetchMetadata,
  25331. appendRequestOriginHeader,
  25332. TAOCheck,
  25333. corsCheck,
  25334. crossOriginResourcePolicyCheck,
  25335. createOpaqueTimingInfo,
  25336. setRequestReferrerPolicyOnRedirect,
  25337. isValidHTTPToken,
  25338. requestBadPort,
  25339. requestCurrentURL,
  25340. responseURL,
  25341. responseLocationURL,
  25342. isBlobLike,
  25343. isURLPotentiallyTrustworthy,
  25344. isValidReasonPhrase,
  25345. sameOrigin,
  25346. normalizeMethod,
  25347. serializeJavascriptValueToJSONString,
  25348. makeIterator,
  25349. isValidHeaderName,
  25350. isValidHeaderValue,
  25351. hasOwn,
  25352. isErrorLike,
  25353. fullyReadBody,
  25354. bytesMatch,
  25355. isReadableStreamLike,
  25356. readableStreamClose,
  25357. isomorphicEncode,
  25358. isomorphicDecode,
  25359. urlIsLocal,
  25360. urlHasHttpsScheme,
  25361. urlIsHttpHttpsScheme,
  25362. readAllBytes,
  25363. normalizeMethodRecord,
  25364. parseMetadata
  25365. }
  25366. /***/ }),
  25367. /***/ 1744:
  25368. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25369. "use strict";
  25370. const { types } = __nccwpck_require__(3837)
  25371. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25372. /** @type {import('../../types/webidl').Webidl} */
  25373. const webidl = {}
  25374. webidl.converters = {}
  25375. webidl.util = {}
  25376. webidl.errors = {}
  25377. webidl.errors.exception = function (message) {
  25378. return new TypeError(`${message.header}: ${message.message}`)
  25379. }
  25380. webidl.errors.conversionFailed = function (context) {
  25381. const plural = context.types.length === 1 ? '' : ' one of'
  25382. const message =
  25383. `${context.argument} could not be converted to` +
  25384. `${plural}: ${context.types.join(', ')}.`
  25385. return webidl.errors.exception({
  25386. header: context.prefix,
  25387. message
  25388. })
  25389. }
  25390. webidl.errors.invalidArgument = function (context) {
  25391. return webidl.errors.exception({
  25392. header: context.prefix,
  25393. message: `"${context.value}" is an invalid ${context.type}.`
  25394. })
  25395. }
  25396. // https://webidl.spec.whatwg.org/#implements
  25397. webidl.brandCheck = function (V, I, opts = undefined) {
  25398. if (opts?.strict !== false && !(V instanceof I)) {
  25399. throw new TypeError('Illegal invocation')
  25400. } else {
  25401. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25402. }
  25403. }
  25404. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25405. if (length < min) {
  25406. throw webidl.errors.exception({
  25407. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25408. `but${length ? ' only' : ''} ${length} found.`,
  25409. ...ctx
  25410. })
  25411. }
  25412. }
  25413. webidl.illegalConstructor = function () {
  25414. throw webidl.errors.exception({
  25415. header: 'TypeError',
  25416. message: 'Illegal constructor'
  25417. })
  25418. }
  25419. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25420. webidl.util.Type = function (V) {
  25421. switch (typeof V) {
  25422. case 'undefined': return 'Undefined'
  25423. case 'boolean': return 'Boolean'
  25424. case 'string': return 'String'
  25425. case 'symbol': return 'Symbol'
  25426. case 'number': return 'Number'
  25427. case 'bigint': return 'BigInt'
  25428. case 'function':
  25429. case 'object': {
  25430. if (V === null) {
  25431. return 'Null'
  25432. }
  25433. return 'Object'
  25434. }
  25435. }
  25436. }
  25437. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25438. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25439. let upperBound
  25440. let lowerBound
  25441. // 1. If bitLength is 64, then:
  25442. if (bitLength === 64) {
  25443. // 1. Let upperBound be 2^53 − 1.
  25444. upperBound = Math.pow(2, 53) - 1
  25445. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25446. if (signedness === 'unsigned') {
  25447. lowerBound = 0
  25448. } else {
  25449. // 3. Otherwise let lowerBound be −2^53 + 1.
  25450. lowerBound = Math.pow(-2, 53) + 1
  25451. }
  25452. } else if (signedness === 'unsigned') {
  25453. // 2. Otherwise, if signedness is "unsigned", then:
  25454. // 1. Let lowerBound be 0.
  25455. lowerBound = 0
  25456. // 2. Let upperBound be 2^bitLength − 1.
  25457. upperBound = Math.pow(2, bitLength) - 1
  25458. } else {
  25459. // 3. Otherwise:
  25460. // 1. Let lowerBound be -2^bitLength − 1.
  25461. lowerBound = Math.pow(-2, bitLength) - 1
  25462. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25463. upperBound = Math.pow(2, bitLength - 1) - 1
  25464. }
  25465. // 4. Let x be ? ToNumber(V).
  25466. let x = Number(V)
  25467. // 5. If x is −0, then set x to +0.
  25468. if (x === 0) {
  25469. x = 0
  25470. }
  25471. // 6. If the conversion is to an IDL type associated
  25472. // with the [EnforceRange] extended attribute, then:
  25473. if (opts.enforceRange === true) {
  25474. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25475. if (
  25476. Number.isNaN(x) ||
  25477. x === Number.POSITIVE_INFINITY ||
  25478. x === Number.NEGATIVE_INFINITY
  25479. ) {
  25480. throw webidl.errors.exception({
  25481. header: 'Integer conversion',
  25482. message: `Could not convert ${V} to an integer.`
  25483. })
  25484. }
  25485. // 2. Set x to IntegerPart(x).
  25486. x = webidl.util.IntegerPart(x)
  25487. // 3. If x < lowerBound or x > upperBound, then
  25488. // throw a TypeError.
  25489. if (x < lowerBound || x > upperBound) {
  25490. throw webidl.errors.exception({
  25491. header: 'Integer conversion',
  25492. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25493. })
  25494. }
  25495. // 4. Return x.
  25496. return x
  25497. }
  25498. // 7. If x is not NaN and the conversion is to an IDL
  25499. // type associated with the [Clamp] extended
  25500. // attribute, then:
  25501. if (!Number.isNaN(x) && opts.clamp === true) {
  25502. // 1. Set x to min(max(x, lowerBound), upperBound).
  25503. x = Math.min(Math.max(x, lowerBound), upperBound)
  25504. // 2. Round x to the nearest integer, choosing the
  25505. // even integer if it lies halfway between two,
  25506. // and choosing +0 rather than −0.
  25507. if (Math.floor(x) % 2 === 0) {
  25508. x = Math.floor(x)
  25509. } else {
  25510. x = Math.ceil(x)
  25511. }
  25512. // 3. Return x.
  25513. return x
  25514. }
  25515. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25516. if (
  25517. Number.isNaN(x) ||
  25518. (x === 0 && Object.is(0, x)) ||
  25519. x === Number.POSITIVE_INFINITY ||
  25520. x === Number.NEGATIVE_INFINITY
  25521. ) {
  25522. return 0
  25523. }
  25524. // 9. Set x to IntegerPart(x).
  25525. x = webidl.util.IntegerPart(x)
  25526. // 10. Set x to x modulo 2^bitLength.
  25527. x = x % Math.pow(2, bitLength)
  25528. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25529. // then return x − 2^bitLength.
  25530. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25531. return x - Math.pow(2, bitLength)
  25532. }
  25533. // 12. Otherwise, return x.
  25534. return x
  25535. }
  25536. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25537. webidl.util.IntegerPart = function (n) {
  25538. // 1. Let r be floor(abs(n)).
  25539. const r = Math.floor(Math.abs(n))
  25540. // 2. If n < 0, then return -1 × r.
  25541. if (n < 0) {
  25542. return -1 * r
  25543. }
  25544. // 3. Otherwise, return r.
  25545. return r
  25546. }
  25547. // https://webidl.spec.whatwg.org/#es-sequence
  25548. webidl.sequenceConverter = function (converter) {
  25549. return (V) => {
  25550. // 1. If Type(V) is not Object, throw a TypeError.
  25551. if (webidl.util.Type(V) !== 'Object') {
  25552. throw webidl.errors.exception({
  25553. header: 'Sequence',
  25554. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25555. })
  25556. }
  25557. // 2. Let method be ? GetMethod(V, @@iterator).
  25558. /** @type {Generator} */
  25559. const method = V?.[Symbol.iterator]?.()
  25560. const seq = []
  25561. // 3. If method is undefined, throw a TypeError.
  25562. if (
  25563. method === undefined ||
  25564. typeof method.next !== 'function'
  25565. ) {
  25566. throw webidl.errors.exception({
  25567. header: 'Sequence',
  25568. message: 'Object is not an iterator.'
  25569. })
  25570. }
  25571. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25572. while (true) {
  25573. const { done, value } = method.next()
  25574. if (done) {
  25575. break
  25576. }
  25577. seq.push(converter(value))
  25578. }
  25579. return seq
  25580. }
  25581. }
  25582. // https://webidl.spec.whatwg.org/#es-to-record
  25583. webidl.recordConverter = function (keyConverter, valueConverter) {
  25584. return (O) => {
  25585. // 1. If Type(O) is not Object, throw a TypeError.
  25586. if (webidl.util.Type(O) !== 'Object') {
  25587. throw webidl.errors.exception({
  25588. header: 'Record',
  25589. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25590. })
  25591. }
  25592. // 2. Let result be a new empty instance of record<K, V>.
  25593. const result = {}
  25594. if (!types.isProxy(O)) {
  25595. // Object.keys only returns enumerable properties
  25596. const keys = Object.keys(O)
  25597. for (const key of keys) {
  25598. // 1. Let typedKey be key converted to an IDL value of type K.
  25599. const typedKey = keyConverter(key)
  25600. // 2. Let value be ? Get(O, key).
  25601. // 3. Let typedValue be value converted to an IDL value of type V.
  25602. const typedValue = valueConverter(O[key])
  25603. // 4. Set result[typedKey] to typedValue.
  25604. result[typedKey] = typedValue
  25605. }
  25606. // 5. Return result.
  25607. return result
  25608. }
  25609. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25610. const keys = Reflect.ownKeys(O)
  25611. // 4. For each key of keys.
  25612. for (const key of keys) {
  25613. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25614. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25615. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25616. if (desc?.enumerable) {
  25617. // 1. Let typedKey be key converted to an IDL value of type K.
  25618. const typedKey = keyConverter(key)
  25619. // 2. Let value be ? Get(O, key).
  25620. // 3. Let typedValue be value converted to an IDL value of type V.
  25621. const typedValue = valueConverter(O[key])
  25622. // 4. Set result[typedKey] to typedValue.
  25623. result[typedKey] = typedValue
  25624. }
  25625. }
  25626. // 5. Return result.
  25627. return result
  25628. }
  25629. }
  25630. webidl.interfaceConverter = function (i) {
  25631. return (V, opts = {}) => {
  25632. if (opts.strict !== false && !(V instanceof i)) {
  25633. throw webidl.errors.exception({
  25634. header: i.name,
  25635. message: `Expected ${V} to be an instance of ${i.name}.`
  25636. })
  25637. }
  25638. return V
  25639. }
  25640. }
  25641. webidl.dictionaryConverter = function (converters) {
  25642. return (dictionary) => {
  25643. const type = webidl.util.Type(dictionary)
  25644. const dict = {}
  25645. if (type === 'Null' || type === 'Undefined') {
  25646. return dict
  25647. } else if (type !== 'Object') {
  25648. throw webidl.errors.exception({
  25649. header: 'Dictionary',
  25650. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25651. })
  25652. }
  25653. for (const options of converters) {
  25654. const { key, defaultValue, required, converter } = options
  25655. if (required === true) {
  25656. if (!hasOwn(dictionary, key)) {
  25657. throw webidl.errors.exception({
  25658. header: 'Dictionary',
  25659. message: `Missing required key "${key}".`
  25660. })
  25661. }
  25662. }
  25663. let value = dictionary[key]
  25664. const hasDefault = hasOwn(options, 'defaultValue')
  25665. // Only use defaultValue if value is undefined and
  25666. // a defaultValue options was provided.
  25667. if (hasDefault && value !== null) {
  25668. value = value ?? defaultValue
  25669. }
  25670. // A key can be optional and have no default value.
  25671. // When this happens, do not perform a conversion,
  25672. // and do not assign the key a value.
  25673. if (required || hasDefault || value !== undefined) {
  25674. value = converter(value)
  25675. if (
  25676. options.allowedValues &&
  25677. !options.allowedValues.includes(value)
  25678. ) {
  25679. throw webidl.errors.exception({
  25680. header: 'Dictionary',
  25681. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25682. })
  25683. }
  25684. dict[key] = value
  25685. }
  25686. }
  25687. return dict
  25688. }
  25689. }
  25690. webidl.nullableConverter = function (converter) {
  25691. return (V) => {
  25692. if (V === null) {
  25693. return V
  25694. }
  25695. return converter(V)
  25696. }
  25697. }
  25698. // https://webidl.spec.whatwg.org/#es-DOMString
  25699. webidl.converters.DOMString = function (V, opts = {}) {
  25700. // 1. If V is null and the conversion is to an IDL type
  25701. // associated with the [LegacyNullToEmptyString]
  25702. // extended attribute, then return the DOMString value
  25703. // that represents the empty string.
  25704. if (V === null && opts.legacyNullToEmptyString) {
  25705. return ''
  25706. }
  25707. // 2. Let x be ? ToString(V).
  25708. if (typeof V === 'symbol') {
  25709. throw new TypeError('Could not convert argument of type symbol to string.')
  25710. }
  25711. // 3. Return the IDL DOMString value that represents the
  25712. // same sequence of code units as the one the
  25713. // ECMAScript String value x represents.
  25714. return String(V)
  25715. }
  25716. // https://webidl.spec.whatwg.org/#es-ByteString
  25717. webidl.converters.ByteString = function (V) {
  25718. // 1. Let x be ? ToString(V).
  25719. // Note: DOMString converter perform ? ToString(V)
  25720. const x = webidl.converters.DOMString(V)
  25721. // 2. If the value of any element of x is greater than
  25722. // 255, then throw a TypeError.
  25723. for (let index = 0; index < x.length; index++) {
  25724. if (x.charCodeAt(index) > 255) {
  25725. throw new TypeError(
  25726. 'Cannot convert argument to a ByteString because the character at ' +
  25727. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25728. )
  25729. }
  25730. }
  25731. // 3. Return an IDL ByteString value whose length is the
  25732. // length of x, and where the value of each element is
  25733. // the value of the corresponding element of x.
  25734. return x
  25735. }
  25736. // https://webidl.spec.whatwg.org/#es-USVString
  25737. webidl.converters.USVString = toUSVString
  25738. // https://webidl.spec.whatwg.org/#es-boolean
  25739. webidl.converters.boolean = function (V) {
  25740. // 1. Let x be the result of computing ToBoolean(V).
  25741. const x = Boolean(V)
  25742. // 2. Return the IDL boolean value that is the one that represents
  25743. // the same truth value as the ECMAScript Boolean value x.
  25744. return x
  25745. }
  25746. // https://webidl.spec.whatwg.org/#es-any
  25747. webidl.converters.any = function (V) {
  25748. return V
  25749. }
  25750. // https://webidl.spec.whatwg.org/#es-long-long
  25751. webidl.converters['long long'] = function (V) {
  25752. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  25753. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  25754. // 2. Return the IDL long long value that represents
  25755. // the same numeric value as x.
  25756. return x
  25757. }
  25758. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  25759. webidl.converters['unsigned long long'] = function (V) {
  25760. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  25761. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  25762. // 2. Return the IDL unsigned long long value that
  25763. // represents the same numeric value as x.
  25764. return x
  25765. }
  25766. // https://webidl.spec.whatwg.org/#es-unsigned-long
  25767. webidl.converters['unsigned long'] = function (V) {
  25768. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  25769. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  25770. // 2. Return the IDL unsigned long value that
  25771. // represents the same numeric value as x.
  25772. return x
  25773. }
  25774. // https://webidl.spec.whatwg.org/#es-unsigned-short
  25775. webidl.converters['unsigned short'] = function (V, opts) {
  25776. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  25777. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  25778. // 2. Return the IDL unsigned short value that represents
  25779. // the same numeric value as x.
  25780. return x
  25781. }
  25782. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  25783. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  25784. // 1. If Type(V) is not Object, or V does not have an
  25785. // [[ArrayBufferData]] internal slot, then throw a
  25786. // TypeError.
  25787. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  25788. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  25789. if (
  25790. webidl.util.Type(V) !== 'Object' ||
  25791. !types.isAnyArrayBuffer(V)
  25792. ) {
  25793. throw webidl.errors.conversionFailed({
  25794. prefix: `${V}`,
  25795. argument: `${V}`,
  25796. types: ['ArrayBuffer']
  25797. })
  25798. }
  25799. // 2. If the conversion is not to an IDL type associated
  25800. // with the [AllowShared] extended attribute, and
  25801. // IsSharedArrayBuffer(V) is true, then throw a
  25802. // TypeError.
  25803. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  25804. throw webidl.errors.exception({
  25805. header: 'ArrayBuffer',
  25806. message: 'SharedArrayBuffer is not allowed.'
  25807. })
  25808. }
  25809. // 3. If the conversion is not to an IDL type associated
  25810. // with the [AllowResizable] extended attribute, and
  25811. // IsResizableArrayBuffer(V) is true, then throw a
  25812. // TypeError.
  25813. // Note: resizable ArrayBuffers are currently a proposal.
  25814. // 4. Return the IDL ArrayBuffer value that is a
  25815. // reference to the same object as V.
  25816. return V
  25817. }
  25818. webidl.converters.TypedArray = function (V, T, opts = {}) {
  25819. // 1. Let T be the IDL type V is being converted to.
  25820. // 2. If Type(V) is not Object, or V does not have a
  25821. // [[TypedArrayName]] internal slot with a value
  25822. // equal to T’s name, then throw a TypeError.
  25823. if (
  25824. webidl.util.Type(V) !== 'Object' ||
  25825. !types.isTypedArray(V) ||
  25826. V.constructor.name !== T.name
  25827. ) {
  25828. throw webidl.errors.conversionFailed({
  25829. prefix: `${T.name}`,
  25830. argument: `${V}`,
  25831. types: [T.name]
  25832. })
  25833. }
  25834. // 3. If the conversion is not to an IDL type associated
  25835. // with the [AllowShared] extended attribute, and
  25836. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25837. // true, then throw a TypeError.
  25838. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25839. throw webidl.errors.exception({
  25840. header: 'ArrayBuffer',
  25841. message: 'SharedArrayBuffer is not allowed.'
  25842. })
  25843. }
  25844. // 4. If the conversion is not to an IDL type associated
  25845. // with the [AllowResizable] extended attribute, and
  25846. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25847. // true, then throw a TypeError.
  25848. // Note: resizable array buffers are currently a proposal
  25849. // 5. Return the IDL value of type T that is a reference
  25850. // to the same object as V.
  25851. return V
  25852. }
  25853. webidl.converters.DataView = function (V, opts = {}) {
  25854. // 1. If Type(V) is not Object, or V does not have a
  25855. // [[DataView]] internal slot, then throw a TypeError.
  25856. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  25857. throw webidl.errors.exception({
  25858. header: 'DataView',
  25859. message: 'Object is not a DataView.'
  25860. })
  25861. }
  25862. // 2. If the conversion is not to an IDL type associated
  25863. // with the [AllowShared] extended attribute, and
  25864. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  25865. // then throw a TypeError.
  25866. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25867. throw webidl.errors.exception({
  25868. header: 'ArrayBuffer',
  25869. message: 'SharedArrayBuffer is not allowed.'
  25870. })
  25871. }
  25872. // 3. If the conversion is not to an IDL type associated
  25873. // with the [AllowResizable] extended attribute, and
  25874. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25875. // true, then throw a TypeError.
  25876. // Note: resizable ArrayBuffers are currently a proposal
  25877. // 4. Return the IDL DataView value that is a reference
  25878. // to the same object as V.
  25879. return V
  25880. }
  25881. // https://webidl.spec.whatwg.org/#BufferSource
  25882. webidl.converters.BufferSource = function (V, opts = {}) {
  25883. if (types.isAnyArrayBuffer(V)) {
  25884. return webidl.converters.ArrayBuffer(V, opts)
  25885. }
  25886. if (types.isTypedArray(V)) {
  25887. return webidl.converters.TypedArray(V, V.constructor)
  25888. }
  25889. if (types.isDataView(V)) {
  25890. return webidl.converters.DataView(V, opts)
  25891. }
  25892. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  25893. }
  25894. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  25895. webidl.converters.ByteString
  25896. )
  25897. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  25898. webidl.converters['sequence<ByteString>']
  25899. )
  25900. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  25901. webidl.converters.ByteString,
  25902. webidl.converters.ByteString
  25903. )
  25904. module.exports = {
  25905. webidl
  25906. }
  25907. /***/ }),
  25908. /***/ 4854:
  25909. /***/ ((module) => {
  25910. "use strict";
  25911. /**
  25912. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  25913. * @param {string|undefined} label
  25914. */
  25915. function getEncoding (label) {
  25916. if (!label) {
  25917. return 'failure'
  25918. }
  25919. // 1. Remove any leading and trailing ASCII whitespace from label.
  25920. // 2. If label is an ASCII case-insensitive match for any of the
  25921. // labels listed in the table below, then return the
  25922. // corresponding encoding; otherwise return failure.
  25923. switch (label.trim().toLowerCase()) {
  25924. case 'unicode-1-1-utf-8':
  25925. case 'unicode11utf8':
  25926. case 'unicode20utf8':
  25927. case 'utf-8':
  25928. case 'utf8':
  25929. case 'x-unicode20utf8':
  25930. return 'UTF-8'
  25931. case '866':
  25932. case 'cp866':
  25933. case 'csibm866':
  25934. case 'ibm866':
  25935. return 'IBM866'
  25936. case 'csisolatin2':
  25937. case 'iso-8859-2':
  25938. case 'iso-ir-101':
  25939. case 'iso8859-2':
  25940. case 'iso88592':
  25941. case 'iso_8859-2':
  25942. case 'iso_8859-2:1987':
  25943. case 'l2':
  25944. case 'latin2':
  25945. return 'ISO-8859-2'
  25946. case 'csisolatin3':
  25947. case 'iso-8859-3':
  25948. case 'iso-ir-109':
  25949. case 'iso8859-3':
  25950. case 'iso88593':
  25951. case 'iso_8859-3':
  25952. case 'iso_8859-3:1988':
  25953. case 'l3':
  25954. case 'latin3':
  25955. return 'ISO-8859-3'
  25956. case 'csisolatin4':
  25957. case 'iso-8859-4':
  25958. case 'iso-ir-110':
  25959. case 'iso8859-4':
  25960. case 'iso88594':
  25961. case 'iso_8859-4':
  25962. case 'iso_8859-4:1988':
  25963. case 'l4':
  25964. case 'latin4':
  25965. return 'ISO-8859-4'
  25966. case 'csisolatincyrillic':
  25967. case 'cyrillic':
  25968. case 'iso-8859-5':
  25969. case 'iso-ir-144':
  25970. case 'iso8859-5':
  25971. case 'iso88595':
  25972. case 'iso_8859-5':
  25973. case 'iso_8859-5:1988':
  25974. return 'ISO-8859-5'
  25975. case 'arabic':
  25976. case 'asmo-708':
  25977. case 'csiso88596e':
  25978. case 'csiso88596i':
  25979. case 'csisolatinarabic':
  25980. case 'ecma-114':
  25981. case 'iso-8859-6':
  25982. case 'iso-8859-6-e':
  25983. case 'iso-8859-6-i':
  25984. case 'iso-ir-127':
  25985. case 'iso8859-6':
  25986. case 'iso88596':
  25987. case 'iso_8859-6':
  25988. case 'iso_8859-6:1987':
  25989. return 'ISO-8859-6'
  25990. case 'csisolatingreek':
  25991. case 'ecma-118':
  25992. case 'elot_928':
  25993. case 'greek':
  25994. case 'greek8':
  25995. case 'iso-8859-7':
  25996. case 'iso-ir-126':
  25997. case 'iso8859-7':
  25998. case 'iso88597':
  25999. case 'iso_8859-7':
  26000. case 'iso_8859-7:1987':
  26001. case 'sun_eu_greek':
  26002. return 'ISO-8859-7'
  26003. case 'csiso88598e':
  26004. case 'csisolatinhebrew':
  26005. case 'hebrew':
  26006. case 'iso-8859-8':
  26007. case 'iso-8859-8-e':
  26008. case 'iso-ir-138':
  26009. case 'iso8859-8':
  26010. case 'iso88598':
  26011. case 'iso_8859-8':
  26012. case 'iso_8859-8:1988':
  26013. case 'visual':
  26014. return 'ISO-8859-8'
  26015. case 'csiso88598i':
  26016. case 'iso-8859-8-i':
  26017. case 'logical':
  26018. return 'ISO-8859-8-I'
  26019. case 'csisolatin6':
  26020. case 'iso-8859-10':
  26021. case 'iso-ir-157':
  26022. case 'iso8859-10':
  26023. case 'iso885910':
  26024. case 'l6':
  26025. case 'latin6':
  26026. return 'ISO-8859-10'
  26027. case 'iso-8859-13':
  26028. case 'iso8859-13':
  26029. case 'iso885913':
  26030. return 'ISO-8859-13'
  26031. case 'iso-8859-14':
  26032. case 'iso8859-14':
  26033. case 'iso885914':
  26034. return 'ISO-8859-14'
  26035. case 'csisolatin9':
  26036. case 'iso-8859-15':
  26037. case 'iso8859-15':
  26038. case 'iso885915':
  26039. case 'iso_8859-15':
  26040. case 'l9':
  26041. return 'ISO-8859-15'
  26042. case 'iso-8859-16':
  26043. return 'ISO-8859-16'
  26044. case 'cskoi8r':
  26045. case 'koi':
  26046. case 'koi8':
  26047. case 'koi8-r':
  26048. case 'koi8_r':
  26049. return 'KOI8-R'
  26050. case 'koi8-ru':
  26051. case 'koi8-u':
  26052. return 'KOI8-U'
  26053. case 'csmacintosh':
  26054. case 'mac':
  26055. case 'macintosh':
  26056. case 'x-mac-roman':
  26057. return 'macintosh'
  26058. case 'iso-8859-11':
  26059. case 'iso8859-11':
  26060. case 'iso885911':
  26061. case 'tis-620':
  26062. case 'windows-874':
  26063. return 'windows-874'
  26064. case 'cp1250':
  26065. case 'windows-1250':
  26066. case 'x-cp1250':
  26067. return 'windows-1250'
  26068. case 'cp1251':
  26069. case 'windows-1251':
  26070. case 'x-cp1251':
  26071. return 'windows-1251'
  26072. case 'ansi_x3.4-1968':
  26073. case 'ascii':
  26074. case 'cp1252':
  26075. case 'cp819':
  26076. case 'csisolatin1':
  26077. case 'ibm819':
  26078. case 'iso-8859-1':
  26079. case 'iso-ir-100':
  26080. case 'iso8859-1':
  26081. case 'iso88591':
  26082. case 'iso_8859-1':
  26083. case 'iso_8859-1:1987':
  26084. case 'l1':
  26085. case 'latin1':
  26086. case 'us-ascii':
  26087. case 'windows-1252':
  26088. case 'x-cp1252':
  26089. return 'windows-1252'
  26090. case 'cp1253':
  26091. case 'windows-1253':
  26092. case 'x-cp1253':
  26093. return 'windows-1253'
  26094. case 'cp1254':
  26095. case 'csisolatin5':
  26096. case 'iso-8859-9':
  26097. case 'iso-ir-148':
  26098. case 'iso8859-9':
  26099. case 'iso88599':
  26100. case 'iso_8859-9':
  26101. case 'iso_8859-9:1989':
  26102. case 'l5':
  26103. case 'latin5':
  26104. case 'windows-1254':
  26105. case 'x-cp1254':
  26106. return 'windows-1254'
  26107. case 'cp1255':
  26108. case 'windows-1255':
  26109. case 'x-cp1255':
  26110. return 'windows-1255'
  26111. case 'cp1256':
  26112. case 'windows-1256':
  26113. case 'x-cp1256':
  26114. return 'windows-1256'
  26115. case 'cp1257':
  26116. case 'windows-1257':
  26117. case 'x-cp1257':
  26118. return 'windows-1257'
  26119. case 'cp1258':
  26120. case 'windows-1258':
  26121. case 'x-cp1258':
  26122. return 'windows-1258'
  26123. case 'x-mac-cyrillic':
  26124. case 'x-mac-ukrainian':
  26125. return 'x-mac-cyrillic'
  26126. case 'chinese':
  26127. case 'csgb2312':
  26128. case 'csiso58gb231280':
  26129. case 'gb2312':
  26130. case 'gb_2312':
  26131. case 'gb_2312-80':
  26132. case 'gbk':
  26133. case 'iso-ir-58':
  26134. case 'x-gbk':
  26135. return 'GBK'
  26136. case 'gb18030':
  26137. return 'gb18030'
  26138. case 'big5':
  26139. case 'big5-hkscs':
  26140. case 'cn-big5':
  26141. case 'csbig5':
  26142. case 'x-x-big5':
  26143. return 'Big5'
  26144. case 'cseucpkdfmtjapanese':
  26145. case 'euc-jp':
  26146. case 'x-euc-jp':
  26147. return 'EUC-JP'
  26148. case 'csiso2022jp':
  26149. case 'iso-2022-jp':
  26150. return 'ISO-2022-JP'
  26151. case 'csshiftjis':
  26152. case 'ms932':
  26153. case 'ms_kanji':
  26154. case 'shift-jis':
  26155. case 'shift_jis':
  26156. case 'sjis':
  26157. case 'windows-31j':
  26158. case 'x-sjis':
  26159. return 'Shift_JIS'
  26160. case 'cseuckr':
  26161. case 'csksc56011987':
  26162. case 'euc-kr':
  26163. case 'iso-ir-149':
  26164. case 'korean':
  26165. case 'ks_c_5601-1987':
  26166. case 'ks_c_5601-1989':
  26167. case 'ksc5601':
  26168. case 'ksc_5601':
  26169. case 'windows-949':
  26170. return 'EUC-KR'
  26171. case 'csiso2022kr':
  26172. case 'hz-gb-2312':
  26173. case 'iso-2022-cn':
  26174. case 'iso-2022-cn-ext':
  26175. case 'iso-2022-kr':
  26176. case 'replacement':
  26177. return 'replacement'
  26178. case 'unicodefffe':
  26179. case 'utf-16be':
  26180. return 'UTF-16BE'
  26181. case 'csunicode':
  26182. case 'iso-10646-ucs-2':
  26183. case 'ucs-2':
  26184. case 'unicode':
  26185. case 'unicodefeff':
  26186. case 'utf-16':
  26187. case 'utf-16le':
  26188. return 'UTF-16LE'
  26189. case 'x-user-defined':
  26190. return 'x-user-defined'
  26191. default: return 'failure'
  26192. }
  26193. }
  26194. module.exports = {
  26195. getEncoding
  26196. }
  26197. /***/ }),
  26198. /***/ 1446:
  26199. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26200. "use strict";
  26201. const {
  26202. staticPropertyDescriptors,
  26203. readOperation,
  26204. fireAProgressEvent
  26205. } = __nccwpck_require__(7530)
  26206. const {
  26207. kState,
  26208. kError,
  26209. kResult,
  26210. kEvents,
  26211. kAborted
  26212. } = __nccwpck_require__(9054)
  26213. const { webidl } = __nccwpck_require__(1744)
  26214. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26215. class FileReader extends EventTarget {
  26216. constructor () {
  26217. super()
  26218. this[kState] = 'empty'
  26219. this[kResult] = null
  26220. this[kError] = null
  26221. this[kEvents] = {
  26222. loadend: null,
  26223. error: null,
  26224. abort: null,
  26225. load: null,
  26226. progress: null,
  26227. loadstart: null
  26228. }
  26229. }
  26230. /**
  26231. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26232. * @param {import('buffer').Blob} blob
  26233. */
  26234. readAsArrayBuffer (blob) {
  26235. webidl.brandCheck(this, FileReader)
  26236. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26237. blob = webidl.converters.Blob(blob, { strict: false })
  26238. // The readAsArrayBuffer(blob) method, when invoked,
  26239. // must initiate a read operation for blob with ArrayBuffer.
  26240. readOperation(this, blob, 'ArrayBuffer')
  26241. }
  26242. /**
  26243. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26244. * @param {import('buffer').Blob} blob
  26245. */
  26246. readAsBinaryString (blob) {
  26247. webidl.brandCheck(this, FileReader)
  26248. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26249. blob = webidl.converters.Blob(blob, { strict: false })
  26250. // The readAsBinaryString(blob) method, when invoked,
  26251. // must initiate a read operation for blob with BinaryString.
  26252. readOperation(this, blob, 'BinaryString')
  26253. }
  26254. /**
  26255. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26256. * @param {import('buffer').Blob} blob
  26257. * @param {string?} encoding
  26258. */
  26259. readAsText (blob, encoding = undefined) {
  26260. webidl.brandCheck(this, FileReader)
  26261. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26262. blob = webidl.converters.Blob(blob, { strict: false })
  26263. if (encoding !== undefined) {
  26264. encoding = webidl.converters.DOMString(encoding)
  26265. }
  26266. // The readAsText(blob, encoding) method, when invoked,
  26267. // must initiate a read operation for blob with Text and encoding.
  26268. readOperation(this, blob, 'Text', encoding)
  26269. }
  26270. /**
  26271. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26272. * @param {import('buffer').Blob} blob
  26273. */
  26274. readAsDataURL (blob) {
  26275. webidl.brandCheck(this, FileReader)
  26276. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26277. blob = webidl.converters.Blob(blob, { strict: false })
  26278. // The readAsDataURL(blob) method, when invoked, must
  26279. // initiate a read operation for blob with DataURL.
  26280. readOperation(this, blob, 'DataURL')
  26281. }
  26282. /**
  26283. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26284. */
  26285. abort () {
  26286. // 1. If this's state is "empty" or if this's state is
  26287. // "done" set this's result to null and terminate
  26288. // this algorithm.
  26289. if (this[kState] === 'empty' || this[kState] === 'done') {
  26290. this[kResult] = null
  26291. return
  26292. }
  26293. // 2. If this's state is "loading" set this's state to
  26294. // "done" and set this's result to null.
  26295. if (this[kState] === 'loading') {
  26296. this[kState] = 'done'
  26297. this[kResult] = null
  26298. }
  26299. // 3. If there are any tasks from this on the file reading
  26300. // task source in an affiliated task queue, then remove
  26301. // those tasks from that task queue.
  26302. this[kAborted] = true
  26303. // 4. Terminate the algorithm for the read method being processed.
  26304. // TODO
  26305. // 5. Fire a progress event called abort at this.
  26306. fireAProgressEvent('abort', this)
  26307. // 6. If this's state is not "loading", fire a progress
  26308. // event called loadend at this.
  26309. if (this[kState] !== 'loading') {
  26310. fireAProgressEvent('loadend', this)
  26311. }
  26312. }
  26313. /**
  26314. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26315. */
  26316. get readyState () {
  26317. webidl.brandCheck(this, FileReader)
  26318. switch (this[kState]) {
  26319. case 'empty': return this.EMPTY
  26320. case 'loading': return this.LOADING
  26321. case 'done': return this.DONE
  26322. }
  26323. }
  26324. /**
  26325. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26326. */
  26327. get result () {
  26328. webidl.brandCheck(this, FileReader)
  26329. // The result attribute’s getter, when invoked, must return
  26330. // this's result.
  26331. return this[kResult]
  26332. }
  26333. /**
  26334. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26335. */
  26336. get error () {
  26337. webidl.brandCheck(this, FileReader)
  26338. // The error attribute’s getter, when invoked, must return
  26339. // this's error.
  26340. return this[kError]
  26341. }
  26342. get onloadend () {
  26343. webidl.brandCheck(this, FileReader)
  26344. return this[kEvents].loadend
  26345. }
  26346. set onloadend (fn) {
  26347. webidl.brandCheck(this, FileReader)
  26348. if (this[kEvents].loadend) {
  26349. this.removeEventListener('loadend', this[kEvents].loadend)
  26350. }
  26351. if (typeof fn === 'function') {
  26352. this[kEvents].loadend = fn
  26353. this.addEventListener('loadend', fn)
  26354. } else {
  26355. this[kEvents].loadend = null
  26356. }
  26357. }
  26358. get onerror () {
  26359. webidl.brandCheck(this, FileReader)
  26360. return this[kEvents].error
  26361. }
  26362. set onerror (fn) {
  26363. webidl.brandCheck(this, FileReader)
  26364. if (this[kEvents].error) {
  26365. this.removeEventListener('error', this[kEvents].error)
  26366. }
  26367. if (typeof fn === 'function') {
  26368. this[kEvents].error = fn
  26369. this.addEventListener('error', fn)
  26370. } else {
  26371. this[kEvents].error = null
  26372. }
  26373. }
  26374. get onloadstart () {
  26375. webidl.brandCheck(this, FileReader)
  26376. return this[kEvents].loadstart
  26377. }
  26378. set onloadstart (fn) {
  26379. webidl.brandCheck(this, FileReader)
  26380. if (this[kEvents].loadstart) {
  26381. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26382. }
  26383. if (typeof fn === 'function') {
  26384. this[kEvents].loadstart = fn
  26385. this.addEventListener('loadstart', fn)
  26386. } else {
  26387. this[kEvents].loadstart = null
  26388. }
  26389. }
  26390. get onprogress () {
  26391. webidl.brandCheck(this, FileReader)
  26392. return this[kEvents].progress
  26393. }
  26394. set onprogress (fn) {
  26395. webidl.brandCheck(this, FileReader)
  26396. if (this[kEvents].progress) {
  26397. this.removeEventListener('progress', this[kEvents].progress)
  26398. }
  26399. if (typeof fn === 'function') {
  26400. this[kEvents].progress = fn
  26401. this.addEventListener('progress', fn)
  26402. } else {
  26403. this[kEvents].progress = null
  26404. }
  26405. }
  26406. get onload () {
  26407. webidl.brandCheck(this, FileReader)
  26408. return this[kEvents].load
  26409. }
  26410. set onload (fn) {
  26411. webidl.brandCheck(this, FileReader)
  26412. if (this[kEvents].load) {
  26413. this.removeEventListener('load', this[kEvents].load)
  26414. }
  26415. if (typeof fn === 'function') {
  26416. this[kEvents].load = fn
  26417. this.addEventListener('load', fn)
  26418. } else {
  26419. this[kEvents].load = null
  26420. }
  26421. }
  26422. get onabort () {
  26423. webidl.brandCheck(this, FileReader)
  26424. return this[kEvents].abort
  26425. }
  26426. set onabort (fn) {
  26427. webidl.brandCheck(this, FileReader)
  26428. if (this[kEvents].abort) {
  26429. this.removeEventListener('abort', this[kEvents].abort)
  26430. }
  26431. if (typeof fn === 'function') {
  26432. this[kEvents].abort = fn
  26433. this.addEventListener('abort', fn)
  26434. } else {
  26435. this[kEvents].abort = null
  26436. }
  26437. }
  26438. }
  26439. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26440. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26441. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26442. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26443. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26444. FileReader.DONE = FileReader.prototype.DONE = 2
  26445. Object.defineProperties(FileReader.prototype, {
  26446. EMPTY: staticPropertyDescriptors,
  26447. LOADING: staticPropertyDescriptors,
  26448. DONE: staticPropertyDescriptors,
  26449. readAsArrayBuffer: kEnumerableProperty,
  26450. readAsBinaryString: kEnumerableProperty,
  26451. readAsText: kEnumerableProperty,
  26452. readAsDataURL: kEnumerableProperty,
  26453. abort: kEnumerableProperty,
  26454. readyState: kEnumerableProperty,
  26455. result: kEnumerableProperty,
  26456. error: kEnumerableProperty,
  26457. onloadstart: kEnumerableProperty,
  26458. onprogress: kEnumerableProperty,
  26459. onload: kEnumerableProperty,
  26460. onabort: kEnumerableProperty,
  26461. onerror: kEnumerableProperty,
  26462. onloadend: kEnumerableProperty,
  26463. [Symbol.toStringTag]: {
  26464. value: 'FileReader',
  26465. writable: false,
  26466. enumerable: false,
  26467. configurable: true
  26468. }
  26469. })
  26470. Object.defineProperties(FileReader, {
  26471. EMPTY: staticPropertyDescriptors,
  26472. LOADING: staticPropertyDescriptors,
  26473. DONE: staticPropertyDescriptors
  26474. })
  26475. module.exports = {
  26476. FileReader
  26477. }
  26478. /***/ }),
  26479. /***/ 5504:
  26480. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26481. "use strict";
  26482. const { webidl } = __nccwpck_require__(1744)
  26483. const kState = Symbol('ProgressEvent state')
  26484. /**
  26485. * @see https://xhr.spec.whatwg.org/#progressevent
  26486. */
  26487. class ProgressEvent extends Event {
  26488. constructor (type, eventInitDict = {}) {
  26489. type = webidl.converters.DOMString(type)
  26490. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26491. super(type, eventInitDict)
  26492. this[kState] = {
  26493. lengthComputable: eventInitDict.lengthComputable,
  26494. loaded: eventInitDict.loaded,
  26495. total: eventInitDict.total
  26496. }
  26497. }
  26498. get lengthComputable () {
  26499. webidl.brandCheck(this, ProgressEvent)
  26500. return this[kState].lengthComputable
  26501. }
  26502. get loaded () {
  26503. webidl.brandCheck(this, ProgressEvent)
  26504. return this[kState].loaded
  26505. }
  26506. get total () {
  26507. webidl.brandCheck(this, ProgressEvent)
  26508. return this[kState].total
  26509. }
  26510. }
  26511. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26512. {
  26513. key: 'lengthComputable',
  26514. converter: webidl.converters.boolean,
  26515. defaultValue: false
  26516. },
  26517. {
  26518. key: 'loaded',
  26519. converter: webidl.converters['unsigned long long'],
  26520. defaultValue: 0
  26521. },
  26522. {
  26523. key: 'total',
  26524. converter: webidl.converters['unsigned long long'],
  26525. defaultValue: 0
  26526. },
  26527. {
  26528. key: 'bubbles',
  26529. converter: webidl.converters.boolean,
  26530. defaultValue: false
  26531. },
  26532. {
  26533. key: 'cancelable',
  26534. converter: webidl.converters.boolean,
  26535. defaultValue: false
  26536. },
  26537. {
  26538. key: 'composed',
  26539. converter: webidl.converters.boolean,
  26540. defaultValue: false
  26541. }
  26542. ])
  26543. module.exports = {
  26544. ProgressEvent
  26545. }
  26546. /***/ }),
  26547. /***/ 9054:
  26548. /***/ ((module) => {
  26549. "use strict";
  26550. module.exports = {
  26551. kState: Symbol('FileReader state'),
  26552. kResult: Symbol('FileReader result'),
  26553. kError: Symbol('FileReader error'),
  26554. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26555. kEvents: Symbol('FileReader events'),
  26556. kAborted: Symbol('FileReader aborted')
  26557. }
  26558. /***/ }),
  26559. /***/ 7530:
  26560. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26561. "use strict";
  26562. const {
  26563. kState,
  26564. kError,
  26565. kResult,
  26566. kAborted,
  26567. kLastProgressEventFired
  26568. } = __nccwpck_require__(9054)
  26569. const { ProgressEvent } = __nccwpck_require__(5504)
  26570. const { getEncoding } = __nccwpck_require__(4854)
  26571. const { DOMException } = __nccwpck_require__(1037)
  26572. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26573. const { types } = __nccwpck_require__(3837)
  26574. const { StringDecoder } = __nccwpck_require__(1576)
  26575. const { btoa } = __nccwpck_require__(4300)
  26576. /** @type {PropertyDescriptor} */
  26577. const staticPropertyDescriptors = {
  26578. enumerable: true,
  26579. writable: false,
  26580. configurable: false
  26581. }
  26582. /**
  26583. * @see https://w3c.github.io/FileAPI/#readOperation
  26584. * @param {import('./filereader').FileReader} fr
  26585. * @param {import('buffer').Blob} blob
  26586. * @param {string} type
  26587. * @param {string?} encodingName
  26588. */
  26589. function readOperation (fr, blob, type, encodingName) {
  26590. // 1. If fr’s state is "loading", throw an InvalidStateError
  26591. // DOMException.
  26592. if (fr[kState] === 'loading') {
  26593. throw new DOMException('Invalid state', 'InvalidStateError')
  26594. }
  26595. // 2. Set fr’s state to "loading".
  26596. fr[kState] = 'loading'
  26597. // 3. Set fr’s result to null.
  26598. fr[kResult] = null
  26599. // 4. Set fr’s error to null.
  26600. fr[kError] = null
  26601. // 5. Let stream be the result of calling get stream on blob.
  26602. /** @type {import('stream/web').ReadableStream} */
  26603. const stream = blob.stream()
  26604. // 6. Let reader be the result of getting a reader from stream.
  26605. const reader = stream.getReader()
  26606. // 7. Let bytes be an empty byte sequence.
  26607. /** @type {Uint8Array[]} */
  26608. const bytes = []
  26609. // 8. Let chunkPromise be the result of reading a chunk from
  26610. // stream with reader.
  26611. let chunkPromise = reader.read()
  26612. // 9. Let isFirstChunk be true.
  26613. let isFirstChunk = true
  26614. // 10. In parallel, while true:
  26615. // Note: "In parallel" just means non-blocking
  26616. // Note 2: readOperation itself cannot be async as double
  26617. // reading the body would then reject the promise, instead
  26618. // of throwing an error.
  26619. ;(async () => {
  26620. while (!fr[kAborted]) {
  26621. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26622. try {
  26623. const { done, value } = await chunkPromise
  26624. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26625. // true, queue a task to fire a progress event called
  26626. // loadstart at fr.
  26627. if (isFirstChunk && !fr[kAborted]) {
  26628. queueMicrotask(() => {
  26629. fireAProgressEvent('loadstart', fr)
  26630. })
  26631. }
  26632. // 3. Set isFirstChunk to false.
  26633. isFirstChunk = false
  26634. // 4. If chunkPromise is fulfilled with an object whose
  26635. // done property is false and whose value property is
  26636. // a Uint8Array object, run these steps:
  26637. if (!done && types.isUint8Array(value)) {
  26638. // 1. Let bs be the byte sequence represented by the
  26639. // Uint8Array object.
  26640. // 2. Append bs to bytes.
  26641. bytes.push(value)
  26642. // 3. If roughly 50ms have passed since these steps
  26643. // were last invoked, queue a task to fire a
  26644. // progress event called progress at fr.
  26645. if (
  26646. (
  26647. fr[kLastProgressEventFired] === undefined ||
  26648. Date.now() - fr[kLastProgressEventFired] >= 50
  26649. ) &&
  26650. !fr[kAborted]
  26651. ) {
  26652. fr[kLastProgressEventFired] = Date.now()
  26653. queueMicrotask(() => {
  26654. fireAProgressEvent('progress', fr)
  26655. })
  26656. }
  26657. // 4. Set chunkPromise to the result of reading a
  26658. // chunk from stream with reader.
  26659. chunkPromise = reader.read()
  26660. } else if (done) {
  26661. // 5. Otherwise, if chunkPromise is fulfilled with an
  26662. // object whose done property is true, queue a task
  26663. // to run the following steps and abort this algorithm:
  26664. queueMicrotask(() => {
  26665. // 1. Set fr’s state to "done".
  26666. fr[kState] = 'done'
  26667. // 2. Let result be the result of package data given
  26668. // bytes, type, blob’s type, and encodingName.
  26669. try {
  26670. const result = packageData(bytes, type, blob.type, encodingName)
  26671. // 4. Else:
  26672. if (fr[kAborted]) {
  26673. return
  26674. }
  26675. // 1. Set fr’s result to result.
  26676. fr[kResult] = result
  26677. // 2. Fire a progress event called load at the fr.
  26678. fireAProgressEvent('load', fr)
  26679. } catch (error) {
  26680. // 3. If package data threw an exception error:
  26681. // 1. Set fr’s error to error.
  26682. fr[kError] = error
  26683. // 2. Fire a progress event called error at fr.
  26684. fireAProgressEvent('error', fr)
  26685. }
  26686. // 5. If fr’s state is not "loading", fire a progress
  26687. // event called loadend at the fr.
  26688. if (fr[kState] !== 'loading') {
  26689. fireAProgressEvent('loadend', fr)
  26690. }
  26691. })
  26692. break
  26693. }
  26694. } catch (error) {
  26695. if (fr[kAborted]) {
  26696. return
  26697. }
  26698. // 6. Otherwise, if chunkPromise is rejected with an
  26699. // error error, queue a task to run the following
  26700. // steps and abort this algorithm:
  26701. queueMicrotask(() => {
  26702. // 1. Set fr’s state to "done".
  26703. fr[kState] = 'done'
  26704. // 2. Set fr’s error to error.
  26705. fr[kError] = error
  26706. // 3. Fire a progress event called error at fr.
  26707. fireAProgressEvent('error', fr)
  26708. // 4. If fr’s state is not "loading", fire a progress
  26709. // event called loadend at fr.
  26710. if (fr[kState] !== 'loading') {
  26711. fireAProgressEvent('loadend', fr)
  26712. }
  26713. })
  26714. break
  26715. }
  26716. }
  26717. })()
  26718. }
  26719. /**
  26720. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26721. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26722. * @param {string} e The name of the event
  26723. * @param {import('./filereader').FileReader} reader
  26724. */
  26725. function fireAProgressEvent (e, reader) {
  26726. // The progress event e does not bubble. e.bubbles must be false
  26727. // The progress event e is NOT cancelable. e.cancelable must be false
  26728. const event = new ProgressEvent(e, {
  26729. bubbles: false,
  26730. cancelable: false
  26731. })
  26732. reader.dispatchEvent(event)
  26733. }
  26734. /**
  26735. * @see https://w3c.github.io/FileAPI/#blob-package-data
  26736. * @param {Uint8Array[]} bytes
  26737. * @param {string} type
  26738. * @param {string?} mimeType
  26739. * @param {string?} encodingName
  26740. */
  26741. function packageData (bytes, type, mimeType, encodingName) {
  26742. // 1. A Blob has an associated package data algorithm, given
  26743. // bytes, a type, a optional mimeType, and a optional
  26744. // encodingName, which switches on type and runs the
  26745. // associated steps:
  26746. switch (type) {
  26747. case 'DataURL': {
  26748. // 1. Return bytes as a DataURL [RFC2397] subject to
  26749. // the considerations below:
  26750. // * Use mimeType as part of the Data URL if it is
  26751. // available in keeping with the Data URL
  26752. // specification [RFC2397].
  26753. // * If mimeType is not available return a Data URL
  26754. // without a media-type. [RFC2397].
  26755. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  26756. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  26757. // mediatype := [ type "/" subtype ] *( ";" parameter )
  26758. // data := *urlchar
  26759. // parameter := attribute "=" value
  26760. let dataURL = 'data:'
  26761. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  26762. if (parsed !== 'failure') {
  26763. dataURL += serializeAMimeType(parsed)
  26764. }
  26765. dataURL += ';base64,'
  26766. const decoder = new StringDecoder('latin1')
  26767. for (const chunk of bytes) {
  26768. dataURL += btoa(decoder.write(chunk))
  26769. }
  26770. dataURL += btoa(decoder.end())
  26771. return dataURL
  26772. }
  26773. case 'Text': {
  26774. // 1. Let encoding be failure
  26775. let encoding = 'failure'
  26776. // 2. If the encodingName is present, set encoding to the
  26777. // result of getting an encoding from encodingName.
  26778. if (encodingName) {
  26779. encoding = getEncoding(encodingName)
  26780. }
  26781. // 3. If encoding is failure, and mimeType is present:
  26782. if (encoding === 'failure' && mimeType) {
  26783. // 1. Let type be the result of parse a MIME type
  26784. // given mimeType.
  26785. const type = parseMIMEType(mimeType)
  26786. // 2. If type is not failure, set encoding to the result
  26787. // of getting an encoding from type’s parameters["charset"].
  26788. if (type !== 'failure') {
  26789. encoding = getEncoding(type.parameters.get('charset'))
  26790. }
  26791. }
  26792. // 4. If encoding is failure, then set encoding to UTF-8.
  26793. if (encoding === 'failure') {
  26794. encoding = 'UTF-8'
  26795. }
  26796. // 5. Decode bytes using fallback encoding encoding, and
  26797. // return the result.
  26798. return decode(bytes, encoding)
  26799. }
  26800. case 'ArrayBuffer': {
  26801. // Return a new ArrayBuffer whose contents are bytes.
  26802. const sequence = combineByteSequences(bytes)
  26803. return sequence.buffer
  26804. }
  26805. case 'BinaryString': {
  26806. // Return bytes as a binary string, in which every byte
  26807. // is represented by a code unit of equal value [0..255].
  26808. let binaryString = ''
  26809. const decoder = new StringDecoder('latin1')
  26810. for (const chunk of bytes) {
  26811. binaryString += decoder.write(chunk)
  26812. }
  26813. binaryString += decoder.end()
  26814. return binaryString
  26815. }
  26816. }
  26817. }
  26818. /**
  26819. * @see https://encoding.spec.whatwg.org/#decode
  26820. * @param {Uint8Array[]} ioQueue
  26821. * @param {string} encoding
  26822. */
  26823. function decode (ioQueue, encoding) {
  26824. const bytes = combineByteSequences(ioQueue)
  26825. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  26826. const BOMEncoding = BOMSniffing(bytes)
  26827. let slice = 0
  26828. // 2. If BOMEncoding is non-null:
  26829. if (BOMEncoding !== null) {
  26830. // 1. Set encoding to BOMEncoding.
  26831. encoding = BOMEncoding
  26832. // 2. Read three bytes from ioQueue, if BOMEncoding is
  26833. // UTF-8; otherwise read two bytes.
  26834. // (Do nothing with those bytes.)
  26835. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  26836. }
  26837. // 3. Process a queue with an instance of encoding’s
  26838. // decoder, ioQueue, output, and "replacement".
  26839. // 4. Return output.
  26840. const sliced = bytes.slice(slice)
  26841. return new TextDecoder(encoding).decode(sliced)
  26842. }
  26843. /**
  26844. * @see https://encoding.spec.whatwg.org/#bom-sniff
  26845. * @param {Uint8Array} ioQueue
  26846. */
  26847. function BOMSniffing (ioQueue) {
  26848. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  26849. // converted to a byte sequence.
  26850. const [a, b, c] = ioQueue
  26851. // 2. For each of the rows in the table below, starting with
  26852. // the first one and going down, if BOM starts with the
  26853. // bytes given in the first column, then return the
  26854. // encoding given in the cell in the second column of that
  26855. // row. Otherwise, return null.
  26856. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  26857. return 'UTF-8'
  26858. } else if (a === 0xFE && b === 0xFF) {
  26859. return 'UTF-16BE'
  26860. } else if (a === 0xFF && b === 0xFE) {
  26861. return 'UTF-16LE'
  26862. }
  26863. return null
  26864. }
  26865. /**
  26866. * @param {Uint8Array[]} sequences
  26867. */
  26868. function combineByteSequences (sequences) {
  26869. const size = sequences.reduce((a, b) => {
  26870. return a + b.byteLength
  26871. }, 0)
  26872. let offset = 0
  26873. return sequences.reduce((a, b) => {
  26874. a.set(b, offset)
  26875. offset += b.byteLength
  26876. return a
  26877. }, new Uint8Array(size))
  26878. }
  26879. module.exports = {
  26880. staticPropertyDescriptors,
  26881. readOperation,
  26882. fireAProgressEvent
  26883. }
  26884. /***/ }),
  26885. /***/ 1892:
  26886. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26887. "use strict";
  26888. // We include a version number for the Dispatcher API. In case of breaking changes,
  26889. // this version number must be increased to avoid conflicts.
  26890. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  26891. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26892. const Agent = __nccwpck_require__(7890)
  26893. if (getGlobalDispatcher() === undefined) {
  26894. setGlobalDispatcher(new Agent())
  26895. }
  26896. function setGlobalDispatcher (agent) {
  26897. if (!agent || typeof agent.dispatch !== 'function') {
  26898. throw new InvalidArgumentError('Argument agent must implement Agent')
  26899. }
  26900. Object.defineProperty(globalThis, globalDispatcher, {
  26901. value: agent,
  26902. writable: true,
  26903. enumerable: false,
  26904. configurable: false
  26905. })
  26906. }
  26907. function getGlobalDispatcher () {
  26908. return globalThis[globalDispatcher]
  26909. }
  26910. module.exports = {
  26911. setGlobalDispatcher,
  26912. getGlobalDispatcher
  26913. }
  26914. /***/ }),
  26915. /***/ 6930:
  26916. /***/ ((module) => {
  26917. "use strict";
  26918. module.exports = class DecoratorHandler {
  26919. constructor (handler) {
  26920. this.handler = handler
  26921. }
  26922. onConnect (...args) {
  26923. return this.handler.onConnect(...args)
  26924. }
  26925. onError (...args) {
  26926. return this.handler.onError(...args)
  26927. }
  26928. onUpgrade (...args) {
  26929. return this.handler.onUpgrade(...args)
  26930. }
  26931. onHeaders (...args) {
  26932. return this.handler.onHeaders(...args)
  26933. }
  26934. onData (...args) {
  26935. return this.handler.onData(...args)
  26936. }
  26937. onComplete (...args) {
  26938. return this.handler.onComplete(...args)
  26939. }
  26940. onBodySent (...args) {
  26941. return this.handler.onBodySent(...args)
  26942. }
  26943. }
  26944. /***/ }),
  26945. /***/ 2860:
  26946. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26947. "use strict";
  26948. const util = __nccwpck_require__(3983)
  26949. const { kBodyUsed } = __nccwpck_require__(2785)
  26950. const assert = __nccwpck_require__(9491)
  26951. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26952. const EE = __nccwpck_require__(2361)
  26953. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  26954. const kBody = Symbol('body')
  26955. class BodyAsyncIterable {
  26956. constructor (body) {
  26957. this[kBody] = body
  26958. this[kBodyUsed] = false
  26959. }
  26960. async * [Symbol.asyncIterator] () {
  26961. assert(!this[kBodyUsed], 'disturbed')
  26962. this[kBodyUsed] = true
  26963. yield * this[kBody]
  26964. }
  26965. }
  26966. class RedirectHandler {
  26967. constructor (dispatch, maxRedirections, opts, handler) {
  26968. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  26969. throw new InvalidArgumentError('maxRedirections must be a positive number')
  26970. }
  26971. util.validateHandler(handler, opts.method, opts.upgrade)
  26972. this.dispatch = dispatch
  26973. this.location = null
  26974. this.abort = null
  26975. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  26976. this.maxRedirections = maxRedirections
  26977. this.handler = handler
  26978. this.history = []
  26979. if (util.isStream(this.opts.body)) {
  26980. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  26981. // so that it can be dispatched again?
  26982. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  26983. if (util.bodyLength(this.opts.body) === 0) {
  26984. this.opts.body
  26985. .on('data', function () {
  26986. assert(false)
  26987. })
  26988. }
  26989. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  26990. this.opts.body[kBodyUsed] = false
  26991. EE.prototype.on.call(this.opts.body, 'data', function () {
  26992. this[kBodyUsed] = true
  26993. })
  26994. }
  26995. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  26996. // TODO (fix): We can't access ReadableStream internal state
  26997. // to determine whether or not it has been disturbed. This is just
  26998. // a workaround.
  26999. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27000. } else if (
  27001. this.opts.body &&
  27002. typeof this.opts.body !== 'string' &&
  27003. !ArrayBuffer.isView(this.opts.body) &&
  27004. util.isIterable(this.opts.body)
  27005. ) {
  27006. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27007. // or through some other flag?
  27008. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27009. }
  27010. }
  27011. onConnect (abort) {
  27012. this.abort = abort
  27013. this.handler.onConnect(abort, { history: this.history })
  27014. }
  27015. onUpgrade (statusCode, headers, socket) {
  27016. this.handler.onUpgrade(statusCode, headers, socket)
  27017. }
  27018. onError (error) {
  27019. this.handler.onError(error)
  27020. }
  27021. onHeaders (statusCode, headers, resume, statusText) {
  27022. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27023. ? null
  27024. : parseLocation(statusCode, headers)
  27025. if (this.opts.origin) {
  27026. this.history.push(new URL(this.opts.path, this.opts.origin))
  27027. }
  27028. if (!this.location) {
  27029. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27030. }
  27031. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27032. const path = search ? `${pathname}${search}` : pathname
  27033. // Remove headers referring to the original URL.
  27034. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27035. // https://tools.ietf.org/html/rfc7231#section-6.4
  27036. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27037. this.opts.path = path
  27038. this.opts.origin = origin
  27039. this.opts.maxRedirections = 0
  27040. this.opts.query = null
  27041. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27042. // In case of HTTP 303, always replace method to be either HEAD or GET
  27043. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27044. this.opts.method = 'GET'
  27045. this.opts.body = null
  27046. }
  27047. }
  27048. onData (chunk) {
  27049. if (this.location) {
  27050. /*
  27051. https://tools.ietf.org/html/rfc7231#section-6.4
  27052. TLDR: undici always ignores 3xx response bodies.
  27053. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27054. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27055. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27056. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27057. the Location response header, so the body can be ignored safely.
  27058. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27059. response header AND a response body with the other possible location to follow.
  27060. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27061. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27062. */
  27063. } else {
  27064. return this.handler.onData(chunk)
  27065. }
  27066. }
  27067. onComplete (trailers) {
  27068. if (this.location) {
  27069. /*
  27070. https://tools.ietf.org/html/rfc7231#section-6.4
  27071. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27072. and neither are useful if present.
  27073. See comment on onData method above for more detailed informations.
  27074. */
  27075. this.location = null
  27076. this.abort = null
  27077. this.dispatch(this.opts, this)
  27078. } else {
  27079. this.handler.onComplete(trailers)
  27080. }
  27081. }
  27082. onBodySent (chunk) {
  27083. if (this.handler.onBodySent) {
  27084. this.handler.onBodySent(chunk)
  27085. }
  27086. }
  27087. }
  27088. function parseLocation (statusCode, headers) {
  27089. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27090. return null
  27091. }
  27092. for (let i = 0; i < headers.length; i += 2) {
  27093. if (headers[i].toString().toLowerCase() === 'location') {
  27094. return headers[i + 1]
  27095. }
  27096. }
  27097. }
  27098. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27099. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27100. if (header.length === 4) {
  27101. return util.headerNameToString(header) === 'host'
  27102. }
  27103. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27104. return true
  27105. }
  27106. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27107. const name = util.headerNameToString(header)
  27108. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27109. }
  27110. return false
  27111. }
  27112. // https://tools.ietf.org/html/rfc7231#section-6.4
  27113. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27114. const ret = []
  27115. if (Array.isArray(headers)) {
  27116. for (let i = 0; i < headers.length; i += 2) {
  27117. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27118. ret.push(headers[i], headers[i + 1])
  27119. }
  27120. }
  27121. } else if (headers && typeof headers === 'object') {
  27122. for (const key of Object.keys(headers)) {
  27123. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27124. ret.push(key, headers[key])
  27125. }
  27126. }
  27127. } else {
  27128. assert(headers == null, 'headers must be an object or an array')
  27129. }
  27130. return ret
  27131. }
  27132. module.exports = RedirectHandler
  27133. /***/ }),
  27134. /***/ 2286:
  27135. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27136. const assert = __nccwpck_require__(9491)
  27137. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27138. const { RequestRetryError } = __nccwpck_require__(8045)
  27139. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27140. function calculateRetryAfterHeader (retryAfter) {
  27141. const current = Date.now()
  27142. const diff = new Date(retryAfter).getTime() - current
  27143. return diff
  27144. }
  27145. class RetryHandler {
  27146. constructor (opts, handlers) {
  27147. const { retryOptions, ...dispatchOpts } = opts
  27148. const {
  27149. // Retry scoped
  27150. retry: retryFn,
  27151. maxRetries,
  27152. maxTimeout,
  27153. minTimeout,
  27154. timeoutFactor,
  27155. // Response scoped
  27156. methods,
  27157. errorCodes,
  27158. retryAfter,
  27159. statusCodes
  27160. } = retryOptions ?? {}
  27161. this.dispatch = handlers.dispatch
  27162. this.handler = handlers.handler
  27163. this.opts = dispatchOpts
  27164. this.abort = null
  27165. this.aborted = false
  27166. this.retryOpts = {
  27167. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27168. retryAfter: retryAfter ?? true,
  27169. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27170. timeout: minTimeout ?? 500, // .5s
  27171. timeoutFactor: timeoutFactor ?? 2,
  27172. maxRetries: maxRetries ?? 5,
  27173. // What errors we should retry
  27174. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27175. // Indicates which errors to retry
  27176. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27177. // List of errors to retry
  27178. errorCodes: errorCodes ?? [
  27179. 'ECONNRESET',
  27180. 'ECONNREFUSED',
  27181. 'ENOTFOUND',
  27182. 'ENETDOWN',
  27183. 'ENETUNREACH',
  27184. 'EHOSTDOWN',
  27185. 'EHOSTUNREACH',
  27186. 'EPIPE'
  27187. ]
  27188. }
  27189. this.retryCount = 0
  27190. this.start = 0
  27191. this.end = null
  27192. this.etag = null
  27193. this.resume = null
  27194. // Handle possible onConnect duplication
  27195. this.handler.onConnect(reason => {
  27196. this.aborted = true
  27197. if (this.abort) {
  27198. this.abort(reason)
  27199. } else {
  27200. this.reason = reason
  27201. }
  27202. })
  27203. }
  27204. onRequestSent () {
  27205. if (this.handler.onRequestSent) {
  27206. this.handler.onRequestSent()
  27207. }
  27208. }
  27209. onUpgrade (statusCode, headers, socket) {
  27210. if (this.handler.onUpgrade) {
  27211. this.handler.onUpgrade(statusCode, headers, socket)
  27212. }
  27213. }
  27214. onConnect (abort) {
  27215. if (this.aborted) {
  27216. abort(this.reason)
  27217. } else {
  27218. this.abort = abort
  27219. }
  27220. }
  27221. onBodySent (chunk) {
  27222. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27223. }
  27224. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27225. const { statusCode, code, headers } = err
  27226. const { method, retryOptions } = opts
  27227. const {
  27228. maxRetries,
  27229. timeout,
  27230. maxTimeout,
  27231. timeoutFactor,
  27232. statusCodes,
  27233. errorCodes,
  27234. methods
  27235. } = retryOptions
  27236. let { counter, currentTimeout } = state
  27237. currentTimeout =
  27238. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27239. // Any code that is not a Undici's originated and allowed to retry
  27240. if (
  27241. code &&
  27242. code !== 'UND_ERR_REQ_RETRY' &&
  27243. code !== 'UND_ERR_SOCKET' &&
  27244. !errorCodes.includes(code)
  27245. ) {
  27246. cb(err)
  27247. return
  27248. }
  27249. // If a set of method are provided and the current method is not in the list
  27250. if (Array.isArray(methods) && !methods.includes(method)) {
  27251. cb(err)
  27252. return
  27253. }
  27254. // If a set of status code are provided and the current status code is not in the list
  27255. if (
  27256. statusCode != null &&
  27257. Array.isArray(statusCodes) &&
  27258. !statusCodes.includes(statusCode)
  27259. ) {
  27260. cb(err)
  27261. return
  27262. }
  27263. // If we reached the max number of retries
  27264. if (counter > maxRetries) {
  27265. cb(err)
  27266. return
  27267. }
  27268. let retryAfterHeader = headers != null && headers['retry-after']
  27269. if (retryAfterHeader) {
  27270. retryAfterHeader = Number(retryAfterHeader)
  27271. retryAfterHeader = isNaN(retryAfterHeader)
  27272. ? calculateRetryAfterHeader(retryAfterHeader)
  27273. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27274. }
  27275. const retryTimeout =
  27276. retryAfterHeader > 0
  27277. ? Math.min(retryAfterHeader, maxTimeout)
  27278. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27279. state.currentTimeout = retryTimeout
  27280. setTimeout(() => cb(null), retryTimeout)
  27281. }
  27282. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27283. const headers = parseHeaders(rawHeaders)
  27284. this.retryCount += 1
  27285. if (statusCode >= 300) {
  27286. this.abort(
  27287. new RequestRetryError('Request failed', statusCode, {
  27288. headers,
  27289. count: this.retryCount
  27290. })
  27291. )
  27292. return false
  27293. }
  27294. // Checkpoint for resume from where we left it
  27295. if (this.resume != null) {
  27296. this.resume = null
  27297. if (statusCode !== 206) {
  27298. return true
  27299. }
  27300. const contentRange = parseRangeHeader(headers['content-range'])
  27301. // If no content range
  27302. if (!contentRange) {
  27303. this.abort(
  27304. new RequestRetryError('Content-Range mismatch', statusCode, {
  27305. headers,
  27306. count: this.retryCount
  27307. })
  27308. )
  27309. return false
  27310. }
  27311. // Let's start with a weak etag check
  27312. if (this.etag != null && this.etag !== headers.etag) {
  27313. this.abort(
  27314. new RequestRetryError('ETag mismatch', statusCode, {
  27315. headers,
  27316. count: this.retryCount
  27317. })
  27318. )
  27319. return false
  27320. }
  27321. const { start, size, end = size } = contentRange
  27322. assert(this.start === start, 'content-range mismatch')
  27323. assert(this.end == null || this.end === end, 'content-range mismatch')
  27324. this.resume = resume
  27325. return true
  27326. }
  27327. if (this.end == null) {
  27328. if (statusCode === 206) {
  27329. // First time we receive 206
  27330. const range = parseRangeHeader(headers['content-range'])
  27331. if (range == null) {
  27332. return this.handler.onHeaders(
  27333. statusCode,
  27334. rawHeaders,
  27335. resume,
  27336. statusMessage
  27337. )
  27338. }
  27339. const { start, size, end = size } = range
  27340. assert(
  27341. start != null && Number.isFinite(start) && this.start !== start,
  27342. 'content-range mismatch'
  27343. )
  27344. assert(Number.isFinite(start))
  27345. assert(
  27346. end != null && Number.isFinite(end) && this.end !== end,
  27347. 'invalid content-length'
  27348. )
  27349. this.start = start
  27350. this.end = end
  27351. }
  27352. // We make our best to checkpoint the body for further range headers
  27353. if (this.end == null) {
  27354. const contentLength = headers['content-length']
  27355. this.end = contentLength != null ? Number(contentLength) : null
  27356. }
  27357. assert(Number.isFinite(this.start))
  27358. assert(
  27359. this.end == null || Number.isFinite(this.end),
  27360. 'invalid content-length'
  27361. )
  27362. this.resume = resume
  27363. this.etag = headers.etag != null ? headers.etag : null
  27364. return this.handler.onHeaders(
  27365. statusCode,
  27366. rawHeaders,
  27367. resume,
  27368. statusMessage
  27369. )
  27370. }
  27371. const err = new RequestRetryError('Request failed', statusCode, {
  27372. headers,
  27373. count: this.retryCount
  27374. })
  27375. this.abort(err)
  27376. return false
  27377. }
  27378. onData (chunk) {
  27379. this.start += chunk.length
  27380. return this.handler.onData(chunk)
  27381. }
  27382. onComplete (rawTrailers) {
  27383. this.retryCount = 0
  27384. return this.handler.onComplete(rawTrailers)
  27385. }
  27386. onError (err) {
  27387. if (this.aborted || isDisturbed(this.opts.body)) {
  27388. return this.handler.onError(err)
  27389. }
  27390. this.retryOpts.retry(
  27391. err,
  27392. {
  27393. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27394. opts: { retryOptions: this.retryOpts, ...this.opts }
  27395. },
  27396. onRetry.bind(this)
  27397. )
  27398. function onRetry (err) {
  27399. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27400. return this.handler.onError(err)
  27401. }
  27402. if (this.start !== 0) {
  27403. this.opts = {
  27404. ...this.opts,
  27405. headers: {
  27406. ...this.opts.headers,
  27407. range: `bytes=${this.start}-${this.end ?? ''}`
  27408. }
  27409. }
  27410. }
  27411. try {
  27412. this.dispatch(this.opts, this)
  27413. } catch (err) {
  27414. this.handler.onError(err)
  27415. }
  27416. }
  27417. }
  27418. }
  27419. module.exports = RetryHandler
  27420. /***/ }),
  27421. /***/ 8861:
  27422. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27423. "use strict";
  27424. const RedirectHandler = __nccwpck_require__(2860)
  27425. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27426. return (dispatch) => {
  27427. return function Intercept (opts, handler) {
  27428. const { maxRedirections = defaultMaxRedirections } = opts
  27429. if (!maxRedirections) {
  27430. return dispatch(opts, handler)
  27431. }
  27432. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27433. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27434. return dispatch(opts, redirectHandler)
  27435. }
  27436. }
  27437. }
  27438. module.exports = createRedirectInterceptor
  27439. /***/ }),
  27440. /***/ 953:
  27441. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27442. "use strict";
  27443. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27444. 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;
  27445. const utils_1 = __nccwpck_require__(1891);
  27446. // C headers
  27447. var ERROR;
  27448. (function (ERROR) {
  27449. ERROR[ERROR["OK"] = 0] = "OK";
  27450. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27451. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27452. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27453. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27454. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27455. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27456. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27457. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27458. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27459. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27460. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27461. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27462. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27463. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27464. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27465. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27466. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27467. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27468. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27469. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27470. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27471. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27472. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27473. ERROR[ERROR["USER"] = 24] = "USER";
  27474. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27475. var TYPE;
  27476. (function (TYPE) {
  27477. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27478. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27479. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27480. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27481. var FLAGS;
  27482. (function (FLAGS) {
  27483. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27484. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27485. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27486. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27487. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27488. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27489. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27490. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27491. // 1 << 8 is unused
  27492. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27493. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27494. var LENIENT_FLAGS;
  27495. (function (LENIENT_FLAGS) {
  27496. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27497. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27498. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27499. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27500. var METHODS;
  27501. (function (METHODS) {
  27502. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27503. METHODS[METHODS["GET"] = 1] = "GET";
  27504. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27505. METHODS[METHODS["POST"] = 3] = "POST";
  27506. METHODS[METHODS["PUT"] = 4] = "PUT";
  27507. /* pathological */
  27508. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27509. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27510. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27511. /* WebDAV */
  27512. METHODS[METHODS["COPY"] = 8] = "COPY";
  27513. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27514. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27515. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27516. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27517. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27518. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27519. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27520. METHODS[METHODS["BIND"] = 16] = "BIND";
  27521. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27522. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27523. METHODS[METHODS["ACL"] = 19] = "ACL";
  27524. /* subversion */
  27525. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27526. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27527. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27528. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27529. /* upnp */
  27530. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27531. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27532. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27533. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27534. /* RFC-5789 */
  27535. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27536. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27537. /* CalDAV */
  27538. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27539. /* RFC-2068, section 19.6.1.2 */
  27540. METHODS[METHODS["LINK"] = 31] = "LINK";
  27541. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27542. /* icecast */
  27543. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27544. /* RFC-7540, section 11.6 */
  27545. METHODS[METHODS["PRI"] = 34] = "PRI";
  27546. /* RFC-2326 RTSP */
  27547. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27548. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27549. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27550. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27551. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27552. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27553. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27554. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27555. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27556. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27557. /* RAOP */
  27558. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27559. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27560. exports.METHODS_HTTP = [
  27561. METHODS.DELETE,
  27562. METHODS.GET,
  27563. METHODS.HEAD,
  27564. METHODS.POST,
  27565. METHODS.PUT,
  27566. METHODS.CONNECT,
  27567. METHODS.OPTIONS,
  27568. METHODS.TRACE,
  27569. METHODS.COPY,
  27570. METHODS.LOCK,
  27571. METHODS.MKCOL,
  27572. METHODS.MOVE,
  27573. METHODS.PROPFIND,
  27574. METHODS.PROPPATCH,
  27575. METHODS.SEARCH,
  27576. METHODS.UNLOCK,
  27577. METHODS.BIND,
  27578. METHODS.REBIND,
  27579. METHODS.UNBIND,
  27580. METHODS.ACL,
  27581. METHODS.REPORT,
  27582. METHODS.MKACTIVITY,
  27583. METHODS.CHECKOUT,
  27584. METHODS.MERGE,
  27585. METHODS['M-SEARCH'],
  27586. METHODS.NOTIFY,
  27587. METHODS.SUBSCRIBE,
  27588. METHODS.UNSUBSCRIBE,
  27589. METHODS.PATCH,
  27590. METHODS.PURGE,
  27591. METHODS.MKCALENDAR,
  27592. METHODS.LINK,
  27593. METHODS.UNLINK,
  27594. METHODS.PRI,
  27595. // TODO(indutny): should we allow it with HTTP?
  27596. METHODS.SOURCE,
  27597. ];
  27598. exports.METHODS_ICE = [
  27599. METHODS.SOURCE,
  27600. ];
  27601. exports.METHODS_RTSP = [
  27602. METHODS.OPTIONS,
  27603. METHODS.DESCRIBE,
  27604. METHODS.ANNOUNCE,
  27605. METHODS.SETUP,
  27606. METHODS.PLAY,
  27607. METHODS.PAUSE,
  27608. METHODS.TEARDOWN,
  27609. METHODS.GET_PARAMETER,
  27610. METHODS.SET_PARAMETER,
  27611. METHODS.REDIRECT,
  27612. METHODS.RECORD,
  27613. METHODS.FLUSH,
  27614. // For AirPlay
  27615. METHODS.GET,
  27616. METHODS.POST,
  27617. ];
  27618. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27619. exports.H_METHOD_MAP = {};
  27620. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27621. if (/^H/.test(key)) {
  27622. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27623. }
  27624. });
  27625. var FINISH;
  27626. (function (FINISH) {
  27627. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27628. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27629. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27630. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27631. exports.ALPHA = [];
  27632. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27633. // Upper case
  27634. exports.ALPHA.push(String.fromCharCode(i));
  27635. // Lower case
  27636. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27637. }
  27638. exports.NUM_MAP = {
  27639. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27640. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27641. };
  27642. exports.HEX_MAP = {
  27643. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27644. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27645. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27646. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27647. };
  27648. exports.NUM = [
  27649. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27650. ];
  27651. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27652. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27653. exports.USERINFO_CHARS = exports.ALPHANUM
  27654. .concat(exports.MARK)
  27655. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27656. // TODO(indutny): use RFC
  27657. exports.STRICT_URL_CHAR = [
  27658. '!', '"', '$', '%', '&', '\'',
  27659. '(', ')', '*', '+', ',', '-', '.', '/',
  27660. ':', ';', '<', '=', '>',
  27661. '@', '[', '\\', ']', '^', '_',
  27662. '`',
  27663. '{', '|', '}', '~',
  27664. ].concat(exports.ALPHANUM);
  27665. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27666. .concat(['\t', '\f']);
  27667. // All characters with 0x80 bit set to 1
  27668. for (let i = 0x80; i <= 0xff; i++) {
  27669. exports.URL_CHAR.push(i);
  27670. }
  27671. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27672. /* Tokens as defined by rfc 2616. Also lowercases them.
  27673. * token = 1*<any CHAR except CTLs or separators>
  27674. * separators = "(" | ")" | "<" | ">" | "@"
  27675. * | "," | ";" | ":" | "\" | <">
  27676. * | "/" | "[" | "]" | "?" | "="
  27677. * | "{" | "}" | SP | HT
  27678. */
  27679. exports.STRICT_TOKEN = [
  27680. '!', '#', '$', '%', '&', '\'',
  27681. '*', '+', '-', '.',
  27682. '^', '_', '`',
  27683. '|', '~',
  27684. ].concat(exports.ALPHANUM);
  27685. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27686. /*
  27687. * Verify that a char is a valid visible (printable) US-ASCII
  27688. * character or %x80-FF
  27689. */
  27690. exports.HEADER_CHARS = ['\t'];
  27691. for (let i = 32; i <= 255; i++) {
  27692. if (i !== 127) {
  27693. exports.HEADER_CHARS.push(i);
  27694. }
  27695. }
  27696. // ',' = \x44
  27697. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27698. exports.MAJOR = exports.NUM_MAP;
  27699. exports.MINOR = exports.MAJOR;
  27700. var HEADER_STATE;
  27701. (function (HEADER_STATE) {
  27702. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27703. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27704. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27705. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27706. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27707. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27708. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27709. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27710. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27711. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27712. exports.SPECIAL_HEADERS = {
  27713. 'connection': HEADER_STATE.CONNECTION,
  27714. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27715. 'proxy-connection': HEADER_STATE.CONNECTION,
  27716. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27717. 'upgrade': HEADER_STATE.UPGRADE,
  27718. };
  27719. //# sourceMappingURL=constants.js.map
  27720. /***/ }),
  27721. /***/ 1145:
  27722. /***/ ((module) => {
  27723. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHd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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYB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AAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAF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IcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCD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AiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QH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ngEhEAwmC0GfASEQDCULQaABIRAMJAtBoQEhEAwjC0GiASEQDCILQaMBIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAI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Qc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhA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0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  27728. /***/ }),
  27729. /***/ 1891:
  27730. /***/ ((__unused_webpack_module, exports) => {
  27731. "use strict";
  27732. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27733. exports.enumToMap = void 0;
  27734. function enumToMap(obj) {
  27735. const res = {};
  27736. Object.keys(obj).forEach((key) => {
  27737. const value = obj[key];
  27738. if (typeof value === 'number') {
  27739. res[key] = value;
  27740. }
  27741. });
  27742. return res;
  27743. }
  27744. exports.enumToMap = enumToMap;
  27745. //# sourceMappingURL=utils.js.map
  27746. /***/ }),
  27747. /***/ 6771:
  27748. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27749. "use strict";
  27750. const { kClients } = __nccwpck_require__(2785)
  27751. const Agent = __nccwpck_require__(7890)
  27752. const {
  27753. kAgent,
  27754. kMockAgentSet,
  27755. kMockAgentGet,
  27756. kDispatches,
  27757. kIsMockActive,
  27758. kNetConnect,
  27759. kGetNetConnect,
  27760. kOptions,
  27761. kFactory
  27762. } = __nccwpck_require__(4347)
  27763. const MockClient = __nccwpck_require__(8687)
  27764. const MockPool = __nccwpck_require__(6193)
  27765. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  27766. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  27767. const Dispatcher = __nccwpck_require__(412)
  27768. const Pluralizer = __nccwpck_require__(8891)
  27769. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  27770. class FakeWeakRef {
  27771. constructor (value) {
  27772. this.value = value
  27773. }
  27774. deref () {
  27775. return this.value
  27776. }
  27777. }
  27778. class MockAgent extends Dispatcher {
  27779. constructor (opts) {
  27780. super(opts)
  27781. this[kNetConnect] = true
  27782. this[kIsMockActive] = true
  27783. // Instantiate Agent and encapsulate
  27784. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  27785. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27786. }
  27787. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  27788. this[kAgent] = agent
  27789. this[kClients] = agent[kClients]
  27790. this[kOptions] = buildMockOptions(opts)
  27791. }
  27792. get (origin) {
  27793. let dispatcher = this[kMockAgentGet](origin)
  27794. if (!dispatcher) {
  27795. dispatcher = this[kFactory](origin)
  27796. this[kMockAgentSet](origin, dispatcher)
  27797. }
  27798. return dispatcher
  27799. }
  27800. dispatch (opts, handler) {
  27801. // Call MockAgent.get to perform additional setup before dispatching as normal
  27802. this.get(opts.origin)
  27803. return this[kAgent].dispatch(opts, handler)
  27804. }
  27805. async close () {
  27806. await this[kAgent].close()
  27807. this[kClients].clear()
  27808. }
  27809. deactivate () {
  27810. this[kIsMockActive] = false
  27811. }
  27812. activate () {
  27813. this[kIsMockActive] = true
  27814. }
  27815. enableNetConnect (matcher) {
  27816. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  27817. if (Array.isArray(this[kNetConnect])) {
  27818. this[kNetConnect].push(matcher)
  27819. } else {
  27820. this[kNetConnect] = [matcher]
  27821. }
  27822. } else if (typeof matcher === 'undefined') {
  27823. this[kNetConnect] = true
  27824. } else {
  27825. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  27826. }
  27827. }
  27828. disableNetConnect () {
  27829. this[kNetConnect] = false
  27830. }
  27831. // This is required to bypass issues caused by using global symbols - see:
  27832. // https://github.com/nodejs/undici/issues/1447
  27833. get isMockActive () {
  27834. return this[kIsMockActive]
  27835. }
  27836. [kMockAgentSet] (origin, dispatcher) {
  27837. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  27838. }
  27839. [kFactory] (origin) {
  27840. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  27841. return this[kOptions] && this[kOptions].connections === 1
  27842. ? new MockClient(origin, mockOptions)
  27843. : new MockPool(origin, mockOptions)
  27844. }
  27845. [kMockAgentGet] (origin) {
  27846. // First check if we can immediately find it
  27847. const ref = this[kClients].get(origin)
  27848. if (ref) {
  27849. return ref.deref()
  27850. }
  27851. // If the origin is not a string create a dummy parent pool and return to user
  27852. if (typeof origin !== 'string') {
  27853. const dispatcher = this[kFactory]('http://localhost:9999')
  27854. this[kMockAgentSet](origin, dispatcher)
  27855. return dispatcher
  27856. }
  27857. // If we match, create a pool and assign the same dispatches
  27858. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  27859. const nonExplicitDispatcher = nonExplicitRef.deref()
  27860. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  27861. const dispatcher = this[kFactory](origin)
  27862. this[kMockAgentSet](origin, dispatcher)
  27863. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  27864. return dispatcher
  27865. }
  27866. }
  27867. }
  27868. [kGetNetConnect] () {
  27869. return this[kNetConnect]
  27870. }
  27871. pendingInterceptors () {
  27872. const mockAgentClients = this[kClients]
  27873. return Array.from(mockAgentClients.entries())
  27874. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  27875. .filter(({ pending }) => pending)
  27876. }
  27877. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  27878. const pending = this.pendingInterceptors()
  27879. if (pending.length === 0) {
  27880. return
  27881. }
  27882. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  27883. throw new UndiciError(`
  27884. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  27885. ${pendingInterceptorsFormatter.format(pending)}
  27886. `.trim())
  27887. }
  27888. }
  27889. module.exports = MockAgent
  27890. /***/ }),
  27891. /***/ 8687:
  27892. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27893. "use strict";
  27894. const { promisify } = __nccwpck_require__(3837)
  27895. const Client = __nccwpck_require__(3598)
  27896. const { buildMockDispatch } = __nccwpck_require__(9323)
  27897. const {
  27898. kDispatches,
  27899. kMockAgent,
  27900. kClose,
  27901. kOriginalClose,
  27902. kOrigin,
  27903. kOriginalDispatch,
  27904. kConnected
  27905. } = __nccwpck_require__(4347)
  27906. const { MockInterceptor } = __nccwpck_require__(410)
  27907. const Symbols = __nccwpck_require__(2785)
  27908. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27909. /**
  27910. * MockClient provides an API that extends the Client to influence the mockDispatches.
  27911. */
  27912. class MockClient extends Client {
  27913. constructor (origin, opts) {
  27914. super(origin, opts)
  27915. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  27916. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27917. }
  27918. this[kMockAgent] = opts.agent
  27919. this[kOrigin] = origin
  27920. this[kDispatches] = []
  27921. this[kConnected] = 1
  27922. this[kOriginalDispatch] = this.dispatch
  27923. this[kOriginalClose] = this.close.bind(this)
  27924. this.dispatch = buildMockDispatch.call(this)
  27925. this.close = this[kClose]
  27926. }
  27927. get [Symbols.kConnected] () {
  27928. return this[kConnected]
  27929. }
  27930. /**
  27931. * Sets up the base interceptor for mocking replies from undici.
  27932. */
  27933. intercept (opts) {
  27934. return new MockInterceptor(opts, this[kDispatches])
  27935. }
  27936. async [kClose] () {
  27937. await promisify(this[kOriginalClose])()
  27938. this[kConnected] = 0
  27939. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  27940. }
  27941. }
  27942. module.exports = MockClient
  27943. /***/ }),
  27944. /***/ 888:
  27945. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27946. "use strict";
  27947. const { UndiciError } = __nccwpck_require__(8045)
  27948. class MockNotMatchedError extends UndiciError {
  27949. constructor (message) {
  27950. super(message)
  27951. Error.captureStackTrace(this, MockNotMatchedError)
  27952. this.name = 'MockNotMatchedError'
  27953. this.message = message || 'The request does not match any registered mock dispatches'
  27954. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  27955. }
  27956. }
  27957. module.exports = {
  27958. MockNotMatchedError
  27959. }
  27960. /***/ }),
  27961. /***/ 410:
  27962. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27963. "use strict";
  27964. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  27965. const {
  27966. kDispatches,
  27967. kDispatchKey,
  27968. kDefaultHeaders,
  27969. kDefaultTrailers,
  27970. kContentLength,
  27971. kMockDispatch
  27972. } = __nccwpck_require__(4347)
  27973. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27974. const { buildURL } = __nccwpck_require__(3983)
  27975. /**
  27976. * Defines the scope API for an interceptor reply
  27977. */
  27978. class MockScope {
  27979. constructor (mockDispatch) {
  27980. this[kMockDispatch] = mockDispatch
  27981. }
  27982. /**
  27983. * Delay a reply by a set amount in ms.
  27984. */
  27985. delay (waitInMs) {
  27986. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  27987. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  27988. }
  27989. this[kMockDispatch].delay = waitInMs
  27990. return this
  27991. }
  27992. /**
  27993. * For a defined reply, never mark as consumed.
  27994. */
  27995. persist () {
  27996. this[kMockDispatch].persist = true
  27997. return this
  27998. }
  27999. /**
  28000. * Allow one to define a reply for a set amount of matching requests.
  28001. */
  28002. times (repeatTimes) {
  28003. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28004. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28005. }
  28006. this[kMockDispatch].times = repeatTimes
  28007. return this
  28008. }
  28009. }
  28010. /**
  28011. * Defines an interceptor for a Mock
  28012. */
  28013. class MockInterceptor {
  28014. constructor (opts, mockDispatches) {
  28015. if (typeof opts !== 'object') {
  28016. throw new InvalidArgumentError('opts must be an object')
  28017. }
  28018. if (typeof opts.path === 'undefined') {
  28019. throw new InvalidArgumentError('opts.path must be defined')
  28020. }
  28021. if (typeof opts.method === 'undefined') {
  28022. opts.method = 'GET'
  28023. }
  28024. // See https://github.com/nodejs/undici/issues/1245
  28025. // As per RFC 3986, clients are not supposed to send URI
  28026. // fragments to servers when they retrieve a document,
  28027. if (typeof opts.path === 'string') {
  28028. if (opts.query) {
  28029. opts.path = buildURL(opts.path, opts.query)
  28030. } else {
  28031. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28032. const parsedURL = new URL(opts.path, 'data://')
  28033. opts.path = parsedURL.pathname + parsedURL.search
  28034. }
  28035. }
  28036. if (typeof opts.method === 'string') {
  28037. opts.method = opts.method.toUpperCase()
  28038. }
  28039. this[kDispatchKey] = buildKey(opts)
  28040. this[kDispatches] = mockDispatches
  28041. this[kDefaultHeaders] = {}
  28042. this[kDefaultTrailers] = {}
  28043. this[kContentLength] = false
  28044. }
  28045. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28046. const responseData = getResponseData(data)
  28047. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28048. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28049. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28050. return { statusCode, data, headers, trailers }
  28051. }
  28052. validateReplyParameters (statusCode, data, responseOptions) {
  28053. if (typeof statusCode === 'undefined') {
  28054. throw new InvalidArgumentError('statusCode must be defined')
  28055. }
  28056. if (typeof data === 'undefined') {
  28057. throw new InvalidArgumentError('data must be defined')
  28058. }
  28059. if (typeof responseOptions !== 'object') {
  28060. throw new InvalidArgumentError('responseOptions must be an object')
  28061. }
  28062. }
  28063. /**
  28064. * Mock an undici request with a defined reply.
  28065. */
  28066. reply (replyData) {
  28067. // Values of reply aren't available right now as they
  28068. // can only be available when the reply callback is invoked.
  28069. if (typeof replyData === 'function') {
  28070. // We'll first wrap the provided callback in another function,
  28071. // this function will properly resolve the data from the callback
  28072. // when invoked.
  28073. const wrappedDefaultsCallback = (opts) => {
  28074. // Our reply options callback contains the parameter for statusCode, data and options.
  28075. const resolvedData = replyData(opts)
  28076. // Check if it is in the right format
  28077. if (typeof resolvedData !== 'object') {
  28078. throw new InvalidArgumentError('reply options callback must return an object')
  28079. }
  28080. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28081. this.validateReplyParameters(statusCode, data, responseOptions)
  28082. // Since the values can be obtained immediately we return them
  28083. // from this higher order function that will be resolved later.
  28084. return {
  28085. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28086. }
  28087. }
  28088. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28089. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28090. return new MockScope(newMockDispatch)
  28091. }
  28092. // We can have either one or three parameters, if we get here,
  28093. // we should have 1-3 parameters. So we spread the arguments of
  28094. // this function to obtain the parameters, since replyData will always
  28095. // just be the statusCode.
  28096. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28097. this.validateReplyParameters(statusCode, data, responseOptions)
  28098. // Send in-already provided data like usual
  28099. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28100. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28101. return new MockScope(newMockDispatch)
  28102. }
  28103. /**
  28104. * Mock an undici request with a defined error.
  28105. */
  28106. replyWithError (error) {
  28107. if (typeof error === 'undefined') {
  28108. throw new InvalidArgumentError('error must be defined')
  28109. }
  28110. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28111. return new MockScope(newMockDispatch)
  28112. }
  28113. /**
  28114. * Set default reply headers on the interceptor for subsequent replies
  28115. */
  28116. defaultReplyHeaders (headers) {
  28117. if (typeof headers === 'undefined') {
  28118. throw new InvalidArgumentError('headers must be defined')
  28119. }
  28120. this[kDefaultHeaders] = headers
  28121. return this
  28122. }
  28123. /**
  28124. * Set default reply trailers on the interceptor for subsequent replies
  28125. */
  28126. defaultReplyTrailers (trailers) {
  28127. if (typeof trailers === 'undefined') {
  28128. throw new InvalidArgumentError('trailers must be defined')
  28129. }
  28130. this[kDefaultTrailers] = trailers
  28131. return this
  28132. }
  28133. /**
  28134. * Set reply content length header for replies on the interceptor
  28135. */
  28136. replyContentLength () {
  28137. this[kContentLength] = true
  28138. return this
  28139. }
  28140. }
  28141. module.exports.MockInterceptor = MockInterceptor
  28142. module.exports.MockScope = MockScope
  28143. /***/ }),
  28144. /***/ 6193:
  28145. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28146. "use strict";
  28147. const { promisify } = __nccwpck_require__(3837)
  28148. const Pool = __nccwpck_require__(4634)
  28149. const { buildMockDispatch } = __nccwpck_require__(9323)
  28150. const {
  28151. kDispatches,
  28152. kMockAgent,
  28153. kClose,
  28154. kOriginalClose,
  28155. kOrigin,
  28156. kOriginalDispatch,
  28157. kConnected
  28158. } = __nccwpck_require__(4347)
  28159. const { MockInterceptor } = __nccwpck_require__(410)
  28160. const Symbols = __nccwpck_require__(2785)
  28161. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28162. /**
  28163. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28164. */
  28165. class MockPool extends Pool {
  28166. constructor (origin, opts) {
  28167. super(origin, opts)
  28168. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28169. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28170. }
  28171. this[kMockAgent] = opts.agent
  28172. this[kOrigin] = origin
  28173. this[kDispatches] = []
  28174. this[kConnected] = 1
  28175. this[kOriginalDispatch] = this.dispatch
  28176. this[kOriginalClose] = this.close.bind(this)
  28177. this.dispatch = buildMockDispatch.call(this)
  28178. this.close = this[kClose]
  28179. }
  28180. get [Symbols.kConnected] () {
  28181. return this[kConnected]
  28182. }
  28183. /**
  28184. * Sets up the base interceptor for mocking replies from undici.
  28185. */
  28186. intercept (opts) {
  28187. return new MockInterceptor(opts, this[kDispatches])
  28188. }
  28189. async [kClose] () {
  28190. await promisify(this[kOriginalClose])()
  28191. this[kConnected] = 0
  28192. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28193. }
  28194. }
  28195. module.exports = MockPool
  28196. /***/ }),
  28197. /***/ 4347:
  28198. /***/ ((module) => {
  28199. "use strict";
  28200. module.exports = {
  28201. kAgent: Symbol('agent'),
  28202. kOptions: Symbol('options'),
  28203. kFactory: Symbol('factory'),
  28204. kDispatches: Symbol('dispatches'),
  28205. kDispatchKey: Symbol('dispatch key'),
  28206. kDefaultHeaders: Symbol('default headers'),
  28207. kDefaultTrailers: Symbol('default trailers'),
  28208. kContentLength: Symbol('content length'),
  28209. kMockAgent: Symbol('mock agent'),
  28210. kMockAgentSet: Symbol('mock agent set'),
  28211. kMockAgentGet: Symbol('mock agent get'),
  28212. kMockDispatch: Symbol('mock dispatch'),
  28213. kClose: Symbol('close'),
  28214. kOriginalClose: Symbol('original agent close'),
  28215. kOrigin: Symbol('origin'),
  28216. kIsMockActive: Symbol('is mock active'),
  28217. kNetConnect: Symbol('net connect'),
  28218. kGetNetConnect: Symbol('get net connect'),
  28219. kConnected: Symbol('connected')
  28220. }
  28221. /***/ }),
  28222. /***/ 9323:
  28223. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28224. "use strict";
  28225. const { MockNotMatchedError } = __nccwpck_require__(888)
  28226. const {
  28227. kDispatches,
  28228. kMockAgent,
  28229. kOriginalDispatch,
  28230. kOrigin,
  28231. kGetNetConnect
  28232. } = __nccwpck_require__(4347)
  28233. const { buildURL, nop } = __nccwpck_require__(3983)
  28234. const { STATUS_CODES } = __nccwpck_require__(3685)
  28235. const {
  28236. types: {
  28237. isPromise
  28238. }
  28239. } = __nccwpck_require__(3837)
  28240. function matchValue (match, value) {
  28241. if (typeof match === 'string') {
  28242. return match === value
  28243. }
  28244. if (match instanceof RegExp) {
  28245. return match.test(value)
  28246. }
  28247. if (typeof match === 'function') {
  28248. return match(value) === true
  28249. }
  28250. return false
  28251. }
  28252. function lowerCaseEntries (headers) {
  28253. return Object.fromEntries(
  28254. Object.entries(headers).map(([headerName, headerValue]) => {
  28255. return [headerName.toLocaleLowerCase(), headerValue]
  28256. })
  28257. )
  28258. }
  28259. /**
  28260. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28261. * @param {string} key
  28262. */
  28263. function getHeaderByName (headers, key) {
  28264. if (Array.isArray(headers)) {
  28265. for (let i = 0; i < headers.length; i += 2) {
  28266. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28267. return headers[i + 1]
  28268. }
  28269. }
  28270. return undefined
  28271. } else if (typeof headers.get === 'function') {
  28272. return headers.get(key)
  28273. } else {
  28274. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28275. }
  28276. }
  28277. /** @param {string[]} headers */
  28278. function buildHeadersFromArray (headers) { // fetch HeadersList
  28279. const clone = headers.slice()
  28280. const entries = []
  28281. for (let index = 0; index < clone.length; index += 2) {
  28282. entries.push([clone[index], clone[index + 1]])
  28283. }
  28284. return Object.fromEntries(entries)
  28285. }
  28286. function matchHeaders (mockDispatch, headers) {
  28287. if (typeof mockDispatch.headers === 'function') {
  28288. if (Array.isArray(headers)) { // fetch HeadersList
  28289. headers = buildHeadersFromArray(headers)
  28290. }
  28291. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28292. }
  28293. if (typeof mockDispatch.headers === 'undefined') {
  28294. return true
  28295. }
  28296. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28297. return false
  28298. }
  28299. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28300. const headerValue = getHeaderByName(headers, matchHeaderName)
  28301. if (!matchValue(matchHeaderValue, headerValue)) {
  28302. return false
  28303. }
  28304. }
  28305. return true
  28306. }
  28307. function safeUrl (path) {
  28308. if (typeof path !== 'string') {
  28309. return path
  28310. }
  28311. const pathSegments = path.split('?')
  28312. if (pathSegments.length !== 2) {
  28313. return path
  28314. }
  28315. const qp = new URLSearchParams(pathSegments.pop())
  28316. qp.sort()
  28317. return [...pathSegments, qp.toString()].join('?')
  28318. }
  28319. function matchKey (mockDispatch, { path, method, body, headers }) {
  28320. const pathMatch = matchValue(mockDispatch.path, path)
  28321. const methodMatch = matchValue(mockDispatch.method, method)
  28322. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28323. const headersMatch = matchHeaders(mockDispatch, headers)
  28324. return pathMatch && methodMatch && bodyMatch && headersMatch
  28325. }
  28326. function getResponseData (data) {
  28327. if (Buffer.isBuffer(data)) {
  28328. return data
  28329. } else if (typeof data === 'object') {
  28330. return JSON.stringify(data)
  28331. } else {
  28332. return data.toString()
  28333. }
  28334. }
  28335. function getMockDispatch (mockDispatches, key) {
  28336. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28337. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28338. // Match path
  28339. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28340. if (matchedMockDispatches.length === 0) {
  28341. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28342. }
  28343. // Match method
  28344. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28345. if (matchedMockDispatches.length === 0) {
  28346. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28347. }
  28348. // Match body
  28349. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28350. if (matchedMockDispatches.length === 0) {
  28351. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28352. }
  28353. // Match headers
  28354. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28355. if (matchedMockDispatches.length === 0) {
  28356. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28357. }
  28358. return matchedMockDispatches[0]
  28359. }
  28360. function addMockDispatch (mockDispatches, key, data) {
  28361. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28362. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28363. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28364. mockDispatches.push(newMockDispatch)
  28365. return newMockDispatch
  28366. }
  28367. function deleteMockDispatch (mockDispatches, key) {
  28368. const index = mockDispatches.findIndex(dispatch => {
  28369. if (!dispatch.consumed) {
  28370. return false
  28371. }
  28372. return matchKey(dispatch, key)
  28373. })
  28374. if (index !== -1) {
  28375. mockDispatches.splice(index, 1)
  28376. }
  28377. }
  28378. function buildKey (opts) {
  28379. const { path, method, body, headers, query } = opts
  28380. return {
  28381. path,
  28382. method,
  28383. body,
  28384. headers,
  28385. query
  28386. }
  28387. }
  28388. function generateKeyValues (data) {
  28389. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28390. ...keyValuePairs,
  28391. Buffer.from(`${key}`),
  28392. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28393. ], [])
  28394. }
  28395. /**
  28396. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28397. * @param {number} statusCode
  28398. */
  28399. function getStatusText (statusCode) {
  28400. return STATUS_CODES[statusCode] || 'unknown'
  28401. }
  28402. async function getResponse (body) {
  28403. const buffers = []
  28404. for await (const data of body) {
  28405. buffers.push(data)
  28406. }
  28407. return Buffer.concat(buffers).toString('utf8')
  28408. }
  28409. /**
  28410. * Mock dispatch function used to simulate undici dispatches
  28411. */
  28412. function mockDispatch (opts, handler) {
  28413. // Get mock dispatch from built key
  28414. const key = buildKey(opts)
  28415. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28416. mockDispatch.timesInvoked++
  28417. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28418. if (mockDispatch.data.callback) {
  28419. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28420. }
  28421. // Parse mockDispatch data
  28422. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28423. const { timesInvoked, times } = mockDispatch
  28424. // If it's used up and not persistent, mark as consumed
  28425. mockDispatch.consumed = !persist && timesInvoked >= times
  28426. mockDispatch.pending = timesInvoked < times
  28427. // If specified, trigger dispatch error
  28428. if (error !== null) {
  28429. deleteMockDispatch(this[kDispatches], key)
  28430. handler.onError(error)
  28431. return true
  28432. }
  28433. // Handle the request with a delay if necessary
  28434. if (typeof delay === 'number' && delay > 0) {
  28435. setTimeout(() => {
  28436. handleReply(this[kDispatches])
  28437. }, delay)
  28438. } else {
  28439. handleReply(this[kDispatches])
  28440. }
  28441. function handleReply (mockDispatches, _data = data) {
  28442. // fetch's HeadersList is a 1D string array
  28443. const optsHeaders = Array.isArray(opts.headers)
  28444. ? buildHeadersFromArray(opts.headers)
  28445. : opts.headers
  28446. const body = typeof _data === 'function'
  28447. ? _data({ ...opts, headers: optsHeaders })
  28448. : _data
  28449. // util.types.isPromise is likely needed for jest.
  28450. if (isPromise(body)) {
  28451. // If handleReply is asynchronous, throwing an error
  28452. // in the callback will reject the promise, rather than
  28453. // synchronously throw the error, which breaks some tests.
  28454. // Rather, we wait for the callback to resolve if it is a
  28455. // promise, and then re-run handleReply with the new body.
  28456. body.then((newData) => handleReply(mockDispatches, newData))
  28457. return
  28458. }
  28459. const responseData = getResponseData(body)
  28460. const responseHeaders = generateKeyValues(headers)
  28461. const responseTrailers = generateKeyValues(trailers)
  28462. handler.abort = nop
  28463. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28464. handler.onData(Buffer.from(responseData))
  28465. handler.onComplete(responseTrailers)
  28466. deleteMockDispatch(mockDispatches, key)
  28467. }
  28468. function resume () {}
  28469. return true
  28470. }
  28471. function buildMockDispatch () {
  28472. const agent = this[kMockAgent]
  28473. const origin = this[kOrigin]
  28474. const originalDispatch = this[kOriginalDispatch]
  28475. return function dispatch (opts, handler) {
  28476. if (agent.isMockActive) {
  28477. try {
  28478. mockDispatch.call(this, opts, handler)
  28479. } catch (error) {
  28480. if (error instanceof MockNotMatchedError) {
  28481. const netConnect = agent[kGetNetConnect]()
  28482. if (netConnect === false) {
  28483. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28484. }
  28485. if (checkNetConnect(netConnect, origin)) {
  28486. originalDispatch.call(this, opts, handler)
  28487. } else {
  28488. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28489. }
  28490. } else {
  28491. throw error
  28492. }
  28493. }
  28494. } else {
  28495. originalDispatch.call(this, opts, handler)
  28496. }
  28497. }
  28498. }
  28499. function checkNetConnect (netConnect, origin) {
  28500. const url = new URL(origin)
  28501. if (netConnect === true) {
  28502. return true
  28503. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28504. return true
  28505. }
  28506. return false
  28507. }
  28508. function buildMockOptions (opts) {
  28509. if (opts) {
  28510. const { agent, ...mockOptions } = opts
  28511. return mockOptions
  28512. }
  28513. }
  28514. module.exports = {
  28515. getResponseData,
  28516. getMockDispatch,
  28517. addMockDispatch,
  28518. deleteMockDispatch,
  28519. buildKey,
  28520. generateKeyValues,
  28521. matchValue,
  28522. getResponse,
  28523. getStatusText,
  28524. mockDispatch,
  28525. buildMockDispatch,
  28526. checkNetConnect,
  28527. buildMockOptions,
  28528. getHeaderByName
  28529. }
  28530. /***/ }),
  28531. /***/ 6823:
  28532. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28533. "use strict";
  28534. const { Transform } = __nccwpck_require__(2781)
  28535. const { Console } = __nccwpck_require__(6206)
  28536. /**
  28537. * Gets the output of `console.table(…)` as a string.
  28538. */
  28539. module.exports = class PendingInterceptorsFormatter {
  28540. constructor ({ disableColors } = {}) {
  28541. this.transform = new Transform({
  28542. transform (chunk, _enc, cb) {
  28543. cb(null, chunk)
  28544. }
  28545. })
  28546. this.logger = new Console({
  28547. stdout: this.transform,
  28548. inspectOptions: {
  28549. colors: !disableColors && !process.env.CI
  28550. }
  28551. })
  28552. }
  28553. format (pendingInterceptors) {
  28554. const withPrettyHeaders = pendingInterceptors.map(
  28555. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28556. Method: method,
  28557. Origin: origin,
  28558. Path: path,
  28559. 'Status code': statusCode,
  28560. Persistent: persist ? '✅' : '❌',
  28561. Invocations: timesInvoked,
  28562. Remaining: persist ? Infinity : times - timesInvoked
  28563. }))
  28564. this.logger.table(withPrettyHeaders)
  28565. return this.transform.read().toString()
  28566. }
  28567. }
  28568. /***/ }),
  28569. /***/ 8891:
  28570. /***/ ((module) => {
  28571. "use strict";
  28572. const singulars = {
  28573. pronoun: 'it',
  28574. is: 'is',
  28575. was: 'was',
  28576. this: 'this'
  28577. }
  28578. const plurals = {
  28579. pronoun: 'they',
  28580. is: 'are',
  28581. was: 'were',
  28582. this: 'these'
  28583. }
  28584. module.exports = class Pluralizer {
  28585. constructor (singular, plural) {
  28586. this.singular = singular
  28587. this.plural = plural
  28588. }
  28589. pluralize (count) {
  28590. const one = count === 1
  28591. const keys = one ? singulars : plurals
  28592. const noun = one ? this.singular : this.plural
  28593. return { ...keys, count, noun }
  28594. }
  28595. }
  28596. /***/ }),
  28597. /***/ 8266:
  28598. /***/ ((module) => {
  28599. "use strict";
  28600. /* eslint-disable */
  28601. // Extracted from node/lib/internal/fixed_queue.js
  28602. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28603. const kSize = 2048;
  28604. const kMask = kSize - 1;
  28605. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28606. // circular buffers. It looks something like this:
  28607. //
  28608. // head tail
  28609. // | |
  28610. // v v
  28611. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28612. // | [null] | \----- | next | \------- | next |
  28613. // +-----------+ +-----------+ +-----------+
  28614. // | item | <-- bottom | item | <-- bottom | [empty] |
  28615. // | item | | item | | [empty] |
  28616. // | item | | item | | [empty] |
  28617. // | item | | item | | [empty] |
  28618. // | item | | item | bottom --> | item |
  28619. // | item | | item | | item |
  28620. // | ... | | ... | | ... |
  28621. // | item | | item | | item |
  28622. // | item | | item | | item |
  28623. // | [empty] | <-- top | item | | item |
  28624. // | [empty] | | item | | item |
  28625. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28626. // +-----------+ +-----------+ +-----------+
  28627. //
  28628. // Or, if there is only one circular buffer, it looks something
  28629. // like either of these:
  28630. //
  28631. // head tail head tail
  28632. // | | | |
  28633. // v v v v
  28634. // +-----------+ +-----------+
  28635. // | [null] | | [null] |
  28636. // +-----------+ +-----------+
  28637. // | [empty] | | item |
  28638. // | [empty] | | item |
  28639. // | item | <-- bottom top --> | [empty] |
  28640. // | item | | [empty] |
  28641. // | [empty] | <-- top bottom --> | item |
  28642. // | [empty] | | item |
  28643. // +-----------+ +-----------+
  28644. //
  28645. // Adding a value means moving `top` forward by one, removing means
  28646. // moving `bottom` forward by one. After reaching the end, the queue
  28647. // wraps around.
  28648. //
  28649. // When `top === bottom` the current queue is empty and when
  28650. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28651. // but allows much quicker checks.
  28652. class FixedCircularBuffer {
  28653. constructor() {
  28654. this.bottom = 0;
  28655. this.top = 0;
  28656. this.list = new Array(kSize);
  28657. this.next = null;
  28658. }
  28659. isEmpty() {
  28660. return this.top === this.bottom;
  28661. }
  28662. isFull() {
  28663. return ((this.top + 1) & kMask) === this.bottom;
  28664. }
  28665. push(data) {
  28666. this.list[this.top] = data;
  28667. this.top = (this.top + 1) & kMask;
  28668. }
  28669. shift() {
  28670. const nextItem = this.list[this.bottom];
  28671. if (nextItem === undefined)
  28672. return null;
  28673. this.list[this.bottom] = undefined;
  28674. this.bottom = (this.bottom + 1) & kMask;
  28675. return nextItem;
  28676. }
  28677. }
  28678. module.exports = class FixedQueue {
  28679. constructor() {
  28680. this.head = this.tail = new FixedCircularBuffer();
  28681. }
  28682. isEmpty() {
  28683. return this.head.isEmpty();
  28684. }
  28685. push(data) {
  28686. if (this.head.isFull()) {
  28687. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28688. // and sets it as the new main queue.
  28689. this.head = this.head.next = new FixedCircularBuffer();
  28690. }
  28691. this.head.push(data);
  28692. }
  28693. shift() {
  28694. const tail = this.tail;
  28695. const next = tail.shift();
  28696. if (tail.isEmpty() && tail.next !== null) {
  28697. // If there is another queue, it forms the new tail.
  28698. this.tail = tail.next;
  28699. }
  28700. return next;
  28701. }
  28702. };
  28703. /***/ }),
  28704. /***/ 3198:
  28705. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28706. "use strict";
  28707. const DispatcherBase = __nccwpck_require__(4839)
  28708. const FixedQueue = __nccwpck_require__(8266)
  28709. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28710. const PoolStats = __nccwpck_require__(9689)
  28711. const kClients = Symbol('clients')
  28712. const kNeedDrain = Symbol('needDrain')
  28713. const kQueue = Symbol('queue')
  28714. const kClosedResolve = Symbol('closed resolve')
  28715. const kOnDrain = Symbol('onDrain')
  28716. const kOnConnect = Symbol('onConnect')
  28717. const kOnDisconnect = Symbol('onDisconnect')
  28718. const kOnConnectionError = Symbol('onConnectionError')
  28719. const kGetDispatcher = Symbol('get dispatcher')
  28720. const kAddClient = Symbol('add client')
  28721. const kRemoveClient = Symbol('remove client')
  28722. const kStats = Symbol('stats')
  28723. class PoolBase extends DispatcherBase {
  28724. constructor () {
  28725. super()
  28726. this[kQueue] = new FixedQueue()
  28727. this[kClients] = []
  28728. this[kQueued] = 0
  28729. const pool = this
  28730. this[kOnDrain] = function onDrain (origin, targets) {
  28731. const queue = pool[kQueue]
  28732. let needDrain = false
  28733. while (!needDrain) {
  28734. const item = queue.shift()
  28735. if (!item) {
  28736. break
  28737. }
  28738. pool[kQueued]--
  28739. needDrain = !this.dispatch(item.opts, item.handler)
  28740. }
  28741. this[kNeedDrain] = needDrain
  28742. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  28743. pool[kNeedDrain] = false
  28744. pool.emit('drain', origin, [pool, ...targets])
  28745. }
  28746. if (pool[kClosedResolve] && queue.isEmpty()) {
  28747. Promise
  28748. .all(pool[kClients].map(c => c.close()))
  28749. .then(pool[kClosedResolve])
  28750. }
  28751. }
  28752. this[kOnConnect] = (origin, targets) => {
  28753. pool.emit('connect', origin, [pool, ...targets])
  28754. }
  28755. this[kOnDisconnect] = (origin, targets, err) => {
  28756. pool.emit('disconnect', origin, [pool, ...targets], err)
  28757. }
  28758. this[kOnConnectionError] = (origin, targets, err) => {
  28759. pool.emit('connectionError', origin, [pool, ...targets], err)
  28760. }
  28761. this[kStats] = new PoolStats(this)
  28762. }
  28763. get [kBusy] () {
  28764. return this[kNeedDrain]
  28765. }
  28766. get [kConnected] () {
  28767. return this[kClients].filter(client => client[kConnected]).length
  28768. }
  28769. get [kFree] () {
  28770. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  28771. }
  28772. get [kPending] () {
  28773. let ret = this[kQueued]
  28774. for (const { [kPending]: pending } of this[kClients]) {
  28775. ret += pending
  28776. }
  28777. return ret
  28778. }
  28779. get [kRunning] () {
  28780. let ret = 0
  28781. for (const { [kRunning]: running } of this[kClients]) {
  28782. ret += running
  28783. }
  28784. return ret
  28785. }
  28786. get [kSize] () {
  28787. let ret = this[kQueued]
  28788. for (const { [kSize]: size } of this[kClients]) {
  28789. ret += size
  28790. }
  28791. return ret
  28792. }
  28793. get stats () {
  28794. return this[kStats]
  28795. }
  28796. async [kClose] () {
  28797. if (this[kQueue].isEmpty()) {
  28798. return Promise.all(this[kClients].map(c => c.close()))
  28799. } else {
  28800. return new Promise((resolve) => {
  28801. this[kClosedResolve] = resolve
  28802. })
  28803. }
  28804. }
  28805. async [kDestroy] (err) {
  28806. while (true) {
  28807. const item = this[kQueue].shift()
  28808. if (!item) {
  28809. break
  28810. }
  28811. item.handler.onError(err)
  28812. }
  28813. return Promise.all(this[kClients].map(c => c.destroy(err)))
  28814. }
  28815. [kDispatch] (opts, handler) {
  28816. const dispatcher = this[kGetDispatcher]()
  28817. if (!dispatcher) {
  28818. this[kNeedDrain] = true
  28819. this[kQueue].push({ opts, handler })
  28820. this[kQueued]++
  28821. } else if (!dispatcher.dispatch(opts, handler)) {
  28822. dispatcher[kNeedDrain] = true
  28823. this[kNeedDrain] = !this[kGetDispatcher]()
  28824. }
  28825. return !this[kNeedDrain]
  28826. }
  28827. [kAddClient] (client) {
  28828. client
  28829. .on('drain', this[kOnDrain])
  28830. .on('connect', this[kOnConnect])
  28831. .on('disconnect', this[kOnDisconnect])
  28832. .on('connectionError', this[kOnConnectionError])
  28833. this[kClients].push(client)
  28834. if (this[kNeedDrain]) {
  28835. process.nextTick(() => {
  28836. if (this[kNeedDrain]) {
  28837. this[kOnDrain](client[kUrl], [this, client])
  28838. }
  28839. })
  28840. }
  28841. return this
  28842. }
  28843. [kRemoveClient] (client) {
  28844. client.close(() => {
  28845. const idx = this[kClients].indexOf(client)
  28846. if (idx !== -1) {
  28847. this[kClients].splice(idx, 1)
  28848. }
  28849. })
  28850. this[kNeedDrain] = this[kClients].some(dispatcher => (
  28851. !dispatcher[kNeedDrain] &&
  28852. dispatcher.closed !== true &&
  28853. dispatcher.destroyed !== true
  28854. ))
  28855. }
  28856. }
  28857. module.exports = {
  28858. PoolBase,
  28859. kClients,
  28860. kNeedDrain,
  28861. kAddClient,
  28862. kRemoveClient,
  28863. kGetDispatcher
  28864. }
  28865. /***/ }),
  28866. /***/ 9689:
  28867. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28868. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  28869. const kPool = Symbol('pool')
  28870. class PoolStats {
  28871. constructor (pool) {
  28872. this[kPool] = pool
  28873. }
  28874. get connected () {
  28875. return this[kPool][kConnected]
  28876. }
  28877. get free () {
  28878. return this[kPool][kFree]
  28879. }
  28880. get pending () {
  28881. return this[kPool][kPending]
  28882. }
  28883. get queued () {
  28884. return this[kPool][kQueued]
  28885. }
  28886. get running () {
  28887. return this[kPool][kRunning]
  28888. }
  28889. get size () {
  28890. return this[kPool][kSize]
  28891. }
  28892. }
  28893. module.exports = PoolStats
  28894. /***/ }),
  28895. /***/ 4634:
  28896. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28897. "use strict";
  28898. const {
  28899. PoolBase,
  28900. kClients,
  28901. kNeedDrain,
  28902. kAddClient,
  28903. kGetDispatcher
  28904. } = __nccwpck_require__(3198)
  28905. const Client = __nccwpck_require__(3598)
  28906. const {
  28907. InvalidArgumentError
  28908. } = __nccwpck_require__(8045)
  28909. const util = __nccwpck_require__(3983)
  28910. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  28911. const buildConnector = __nccwpck_require__(2067)
  28912. const kOptions = Symbol('options')
  28913. const kConnections = Symbol('connections')
  28914. const kFactory = Symbol('factory')
  28915. function defaultFactory (origin, opts) {
  28916. return new Client(origin, opts)
  28917. }
  28918. class Pool extends PoolBase {
  28919. constructor (origin, {
  28920. connections,
  28921. factory = defaultFactory,
  28922. connect,
  28923. connectTimeout,
  28924. tls,
  28925. maxCachedSessions,
  28926. socketPath,
  28927. autoSelectFamily,
  28928. autoSelectFamilyAttemptTimeout,
  28929. allowH2,
  28930. ...options
  28931. } = {}) {
  28932. super()
  28933. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  28934. throw new InvalidArgumentError('invalid connections')
  28935. }
  28936. if (typeof factory !== 'function') {
  28937. throw new InvalidArgumentError('factory must be a function.')
  28938. }
  28939. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  28940. throw new InvalidArgumentError('connect must be a function or an object')
  28941. }
  28942. if (typeof connect !== 'function') {
  28943. connect = buildConnector({
  28944. ...tls,
  28945. maxCachedSessions,
  28946. allowH2,
  28947. socketPath,
  28948. timeout: connectTimeout,
  28949. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  28950. ...connect
  28951. })
  28952. }
  28953. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  28954. ? options.interceptors.Pool
  28955. : []
  28956. this[kConnections] = connections || null
  28957. this[kUrl] = util.parseOrigin(origin)
  28958. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  28959. this[kOptions].interceptors = options.interceptors
  28960. ? { ...options.interceptors }
  28961. : undefined
  28962. this[kFactory] = factory
  28963. }
  28964. [kGetDispatcher] () {
  28965. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  28966. if (dispatcher) {
  28967. return dispatcher
  28968. }
  28969. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  28970. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  28971. this[kAddClient](dispatcher)
  28972. }
  28973. return dispatcher
  28974. }
  28975. }
  28976. module.exports = Pool
  28977. /***/ }),
  28978. /***/ 7858:
  28979. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28980. "use strict";
  28981. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  28982. const { URL } = __nccwpck_require__(7310)
  28983. const Agent = __nccwpck_require__(7890)
  28984. const Pool = __nccwpck_require__(4634)
  28985. const DispatcherBase = __nccwpck_require__(4839)
  28986. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  28987. const buildConnector = __nccwpck_require__(2067)
  28988. const kAgent = Symbol('proxy agent')
  28989. const kClient = Symbol('proxy client')
  28990. const kProxyHeaders = Symbol('proxy headers')
  28991. const kRequestTls = Symbol('request tls settings')
  28992. const kProxyTls = Symbol('proxy tls settings')
  28993. const kConnectEndpoint = Symbol('connect endpoint function')
  28994. function defaultProtocolPort (protocol) {
  28995. return protocol === 'https:' ? 443 : 80
  28996. }
  28997. function buildProxyOptions (opts) {
  28998. if (typeof opts === 'string') {
  28999. opts = { uri: opts }
  29000. }
  29001. if (!opts || !opts.uri) {
  29002. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29003. }
  29004. return {
  29005. uri: opts.uri,
  29006. protocol: opts.protocol || 'https'
  29007. }
  29008. }
  29009. function defaultFactory (origin, opts) {
  29010. return new Pool(origin, opts)
  29011. }
  29012. class ProxyAgent extends DispatcherBase {
  29013. constructor (opts) {
  29014. super(opts)
  29015. this[kProxy] = buildProxyOptions(opts)
  29016. this[kAgent] = new Agent(opts)
  29017. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29018. ? opts.interceptors.ProxyAgent
  29019. : []
  29020. if (typeof opts === 'string') {
  29021. opts = { uri: opts }
  29022. }
  29023. if (!opts || !opts.uri) {
  29024. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29025. }
  29026. const { clientFactory = defaultFactory } = opts
  29027. if (typeof clientFactory !== 'function') {
  29028. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29029. }
  29030. this[kRequestTls] = opts.requestTls
  29031. this[kProxyTls] = opts.proxyTls
  29032. this[kProxyHeaders] = opts.headers || {}
  29033. const resolvedUrl = new URL(opts.uri)
  29034. const { origin, port, host, username, password } = resolvedUrl
  29035. if (opts.auth && opts.token) {
  29036. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29037. } else if (opts.auth) {
  29038. /* @deprecated in favour of opts.token */
  29039. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29040. } else if (opts.token) {
  29041. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29042. } else if (username && password) {
  29043. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29044. }
  29045. const connect = buildConnector({ ...opts.proxyTls })
  29046. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29047. this[kClient] = clientFactory(resolvedUrl, { connect })
  29048. this[kAgent] = new Agent({
  29049. ...opts,
  29050. connect: async (opts, callback) => {
  29051. let requestedHost = opts.host
  29052. if (!opts.port) {
  29053. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29054. }
  29055. try {
  29056. const { socket, statusCode } = await this[kClient].connect({
  29057. origin,
  29058. port,
  29059. path: requestedHost,
  29060. signal: opts.signal,
  29061. headers: {
  29062. ...this[kProxyHeaders],
  29063. host
  29064. }
  29065. })
  29066. if (statusCode !== 200) {
  29067. socket.on('error', () => {}).destroy()
  29068. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29069. }
  29070. if (opts.protocol !== 'https:') {
  29071. callback(null, socket)
  29072. return
  29073. }
  29074. let servername
  29075. if (this[kRequestTls]) {
  29076. servername = this[kRequestTls].servername
  29077. } else {
  29078. servername = opts.servername
  29079. }
  29080. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29081. } catch (err) {
  29082. callback(err)
  29083. }
  29084. }
  29085. })
  29086. }
  29087. dispatch (opts, handler) {
  29088. const { host } = new URL(opts.origin)
  29089. const headers = buildHeaders(opts.headers)
  29090. throwIfProxyAuthIsSent(headers)
  29091. return this[kAgent].dispatch(
  29092. {
  29093. ...opts,
  29094. headers: {
  29095. ...headers,
  29096. host
  29097. }
  29098. },
  29099. handler
  29100. )
  29101. }
  29102. async [kClose] () {
  29103. await this[kAgent].close()
  29104. await this[kClient].close()
  29105. }
  29106. async [kDestroy] () {
  29107. await this[kAgent].destroy()
  29108. await this[kClient].destroy()
  29109. }
  29110. }
  29111. /**
  29112. * @param {string[] | Record<string, string>} headers
  29113. * @returns {Record<string, string>}
  29114. */
  29115. function buildHeaders (headers) {
  29116. // When using undici.fetch, the headers list is stored
  29117. // as an array.
  29118. if (Array.isArray(headers)) {
  29119. /** @type {Record<string, string>} */
  29120. const headersPair = {}
  29121. for (let i = 0; i < headers.length; i += 2) {
  29122. headersPair[headers[i]] = headers[i + 1]
  29123. }
  29124. return headersPair
  29125. }
  29126. return headers
  29127. }
  29128. /**
  29129. * @param {Record<string, string>} headers
  29130. *
  29131. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29132. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29133. * this check was created.
  29134. * It should be removed in the next major version for performance reasons
  29135. */
  29136. function throwIfProxyAuthIsSent (headers) {
  29137. const existProxyAuth = headers && Object.keys(headers)
  29138. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29139. if (existProxyAuth) {
  29140. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29141. }
  29142. }
  29143. module.exports = ProxyAgent
  29144. /***/ }),
  29145. /***/ 9459:
  29146. /***/ ((module) => {
  29147. "use strict";
  29148. let fastNow = Date.now()
  29149. let fastNowTimeout
  29150. const fastTimers = []
  29151. function onTimeout () {
  29152. fastNow = Date.now()
  29153. let len = fastTimers.length
  29154. let idx = 0
  29155. while (idx < len) {
  29156. const timer = fastTimers[idx]
  29157. if (timer.state === 0) {
  29158. timer.state = fastNow + timer.delay
  29159. } else if (timer.state > 0 && fastNow >= timer.state) {
  29160. timer.state = -1
  29161. timer.callback(timer.opaque)
  29162. }
  29163. if (timer.state === -1) {
  29164. timer.state = -2
  29165. if (idx !== len - 1) {
  29166. fastTimers[idx] = fastTimers.pop()
  29167. } else {
  29168. fastTimers.pop()
  29169. }
  29170. len -= 1
  29171. } else {
  29172. idx += 1
  29173. }
  29174. }
  29175. if (fastTimers.length > 0) {
  29176. refreshTimeout()
  29177. }
  29178. }
  29179. function refreshTimeout () {
  29180. if (fastNowTimeout && fastNowTimeout.refresh) {
  29181. fastNowTimeout.refresh()
  29182. } else {
  29183. clearTimeout(fastNowTimeout)
  29184. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29185. if (fastNowTimeout.unref) {
  29186. fastNowTimeout.unref()
  29187. }
  29188. }
  29189. }
  29190. class Timeout {
  29191. constructor (callback, delay, opaque) {
  29192. this.callback = callback
  29193. this.delay = delay
  29194. this.opaque = opaque
  29195. // -2 not in timer list
  29196. // -1 in timer list but inactive
  29197. // 0 in timer list waiting for time
  29198. // > 0 in timer list waiting for time to expire
  29199. this.state = -2
  29200. this.refresh()
  29201. }
  29202. refresh () {
  29203. if (this.state === -2) {
  29204. fastTimers.push(this)
  29205. if (!fastNowTimeout || fastTimers.length === 1) {
  29206. refreshTimeout()
  29207. }
  29208. }
  29209. this.state = 0
  29210. }
  29211. clear () {
  29212. this.state = -1
  29213. }
  29214. }
  29215. module.exports = {
  29216. setTimeout (callback, delay, opaque) {
  29217. return delay < 1e3
  29218. ? setTimeout(callback, delay, opaque)
  29219. : new Timeout(callback, delay, opaque)
  29220. },
  29221. clearTimeout (timeout) {
  29222. if (timeout instanceof Timeout) {
  29223. timeout.clear()
  29224. } else {
  29225. clearTimeout(timeout)
  29226. }
  29227. }
  29228. }
  29229. /***/ }),
  29230. /***/ 5354:
  29231. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29232. "use strict";
  29233. const diagnosticsChannel = __nccwpck_require__(7643)
  29234. const { uid, states } = __nccwpck_require__(9188)
  29235. const {
  29236. kReadyState,
  29237. kSentClose,
  29238. kByteParser,
  29239. kReceivedClose
  29240. } = __nccwpck_require__(7578)
  29241. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29242. const { CloseEvent } = __nccwpck_require__(2611)
  29243. const { makeRequest } = __nccwpck_require__(8359)
  29244. const { fetching } = __nccwpck_require__(4881)
  29245. const { Headers } = __nccwpck_require__(554)
  29246. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29247. const { kHeadersList } = __nccwpck_require__(2785)
  29248. const channels = {}
  29249. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29250. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29251. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29252. /** @type {import('crypto')} */
  29253. let crypto
  29254. try {
  29255. crypto = __nccwpck_require__(6113)
  29256. } catch {
  29257. }
  29258. /**
  29259. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29260. * @param {URL} url
  29261. * @param {string|string[]} protocols
  29262. * @param {import('./websocket').WebSocket} ws
  29263. * @param {(response: any) => void} onEstablish
  29264. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29265. */
  29266. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29267. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29268. // scheme is "ws", and to "https" otherwise.
  29269. const requestURL = url
  29270. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29271. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29272. // service-workers mode is "none", referrer is "no-referrer", mode is
  29273. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29274. // and redirect mode is "error".
  29275. const request = makeRequest({
  29276. urlList: [requestURL],
  29277. serviceWorkers: 'none',
  29278. referrer: 'no-referrer',
  29279. mode: 'websocket',
  29280. credentials: 'include',
  29281. cache: 'no-store',
  29282. redirect: 'error'
  29283. })
  29284. // Note: undici extension, allow setting custom headers.
  29285. if (options.headers) {
  29286. const headersList = new Headers(options.headers)[kHeadersList]
  29287. request.headersList = headersList
  29288. }
  29289. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29290. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29291. // Note: both of these are handled by undici currently.
  29292. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29293. // 5. Let keyValue be a nonce consisting of a randomly selected
  29294. // 16-byte value that has been forgiving-base64-encoded and
  29295. // isomorphic encoded.
  29296. const keyValue = crypto.randomBytes(16).toString('base64')
  29297. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29298. // header list.
  29299. request.headersList.append('sec-websocket-key', keyValue)
  29300. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29301. // header list.
  29302. request.headersList.append('sec-websocket-version', '13')
  29303. // 8. For each protocol in protocols, combine
  29304. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29305. // list.
  29306. for (const protocol of protocols) {
  29307. request.headersList.append('sec-websocket-protocol', protocol)
  29308. }
  29309. // 9. Let permessageDeflate be a user-agent defined
  29310. // "permessage-deflate" extension header value.
  29311. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29312. // TODO: enable once permessage-deflate is supported
  29313. const permessageDeflate = '' // 'permessage-deflate; 15'
  29314. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29315. // request’s header list.
  29316. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29317. // 11. Fetch request with useParallelQueue set to true, and
  29318. // processResponse given response being these steps:
  29319. const controller = fetching({
  29320. request,
  29321. useParallelQueue: true,
  29322. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29323. processResponse (response) {
  29324. // 1. If response is a network error or its status is not 101,
  29325. // fail the WebSocket connection.
  29326. if (response.type === 'error' || response.status !== 101) {
  29327. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29328. return
  29329. }
  29330. // 2. If protocols is not the empty list and extracting header
  29331. // list values given `Sec-WebSocket-Protocol` and response’s
  29332. // header list results in null, failure, or the empty byte
  29333. // sequence, then fail the WebSocket connection.
  29334. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29335. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29336. return
  29337. }
  29338. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29339. // of the last set of steps in section 4.1 of The WebSocket
  29340. // Protocol to validate response. This either results in fail
  29341. // the WebSocket connection or the WebSocket connection is
  29342. // established.
  29343. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29344. // header field contains a value that is not an ASCII case-
  29345. // insensitive match for the value "websocket", the client MUST
  29346. // _Fail the WebSocket Connection_.
  29347. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29348. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29349. return
  29350. }
  29351. // 3. If the response lacks a |Connection| header field or the
  29352. // |Connection| header field doesn't contain a token that is an
  29353. // ASCII case-insensitive match for the value "Upgrade", the client
  29354. // MUST _Fail the WebSocket Connection_.
  29355. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29356. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29357. return
  29358. }
  29359. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29360. // the |Sec-WebSocket-Accept| contains a value other than the
  29361. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29362. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29363. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29364. // trailing whitespace, the client MUST _Fail the WebSocket
  29365. // Connection_.
  29366. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29367. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29368. if (secWSAccept !== digest) {
  29369. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29370. return
  29371. }
  29372. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29373. // field and this header field indicates the use of an extension
  29374. // that was not present in the client's handshake (the server has
  29375. // indicated an extension not requested by the client), the client
  29376. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29377. // header field to determine which extensions are requested is
  29378. // discussed in Section 9.1.)
  29379. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29380. if (secExtension !== null && secExtension !== permessageDeflate) {
  29381. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29382. return
  29383. }
  29384. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29385. // and this header field indicates the use of a subprotocol that was
  29386. // not present in the client's handshake (the server has indicated a
  29387. // subprotocol not requested by the client), the client MUST _Fail
  29388. // the WebSocket Connection_.
  29389. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29390. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29391. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29392. return
  29393. }
  29394. response.socket.on('data', onSocketData)
  29395. response.socket.on('close', onSocketClose)
  29396. response.socket.on('error', onSocketError)
  29397. if (channels.open.hasSubscribers) {
  29398. channels.open.publish({
  29399. address: response.socket.address(),
  29400. protocol: secProtocol,
  29401. extensions: secExtension
  29402. })
  29403. }
  29404. onEstablish(response)
  29405. }
  29406. })
  29407. return controller
  29408. }
  29409. /**
  29410. * @param {Buffer} chunk
  29411. */
  29412. function onSocketData (chunk) {
  29413. if (!this.ws[kByteParser].write(chunk)) {
  29414. this.pause()
  29415. }
  29416. }
  29417. /**
  29418. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29419. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29420. */
  29421. function onSocketClose () {
  29422. const { ws } = this
  29423. // If the TCP connection was closed after the
  29424. // WebSocket closing handshake was completed, the WebSocket connection
  29425. // is said to have been closed _cleanly_.
  29426. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29427. let code = 1005
  29428. let reason = ''
  29429. const result = ws[kByteParser].closingInfo
  29430. if (result) {
  29431. code = result.code ?? 1005
  29432. reason = result.reason
  29433. } else if (!ws[kSentClose]) {
  29434. // If _The WebSocket
  29435. // Connection is Closed_ and no Close control frame was received by the
  29436. // endpoint (such as could occur if the underlying transport connection
  29437. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29438. // 1006.
  29439. code = 1006
  29440. }
  29441. // 1. Change the ready state to CLOSED (3).
  29442. ws[kReadyState] = states.CLOSED
  29443. // 2. If the user agent was required to fail the WebSocket
  29444. // connection, or if the WebSocket connection was closed
  29445. // after being flagged as full, fire an event named error
  29446. // at the WebSocket object.
  29447. // TODO
  29448. // 3. Fire an event named close at the WebSocket object,
  29449. // using CloseEvent, with the wasClean attribute
  29450. // initialized to true if the connection closed cleanly
  29451. // and false otherwise, the code attribute initialized to
  29452. // the WebSocket connection close code, and the reason
  29453. // attribute initialized to the result of applying UTF-8
  29454. // decode without BOM to the WebSocket connection close
  29455. // reason.
  29456. fireEvent('close', ws, CloseEvent, {
  29457. wasClean, code, reason
  29458. })
  29459. if (channels.close.hasSubscribers) {
  29460. channels.close.publish({
  29461. websocket: ws,
  29462. code,
  29463. reason
  29464. })
  29465. }
  29466. }
  29467. function onSocketError (error) {
  29468. const { ws } = this
  29469. ws[kReadyState] = states.CLOSING
  29470. if (channels.socketError.hasSubscribers) {
  29471. channels.socketError.publish(error)
  29472. }
  29473. this.destroy()
  29474. }
  29475. module.exports = {
  29476. establishWebSocketConnection
  29477. }
  29478. /***/ }),
  29479. /***/ 9188:
  29480. /***/ ((module) => {
  29481. "use strict";
  29482. // This is a Globally Unique Identifier unique used
  29483. // to validate that the endpoint accepts websocket
  29484. // connections.
  29485. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29486. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29487. /** @type {PropertyDescriptor} */
  29488. const staticPropertyDescriptors = {
  29489. enumerable: true,
  29490. writable: false,
  29491. configurable: false
  29492. }
  29493. const states = {
  29494. CONNECTING: 0,
  29495. OPEN: 1,
  29496. CLOSING: 2,
  29497. CLOSED: 3
  29498. }
  29499. const opcodes = {
  29500. CONTINUATION: 0x0,
  29501. TEXT: 0x1,
  29502. BINARY: 0x2,
  29503. CLOSE: 0x8,
  29504. PING: 0x9,
  29505. PONG: 0xA
  29506. }
  29507. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29508. const parserStates = {
  29509. INFO: 0,
  29510. PAYLOADLENGTH_16: 2,
  29511. PAYLOADLENGTH_64: 3,
  29512. READ_DATA: 4
  29513. }
  29514. const emptyBuffer = Buffer.allocUnsafe(0)
  29515. module.exports = {
  29516. uid,
  29517. staticPropertyDescriptors,
  29518. states,
  29519. opcodes,
  29520. maxUnsigned16Bit,
  29521. parserStates,
  29522. emptyBuffer
  29523. }
  29524. /***/ }),
  29525. /***/ 2611:
  29526. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29527. "use strict";
  29528. const { webidl } = __nccwpck_require__(1744)
  29529. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29530. const { MessagePort } = __nccwpck_require__(1267)
  29531. /**
  29532. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29533. */
  29534. class MessageEvent extends Event {
  29535. #eventInit
  29536. constructor (type, eventInitDict = {}) {
  29537. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29538. type = webidl.converters.DOMString(type)
  29539. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29540. super(type, eventInitDict)
  29541. this.#eventInit = eventInitDict
  29542. }
  29543. get data () {
  29544. webidl.brandCheck(this, MessageEvent)
  29545. return this.#eventInit.data
  29546. }
  29547. get origin () {
  29548. webidl.brandCheck(this, MessageEvent)
  29549. return this.#eventInit.origin
  29550. }
  29551. get lastEventId () {
  29552. webidl.brandCheck(this, MessageEvent)
  29553. return this.#eventInit.lastEventId
  29554. }
  29555. get source () {
  29556. webidl.brandCheck(this, MessageEvent)
  29557. return this.#eventInit.source
  29558. }
  29559. get ports () {
  29560. webidl.brandCheck(this, MessageEvent)
  29561. if (!Object.isFrozen(this.#eventInit.ports)) {
  29562. Object.freeze(this.#eventInit.ports)
  29563. }
  29564. return this.#eventInit.ports
  29565. }
  29566. initMessageEvent (
  29567. type,
  29568. bubbles = false,
  29569. cancelable = false,
  29570. data = null,
  29571. origin = '',
  29572. lastEventId = '',
  29573. source = null,
  29574. ports = []
  29575. ) {
  29576. webidl.brandCheck(this, MessageEvent)
  29577. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29578. return new MessageEvent(type, {
  29579. bubbles, cancelable, data, origin, lastEventId, source, ports
  29580. })
  29581. }
  29582. }
  29583. /**
  29584. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29585. */
  29586. class CloseEvent extends Event {
  29587. #eventInit
  29588. constructor (type, eventInitDict = {}) {
  29589. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29590. type = webidl.converters.DOMString(type)
  29591. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29592. super(type, eventInitDict)
  29593. this.#eventInit = eventInitDict
  29594. }
  29595. get wasClean () {
  29596. webidl.brandCheck(this, CloseEvent)
  29597. return this.#eventInit.wasClean
  29598. }
  29599. get code () {
  29600. webidl.brandCheck(this, CloseEvent)
  29601. return this.#eventInit.code
  29602. }
  29603. get reason () {
  29604. webidl.brandCheck(this, CloseEvent)
  29605. return this.#eventInit.reason
  29606. }
  29607. }
  29608. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29609. class ErrorEvent extends Event {
  29610. #eventInit
  29611. constructor (type, eventInitDict) {
  29612. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29613. super(type, eventInitDict)
  29614. type = webidl.converters.DOMString(type)
  29615. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29616. this.#eventInit = eventInitDict
  29617. }
  29618. get message () {
  29619. webidl.brandCheck(this, ErrorEvent)
  29620. return this.#eventInit.message
  29621. }
  29622. get filename () {
  29623. webidl.brandCheck(this, ErrorEvent)
  29624. return this.#eventInit.filename
  29625. }
  29626. get lineno () {
  29627. webidl.brandCheck(this, ErrorEvent)
  29628. return this.#eventInit.lineno
  29629. }
  29630. get colno () {
  29631. webidl.brandCheck(this, ErrorEvent)
  29632. return this.#eventInit.colno
  29633. }
  29634. get error () {
  29635. webidl.brandCheck(this, ErrorEvent)
  29636. return this.#eventInit.error
  29637. }
  29638. }
  29639. Object.defineProperties(MessageEvent.prototype, {
  29640. [Symbol.toStringTag]: {
  29641. value: 'MessageEvent',
  29642. configurable: true
  29643. },
  29644. data: kEnumerableProperty,
  29645. origin: kEnumerableProperty,
  29646. lastEventId: kEnumerableProperty,
  29647. source: kEnumerableProperty,
  29648. ports: kEnumerableProperty,
  29649. initMessageEvent: kEnumerableProperty
  29650. })
  29651. Object.defineProperties(CloseEvent.prototype, {
  29652. [Symbol.toStringTag]: {
  29653. value: 'CloseEvent',
  29654. configurable: true
  29655. },
  29656. reason: kEnumerableProperty,
  29657. code: kEnumerableProperty,
  29658. wasClean: kEnumerableProperty
  29659. })
  29660. Object.defineProperties(ErrorEvent.prototype, {
  29661. [Symbol.toStringTag]: {
  29662. value: 'ErrorEvent',
  29663. configurable: true
  29664. },
  29665. message: kEnumerableProperty,
  29666. filename: kEnumerableProperty,
  29667. lineno: kEnumerableProperty,
  29668. colno: kEnumerableProperty,
  29669. error: kEnumerableProperty
  29670. })
  29671. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29672. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29673. webidl.converters.MessagePort
  29674. )
  29675. const eventInit = [
  29676. {
  29677. key: 'bubbles',
  29678. converter: webidl.converters.boolean,
  29679. defaultValue: false
  29680. },
  29681. {
  29682. key: 'cancelable',
  29683. converter: webidl.converters.boolean,
  29684. defaultValue: false
  29685. },
  29686. {
  29687. key: 'composed',
  29688. converter: webidl.converters.boolean,
  29689. defaultValue: false
  29690. }
  29691. ]
  29692. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29693. ...eventInit,
  29694. {
  29695. key: 'data',
  29696. converter: webidl.converters.any,
  29697. defaultValue: null
  29698. },
  29699. {
  29700. key: 'origin',
  29701. converter: webidl.converters.USVString,
  29702. defaultValue: ''
  29703. },
  29704. {
  29705. key: 'lastEventId',
  29706. converter: webidl.converters.DOMString,
  29707. defaultValue: ''
  29708. },
  29709. {
  29710. key: 'source',
  29711. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29712. // valid value for source is a MessagePort.
  29713. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29714. defaultValue: null
  29715. },
  29716. {
  29717. key: 'ports',
  29718. converter: webidl.converters['sequence<MessagePort>'],
  29719. get defaultValue () {
  29720. return []
  29721. }
  29722. }
  29723. ])
  29724. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  29725. ...eventInit,
  29726. {
  29727. key: 'wasClean',
  29728. converter: webidl.converters.boolean,
  29729. defaultValue: false
  29730. },
  29731. {
  29732. key: 'code',
  29733. converter: webidl.converters['unsigned short'],
  29734. defaultValue: 0
  29735. },
  29736. {
  29737. key: 'reason',
  29738. converter: webidl.converters.USVString,
  29739. defaultValue: ''
  29740. }
  29741. ])
  29742. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  29743. ...eventInit,
  29744. {
  29745. key: 'message',
  29746. converter: webidl.converters.DOMString,
  29747. defaultValue: ''
  29748. },
  29749. {
  29750. key: 'filename',
  29751. converter: webidl.converters.USVString,
  29752. defaultValue: ''
  29753. },
  29754. {
  29755. key: 'lineno',
  29756. converter: webidl.converters['unsigned long'],
  29757. defaultValue: 0
  29758. },
  29759. {
  29760. key: 'colno',
  29761. converter: webidl.converters['unsigned long'],
  29762. defaultValue: 0
  29763. },
  29764. {
  29765. key: 'error',
  29766. converter: webidl.converters.any
  29767. }
  29768. ])
  29769. module.exports = {
  29770. MessageEvent,
  29771. CloseEvent,
  29772. ErrorEvent
  29773. }
  29774. /***/ }),
  29775. /***/ 5444:
  29776. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29777. "use strict";
  29778. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  29779. /** @type {import('crypto')} */
  29780. let crypto
  29781. try {
  29782. crypto = __nccwpck_require__(6113)
  29783. } catch {
  29784. }
  29785. class WebsocketFrameSend {
  29786. /**
  29787. * @param {Buffer|undefined} data
  29788. */
  29789. constructor (data) {
  29790. this.frameData = data
  29791. this.maskKey = crypto.randomBytes(4)
  29792. }
  29793. createFrame (opcode) {
  29794. const bodyLength = this.frameData?.byteLength ?? 0
  29795. /** @type {number} */
  29796. let payloadLength = bodyLength // 0-125
  29797. let offset = 6
  29798. if (bodyLength > maxUnsigned16Bit) {
  29799. offset += 8 // payload length is next 8 bytes
  29800. payloadLength = 127
  29801. } else if (bodyLength > 125) {
  29802. offset += 2 // payload length is next 2 bytes
  29803. payloadLength = 126
  29804. }
  29805. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  29806. // Clear first 2 bytes, everything else is overwritten
  29807. buffer[0] = buffer[1] = 0
  29808. buffer[0] |= 0x80 // FIN
  29809. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  29810. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  29811. buffer[offset - 4] = this.maskKey[0]
  29812. buffer[offset - 3] = this.maskKey[1]
  29813. buffer[offset - 2] = this.maskKey[2]
  29814. buffer[offset - 1] = this.maskKey[3]
  29815. buffer[1] = payloadLength
  29816. if (payloadLength === 126) {
  29817. buffer.writeUInt16BE(bodyLength, 2)
  29818. } else if (payloadLength === 127) {
  29819. // Clear extended payload length
  29820. buffer[2] = buffer[3] = 0
  29821. buffer.writeUIntBE(bodyLength, 4, 6)
  29822. }
  29823. buffer[1] |= 0x80 // MASK
  29824. // mask body
  29825. for (let i = 0; i < bodyLength; i++) {
  29826. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  29827. }
  29828. return buffer
  29829. }
  29830. }
  29831. module.exports = {
  29832. WebsocketFrameSend
  29833. }
  29834. /***/ }),
  29835. /***/ 1688:
  29836. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29837. "use strict";
  29838. const { Writable } = __nccwpck_require__(2781)
  29839. const diagnosticsChannel = __nccwpck_require__(7643)
  29840. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  29841. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  29842. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  29843. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  29844. // This code was influenced by ws released under the MIT license.
  29845. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  29846. // Copyright (c) 2013 Arnout Kazemier and contributors
  29847. // Copyright (c) 2016 Luigi Pinca and contributors
  29848. const channels = {}
  29849. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  29850. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  29851. class ByteParser extends Writable {
  29852. #buffers = []
  29853. #byteOffset = 0
  29854. #state = parserStates.INFO
  29855. #info = {}
  29856. #fragments = []
  29857. constructor (ws) {
  29858. super()
  29859. this.ws = ws
  29860. }
  29861. /**
  29862. * @param {Buffer} chunk
  29863. * @param {() => void} callback
  29864. */
  29865. _write (chunk, _, callback) {
  29866. this.#buffers.push(chunk)
  29867. this.#byteOffset += chunk.length
  29868. this.run(callback)
  29869. }
  29870. /**
  29871. * Runs whenever a new chunk is received.
  29872. * Callback is called whenever there are no more chunks buffering,
  29873. * or not enough bytes are buffered to parse.
  29874. */
  29875. run (callback) {
  29876. while (true) {
  29877. if (this.#state === parserStates.INFO) {
  29878. // If there aren't enough bytes to parse the payload length, etc.
  29879. if (this.#byteOffset < 2) {
  29880. return callback()
  29881. }
  29882. const buffer = this.consume(2)
  29883. this.#info.fin = (buffer[0] & 0x80) !== 0
  29884. this.#info.opcode = buffer[0] & 0x0F
  29885. // If we receive a fragmented message, we use the type of the first
  29886. // frame to parse the full message as binary/text, when it's terminated
  29887. this.#info.originalOpcode ??= this.#info.opcode
  29888. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  29889. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  29890. // Only text and binary frames can be fragmented
  29891. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  29892. return
  29893. }
  29894. const payloadLength = buffer[1] & 0x7F
  29895. if (payloadLength <= 125) {
  29896. this.#info.payloadLength = payloadLength
  29897. this.#state = parserStates.READ_DATA
  29898. } else if (payloadLength === 126) {
  29899. this.#state = parserStates.PAYLOADLENGTH_16
  29900. } else if (payloadLength === 127) {
  29901. this.#state = parserStates.PAYLOADLENGTH_64
  29902. }
  29903. if (this.#info.fragmented && payloadLength > 125) {
  29904. // A fragmented frame can't be fragmented itself
  29905. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  29906. return
  29907. } else if (
  29908. (this.#info.opcode === opcodes.PING ||
  29909. this.#info.opcode === opcodes.PONG ||
  29910. this.#info.opcode === opcodes.CLOSE) &&
  29911. payloadLength > 125
  29912. ) {
  29913. // Control frames can have a payload length of 125 bytes MAX
  29914. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  29915. return
  29916. } else if (this.#info.opcode === opcodes.CLOSE) {
  29917. if (payloadLength === 1) {
  29918. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  29919. return
  29920. }
  29921. const body = this.consume(payloadLength)
  29922. this.#info.closeInfo = this.parseCloseBody(false, body)
  29923. if (!this.ws[kSentClose]) {
  29924. // If an endpoint receives a Close frame and did not previously send a
  29925. // Close frame, the endpoint MUST send a Close frame in response. (When
  29926. // sending a Close frame in response, the endpoint typically echos the
  29927. // status code it received.)
  29928. const body = Buffer.allocUnsafe(2)
  29929. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  29930. const closeFrame = new WebsocketFrameSend(body)
  29931. this.ws[kResponse].socket.write(
  29932. closeFrame.createFrame(opcodes.CLOSE),
  29933. (err) => {
  29934. if (!err) {
  29935. this.ws[kSentClose] = true
  29936. }
  29937. }
  29938. )
  29939. }
  29940. // Upon either sending or receiving a Close control frame, it is said
  29941. // that _The WebSocket Closing Handshake is Started_ and that the
  29942. // WebSocket connection is in the CLOSING state.
  29943. this.ws[kReadyState] = states.CLOSING
  29944. this.ws[kReceivedClose] = true
  29945. this.end()
  29946. return
  29947. } else if (this.#info.opcode === opcodes.PING) {
  29948. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  29949. // response, unless it already received a Close frame.
  29950. // A Pong frame sent in response to a Ping frame must have identical
  29951. // "Application data"
  29952. const body = this.consume(payloadLength)
  29953. if (!this.ws[kReceivedClose]) {
  29954. const frame = new WebsocketFrameSend(body)
  29955. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  29956. if (channels.ping.hasSubscribers) {
  29957. channels.ping.publish({
  29958. payload: body
  29959. })
  29960. }
  29961. }
  29962. this.#state = parserStates.INFO
  29963. if (this.#byteOffset > 0) {
  29964. continue
  29965. } else {
  29966. callback()
  29967. return
  29968. }
  29969. } else if (this.#info.opcode === opcodes.PONG) {
  29970. // A Pong frame MAY be sent unsolicited. This serves as a
  29971. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  29972. // not expected.
  29973. const body = this.consume(payloadLength)
  29974. if (channels.pong.hasSubscribers) {
  29975. channels.pong.publish({
  29976. payload: body
  29977. })
  29978. }
  29979. if (this.#byteOffset > 0) {
  29980. continue
  29981. } else {
  29982. callback()
  29983. return
  29984. }
  29985. }
  29986. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  29987. if (this.#byteOffset < 2) {
  29988. return callback()
  29989. }
  29990. const buffer = this.consume(2)
  29991. this.#info.payloadLength = buffer.readUInt16BE(0)
  29992. this.#state = parserStates.READ_DATA
  29993. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  29994. if (this.#byteOffset < 8) {
  29995. return callback()
  29996. }
  29997. const buffer = this.consume(8)
  29998. const upper = buffer.readUInt32BE(0)
  29999. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30000. // on 32-bit systems. Although, on 64-bit systems, this is
  30001. // 2^53-1 bytes.
  30002. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30003. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30004. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30005. if (upper > 2 ** 31 - 1) {
  30006. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30007. return
  30008. }
  30009. const lower = buffer.readUInt32BE(4)
  30010. this.#info.payloadLength = (upper << 8) + lower
  30011. this.#state = parserStates.READ_DATA
  30012. } else if (this.#state === parserStates.READ_DATA) {
  30013. if (this.#byteOffset < this.#info.payloadLength) {
  30014. // If there is still more data in this chunk that needs to be read
  30015. return callback()
  30016. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30017. // If the server sent multiple frames in a single chunk
  30018. const body = this.consume(this.#info.payloadLength)
  30019. this.#fragments.push(body)
  30020. // If the frame is unfragmented, or a fragmented frame was terminated,
  30021. // a message was received
  30022. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30023. const fullMessage = Buffer.concat(this.#fragments)
  30024. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30025. this.#info = {}
  30026. this.#fragments.length = 0
  30027. }
  30028. this.#state = parserStates.INFO
  30029. }
  30030. }
  30031. if (this.#byteOffset > 0) {
  30032. continue
  30033. } else {
  30034. callback()
  30035. break
  30036. }
  30037. }
  30038. }
  30039. /**
  30040. * Take n bytes from the buffered Buffers
  30041. * @param {number} n
  30042. * @returns {Buffer|null}
  30043. */
  30044. consume (n) {
  30045. if (n > this.#byteOffset) {
  30046. return null
  30047. } else if (n === 0) {
  30048. return emptyBuffer
  30049. }
  30050. if (this.#buffers[0].length === n) {
  30051. this.#byteOffset -= this.#buffers[0].length
  30052. return this.#buffers.shift()
  30053. }
  30054. const buffer = Buffer.allocUnsafe(n)
  30055. let offset = 0
  30056. while (offset !== n) {
  30057. const next = this.#buffers[0]
  30058. const { length } = next
  30059. if (length + offset === n) {
  30060. buffer.set(this.#buffers.shift(), offset)
  30061. break
  30062. } else if (length + offset > n) {
  30063. buffer.set(next.subarray(0, n - offset), offset)
  30064. this.#buffers[0] = next.subarray(n - offset)
  30065. break
  30066. } else {
  30067. buffer.set(this.#buffers.shift(), offset)
  30068. offset += next.length
  30069. }
  30070. }
  30071. this.#byteOffset -= n
  30072. return buffer
  30073. }
  30074. parseCloseBody (onlyCode, data) {
  30075. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30076. /** @type {number|undefined} */
  30077. let code
  30078. if (data.length >= 2) {
  30079. // _The WebSocket Connection Close Code_ is
  30080. // defined as the status code (Section 7.4) contained in the first Close
  30081. // control frame received by the application
  30082. code = data.readUInt16BE(0)
  30083. }
  30084. if (onlyCode) {
  30085. if (!isValidStatusCode(code)) {
  30086. return null
  30087. }
  30088. return { code }
  30089. }
  30090. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30091. /** @type {Buffer} */
  30092. let reason = data.subarray(2)
  30093. // Remove BOM
  30094. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30095. reason = reason.subarray(3)
  30096. }
  30097. if (code !== undefined && !isValidStatusCode(code)) {
  30098. return null
  30099. }
  30100. try {
  30101. // TODO: optimize this
  30102. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30103. } catch {
  30104. return null
  30105. }
  30106. return { code, reason }
  30107. }
  30108. get closingInfo () {
  30109. return this.#info.closeInfo
  30110. }
  30111. }
  30112. module.exports = {
  30113. ByteParser
  30114. }
  30115. /***/ }),
  30116. /***/ 7578:
  30117. /***/ ((module) => {
  30118. "use strict";
  30119. module.exports = {
  30120. kWebSocketURL: Symbol('url'),
  30121. kReadyState: Symbol('ready state'),
  30122. kController: Symbol('controller'),
  30123. kResponse: Symbol('response'),
  30124. kBinaryType: Symbol('binary type'),
  30125. kSentClose: Symbol('sent close'),
  30126. kReceivedClose: Symbol('received close'),
  30127. kByteParser: Symbol('byte parser')
  30128. }
  30129. /***/ }),
  30130. /***/ 5515:
  30131. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30132. "use strict";
  30133. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30134. const { states, opcodes } = __nccwpck_require__(9188)
  30135. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30136. /* globals Blob */
  30137. /**
  30138. * @param {import('./websocket').WebSocket} ws
  30139. */
  30140. function isEstablished (ws) {
  30141. // If the server's response is validated as provided for above, it is
  30142. // said that _The WebSocket Connection is Established_ and that the
  30143. // WebSocket Connection is in the OPEN state.
  30144. return ws[kReadyState] === states.OPEN
  30145. }
  30146. /**
  30147. * @param {import('./websocket').WebSocket} ws
  30148. */
  30149. function isClosing (ws) {
  30150. // Upon either sending or receiving a Close control frame, it is said
  30151. // that _The WebSocket Closing Handshake is Started_ and that the
  30152. // WebSocket connection is in the CLOSING state.
  30153. return ws[kReadyState] === states.CLOSING
  30154. }
  30155. /**
  30156. * @param {import('./websocket').WebSocket} ws
  30157. */
  30158. function isClosed (ws) {
  30159. return ws[kReadyState] === states.CLOSED
  30160. }
  30161. /**
  30162. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30163. * @param {string} e
  30164. * @param {EventTarget} target
  30165. * @param {EventInit | undefined} eventInitDict
  30166. */
  30167. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30168. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30169. // 2. Let event be the result of creating an event given eventConstructor,
  30170. // in the relevant realm of target.
  30171. // 3. Initialize event’s type attribute to e.
  30172. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30173. // 4. Initialize any other IDL attributes of event as described in the
  30174. // invocation of this algorithm.
  30175. // 5. Return the result of dispatching event at target, with legacy target
  30176. // override flag set if set.
  30177. target.dispatchEvent(event)
  30178. }
  30179. /**
  30180. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30181. * @param {import('./websocket').WebSocket} ws
  30182. * @param {number} type Opcode
  30183. * @param {Buffer} data application data
  30184. */
  30185. function websocketMessageReceived (ws, type, data) {
  30186. // 1. If ready state is not OPEN (1), then return.
  30187. if (ws[kReadyState] !== states.OPEN) {
  30188. return
  30189. }
  30190. // 2. Let dataForEvent be determined by switching on type and binary type:
  30191. let dataForEvent
  30192. if (type === opcodes.TEXT) {
  30193. // -> type indicates that the data is Text
  30194. // a new DOMString containing data
  30195. try {
  30196. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30197. } catch {
  30198. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30199. return
  30200. }
  30201. } else if (type === opcodes.BINARY) {
  30202. if (ws[kBinaryType] === 'blob') {
  30203. // -> type indicates that the data is Binary and binary type is "blob"
  30204. // a new Blob object, created in the relevant Realm of the WebSocket
  30205. // object, that represents data as its raw data
  30206. dataForEvent = new Blob([data])
  30207. } else {
  30208. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30209. // a new ArrayBuffer object, created in the relevant Realm of the
  30210. // WebSocket object, whose contents are data
  30211. dataForEvent = new Uint8Array(data).buffer
  30212. }
  30213. }
  30214. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30215. // with the origin attribute initialized to the serialization of the WebSocket
  30216. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30217. fireEvent('message', ws, MessageEvent, {
  30218. origin: ws[kWebSocketURL].origin,
  30219. data: dataForEvent
  30220. })
  30221. }
  30222. /**
  30223. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30224. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30225. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30226. * @param {string} protocol
  30227. */
  30228. function isValidSubprotocol (protocol) {
  30229. // If present, this value indicates one
  30230. // or more comma-separated subprotocol the client wishes to speak,
  30231. // ordered by preference. The elements that comprise this value
  30232. // MUST be non-empty strings with characters in the range U+0021 to
  30233. // U+007E not including separator characters as defined in
  30234. // [RFC2616] and MUST all be unique strings.
  30235. if (protocol.length === 0) {
  30236. return false
  30237. }
  30238. for (const char of protocol) {
  30239. const code = char.charCodeAt(0)
  30240. if (
  30241. code < 0x21 ||
  30242. code > 0x7E ||
  30243. char === '(' ||
  30244. char === ')' ||
  30245. char === '<' ||
  30246. char === '>' ||
  30247. char === '@' ||
  30248. char === ',' ||
  30249. char === ';' ||
  30250. char === ':' ||
  30251. char === '\\' ||
  30252. char === '"' ||
  30253. char === '/' ||
  30254. char === '[' ||
  30255. char === ']' ||
  30256. char === '?' ||
  30257. char === '=' ||
  30258. char === '{' ||
  30259. char === '}' ||
  30260. code === 32 || // SP
  30261. code === 9 // HT
  30262. ) {
  30263. return false
  30264. }
  30265. }
  30266. return true
  30267. }
  30268. /**
  30269. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30270. * @param {number} code
  30271. */
  30272. function isValidStatusCode (code) {
  30273. if (code >= 1000 && code < 1015) {
  30274. return (
  30275. code !== 1004 && // reserved
  30276. code !== 1005 && // "MUST NOT be set as a status code"
  30277. code !== 1006 // "MUST NOT be set as a status code"
  30278. )
  30279. }
  30280. return code >= 3000 && code <= 4999
  30281. }
  30282. /**
  30283. * @param {import('./websocket').WebSocket} ws
  30284. * @param {string|undefined} reason
  30285. */
  30286. function failWebsocketConnection (ws, reason) {
  30287. const { [kController]: controller, [kResponse]: response } = ws
  30288. controller.abort()
  30289. if (response?.socket && !response.socket.destroyed) {
  30290. response.socket.destroy()
  30291. }
  30292. if (reason) {
  30293. fireEvent('error', ws, ErrorEvent, {
  30294. error: new Error(reason)
  30295. })
  30296. }
  30297. }
  30298. module.exports = {
  30299. isEstablished,
  30300. isClosing,
  30301. isClosed,
  30302. fireEvent,
  30303. isValidSubprotocol,
  30304. isValidStatusCode,
  30305. failWebsocketConnection,
  30306. websocketMessageReceived
  30307. }
  30308. /***/ }),
  30309. /***/ 4284:
  30310. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30311. "use strict";
  30312. const { webidl } = __nccwpck_require__(1744)
  30313. const { DOMException } = __nccwpck_require__(1037)
  30314. const { URLSerializer } = __nccwpck_require__(685)
  30315. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30316. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30317. const {
  30318. kWebSocketURL,
  30319. kReadyState,
  30320. kController,
  30321. kBinaryType,
  30322. kResponse,
  30323. kSentClose,
  30324. kByteParser
  30325. } = __nccwpck_require__(7578)
  30326. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30327. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30328. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30329. const { ByteParser } = __nccwpck_require__(1688)
  30330. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30331. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30332. const { types } = __nccwpck_require__(3837)
  30333. let experimentalWarned = false
  30334. // https://websockets.spec.whatwg.org/#interface-definition
  30335. class WebSocket extends EventTarget {
  30336. #events = {
  30337. open: null,
  30338. error: null,
  30339. close: null,
  30340. message: null
  30341. }
  30342. #bufferedAmount = 0
  30343. #protocol = ''
  30344. #extensions = ''
  30345. /**
  30346. * @param {string} url
  30347. * @param {string|string[]} protocols
  30348. */
  30349. constructor (url, protocols = []) {
  30350. super()
  30351. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30352. if (!experimentalWarned) {
  30353. experimentalWarned = true
  30354. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30355. code: 'UNDICI-WS'
  30356. })
  30357. }
  30358. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30359. url = webidl.converters.USVString(url)
  30360. protocols = options.protocols
  30361. // 1. Let baseURL be this's relevant settings object's API base URL.
  30362. const baseURL = getGlobalOrigin()
  30363. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30364. let urlRecord
  30365. try {
  30366. urlRecord = new URL(url, baseURL)
  30367. } catch (e) {
  30368. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30369. throw new DOMException(e, 'SyntaxError')
  30370. }
  30371. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30372. if (urlRecord.protocol === 'http:') {
  30373. urlRecord.protocol = 'ws:'
  30374. } else if (urlRecord.protocol === 'https:') {
  30375. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30376. urlRecord.protocol = 'wss:'
  30377. }
  30378. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30379. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30380. throw new DOMException(
  30381. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30382. 'SyntaxError'
  30383. )
  30384. }
  30385. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30386. // DOMException.
  30387. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30388. throw new DOMException('Got fragment', 'SyntaxError')
  30389. }
  30390. // 8. If protocols is a string, set protocols to a sequence consisting
  30391. // of just that string.
  30392. if (typeof protocols === 'string') {
  30393. protocols = [protocols]
  30394. }
  30395. // 9. If any of the values in protocols occur more than once or otherwise
  30396. // fail to match the requirements for elements that comprise the value
  30397. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30398. // protocol, then throw a "SyntaxError" DOMException.
  30399. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30400. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30401. }
  30402. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30403. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30404. }
  30405. // 10. Set this's url to urlRecord.
  30406. this[kWebSocketURL] = new URL(urlRecord.href)
  30407. // 11. Let client be this's relevant settings object.
  30408. // 12. Run this step in parallel:
  30409. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30410. // and client.
  30411. this[kController] = establishWebSocketConnection(
  30412. urlRecord,
  30413. protocols,
  30414. this,
  30415. (response) => this.#onConnectionEstablished(response),
  30416. options
  30417. )
  30418. // Each WebSocket object has an associated ready state, which is a
  30419. // number representing the state of the connection. Initially it must
  30420. // be CONNECTING (0).
  30421. this[kReadyState] = WebSocket.CONNECTING
  30422. // The extensions attribute must initially return the empty string.
  30423. // The protocol attribute must initially return the empty string.
  30424. // Each WebSocket object has an associated binary type, which is a
  30425. // BinaryType. Initially it must be "blob".
  30426. this[kBinaryType] = 'blob'
  30427. }
  30428. /**
  30429. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30430. * @param {number|undefined} code
  30431. * @param {string|undefined} reason
  30432. */
  30433. close (code = undefined, reason = undefined) {
  30434. webidl.brandCheck(this, WebSocket)
  30435. if (code !== undefined) {
  30436. code = webidl.converters['unsigned short'](code, { clamp: true })
  30437. }
  30438. if (reason !== undefined) {
  30439. reason = webidl.converters.USVString(reason)
  30440. }
  30441. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30442. // integer in the range 3000 to 4999, inclusive, throw an
  30443. // "InvalidAccessError" DOMException.
  30444. if (code !== undefined) {
  30445. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30446. throw new DOMException('invalid code', 'InvalidAccessError')
  30447. }
  30448. }
  30449. let reasonByteLength = 0
  30450. // 2. If reason is present, then run these substeps:
  30451. if (reason !== undefined) {
  30452. // 1. Let reasonBytes be the result of encoding reason.
  30453. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30454. // "SyntaxError" DOMException.
  30455. reasonByteLength = Buffer.byteLength(reason)
  30456. if (reasonByteLength > 123) {
  30457. throw new DOMException(
  30458. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30459. 'SyntaxError'
  30460. )
  30461. }
  30462. }
  30463. // 3. Run the first matching steps from the following list:
  30464. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30465. // If this's ready state is CLOSING (2) or CLOSED (3)
  30466. // Do nothing.
  30467. } else if (!isEstablished(this)) {
  30468. // If the WebSocket connection is not yet established
  30469. // Fail the WebSocket connection and set this's ready state
  30470. // to CLOSING (2).
  30471. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30472. this[kReadyState] = WebSocket.CLOSING
  30473. } else if (!isClosing(this)) {
  30474. // If the WebSocket closing handshake has not yet been started
  30475. // Start the WebSocket closing handshake and set this's ready
  30476. // state to CLOSING (2).
  30477. // - If neither code nor reason is present, the WebSocket Close
  30478. // message must not have a body.
  30479. // - If code is present, then the status code to use in the
  30480. // WebSocket Close message must be the integer given by code.
  30481. // - If reason is also present, then reasonBytes must be
  30482. // provided in the Close message after the status code.
  30483. const frame = new WebsocketFrameSend()
  30484. // If neither code nor reason is present, the WebSocket Close
  30485. // message must not have a body.
  30486. // If code is present, then the status code to use in the
  30487. // WebSocket Close message must be the integer given by code.
  30488. if (code !== undefined && reason === undefined) {
  30489. frame.frameData = Buffer.allocUnsafe(2)
  30490. frame.frameData.writeUInt16BE(code, 0)
  30491. } else if (code !== undefined && reason !== undefined) {
  30492. // If reason is also present, then reasonBytes must be
  30493. // provided in the Close message after the status code.
  30494. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30495. frame.frameData.writeUInt16BE(code, 0)
  30496. // the body MAY contain UTF-8-encoded data with value /reason/
  30497. frame.frameData.write(reason, 2, 'utf-8')
  30498. } else {
  30499. frame.frameData = emptyBuffer
  30500. }
  30501. /** @type {import('stream').Duplex} */
  30502. const socket = this[kResponse].socket
  30503. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30504. if (!err) {
  30505. this[kSentClose] = true
  30506. }
  30507. })
  30508. // Upon either sending or receiving a Close control frame, it is said
  30509. // that _The WebSocket Closing Handshake is Started_ and that the
  30510. // WebSocket connection is in the CLOSING state.
  30511. this[kReadyState] = states.CLOSING
  30512. } else {
  30513. // Otherwise
  30514. // Set this's ready state to CLOSING (2).
  30515. this[kReadyState] = WebSocket.CLOSING
  30516. }
  30517. }
  30518. /**
  30519. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30520. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30521. */
  30522. send (data) {
  30523. webidl.brandCheck(this, WebSocket)
  30524. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30525. data = webidl.converters.WebSocketSendData(data)
  30526. // 1. If this's ready state is CONNECTING, then throw an
  30527. // "InvalidStateError" DOMException.
  30528. if (this[kReadyState] === WebSocket.CONNECTING) {
  30529. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30530. }
  30531. // 2. Run the appropriate set of steps from the following list:
  30532. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30533. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30534. if (!isEstablished(this) || isClosing(this)) {
  30535. return
  30536. }
  30537. /** @type {import('stream').Duplex} */
  30538. const socket = this[kResponse].socket
  30539. // If data is a string
  30540. if (typeof data === 'string') {
  30541. // If the WebSocket connection is established and the WebSocket
  30542. // closing handshake has not yet started, then the user agent
  30543. // must send a WebSocket Message comprised of the data argument
  30544. // using a text frame opcode; if the data cannot be sent, e.g.
  30545. // because it would need to be buffered but the buffer is full,
  30546. // the user agent must flag the WebSocket as full and then close
  30547. // the WebSocket connection. Any invocation of this method with a
  30548. // string argument that does not throw an exception must increase
  30549. // the bufferedAmount attribute by the number of bytes needed to
  30550. // express the argument as UTF-8.
  30551. const value = Buffer.from(data)
  30552. const frame = new WebsocketFrameSend(value)
  30553. const buffer = frame.createFrame(opcodes.TEXT)
  30554. this.#bufferedAmount += value.byteLength
  30555. socket.write(buffer, () => {
  30556. this.#bufferedAmount -= value.byteLength
  30557. })
  30558. } else if (types.isArrayBuffer(data)) {
  30559. // If the WebSocket connection is established, and the WebSocket
  30560. // closing handshake has not yet started, then the user agent must
  30561. // send a WebSocket Message comprised of data using a binary frame
  30562. // opcode; if the data cannot be sent, e.g. because it would need
  30563. // to be buffered but the buffer is full, the user agent must flag
  30564. // the WebSocket as full and then close the WebSocket connection.
  30565. // The data to be sent is the data stored in the buffer described
  30566. // by the ArrayBuffer object. Any invocation of this method with an
  30567. // ArrayBuffer argument that does not throw an exception must
  30568. // increase the bufferedAmount attribute by the length of the
  30569. // ArrayBuffer in bytes.
  30570. const value = Buffer.from(data)
  30571. const frame = new WebsocketFrameSend(value)
  30572. const buffer = frame.createFrame(opcodes.BINARY)
  30573. this.#bufferedAmount += value.byteLength
  30574. socket.write(buffer, () => {
  30575. this.#bufferedAmount -= value.byteLength
  30576. })
  30577. } else if (ArrayBuffer.isView(data)) {
  30578. // If the WebSocket connection is established, and the WebSocket
  30579. // closing handshake has not yet started, then the user agent must
  30580. // send a WebSocket Message comprised of data using a binary frame
  30581. // opcode; if the data cannot be sent, e.g. because it would need to
  30582. // be buffered but the buffer is full, the user agent must flag the
  30583. // WebSocket as full and then close the WebSocket connection. The
  30584. // data to be sent is the data stored in the section of the buffer
  30585. // described by the ArrayBuffer object that data references. Any
  30586. // invocation of this method with this kind of argument that does
  30587. // not throw an exception must increase the bufferedAmount attribute
  30588. // by the length of data’s buffer in bytes.
  30589. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30590. const frame = new WebsocketFrameSend(ab)
  30591. const buffer = frame.createFrame(opcodes.BINARY)
  30592. this.#bufferedAmount += ab.byteLength
  30593. socket.write(buffer, () => {
  30594. this.#bufferedAmount -= ab.byteLength
  30595. })
  30596. } else if (isBlobLike(data)) {
  30597. // If the WebSocket connection is established, and the WebSocket
  30598. // closing handshake has not yet started, then the user agent must
  30599. // send a WebSocket Message comprised of data using a binary frame
  30600. // opcode; if the data cannot be sent, e.g. because it would need to
  30601. // be buffered but the buffer is full, the user agent must flag the
  30602. // WebSocket as full and then close the WebSocket connection. The data
  30603. // to be sent is the raw data represented by the Blob object. Any
  30604. // invocation of this method with a Blob argument that does not throw
  30605. // an exception must increase the bufferedAmount attribute by the size
  30606. // of the Blob object’s raw data, in bytes.
  30607. const frame = new WebsocketFrameSend()
  30608. data.arrayBuffer().then((ab) => {
  30609. const value = Buffer.from(ab)
  30610. frame.frameData = value
  30611. const buffer = frame.createFrame(opcodes.BINARY)
  30612. this.#bufferedAmount += value.byteLength
  30613. socket.write(buffer, () => {
  30614. this.#bufferedAmount -= value.byteLength
  30615. })
  30616. })
  30617. }
  30618. }
  30619. get readyState () {
  30620. webidl.brandCheck(this, WebSocket)
  30621. // The readyState getter steps are to return this's ready state.
  30622. return this[kReadyState]
  30623. }
  30624. get bufferedAmount () {
  30625. webidl.brandCheck(this, WebSocket)
  30626. return this.#bufferedAmount
  30627. }
  30628. get url () {
  30629. webidl.brandCheck(this, WebSocket)
  30630. // The url getter steps are to return this's url, serialized.
  30631. return URLSerializer(this[kWebSocketURL])
  30632. }
  30633. get extensions () {
  30634. webidl.brandCheck(this, WebSocket)
  30635. return this.#extensions
  30636. }
  30637. get protocol () {
  30638. webidl.brandCheck(this, WebSocket)
  30639. return this.#protocol
  30640. }
  30641. get onopen () {
  30642. webidl.brandCheck(this, WebSocket)
  30643. return this.#events.open
  30644. }
  30645. set onopen (fn) {
  30646. webidl.brandCheck(this, WebSocket)
  30647. if (this.#events.open) {
  30648. this.removeEventListener('open', this.#events.open)
  30649. }
  30650. if (typeof fn === 'function') {
  30651. this.#events.open = fn
  30652. this.addEventListener('open', fn)
  30653. } else {
  30654. this.#events.open = null
  30655. }
  30656. }
  30657. get onerror () {
  30658. webidl.brandCheck(this, WebSocket)
  30659. return this.#events.error
  30660. }
  30661. set onerror (fn) {
  30662. webidl.brandCheck(this, WebSocket)
  30663. if (this.#events.error) {
  30664. this.removeEventListener('error', this.#events.error)
  30665. }
  30666. if (typeof fn === 'function') {
  30667. this.#events.error = fn
  30668. this.addEventListener('error', fn)
  30669. } else {
  30670. this.#events.error = null
  30671. }
  30672. }
  30673. get onclose () {
  30674. webidl.brandCheck(this, WebSocket)
  30675. return this.#events.close
  30676. }
  30677. set onclose (fn) {
  30678. webidl.brandCheck(this, WebSocket)
  30679. if (this.#events.close) {
  30680. this.removeEventListener('close', this.#events.close)
  30681. }
  30682. if (typeof fn === 'function') {
  30683. this.#events.close = fn
  30684. this.addEventListener('close', fn)
  30685. } else {
  30686. this.#events.close = null
  30687. }
  30688. }
  30689. get onmessage () {
  30690. webidl.brandCheck(this, WebSocket)
  30691. return this.#events.message
  30692. }
  30693. set onmessage (fn) {
  30694. webidl.brandCheck(this, WebSocket)
  30695. if (this.#events.message) {
  30696. this.removeEventListener('message', this.#events.message)
  30697. }
  30698. if (typeof fn === 'function') {
  30699. this.#events.message = fn
  30700. this.addEventListener('message', fn)
  30701. } else {
  30702. this.#events.message = null
  30703. }
  30704. }
  30705. get binaryType () {
  30706. webidl.brandCheck(this, WebSocket)
  30707. return this[kBinaryType]
  30708. }
  30709. set binaryType (type) {
  30710. webidl.brandCheck(this, WebSocket)
  30711. if (type !== 'blob' && type !== 'arraybuffer') {
  30712. this[kBinaryType] = 'blob'
  30713. } else {
  30714. this[kBinaryType] = type
  30715. }
  30716. }
  30717. /**
  30718. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30719. */
  30720. #onConnectionEstablished (response) {
  30721. // processResponse is called when the "response’s header list has been received and initialized."
  30722. // once this happens, the connection is open
  30723. this[kResponse] = response
  30724. const parser = new ByteParser(this)
  30725. parser.on('drain', function onParserDrain () {
  30726. this.ws[kResponse].socket.resume()
  30727. })
  30728. response.socket.ws = this
  30729. this[kByteParser] = parser
  30730. // 1. Change the ready state to OPEN (1).
  30731. this[kReadyState] = states.OPEN
  30732. // 2. Change the extensions attribute’s value to the extensions in use, if
  30733. // it is not the null value.
  30734. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  30735. const extensions = response.headersList.get('sec-websocket-extensions')
  30736. if (extensions !== null) {
  30737. this.#extensions = extensions
  30738. }
  30739. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  30740. // it is not the null value.
  30741. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  30742. const protocol = response.headersList.get('sec-websocket-protocol')
  30743. if (protocol !== null) {
  30744. this.#protocol = protocol
  30745. }
  30746. // 4. Fire an event named open at the WebSocket object.
  30747. fireEvent('open', this)
  30748. }
  30749. }
  30750. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  30751. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  30752. // https://websockets.spec.whatwg.org/#dom-websocket-open
  30753. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  30754. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  30755. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  30756. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  30757. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  30758. Object.defineProperties(WebSocket.prototype, {
  30759. CONNECTING: staticPropertyDescriptors,
  30760. OPEN: staticPropertyDescriptors,
  30761. CLOSING: staticPropertyDescriptors,
  30762. CLOSED: staticPropertyDescriptors,
  30763. url: kEnumerableProperty,
  30764. readyState: kEnumerableProperty,
  30765. bufferedAmount: kEnumerableProperty,
  30766. onopen: kEnumerableProperty,
  30767. onerror: kEnumerableProperty,
  30768. onclose: kEnumerableProperty,
  30769. close: kEnumerableProperty,
  30770. onmessage: kEnumerableProperty,
  30771. binaryType: kEnumerableProperty,
  30772. send: kEnumerableProperty,
  30773. extensions: kEnumerableProperty,
  30774. protocol: kEnumerableProperty,
  30775. [Symbol.toStringTag]: {
  30776. value: 'WebSocket',
  30777. writable: false,
  30778. enumerable: false,
  30779. configurable: true
  30780. }
  30781. })
  30782. Object.defineProperties(WebSocket, {
  30783. CONNECTING: staticPropertyDescriptors,
  30784. OPEN: staticPropertyDescriptors,
  30785. CLOSING: staticPropertyDescriptors,
  30786. CLOSED: staticPropertyDescriptors
  30787. })
  30788. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  30789. webidl.converters.DOMString
  30790. )
  30791. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  30792. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  30793. return webidl.converters['sequence<DOMString>'](V)
  30794. }
  30795. return webidl.converters.DOMString(V)
  30796. }
  30797. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  30798. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  30799. {
  30800. key: 'protocols',
  30801. converter: webidl.converters['DOMString or sequence<DOMString>'],
  30802. get defaultValue () {
  30803. return []
  30804. }
  30805. },
  30806. {
  30807. key: 'dispatcher',
  30808. converter: (V) => V,
  30809. get defaultValue () {
  30810. return getGlobalDispatcher()
  30811. }
  30812. },
  30813. {
  30814. key: 'headers',
  30815. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  30816. }
  30817. ])
  30818. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  30819. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  30820. return webidl.converters.WebSocketInit(V)
  30821. }
  30822. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  30823. }
  30824. webidl.converters.WebSocketSendData = function (V) {
  30825. if (webidl.util.Type(V) === 'Object') {
  30826. if (isBlobLike(V)) {
  30827. return webidl.converters.Blob(V, { strict: false })
  30828. }
  30829. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  30830. return webidl.converters.BufferSource(V)
  30831. }
  30832. }
  30833. return webidl.converters.USVString(V)
  30834. }
  30835. module.exports = {
  30836. WebSocket
  30837. }
  30838. /***/ }),
  30839. /***/ 5030:
  30840. /***/ ((__unused_webpack_module, exports) => {
  30841. "use strict";
  30842. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30843. function getUserAgent() {
  30844. if (typeof navigator === "object" && "userAgent" in navigator) {
  30845. return navigator.userAgent;
  30846. }
  30847. if (typeof process === "object" && process.version !== undefined) {
  30848. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  30849. }
  30850. return "<environment undetectable>";
  30851. }
  30852. exports.getUserAgent = getUserAgent;
  30853. //# sourceMappingURL=index.js.map
  30854. /***/ }),
  30855. /***/ 5840:
  30856. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30857. "use strict";
  30858. Object.defineProperty(exports, "__esModule", ({
  30859. value: true
  30860. }));
  30861. Object.defineProperty(exports, "NIL", ({
  30862. enumerable: true,
  30863. get: function () {
  30864. return _nil.default;
  30865. }
  30866. }));
  30867. Object.defineProperty(exports, "parse", ({
  30868. enumerable: true,
  30869. get: function () {
  30870. return _parse.default;
  30871. }
  30872. }));
  30873. Object.defineProperty(exports, "stringify", ({
  30874. enumerable: true,
  30875. get: function () {
  30876. return _stringify.default;
  30877. }
  30878. }));
  30879. Object.defineProperty(exports, "v1", ({
  30880. enumerable: true,
  30881. get: function () {
  30882. return _v.default;
  30883. }
  30884. }));
  30885. Object.defineProperty(exports, "v3", ({
  30886. enumerable: true,
  30887. get: function () {
  30888. return _v2.default;
  30889. }
  30890. }));
  30891. Object.defineProperty(exports, "v4", ({
  30892. enumerable: true,
  30893. get: function () {
  30894. return _v3.default;
  30895. }
  30896. }));
  30897. Object.defineProperty(exports, "v5", ({
  30898. enumerable: true,
  30899. get: function () {
  30900. return _v4.default;
  30901. }
  30902. }));
  30903. Object.defineProperty(exports, "validate", ({
  30904. enumerable: true,
  30905. get: function () {
  30906. return _validate.default;
  30907. }
  30908. }));
  30909. Object.defineProperty(exports, "version", ({
  30910. enumerable: true,
  30911. get: function () {
  30912. return _version.default;
  30913. }
  30914. }));
  30915. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  30916. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  30917. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  30918. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  30919. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  30920. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  30921. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30922. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  30923. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  30924. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30925. /***/ }),
  30926. /***/ 4569:
  30927. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30928. "use strict";
  30929. Object.defineProperty(exports, "__esModule", ({
  30930. value: true
  30931. }));
  30932. exports["default"] = void 0;
  30933. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30934. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30935. function md5(bytes) {
  30936. if (Array.isArray(bytes)) {
  30937. bytes = Buffer.from(bytes);
  30938. } else if (typeof bytes === 'string') {
  30939. bytes = Buffer.from(bytes, 'utf8');
  30940. }
  30941. return _crypto.default.createHash('md5').update(bytes).digest();
  30942. }
  30943. var _default = md5;
  30944. exports["default"] = _default;
  30945. /***/ }),
  30946. /***/ 2054:
  30947. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30948. "use strict";
  30949. Object.defineProperty(exports, "__esModule", ({
  30950. value: true
  30951. }));
  30952. exports["default"] = void 0;
  30953. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30954. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30955. var _default = {
  30956. randomUUID: _crypto.default.randomUUID
  30957. };
  30958. exports["default"] = _default;
  30959. /***/ }),
  30960. /***/ 5332:
  30961. /***/ ((__unused_webpack_module, exports) => {
  30962. "use strict";
  30963. Object.defineProperty(exports, "__esModule", ({
  30964. value: true
  30965. }));
  30966. exports["default"] = void 0;
  30967. var _default = '00000000-0000-0000-0000-000000000000';
  30968. exports["default"] = _default;
  30969. /***/ }),
  30970. /***/ 2746:
  30971. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30972. "use strict";
  30973. Object.defineProperty(exports, "__esModule", ({
  30974. value: true
  30975. }));
  30976. exports["default"] = void 0;
  30977. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30978. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30979. function parse(uuid) {
  30980. if (!(0, _validate.default)(uuid)) {
  30981. throw TypeError('Invalid UUID');
  30982. }
  30983. let v;
  30984. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  30985. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  30986. arr[1] = v >>> 16 & 0xff;
  30987. arr[2] = v >>> 8 & 0xff;
  30988. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  30989. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  30990. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  30991. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  30992. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  30993. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  30994. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  30995. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  30996. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  30997. arr[11] = v / 0x100000000 & 0xff;
  30998. arr[12] = v >>> 24 & 0xff;
  30999. arr[13] = v >>> 16 & 0xff;
  31000. arr[14] = v >>> 8 & 0xff;
  31001. arr[15] = v & 0xff;
  31002. return arr;
  31003. }
  31004. var _default = parse;
  31005. exports["default"] = _default;
  31006. /***/ }),
  31007. /***/ 814:
  31008. /***/ ((__unused_webpack_module, exports) => {
  31009. "use strict";
  31010. Object.defineProperty(exports, "__esModule", ({
  31011. value: true
  31012. }));
  31013. exports["default"] = void 0;
  31014. 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;
  31015. exports["default"] = _default;
  31016. /***/ }),
  31017. /***/ 807:
  31018. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31019. "use strict";
  31020. Object.defineProperty(exports, "__esModule", ({
  31021. value: true
  31022. }));
  31023. exports["default"] = rng;
  31024. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31025. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31026. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31027. let poolPtr = rnds8Pool.length;
  31028. function rng() {
  31029. if (poolPtr > rnds8Pool.length - 16) {
  31030. _crypto.default.randomFillSync(rnds8Pool);
  31031. poolPtr = 0;
  31032. }
  31033. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31034. }
  31035. /***/ }),
  31036. /***/ 5274:
  31037. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31038. "use strict";
  31039. Object.defineProperty(exports, "__esModule", ({
  31040. value: true
  31041. }));
  31042. exports["default"] = void 0;
  31043. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31044. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31045. function sha1(bytes) {
  31046. if (Array.isArray(bytes)) {
  31047. bytes = Buffer.from(bytes);
  31048. } else if (typeof bytes === 'string') {
  31049. bytes = Buffer.from(bytes, 'utf8');
  31050. }
  31051. return _crypto.default.createHash('sha1').update(bytes).digest();
  31052. }
  31053. var _default = sha1;
  31054. exports["default"] = _default;
  31055. /***/ }),
  31056. /***/ 8950:
  31057. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31058. "use strict";
  31059. Object.defineProperty(exports, "__esModule", ({
  31060. value: true
  31061. }));
  31062. exports["default"] = void 0;
  31063. exports.unsafeStringify = unsafeStringify;
  31064. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31065. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31066. /**
  31067. * Convert array of 16 byte values to UUID string format of the form:
  31068. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31069. */
  31070. const byteToHex = [];
  31071. for (let i = 0; i < 256; ++i) {
  31072. byteToHex.push((i + 0x100).toString(16).slice(1));
  31073. }
  31074. function unsafeStringify(arr, offset = 0) {
  31075. // Note: Be careful editing this code! It's been tuned for performance
  31076. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31077. 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]];
  31078. }
  31079. function stringify(arr, offset = 0) {
  31080. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31081. // of the following:
  31082. // - One or more input array values don't map to a hex octet (leading to
  31083. // "undefined" in the uuid)
  31084. // - Invalid input values for the RFC `version` or `variant` fields
  31085. if (!(0, _validate.default)(uuid)) {
  31086. throw TypeError('Stringified UUID is invalid');
  31087. }
  31088. return uuid;
  31089. }
  31090. var _default = stringify;
  31091. exports["default"] = _default;
  31092. /***/ }),
  31093. /***/ 8628:
  31094. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31095. "use strict";
  31096. Object.defineProperty(exports, "__esModule", ({
  31097. value: true
  31098. }));
  31099. exports["default"] = void 0;
  31100. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31101. var _stringify = __nccwpck_require__(8950);
  31102. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31103. // **`v1()` - Generate time-based UUID**
  31104. //
  31105. // Inspired by https://github.com/LiosK/UUID.js
  31106. // and http://docs.python.org/library/uuid.html
  31107. let _nodeId;
  31108. let _clockseq; // Previous uuid creation time
  31109. let _lastMSecs = 0;
  31110. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31111. function v1(options, buf, offset) {
  31112. let i = buf && offset || 0;
  31113. const b = buf || new Array(16);
  31114. options = options || {};
  31115. let node = options.node || _nodeId;
  31116. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31117. // specified. We do this lazily to minimize issues related to insufficient
  31118. // system entropy. See #189
  31119. if (node == null || clockseq == null) {
  31120. const seedBytes = options.random || (options.rng || _rng.default)();
  31121. if (node == null) {
  31122. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31123. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31124. }
  31125. if (clockseq == null) {
  31126. // Per 4.2.2, randomize (14 bit) clockseq
  31127. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31128. }
  31129. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31130. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31131. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31132. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31133. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31134. // cycle to simulate higher resolution clock
  31135. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31136. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31137. if (dt < 0 && options.clockseq === undefined) {
  31138. clockseq = clockseq + 1 & 0x3fff;
  31139. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31140. // time interval
  31141. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31142. nsecs = 0;
  31143. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31144. if (nsecs >= 10000) {
  31145. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31146. }
  31147. _lastMSecs = msecs;
  31148. _lastNSecs = nsecs;
  31149. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31150. msecs += 12219292800000; // `time_low`
  31151. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31152. b[i++] = tl >>> 24 & 0xff;
  31153. b[i++] = tl >>> 16 & 0xff;
  31154. b[i++] = tl >>> 8 & 0xff;
  31155. b[i++] = tl & 0xff; // `time_mid`
  31156. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31157. b[i++] = tmh >>> 8 & 0xff;
  31158. b[i++] = tmh & 0xff; // `time_high_and_version`
  31159. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31160. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31161. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31162. b[i++] = clockseq & 0xff; // `node`
  31163. for (let n = 0; n < 6; ++n) {
  31164. b[i + n] = node[n];
  31165. }
  31166. return buf || (0, _stringify.unsafeStringify)(b);
  31167. }
  31168. var _default = v1;
  31169. exports["default"] = _default;
  31170. /***/ }),
  31171. /***/ 6409:
  31172. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31173. "use strict";
  31174. Object.defineProperty(exports, "__esModule", ({
  31175. value: true
  31176. }));
  31177. exports["default"] = void 0;
  31178. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31179. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31180. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31181. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31182. var _default = v3;
  31183. exports["default"] = _default;
  31184. /***/ }),
  31185. /***/ 5998:
  31186. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31187. "use strict";
  31188. Object.defineProperty(exports, "__esModule", ({
  31189. value: true
  31190. }));
  31191. exports.URL = exports.DNS = void 0;
  31192. exports["default"] = v35;
  31193. var _stringify = __nccwpck_require__(8950);
  31194. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31195. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31196. function stringToBytes(str) {
  31197. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31198. const bytes = [];
  31199. for (let i = 0; i < str.length; ++i) {
  31200. bytes.push(str.charCodeAt(i));
  31201. }
  31202. return bytes;
  31203. }
  31204. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31205. exports.DNS = DNS;
  31206. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31207. exports.URL = URL;
  31208. function v35(name, version, hashfunc) {
  31209. function generateUUID(value, namespace, buf, offset) {
  31210. var _namespace;
  31211. if (typeof value === 'string') {
  31212. value = stringToBytes(value);
  31213. }
  31214. if (typeof namespace === 'string') {
  31215. namespace = (0, _parse.default)(namespace);
  31216. }
  31217. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31218. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31219. } // Compute hash of namespace and value, Per 4.3
  31220. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31221. // hashfunc([...namespace, ... value])`
  31222. let bytes = new Uint8Array(16 + value.length);
  31223. bytes.set(namespace);
  31224. bytes.set(value, namespace.length);
  31225. bytes = hashfunc(bytes);
  31226. bytes[6] = bytes[6] & 0x0f | version;
  31227. bytes[8] = bytes[8] & 0x3f | 0x80;
  31228. if (buf) {
  31229. offset = offset || 0;
  31230. for (let i = 0; i < 16; ++i) {
  31231. buf[offset + i] = bytes[i];
  31232. }
  31233. return buf;
  31234. }
  31235. return (0, _stringify.unsafeStringify)(bytes);
  31236. } // Function#name is not settable on some platforms (#270)
  31237. try {
  31238. generateUUID.name = name; // eslint-disable-next-line no-empty
  31239. } catch (err) {} // For CommonJS default export support
  31240. generateUUID.DNS = DNS;
  31241. generateUUID.URL = URL;
  31242. return generateUUID;
  31243. }
  31244. /***/ }),
  31245. /***/ 5122:
  31246. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31247. "use strict";
  31248. Object.defineProperty(exports, "__esModule", ({
  31249. value: true
  31250. }));
  31251. exports["default"] = void 0;
  31252. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31253. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31254. var _stringify = __nccwpck_require__(8950);
  31255. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31256. function v4(options, buf, offset) {
  31257. if (_native.default.randomUUID && !buf && !options) {
  31258. return _native.default.randomUUID();
  31259. }
  31260. options = options || {};
  31261. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31262. rnds[6] = rnds[6] & 0x0f | 0x40;
  31263. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31264. if (buf) {
  31265. offset = offset || 0;
  31266. for (let i = 0; i < 16; ++i) {
  31267. buf[offset + i] = rnds[i];
  31268. }
  31269. return buf;
  31270. }
  31271. return (0, _stringify.unsafeStringify)(rnds);
  31272. }
  31273. var _default = v4;
  31274. exports["default"] = _default;
  31275. /***/ }),
  31276. /***/ 9120:
  31277. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31278. "use strict";
  31279. Object.defineProperty(exports, "__esModule", ({
  31280. value: true
  31281. }));
  31282. exports["default"] = void 0;
  31283. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31284. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31285. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31286. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31287. var _default = v5;
  31288. exports["default"] = _default;
  31289. /***/ }),
  31290. /***/ 6900:
  31291. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31292. "use strict";
  31293. Object.defineProperty(exports, "__esModule", ({
  31294. value: true
  31295. }));
  31296. exports["default"] = void 0;
  31297. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31298. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31299. function validate(uuid) {
  31300. return typeof uuid === 'string' && _regex.default.test(uuid);
  31301. }
  31302. var _default = validate;
  31303. exports["default"] = _default;
  31304. /***/ }),
  31305. /***/ 2414:
  31306. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31307. "use strict";
  31308. Object.defineProperty(exports, "__esModule", ({
  31309. value: true
  31310. }));
  31311. exports["default"] = void 0;
  31312. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31313. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31314. function version(uuid) {
  31315. if (!(0, _validate.default)(uuid)) {
  31316. throw TypeError('Invalid UUID');
  31317. }
  31318. return parseInt(uuid.slice(14, 15), 16);
  31319. }
  31320. var _default = version;
  31321. exports["default"] = _default;
  31322. /***/ }),
  31323. /***/ 2940:
  31324. /***/ ((module) => {
  31325. // Returns a wrapper function that returns a wrapped callback
  31326. // The wrapper function should do some stuff, and return a
  31327. // presumably different callback function.
  31328. // This makes sure that own properties are retained, so that
  31329. // decorations and such are not lost along the way.
  31330. module.exports = wrappy
  31331. function wrappy (fn, cb) {
  31332. if (fn && cb) return wrappy(fn)(cb)
  31333. if (typeof fn !== 'function')
  31334. throw new TypeError('need wrapper function')
  31335. Object.keys(fn).forEach(function (k) {
  31336. wrapper[k] = fn[k]
  31337. })
  31338. return wrapper
  31339. function wrapper() {
  31340. var args = new Array(arguments.length)
  31341. for (var i = 0; i < args.length; i++) {
  31342. args[i] = arguments[i]
  31343. }
  31344. var ret = fn.apply(this, args)
  31345. var cb = args[args.length-1]
  31346. if (typeof ret === 'function' && ret !== cb) {
  31347. Object.keys(cb).forEach(function (k) {
  31348. ret[k] = cb[k]
  31349. })
  31350. }
  31351. return ret
  31352. }
  31353. }
  31354. /***/ }),
  31355. /***/ 9491:
  31356. /***/ ((module) => {
  31357. "use strict";
  31358. module.exports = require("assert");
  31359. /***/ }),
  31360. /***/ 852:
  31361. /***/ ((module) => {
  31362. "use strict";
  31363. module.exports = require("async_hooks");
  31364. /***/ }),
  31365. /***/ 4300:
  31366. /***/ ((module) => {
  31367. "use strict";
  31368. module.exports = require("buffer");
  31369. /***/ }),
  31370. /***/ 2081:
  31371. /***/ ((module) => {
  31372. "use strict";
  31373. module.exports = require("child_process");
  31374. /***/ }),
  31375. /***/ 6206:
  31376. /***/ ((module) => {
  31377. "use strict";
  31378. module.exports = require("console");
  31379. /***/ }),
  31380. /***/ 6113:
  31381. /***/ ((module) => {
  31382. "use strict";
  31383. module.exports = require("crypto");
  31384. /***/ }),
  31385. /***/ 7643:
  31386. /***/ ((module) => {
  31387. "use strict";
  31388. module.exports = require("diagnostics_channel");
  31389. /***/ }),
  31390. /***/ 2361:
  31391. /***/ ((module) => {
  31392. "use strict";
  31393. module.exports = require("events");
  31394. /***/ }),
  31395. /***/ 7147:
  31396. /***/ ((module) => {
  31397. "use strict";
  31398. module.exports = require("fs");
  31399. /***/ }),
  31400. /***/ 3685:
  31401. /***/ ((module) => {
  31402. "use strict";
  31403. module.exports = require("http");
  31404. /***/ }),
  31405. /***/ 5158:
  31406. /***/ ((module) => {
  31407. "use strict";
  31408. module.exports = require("http2");
  31409. /***/ }),
  31410. /***/ 5687:
  31411. /***/ ((module) => {
  31412. "use strict";
  31413. module.exports = require("https");
  31414. /***/ }),
  31415. /***/ 1808:
  31416. /***/ ((module) => {
  31417. "use strict";
  31418. module.exports = require("net");
  31419. /***/ }),
  31420. /***/ 5673:
  31421. /***/ ((module) => {
  31422. "use strict";
  31423. module.exports = require("node:events");
  31424. /***/ }),
  31425. /***/ 4492:
  31426. /***/ ((module) => {
  31427. "use strict";
  31428. module.exports = require("node:stream");
  31429. /***/ }),
  31430. /***/ 7261:
  31431. /***/ ((module) => {
  31432. "use strict";
  31433. module.exports = require("node:util");
  31434. /***/ }),
  31435. /***/ 2037:
  31436. /***/ ((module) => {
  31437. "use strict";
  31438. module.exports = require("os");
  31439. /***/ }),
  31440. /***/ 1017:
  31441. /***/ ((module) => {
  31442. "use strict";
  31443. module.exports = require("path");
  31444. /***/ }),
  31445. /***/ 4074:
  31446. /***/ ((module) => {
  31447. "use strict";
  31448. module.exports = require("perf_hooks");
  31449. /***/ }),
  31450. /***/ 3477:
  31451. /***/ ((module) => {
  31452. "use strict";
  31453. module.exports = require("querystring");
  31454. /***/ }),
  31455. /***/ 2781:
  31456. /***/ ((module) => {
  31457. "use strict";
  31458. module.exports = require("stream");
  31459. /***/ }),
  31460. /***/ 5356:
  31461. /***/ ((module) => {
  31462. "use strict";
  31463. module.exports = require("stream/web");
  31464. /***/ }),
  31465. /***/ 1576:
  31466. /***/ ((module) => {
  31467. "use strict";
  31468. module.exports = require("string_decoder");
  31469. /***/ }),
  31470. /***/ 9512:
  31471. /***/ ((module) => {
  31472. "use strict";
  31473. module.exports = require("timers");
  31474. /***/ }),
  31475. /***/ 4404:
  31476. /***/ ((module) => {
  31477. "use strict";
  31478. module.exports = require("tls");
  31479. /***/ }),
  31480. /***/ 7310:
  31481. /***/ ((module) => {
  31482. "use strict";
  31483. module.exports = require("url");
  31484. /***/ }),
  31485. /***/ 3837:
  31486. /***/ ((module) => {
  31487. "use strict";
  31488. module.exports = require("util");
  31489. /***/ }),
  31490. /***/ 9830:
  31491. /***/ ((module) => {
  31492. "use strict";
  31493. module.exports = require("util/types");
  31494. /***/ }),
  31495. /***/ 1267:
  31496. /***/ ((module) => {
  31497. "use strict";
  31498. module.exports = require("worker_threads");
  31499. /***/ }),
  31500. /***/ 9796:
  31501. /***/ ((module) => {
  31502. "use strict";
  31503. module.exports = require("zlib");
  31504. /***/ }),
  31505. /***/ 2960:
  31506. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31507. "use strict";
  31508. const WritableStream = (__nccwpck_require__(4492).Writable)
  31509. const inherits = (__nccwpck_require__(7261).inherits)
  31510. const StreamSearch = __nccwpck_require__(1142)
  31511. const PartStream = __nccwpck_require__(1620)
  31512. const HeaderParser = __nccwpck_require__(2032)
  31513. const DASH = 45
  31514. const B_ONEDASH = Buffer.from('-')
  31515. const B_CRLF = Buffer.from('\r\n')
  31516. const EMPTY_FN = function () {}
  31517. function Dicer (cfg) {
  31518. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31519. WritableStream.call(this, cfg)
  31520. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31521. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31522. this._headerFirst = cfg.headerFirst
  31523. this._dashes = 0
  31524. this._parts = 0
  31525. this._finished = false
  31526. this._realFinish = false
  31527. this._isPreamble = true
  31528. this._justMatched = false
  31529. this._firstWrite = true
  31530. this._inHeader = true
  31531. this._part = undefined
  31532. this._cb = undefined
  31533. this._ignoreData = false
  31534. this._partOpts = { highWaterMark: cfg.partHwm }
  31535. this._pause = false
  31536. const self = this
  31537. this._hparser = new HeaderParser(cfg)
  31538. this._hparser.on('header', function (header) {
  31539. self._inHeader = false
  31540. self._part.emit('header', header)
  31541. })
  31542. }
  31543. inherits(Dicer, WritableStream)
  31544. Dicer.prototype.emit = function (ev) {
  31545. if (ev === 'finish' && !this._realFinish) {
  31546. if (!this._finished) {
  31547. const self = this
  31548. process.nextTick(function () {
  31549. self.emit('error', new Error('Unexpected end of multipart data'))
  31550. if (self._part && !self._ignoreData) {
  31551. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31552. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31553. self._part.push(null)
  31554. process.nextTick(function () {
  31555. self._realFinish = true
  31556. self.emit('finish')
  31557. self._realFinish = false
  31558. })
  31559. return
  31560. }
  31561. self._realFinish = true
  31562. self.emit('finish')
  31563. self._realFinish = false
  31564. })
  31565. }
  31566. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31567. }
  31568. Dicer.prototype._write = function (data, encoding, cb) {
  31569. // ignore unexpected data (e.g. extra trailer data after finished)
  31570. if (!this._hparser && !this._bparser) { return cb() }
  31571. if (this._headerFirst && this._isPreamble) {
  31572. if (!this._part) {
  31573. this._part = new PartStream(this._partOpts)
  31574. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31575. }
  31576. const r = this._hparser.push(data)
  31577. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31578. }
  31579. // allows for "easier" testing
  31580. if (this._firstWrite) {
  31581. this._bparser.push(B_CRLF)
  31582. this._firstWrite = false
  31583. }
  31584. this._bparser.push(data)
  31585. if (this._pause) { this._cb = cb } else { cb() }
  31586. }
  31587. Dicer.prototype.reset = function () {
  31588. this._part = undefined
  31589. this._bparser = undefined
  31590. this._hparser = undefined
  31591. }
  31592. Dicer.prototype.setBoundary = function (boundary) {
  31593. const self = this
  31594. this._bparser = new StreamSearch('\r\n--' + boundary)
  31595. this._bparser.on('info', function (isMatch, data, start, end) {
  31596. self._oninfo(isMatch, data, start, end)
  31597. })
  31598. }
  31599. Dicer.prototype._ignore = function () {
  31600. if (this._part && !this._ignoreData) {
  31601. this._ignoreData = true
  31602. this._part.on('error', EMPTY_FN)
  31603. // we must perform some kind of read on the stream even though we are
  31604. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31605. // after pushing null to the stream
  31606. this._part.resume()
  31607. }
  31608. }
  31609. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31610. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31611. if (!this._part && this._justMatched && data) {
  31612. while (this._dashes < 2 && (start + i) < end) {
  31613. if (data[start + i] === DASH) {
  31614. ++i
  31615. ++this._dashes
  31616. } else {
  31617. if (this._dashes) { buf = B_ONEDASH }
  31618. this._dashes = 0
  31619. break
  31620. }
  31621. }
  31622. if (this._dashes === 2) {
  31623. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31624. this.reset()
  31625. this._finished = true
  31626. // no more parts will be added
  31627. if (self._parts === 0) {
  31628. self._realFinish = true
  31629. self.emit('finish')
  31630. self._realFinish = false
  31631. }
  31632. }
  31633. if (this._dashes) { return }
  31634. }
  31635. if (this._justMatched) { this._justMatched = false }
  31636. if (!this._part) {
  31637. this._part = new PartStream(this._partOpts)
  31638. this._part._read = function (n) {
  31639. self._unpause()
  31640. }
  31641. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31642. this.emit('preamble', this._part)
  31643. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31644. this.emit('part', this._part)
  31645. } else {
  31646. this._ignore()
  31647. }
  31648. if (!this._isPreamble) { this._inHeader = true }
  31649. }
  31650. if (data && start < end && !this._ignoreData) {
  31651. if (this._isPreamble || !this._inHeader) {
  31652. if (buf) { shouldWriteMore = this._part.push(buf) }
  31653. shouldWriteMore = this._part.push(data.slice(start, end))
  31654. if (!shouldWriteMore) { this._pause = true }
  31655. } else if (!this._isPreamble && this._inHeader) {
  31656. if (buf) { this._hparser.push(buf) }
  31657. r = this._hparser.push(data.slice(start, end))
  31658. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31659. }
  31660. }
  31661. if (isMatch) {
  31662. this._hparser.reset()
  31663. if (this._isPreamble) { this._isPreamble = false } else {
  31664. if (start !== end) {
  31665. ++this._parts
  31666. this._part.on('end', function () {
  31667. if (--self._parts === 0) {
  31668. if (self._finished) {
  31669. self._realFinish = true
  31670. self.emit('finish')
  31671. self._realFinish = false
  31672. } else {
  31673. self._unpause()
  31674. }
  31675. }
  31676. })
  31677. }
  31678. }
  31679. this._part.push(null)
  31680. this._part = undefined
  31681. this._ignoreData = false
  31682. this._justMatched = true
  31683. this._dashes = 0
  31684. }
  31685. }
  31686. Dicer.prototype._unpause = function () {
  31687. if (!this._pause) { return }
  31688. this._pause = false
  31689. if (this._cb) {
  31690. const cb = this._cb
  31691. this._cb = undefined
  31692. cb()
  31693. }
  31694. }
  31695. module.exports = Dicer
  31696. /***/ }),
  31697. /***/ 2032:
  31698. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31699. "use strict";
  31700. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31701. const inherits = (__nccwpck_require__(7261).inherits)
  31702. const getLimit = __nccwpck_require__(1467)
  31703. const StreamSearch = __nccwpck_require__(1142)
  31704. const B_DCRLF = Buffer.from('\r\n\r\n')
  31705. const RE_CRLF = /\r\n/g
  31706. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31707. function HeaderParser (cfg) {
  31708. EventEmitter.call(this)
  31709. cfg = cfg || {}
  31710. const self = this
  31711. this.nread = 0
  31712. this.maxed = false
  31713. this.npairs = 0
  31714. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  31715. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  31716. this.buffer = ''
  31717. this.header = {}
  31718. this.finished = false
  31719. this.ss = new StreamSearch(B_DCRLF)
  31720. this.ss.on('info', function (isMatch, data, start, end) {
  31721. if (data && !self.maxed) {
  31722. if (self.nread + end - start >= self.maxHeaderSize) {
  31723. end = self.maxHeaderSize - self.nread + start
  31724. self.nread = self.maxHeaderSize
  31725. self.maxed = true
  31726. } else { self.nread += (end - start) }
  31727. self.buffer += data.toString('binary', start, end)
  31728. }
  31729. if (isMatch) { self._finish() }
  31730. })
  31731. }
  31732. inherits(HeaderParser, EventEmitter)
  31733. HeaderParser.prototype.push = function (data) {
  31734. const r = this.ss.push(data)
  31735. if (this.finished) { return r }
  31736. }
  31737. HeaderParser.prototype.reset = function () {
  31738. this.finished = false
  31739. this.buffer = ''
  31740. this.header = {}
  31741. this.ss.reset()
  31742. }
  31743. HeaderParser.prototype._finish = function () {
  31744. if (this.buffer) { this._parseHeader() }
  31745. this.ss.matches = this.ss.maxMatches
  31746. const header = this.header
  31747. this.header = {}
  31748. this.buffer = ''
  31749. this.finished = true
  31750. this.nread = this.npairs = 0
  31751. this.maxed = false
  31752. this.emit('header', header)
  31753. }
  31754. HeaderParser.prototype._parseHeader = function () {
  31755. if (this.npairs === this.maxHeaderPairs) { return }
  31756. const lines = this.buffer.split(RE_CRLF)
  31757. const len = lines.length
  31758. let m, h
  31759. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31760. if (lines[i].length === 0) { continue }
  31761. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  31762. // folded header content
  31763. // RFC2822 says to just remove the CRLF and not the whitespace following
  31764. // it, so we follow the RFC and include the leading whitespace ...
  31765. if (h) {
  31766. this.header[h][this.header[h].length - 1] += lines[i]
  31767. continue
  31768. }
  31769. }
  31770. const posColon = lines[i].indexOf(':')
  31771. if (
  31772. posColon === -1 ||
  31773. posColon === 0
  31774. ) {
  31775. return
  31776. }
  31777. m = RE_HDR.exec(lines[i])
  31778. h = m[1].toLowerCase()
  31779. this.header[h] = this.header[h] || []
  31780. this.header[h].push((m[2] || ''))
  31781. if (++this.npairs === this.maxHeaderPairs) { break }
  31782. }
  31783. }
  31784. module.exports = HeaderParser
  31785. /***/ }),
  31786. /***/ 1620:
  31787. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31788. "use strict";
  31789. const inherits = (__nccwpck_require__(7261).inherits)
  31790. const ReadableStream = (__nccwpck_require__(4492).Readable)
  31791. function PartStream (opts) {
  31792. ReadableStream.call(this, opts)
  31793. }
  31794. inherits(PartStream, ReadableStream)
  31795. PartStream.prototype._read = function (n) {}
  31796. module.exports = PartStream
  31797. /***/ }),
  31798. /***/ 1142:
  31799. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31800. "use strict";
  31801. /**
  31802. * Copyright Brian White. All rights reserved.
  31803. *
  31804. * @see https://github.com/mscdex/streamsearch
  31805. *
  31806. * Permission is hereby granted, free of charge, to any person obtaining a copy
  31807. * of this software and associated documentation files (the "Software"), to
  31808. * deal in the Software without restriction, including without limitation the
  31809. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  31810. * sell copies of the Software, and to permit persons to whom the Software is
  31811. * furnished to do so, subject to the following conditions:
  31812. *
  31813. * The above copyright notice and this permission notice shall be included in
  31814. * all copies or substantial portions of the Software.
  31815. *
  31816. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  31817. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  31818. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  31819. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  31820. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  31821. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  31822. * IN THE SOFTWARE.
  31823. *
  31824. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  31825. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  31826. */
  31827. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31828. const inherits = (__nccwpck_require__(7261).inherits)
  31829. function SBMH (needle) {
  31830. if (typeof needle === 'string') {
  31831. needle = Buffer.from(needle)
  31832. }
  31833. if (!Buffer.isBuffer(needle)) {
  31834. throw new TypeError('The needle has to be a String or a Buffer.')
  31835. }
  31836. const needleLength = needle.length
  31837. if (needleLength === 0) {
  31838. throw new Error('The needle cannot be an empty String/Buffer.')
  31839. }
  31840. if (needleLength > 256) {
  31841. throw new Error('The needle cannot have a length bigger than 256.')
  31842. }
  31843. this.maxMatches = Infinity
  31844. this.matches = 0
  31845. this._occ = new Array(256)
  31846. .fill(needleLength) // Initialize occurrence table.
  31847. this._lookbehind_size = 0
  31848. this._needle = needle
  31849. this._bufpos = 0
  31850. this._lookbehind = Buffer.alloc(needleLength)
  31851. // Populate occurrence table with analysis of the needle,
  31852. // ignoring last letter.
  31853. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  31854. this._occ[needle[i]] = needleLength - 1 - i
  31855. }
  31856. }
  31857. inherits(SBMH, EventEmitter)
  31858. SBMH.prototype.reset = function () {
  31859. this._lookbehind_size = 0
  31860. this.matches = 0
  31861. this._bufpos = 0
  31862. }
  31863. SBMH.prototype.push = function (chunk, pos) {
  31864. if (!Buffer.isBuffer(chunk)) {
  31865. chunk = Buffer.from(chunk, 'binary')
  31866. }
  31867. const chlen = chunk.length
  31868. this._bufpos = pos || 0
  31869. let r
  31870. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  31871. return r
  31872. }
  31873. SBMH.prototype._sbmh_feed = function (data) {
  31874. const len = data.length
  31875. const needle = this._needle
  31876. const needleLength = needle.length
  31877. const lastNeedleChar = needle[needleLength - 1]
  31878. // Positive: points to a position in `data`
  31879. // pos == 3 points to data[3]
  31880. // Negative: points to a position in the lookbehind buffer
  31881. // pos == -2 points to lookbehind[lookbehind_size - 2]
  31882. let pos = -this._lookbehind_size
  31883. let ch
  31884. if (pos < 0) {
  31885. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  31886. // search with character lookup code that considers both the
  31887. // lookbehind buffer and the current round's haystack data.
  31888. //
  31889. // Loop until
  31890. // there is a match.
  31891. // or until
  31892. // we've moved past the position that requires the
  31893. // lookbehind buffer. In this case we switch to the
  31894. // optimized loop.
  31895. // or until
  31896. // the character to look at lies outside the haystack.
  31897. while (pos < 0 && pos <= len - needleLength) {
  31898. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  31899. if (
  31900. ch === lastNeedleChar &&
  31901. this._sbmh_memcmp(data, pos, needleLength - 1)
  31902. ) {
  31903. this._lookbehind_size = 0
  31904. ++this.matches
  31905. this.emit('info', true)
  31906. return (this._bufpos = pos + needleLength)
  31907. }
  31908. pos += this._occ[ch]
  31909. }
  31910. // No match.
  31911. if (pos < 0) {
  31912. // There's too few data for Boyer-Moore-Horspool to run,
  31913. // so let's use a different algorithm to skip as much as
  31914. // we can.
  31915. // Forward pos until
  31916. // the trailing part of lookbehind + data
  31917. // looks like the beginning of the needle
  31918. // or until
  31919. // pos == 0
  31920. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  31921. }
  31922. if (pos >= 0) {
  31923. // Discard lookbehind buffer.
  31924. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  31925. this._lookbehind_size = 0
  31926. } else {
  31927. // Cut off part of the lookbehind buffer that has
  31928. // been processed and append the entire haystack
  31929. // into it.
  31930. const bytesToCutOff = this._lookbehind_size + pos
  31931. if (bytesToCutOff > 0) {
  31932. // The cut off data is guaranteed not to contain the needle.
  31933. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  31934. }
  31935. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  31936. this._lookbehind_size - bytesToCutOff)
  31937. this._lookbehind_size -= bytesToCutOff
  31938. data.copy(this._lookbehind, this._lookbehind_size)
  31939. this._lookbehind_size += len
  31940. this._bufpos = len
  31941. return len
  31942. }
  31943. }
  31944. pos += (pos >= 0) * this._bufpos
  31945. // Lookbehind buffer is now empty. We only need to check if the
  31946. // needle is in the haystack.
  31947. if (data.indexOf(needle, pos) !== -1) {
  31948. pos = data.indexOf(needle, pos)
  31949. ++this.matches
  31950. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  31951. return (this._bufpos = pos + needleLength)
  31952. } else {
  31953. pos = len - needleLength
  31954. }
  31955. // There was no match. If there's trailing haystack data that we cannot
  31956. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  31957. // data is less than the needle size) then match using a modified
  31958. // algorithm that starts matching from the beginning instead of the end.
  31959. // Whatever trailing data is left after running this algorithm is added to
  31960. // the lookbehind buffer.
  31961. while (
  31962. pos < len &&
  31963. (
  31964. data[pos] !== needle[0] ||
  31965. (
  31966. (Buffer.compare(
  31967. data.subarray(pos, pos + len - pos),
  31968. needle.subarray(0, len - pos)
  31969. ) !== 0)
  31970. )
  31971. )
  31972. ) {
  31973. ++pos
  31974. }
  31975. if (pos < len) {
  31976. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  31977. this._lookbehind_size = len - pos
  31978. }
  31979. // Everything until pos is guaranteed not to contain needle data.
  31980. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  31981. this._bufpos = len
  31982. return len
  31983. }
  31984. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  31985. return (pos < 0)
  31986. ? this._lookbehind[this._lookbehind_size + pos]
  31987. : data[pos]
  31988. }
  31989. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  31990. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31991. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  31992. }
  31993. return true
  31994. }
  31995. module.exports = SBMH
  31996. /***/ }),
  31997. /***/ 727:
  31998. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31999. "use strict";
  32000. const WritableStream = (__nccwpck_require__(4492).Writable)
  32001. const { inherits } = __nccwpck_require__(7261)
  32002. const Dicer = __nccwpck_require__(2960)
  32003. const MultipartParser = __nccwpck_require__(2183)
  32004. const UrlencodedParser = __nccwpck_require__(8306)
  32005. const parseParams = __nccwpck_require__(1854)
  32006. function Busboy (opts) {
  32007. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32008. if (typeof opts !== 'object') {
  32009. throw new TypeError('Busboy expected an options-Object.')
  32010. }
  32011. if (typeof opts.headers !== 'object') {
  32012. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32013. }
  32014. if (typeof opts.headers['content-type'] !== 'string') {
  32015. throw new TypeError('Missing Content-Type-header.')
  32016. }
  32017. const {
  32018. headers,
  32019. ...streamOptions
  32020. } = opts
  32021. this.opts = {
  32022. autoDestroy: false,
  32023. ...streamOptions
  32024. }
  32025. WritableStream.call(this, this.opts)
  32026. this._done = false
  32027. this._parser = this.getParserByHeaders(headers)
  32028. this._finished = false
  32029. }
  32030. inherits(Busboy, WritableStream)
  32031. Busboy.prototype.emit = function (ev) {
  32032. if (ev === 'finish') {
  32033. if (!this._done) {
  32034. this._parser?.end()
  32035. return
  32036. } else if (this._finished) {
  32037. return
  32038. }
  32039. this._finished = true
  32040. }
  32041. WritableStream.prototype.emit.apply(this, arguments)
  32042. }
  32043. Busboy.prototype.getParserByHeaders = function (headers) {
  32044. const parsed = parseParams(headers['content-type'])
  32045. const cfg = {
  32046. defCharset: this.opts.defCharset,
  32047. fileHwm: this.opts.fileHwm,
  32048. headers,
  32049. highWaterMark: this.opts.highWaterMark,
  32050. isPartAFile: this.opts.isPartAFile,
  32051. limits: this.opts.limits,
  32052. parsedConType: parsed,
  32053. preservePath: this.opts.preservePath
  32054. }
  32055. if (MultipartParser.detect.test(parsed[0])) {
  32056. return new MultipartParser(this, cfg)
  32057. }
  32058. if (UrlencodedParser.detect.test(parsed[0])) {
  32059. return new UrlencodedParser(this, cfg)
  32060. }
  32061. throw new Error('Unsupported Content-Type.')
  32062. }
  32063. Busboy.prototype._write = function (chunk, encoding, cb) {
  32064. this._parser.write(chunk, cb)
  32065. }
  32066. module.exports = Busboy
  32067. module.exports["default"] = Busboy
  32068. module.exports.Busboy = Busboy
  32069. module.exports.Dicer = Dicer
  32070. /***/ }),
  32071. /***/ 2183:
  32072. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32073. "use strict";
  32074. // TODO:
  32075. // * support 1 nested multipart level
  32076. // (see second multipart example here:
  32077. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32078. // * support limits.fieldNameSize
  32079. // -- this will require modifications to utils.parseParams
  32080. const { Readable } = __nccwpck_require__(4492)
  32081. const { inherits } = __nccwpck_require__(7261)
  32082. const Dicer = __nccwpck_require__(2960)
  32083. const parseParams = __nccwpck_require__(1854)
  32084. const decodeText = __nccwpck_require__(4619)
  32085. const basename = __nccwpck_require__(8647)
  32086. const getLimit = __nccwpck_require__(1467)
  32087. const RE_BOUNDARY = /^boundary$/i
  32088. const RE_FIELD = /^form-data$/i
  32089. const RE_CHARSET = /^charset$/i
  32090. const RE_FILENAME = /^filename$/i
  32091. const RE_NAME = /^name$/i
  32092. Multipart.detect = /^multipart\/form-data/i
  32093. function Multipart (boy, cfg) {
  32094. let i
  32095. let len
  32096. const self = this
  32097. let boundary
  32098. const limits = cfg.limits
  32099. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32100. const parsedConType = cfg.parsedConType || []
  32101. const defCharset = cfg.defCharset || 'utf8'
  32102. const preservePath = cfg.preservePath
  32103. const fileOpts = { highWaterMark: cfg.fileHwm }
  32104. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32105. if (Array.isArray(parsedConType[i]) &&
  32106. RE_BOUNDARY.test(parsedConType[i][0])) {
  32107. boundary = parsedConType[i][1]
  32108. break
  32109. }
  32110. }
  32111. function checkFinished () {
  32112. if (nends === 0 && finished && !boy._done) {
  32113. finished = false
  32114. self.end()
  32115. }
  32116. }
  32117. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32118. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32119. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32120. const filesLimit = getLimit(limits, 'files', Infinity)
  32121. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32122. const partsLimit = getLimit(limits, 'parts', Infinity)
  32123. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32124. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32125. let nfiles = 0
  32126. let nfields = 0
  32127. let nends = 0
  32128. let curFile
  32129. let curField
  32130. let finished = false
  32131. this._needDrain = false
  32132. this._pause = false
  32133. this._cb = undefined
  32134. this._nparts = 0
  32135. this._boy = boy
  32136. const parserCfg = {
  32137. boundary,
  32138. maxHeaderPairs: headerPairsLimit,
  32139. maxHeaderSize: headerSizeLimit,
  32140. partHwm: fileOpts.highWaterMark,
  32141. highWaterMark: cfg.highWaterMark
  32142. }
  32143. this.parser = new Dicer(parserCfg)
  32144. this.parser.on('drain', function () {
  32145. self._needDrain = false
  32146. if (self._cb && !self._pause) {
  32147. const cb = self._cb
  32148. self._cb = undefined
  32149. cb()
  32150. }
  32151. }).on('part', function onPart (part) {
  32152. if (++self._nparts > partsLimit) {
  32153. self.parser.removeListener('part', onPart)
  32154. self.parser.on('part', skipPart)
  32155. boy.hitPartsLimit = true
  32156. boy.emit('partsLimit')
  32157. return skipPart(part)
  32158. }
  32159. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32160. // us emit 'end' early since we know the part has ended if we are already
  32161. // seeing the next part
  32162. if (curField) {
  32163. const field = curField
  32164. field.emit('end')
  32165. field.removeAllListeners('end')
  32166. }
  32167. part.on('header', function (header) {
  32168. let contype
  32169. let fieldname
  32170. let parsed
  32171. let charset
  32172. let encoding
  32173. let filename
  32174. let nsize = 0
  32175. if (header['content-type']) {
  32176. parsed = parseParams(header['content-type'][0])
  32177. if (parsed[0]) {
  32178. contype = parsed[0].toLowerCase()
  32179. for (i = 0, len = parsed.length; i < len; ++i) {
  32180. if (RE_CHARSET.test(parsed[i][0])) {
  32181. charset = parsed[i][1].toLowerCase()
  32182. break
  32183. }
  32184. }
  32185. }
  32186. }
  32187. if (contype === undefined) { contype = 'text/plain' }
  32188. if (charset === undefined) { charset = defCharset }
  32189. if (header['content-disposition']) {
  32190. parsed = parseParams(header['content-disposition'][0])
  32191. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32192. for (i = 0, len = parsed.length; i < len; ++i) {
  32193. if (RE_NAME.test(parsed[i][0])) {
  32194. fieldname = parsed[i][1]
  32195. } else if (RE_FILENAME.test(parsed[i][0])) {
  32196. filename = parsed[i][1]
  32197. if (!preservePath) { filename = basename(filename) }
  32198. }
  32199. }
  32200. } else { return skipPart(part) }
  32201. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32202. let onData,
  32203. onEnd
  32204. if (isPartAFile(fieldname, contype, filename)) {
  32205. // file/binary field
  32206. if (nfiles === filesLimit) {
  32207. if (!boy.hitFilesLimit) {
  32208. boy.hitFilesLimit = true
  32209. boy.emit('filesLimit')
  32210. }
  32211. return skipPart(part)
  32212. }
  32213. ++nfiles
  32214. if (boy.listenerCount('file') === 0) {
  32215. self.parser._ignore()
  32216. return
  32217. }
  32218. ++nends
  32219. const file = new FileStream(fileOpts)
  32220. curFile = file
  32221. file.on('end', function () {
  32222. --nends
  32223. self._pause = false
  32224. checkFinished()
  32225. if (self._cb && !self._needDrain) {
  32226. const cb = self._cb
  32227. self._cb = undefined
  32228. cb()
  32229. }
  32230. })
  32231. file._read = function (n) {
  32232. if (!self._pause) { return }
  32233. self._pause = false
  32234. if (self._cb && !self._needDrain) {
  32235. const cb = self._cb
  32236. self._cb = undefined
  32237. cb()
  32238. }
  32239. }
  32240. boy.emit('file', fieldname, file, filename, encoding, contype)
  32241. onData = function (data) {
  32242. if ((nsize += data.length) > fileSizeLimit) {
  32243. const extralen = fileSizeLimit - nsize + data.length
  32244. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32245. file.truncated = true
  32246. file.bytesRead = fileSizeLimit
  32247. part.removeAllListeners('data')
  32248. file.emit('limit')
  32249. return
  32250. } else if (!file.push(data)) { self._pause = true }
  32251. file.bytesRead = nsize
  32252. }
  32253. onEnd = function () {
  32254. curFile = undefined
  32255. file.push(null)
  32256. }
  32257. } else {
  32258. // non-file field
  32259. if (nfields === fieldsLimit) {
  32260. if (!boy.hitFieldsLimit) {
  32261. boy.hitFieldsLimit = true
  32262. boy.emit('fieldsLimit')
  32263. }
  32264. return skipPart(part)
  32265. }
  32266. ++nfields
  32267. ++nends
  32268. let buffer = ''
  32269. let truncated = false
  32270. curField = part
  32271. onData = function (data) {
  32272. if ((nsize += data.length) > fieldSizeLimit) {
  32273. const extralen = (fieldSizeLimit - (nsize - data.length))
  32274. buffer += data.toString('binary', 0, extralen)
  32275. truncated = true
  32276. part.removeAllListeners('data')
  32277. } else { buffer += data.toString('binary') }
  32278. }
  32279. onEnd = function () {
  32280. curField = undefined
  32281. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32282. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32283. --nends
  32284. checkFinished()
  32285. }
  32286. }
  32287. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32288. broken. Streams2/streams3 is a huge black box of confusion, but
  32289. somehow overriding the sync state seems to fix things again (and still
  32290. seems to work for previous node versions).
  32291. */
  32292. part._readableState.sync = false
  32293. part.on('data', onData)
  32294. part.on('end', onEnd)
  32295. }).on('error', function (err) {
  32296. if (curFile) { curFile.emit('error', err) }
  32297. })
  32298. }).on('error', function (err) {
  32299. boy.emit('error', err)
  32300. }).on('finish', function () {
  32301. finished = true
  32302. checkFinished()
  32303. })
  32304. }
  32305. Multipart.prototype.write = function (chunk, cb) {
  32306. const r = this.parser.write(chunk)
  32307. if (r && !this._pause) {
  32308. cb()
  32309. } else {
  32310. this._needDrain = !r
  32311. this._cb = cb
  32312. }
  32313. }
  32314. Multipart.prototype.end = function () {
  32315. const self = this
  32316. if (self.parser.writable) {
  32317. self.parser.end()
  32318. } else if (!self._boy._done) {
  32319. process.nextTick(function () {
  32320. self._boy._done = true
  32321. self._boy.emit('finish')
  32322. })
  32323. }
  32324. }
  32325. function skipPart (part) {
  32326. part.resume()
  32327. }
  32328. function FileStream (opts) {
  32329. Readable.call(this, opts)
  32330. this.bytesRead = 0
  32331. this.truncated = false
  32332. }
  32333. inherits(FileStream, Readable)
  32334. FileStream.prototype._read = function (n) {}
  32335. module.exports = Multipart
  32336. /***/ }),
  32337. /***/ 8306:
  32338. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32339. "use strict";
  32340. const Decoder = __nccwpck_require__(7100)
  32341. const decodeText = __nccwpck_require__(4619)
  32342. const getLimit = __nccwpck_require__(1467)
  32343. const RE_CHARSET = /^charset$/i
  32344. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32345. function UrlEncoded (boy, cfg) {
  32346. const limits = cfg.limits
  32347. const parsedConType = cfg.parsedConType
  32348. this.boy = boy
  32349. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32350. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32351. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32352. let charset
  32353. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32354. if (Array.isArray(parsedConType[i]) &&
  32355. RE_CHARSET.test(parsedConType[i][0])) {
  32356. charset = parsedConType[i][1].toLowerCase()
  32357. break
  32358. }
  32359. }
  32360. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32361. this.decoder = new Decoder()
  32362. this.charset = charset
  32363. this._fields = 0
  32364. this._state = 'key'
  32365. this._checkingBytes = true
  32366. this._bytesKey = 0
  32367. this._bytesVal = 0
  32368. this._key = ''
  32369. this._val = ''
  32370. this._keyTrunc = false
  32371. this._valTrunc = false
  32372. this._hitLimit = false
  32373. }
  32374. UrlEncoded.prototype.write = function (data, cb) {
  32375. if (this._fields === this.fieldsLimit) {
  32376. if (!this.boy.hitFieldsLimit) {
  32377. this.boy.hitFieldsLimit = true
  32378. this.boy.emit('fieldsLimit')
  32379. }
  32380. return cb()
  32381. }
  32382. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32383. while (p < len) {
  32384. if (this._state === 'key') {
  32385. idxeq = idxamp = undefined
  32386. for (i = p; i < len; ++i) {
  32387. if (!this._checkingBytes) { ++p }
  32388. if (data[i] === 0x3D/* = */) {
  32389. idxeq = i
  32390. break
  32391. } else if (data[i] === 0x26/* & */) {
  32392. idxamp = i
  32393. break
  32394. }
  32395. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32396. this._hitLimit = true
  32397. break
  32398. } else if (this._checkingBytes) { ++this._bytesKey }
  32399. }
  32400. if (idxeq !== undefined) {
  32401. // key with assignment
  32402. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32403. this._state = 'val'
  32404. this._hitLimit = false
  32405. this._checkingBytes = true
  32406. this._val = ''
  32407. this._bytesVal = 0
  32408. this._valTrunc = false
  32409. this.decoder.reset()
  32410. p = idxeq + 1
  32411. } else if (idxamp !== undefined) {
  32412. // key with no assignment
  32413. ++this._fields
  32414. let key; const keyTrunc = this._keyTrunc
  32415. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32416. this._hitLimit = false
  32417. this._checkingBytes = true
  32418. this._key = ''
  32419. this._bytesKey = 0
  32420. this._keyTrunc = false
  32421. this.decoder.reset()
  32422. if (key.length) {
  32423. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32424. '',
  32425. keyTrunc,
  32426. false)
  32427. }
  32428. p = idxamp + 1
  32429. if (this._fields === this.fieldsLimit) { return cb() }
  32430. } else if (this._hitLimit) {
  32431. // we may not have hit the actual limit if there are encoded bytes...
  32432. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32433. p = i
  32434. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32435. // yep, we actually did hit the limit
  32436. this._checkingBytes = false
  32437. this._keyTrunc = true
  32438. }
  32439. } else {
  32440. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32441. p = len
  32442. }
  32443. } else {
  32444. idxamp = undefined
  32445. for (i = p; i < len; ++i) {
  32446. if (!this._checkingBytes) { ++p }
  32447. if (data[i] === 0x26/* & */) {
  32448. idxamp = i
  32449. break
  32450. }
  32451. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32452. this._hitLimit = true
  32453. break
  32454. } else if (this._checkingBytes) { ++this._bytesVal }
  32455. }
  32456. if (idxamp !== undefined) {
  32457. ++this._fields
  32458. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32459. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32460. decodeText(this._val, 'binary', this.charset),
  32461. this._keyTrunc,
  32462. this._valTrunc)
  32463. this._state = 'key'
  32464. this._hitLimit = false
  32465. this._checkingBytes = true
  32466. this._key = ''
  32467. this._bytesKey = 0
  32468. this._keyTrunc = false
  32469. this.decoder.reset()
  32470. p = idxamp + 1
  32471. if (this._fields === this.fieldsLimit) { return cb() }
  32472. } else if (this._hitLimit) {
  32473. // we may not have hit the actual limit if there are encoded bytes...
  32474. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32475. p = i
  32476. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32477. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32478. // yep, we actually did hit the limit
  32479. this._checkingBytes = false
  32480. this._valTrunc = true
  32481. }
  32482. } else {
  32483. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32484. p = len
  32485. }
  32486. }
  32487. }
  32488. cb()
  32489. }
  32490. UrlEncoded.prototype.end = function () {
  32491. if (this.boy._done) { return }
  32492. if (this._state === 'key' && this._key.length > 0) {
  32493. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32494. '',
  32495. this._keyTrunc,
  32496. false)
  32497. } else if (this._state === 'val') {
  32498. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32499. decodeText(this._val, 'binary', this.charset),
  32500. this._keyTrunc,
  32501. this._valTrunc)
  32502. }
  32503. this.boy._done = true
  32504. this.boy.emit('finish')
  32505. }
  32506. module.exports = UrlEncoded
  32507. /***/ }),
  32508. /***/ 7100:
  32509. /***/ ((module) => {
  32510. "use strict";
  32511. const RE_PLUS = /\+/g
  32512. const HEX = [
  32513. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32514. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32515. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32516. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32517. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32518. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32519. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32520. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32521. ]
  32522. function Decoder () {
  32523. this.buffer = undefined
  32524. }
  32525. Decoder.prototype.write = function (str) {
  32526. // Replace '+' with ' ' before decoding
  32527. str = str.replace(RE_PLUS, ' ')
  32528. let res = ''
  32529. let i = 0; let p = 0; const len = str.length
  32530. for (; i < len; ++i) {
  32531. if (this.buffer !== undefined) {
  32532. if (!HEX[str.charCodeAt(i)]) {
  32533. res += '%' + this.buffer
  32534. this.buffer = undefined
  32535. --i // retry character
  32536. } else {
  32537. this.buffer += str[i]
  32538. ++p
  32539. if (this.buffer.length === 2) {
  32540. res += String.fromCharCode(parseInt(this.buffer, 16))
  32541. this.buffer = undefined
  32542. }
  32543. }
  32544. } else if (str[i] === '%') {
  32545. if (i > p) {
  32546. res += str.substring(p, i)
  32547. p = i
  32548. }
  32549. this.buffer = ''
  32550. ++p
  32551. }
  32552. }
  32553. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32554. return res
  32555. }
  32556. Decoder.prototype.reset = function () {
  32557. this.buffer = undefined
  32558. }
  32559. module.exports = Decoder
  32560. /***/ }),
  32561. /***/ 8647:
  32562. /***/ ((module) => {
  32563. "use strict";
  32564. module.exports = function basename (path) {
  32565. if (typeof path !== 'string') { return '' }
  32566. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32567. switch (path.charCodeAt(i)) {
  32568. case 0x2F: // '/'
  32569. case 0x5C: // '\'
  32570. path = path.slice(i + 1)
  32571. return (path === '..' || path === '.' ? '' : path)
  32572. }
  32573. }
  32574. return (path === '..' || path === '.' ? '' : path)
  32575. }
  32576. /***/ }),
  32577. /***/ 4619:
  32578. /***/ (function(module) {
  32579. "use strict";
  32580. // Node has always utf-8
  32581. const utf8Decoder = new TextDecoder('utf-8')
  32582. const textDecoders = new Map([
  32583. ['utf-8', utf8Decoder],
  32584. ['utf8', utf8Decoder]
  32585. ])
  32586. function getDecoder (charset) {
  32587. let lc
  32588. while (true) {
  32589. switch (charset) {
  32590. case 'utf-8':
  32591. case 'utf8':
  32592. return decoders.utf8
  32593. case 'latin1':
  32594. case 'ascii': // TODO: Make these a separate, strict decoder?
  32595. case 'us-ascii':
  32596. case 'iso-8859-1':
  32597. case 'iso8859-1':
  32598. case 'iso88591':
  32599. case 'iso_8859-1':
  32600. case 'windows-1252':
  32601. case 'iso_8859-1:1987':
  32602. case 'cp1252':
  32603. case 'x-cp1252':
  32604. return decoders.latin1
  32605. case 'utf16le':
  32606. case 'utf-16le':
  32607. case 'ucs2':
  32608. case 'ucs-2':
  32609. return decoders.utf16le
  32610. case 'base64':
  32611. return decoders.base64
  32612. default:
  32613. if (lc === undefined) {
  32614. lc = true
  32615. charset = charset.toLowerCase()
  32616. continue
  32617. }
  32618. return decoders.other.bind(charset)
  32619. }
  32620. }
  32621. }
  32622. const decoders = {
  32623. utf8: (data, sourceEncoding) => {
  32624. if (data.length === 0) {
  32625. return ''
  32626. }
  32627. if (typeof data === 'string') {
  32628. data = Buffer.from(data, sourceEncoding)
  32629. }
  32630. return data.utf8Slice(0, data.length)
  32631. },
  32632. latin1: (data, sourceEncoding) => {
  32633. if (data.length === 0) {
  32634. return ''
  32635. }
  32636. if (typeof data === 'string') {
  32637. return data
  32638. }
  32639. return data.latin1Slice(0, data.length)
  32640. },
  32641. utf16le: (data, sourceEncoding) => {
  32642. if (data.length === 0) {
  32643. return ''
  32644. }
  32645. if (typeof data === 'string') {
  32646. data = Buffer.from(data, sourceEncoding)
  32647. }
  32648. return data.ucs2Slice(0, data.length)
  32649. },
  32650. base64: (data, sourceEncoding) => {
  32651. if (data.length === 0) {
  32652. return ''
  32653. }
  32654. if (typeof data === 'string') {
  32655. data = Buffer.from(data, sourceEncoding)
  32656. }
  32657. return data.base64Slice(0, data.length)
  32658. },
  32659. other: (data, sourceEncoding) => {
  32660. if (data.length === 0) {
  32661. return ''
  32662. }
  32663. if (typeof data === 'string') {
  32664. data = Buffer.from(data, sourceEncoding)
  32665. }
  32666. if (textDecoders.has(this.toString())) {
  32667. try {
  32668. return textDecoders.get(this).decode(data)
  32669. } catch {}
  32670. }
  32671. return typeof data === 'string'
  32672. ? data
  32673. : data.toString()
  32674. }
  32675. }
  32676. function decodeText (text, sourceEncoding, destEncoding) {
  32677. if (text) {
  32678. return getDecoder(destEncoding)(text, sourceEncoding)
  32679. }
  32680. return text
  32681. }
  32682. module.exports = decodeText
  32683. /***/ }),
  32684. /***/ 1467:
  32685. /***/ ((module) => {
  32686. "use strict";
  32687. module.exports = function getLimit (limits, name, defaultLimit) {
  32688. if (
  32689. !limits ||
  32690. limits[name] === undefined ||
  32691. limits[name] === null
  32692. ) { return defaultLimit }
  32693. if (
  32694. typeof limits[name] !== 'number' ||
  32695. isNaN(limits[name])
  32696. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32697. return limits[name]
  32698. }
  32699. /***/ }),
  32700. /***/ 1854:
  32701. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32702. "use strict";
  32703. /* eslint-disable object-property-newline */
  32704. const decodeText = __nccwpck_require__(4619)
  32705. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32706. const EncodedLookup = {
  32707. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32708. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32709. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32710. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  32711. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  32712. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  32713. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  32714. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  32715. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  32716. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  32717. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  32718. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  32719. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  32720. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  32721. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  32722. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  32723. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  32724. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  32725. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  32726. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  32727. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  32728. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  32729. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  32730. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  32731. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  32732. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  32733. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  32734. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  32735. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  32736. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  32737. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  32738. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  32739. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  32740. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  32741. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  32742. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  32743. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  32744. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  32745. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  32746. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  32747. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  32748. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  32749. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  32750. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  32751. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  32752. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  32753. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  32754. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  32755. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  32756. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  32757. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  32758. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  32759. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  32760. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  32761. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  32762. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  32763. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  32764. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  32765. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  32766. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  32767. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  32768. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  32769. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  32770. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  32771. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  32772. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  32773. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  32774. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  32775. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  32776. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  32777. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  32778. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  32779. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  32780. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  32781. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  32782. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  32783. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  32784. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  32785. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  32786. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  32787. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  32788. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  32789. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  32790. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  32791. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  32792. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  32793. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  32794. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  32795. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  32796. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  32797. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  32798. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  32799. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  32800. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  32801. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  32802. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  32803. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  32804. }
  32805. function encodedReplacer (match) {
  32806. return EncodedLookup[match]
  32807. }
  32808. const STATE_KEY = 0
  32809. const STATE_VALUE = 1
  32810. const STATE_CHARSET = 2
  32811. const STATE_LANG = 3
  32812. function parseParams (str) {
  32813. const res = []
  32814. let state = STATE_KEY
  32815. let charset = ''
  32816. let inquote = false
  32817. let escaping = false
  32818. let p = 0
  32819. let tmp = ''
  32820. const len = str.length
  32821. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32822. const char = str[i]
  32823. if (char === '\\' && inquote) {
  32824. if (escaping) { escaping = false } else {
  32825. escaping = true
  32826. continue
  32827. }
  32828. } else if (char === '"') {
  32829. if (!escaping) {
  32830. if (inquote) {
  32831. inquote = false
  32832. state = STATE_KEY
  32833. } else { inquote = true }
  32834. continue
  32835. } else { escaping = false }
  32836. } else {
  32837. if (escaping && inquote) { tmp += '\\' }
  32838. escaping = false
  32839. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  32840. if (state === STATE_CHARSET) {
  32841. state = STATE_LANG
  32842. charset = tmp.substring(1)
  32843. } else { state = STATE_VALUE }
  32844. tmp = ''
  32845. continue
  32846. } else if (state === STATE_KEY &&
  32847. (char === '*' || char === '=') &&
  32848. res.length) {
  32849. state = char === '*'
  32850. ? STATE_CHARSET
  32851. : STATE_VALUE
  32852. res[p] = [tmp, undefined]
  32853. tmp = ''
  32854. continue
  32855. } else if (!inquote && char === ';') {
  32856. state = STATE_KEY
  32857. if (charset) {
  32858. if (tmp.length) {
  32859. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32860. 'binary',
  32861. charset)
  32862. }
  32863. charset = ''
  32864. } else if (tmp.length) {
  32865. tmp = decodeText(tmp, 'binary', 'utf8')
  32866. }
  32867. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  32868. tmp = ''
  32869. ++p
  32870. continue
  32871. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  32872. }
  32873. tmp += char
  32874. }
  32875. if (charset && tmp.length) {
  32876. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32877. 'binary',
  32878. charset)
  32879. } else if (tmp) {
  32880. tmp = decodeText(tmp, 'binary', 'utf8')
  32881. }
  32882. if (res[p] === undefined) {
  32883. if (tmp) { res[p] = tmp }
  32884. } else { res[p][1] = tmp }
  32885. return res
  32886. }
  32887. module.exports = parseParams
  32888. /***/ })
  32889. /******/ });
  32890. /************************************************************************/
  32891. /******/ // The module cache
  32892. /******/ var __webpack_module_cache__ = {};
  32893. /******/
  32894. /******/ // The require function
  32895. /******/ function __nccwpck_require__(moduleId) {
  32896. /******/ // Check if module is in cache
  32897. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  32898. /******/ if (cachedModule !== undefined) {
  32899. /******/ return cachedModule.exports;
  32900. /******/ }
  32901. /******/ // Create a new module (and put it into the cache)
  32902. /******/ var module = __webpack_module_cache__[moduleId] = {
  32903. /******/ // no module.id needed
  32904. /******/ // no module.loaded needed
  32905. /******/ exports: {}
  32906. /******/ };
  32907. /******/
  32908. /******/ // Execute the module function
  32909. /******/ var threw = true;
  32910. /******/ try {
  32911. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  32912. /******/ threw = false;
  32913. /******/ } finally {
  32914. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  32915. /******/ }
  32916. /******/
  32917. /******/ // Return the exports of the module
  32918. /******/ return module.exports;
  32919. /******/ }
  32920. /******/
  32921. /************************************************************************/
  32922. /******/ /* webpack/runtime/compat */
  32923. /******/
  32924. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  32925. /******/
  32926. /************************************************************************/
  32927. /******/
  32928. /******/ // startup
  32929. /******/ // Load entry module and return exports
  32930. /******/ // This entry module is referenced by other modules so it can't be inlined
  32931. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  32932. /******/ module.exports = __webpack_exports__;
  32933. /******/
  32934. /******/ })()
  32935. ;