index.js 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470
  1. /******/ (() => { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 7219:
  4. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5. "use strict";
  6. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  7. if (k2 === undefined) k2 = k;
  8. var desc = Object.getOwnPropertyDescriptor(m, k);
  9. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  10. desc = { enumerable: true, get: function() { return m[k]; } };
  11. }
  12. Object.defineProperty(o, k2, desc);
  13. }) : (function(o, m, k, k2) {
  14. if (k2 === undefined) k2 = k;
  15. o[k2] = m[k];
  16. }));
  17. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  18. Object.defineProperty(o, "default", { enumerable: true, value: v });
  19. }) : function(o, v) {
  20. o["default"] = v;
  21. });
  22. var __importStar = (this && this.__importStar) || function (mod) {
  23. if (mod && mod.__esModule) return mod;
  24. var result = {};
  25. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  26. __setModuleDefault(result, mod);
  27. return result;
  28. };
  29. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30. exports.directoryExistsSync = directoryExistsSync;
  31. exports.existsSync = existsSync;
  32. exports.fileExistsSync = fileExistsSync;
  33. const fs = __importStar(__nccwpck_require__(7147));
  34. function directoryExistsSync(path, required) {
  35. var _a;
  36. if (!path) {
  37. throw new Error("Arg 'path' must not be empty");
  38. }
  39. let stats;
  40. try {
  41. stats = fs.statSync(path);
  42. }
  43. catch (error) {
  44. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  45. if (!required) {
  46. return false;
  47. }
  48. throw new Error(`Directory '${path}' does not exist`);
  49. }
  50. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  51. }
  52. if (stats.isDirectory()) {
  53. return true;
  54. }
  55. else if (!required) {
  56. return false;
  57. }
  58. throw new Error(`Directory '${path}' does not exist`);
  59. }
  60. function existsSync(path) {
  61. var _a;
  62. if (!path) {
  63. throw new Error("Arg 'path' must not be empty");
  64. }
  65. try {
  66. fs.statSync(path);
  67. }
  68. catch (error) {
  69. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  70. return false;
  71. }
  72. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  73. }
  74. return true;
  75. }
  76. function fileExistsSync(path) {
  77. var _a;
  78. if (!path) {
  79. throw new Error("Arg 'path' must not be empty");
  80. }
  81. let stats;
  82. try {
  83. stats = fs.statSync(path);
  84. }
  85. catch (error) {
  86. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  87. return false;
  88. }
  89. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  90. }
  91. if (!stats.isDirectory()) {
  92. return true;
  93. }
  94. return false;
  95. }
  96. /***/ }),
  97. /***/ 2565:
  98. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  99. "use strict";
  100. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  101. if (k2 === undefined) k2 = k;
  102. var desc = Object.getOwnPropertyDescriptor(m, k);
  103. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  104. desc = { enumerable: true, get: function() { return m[k]; } };
  105. }
  106. Object.defineProperty(o, k2, desc);
  107. }) : (function(o, m, k, k2) {
  108. if (k2 === undefined) k2 = k;
  109. o[k2] = m[k];
  110. }));
  111. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  112. Object.defineProperty(o, "default", { enumerable: true, value: v });
  113. }) : function(o, v) {
  114. o["default"] = v;
  115. });
  116. var __importStar = (this && this.__importStar) || function (mod) {
  117. if (mod && mod.__esModule) return mod;
  118. var result = {};
  119. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  120. __setModuleDefault(result, mod);
  121. return result;
  122. };
  123. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  124. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  125. return new (P || (P = Promise))(function (resolve, reject) {
  126. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  127. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  128. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  129. step((generator = generator.apply(thisArg, _arguments || [])).next());
  130. });
  131. };
  132. Object.defineProperty(exports, "__esModule", ({ value: true }));
  133. exports.createAuthHelper = createAuthHelper;
  134. const assert = __importStar(__nccwpck_require__(9491));
  135. const core = __importStar(__nccwpck_require__(2186));
  136. const exec = __importStar(__nccwpck_require__(1514));
  137. const fs = __importStar(__nccwpck_require__(7147));
  138. const io = __importStar(__nccwpck_require__(7436));
  139. const os = __importStar(__nccwpck_require__(2037));
  140. const path = __importStar(__nccwpck_require__(1017));
  141. const regexpHelper = __importStar(__nccwpck_require__(3120));
  142. const stateHelper = __importStar(__nccwpck_require__(4866));
  143. const urlHelper = __importStar(__nccwpck_require__(9437));
  144. const uuid_1 = __nccwpck_require__(5840);
  145. const IS_WINDOWS = process.platform === 'win32';
  146. const SSH_COMMAND_KEY = 'core.sshCommand';
  147. function createAuthHelper(git, settings) {
  148. return new GitAuthHelper(git, settings);
  149. }
  150. class GitAuthHelper {
  151. constructor(gitCommandManager, gitSourceSettings) {
  152. this.insteadOfValues = [];
  153. this.sshCommand = '';
  154. this.sshKeyPath = '';
  155. this.sshKnownHostsPath = '';
  156. this.temporaryHomePath = '';
  157. this.credentialsConfigPath = ''; // Path to separate credentials config file in RUNNER_TEMP
  158. this.git = gitCommandManager;
  159. this.settings = gitSourceSettings || {};
  160. // Token auth header
  161. const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl);
  162. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  163. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  164. core.setSecret(basicCredential);
  165. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  166. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  167. // Instead of SSH URL
  168. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  169. this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
  170. if (this.settings.workflowOrganizationId) {
  171. this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
  172. }
  173. }
  174. configureAuth() {
  175. return __awaiter(this, void 0, void 0, function* () {
  176. // Remove possible previous values
  177. yield this.removeAuth();
  178. // Configure new values
  179. yield this.configureSsh();
  180. yield this.configureToken();
  181. });
  182. }
  183. configureTempGlobalConfig() {
  184. return __awaiter(this, void 0, void 0, function* () {
  185. var _a;
  186. // Already setup global config
  187. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  188. return path.join(this.temporaryHomePath, '.gitconfig');
  189. }
  190. // Create a temp home directory
  191. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  192. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  193. const uniqueId = (0, uuid_1.v4)();
  194. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  195. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  196. // Copy the global git config
  197. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  198. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  199. let configExists = false;
  200. try {
  201. yield fs.promises.stat(gitConfigPath);
  202. configExists = true;
  203. }
  204. catch (err) {
  205. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  206. throw err;
  207. }
  208. }
  209. if (configExists) {
  210. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  211. yield io.cp(gitConfigPath, newGitConfigPath);
  212. }
  213. else {
  214. yield fs.promises.writeFile(newGitConfigPath, '');
  215. }
  216. // Override HOME
  217. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  218. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  219. return newGitConfigPath;
  220. });
  221. }
  222. configureGlobalAuth() {
  223. return __awaiter(this, void 0, void 0, function* () {
  224. // 'configureTempGlobalConfig' noops if already set, just returns the path
  225. yield this.configureTempGlobalConfig();
  226. try {
  227. // Configure the token
  228. yield this.configureToken(true);
  229. // Configure HTTPS instead of SSH
  230. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  231. if (!this.settings.sshKey) {
  232. for (const insteadOfValue of this.insteadOfValues) {
  233. yield this.git.config(this.insteadOfKey, insteadOfValue, true, // globalConfig?
  234. true // add?
  235. );
  236. }
  237. }
  238. }
  239. catch (err) {
  240. // Unset in case somehow written to the real global config
  241. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  242. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  243. throw err;
  244. }
  245. });
  246. }
  247. configureSubmoduleAuth() {
  248. return __awaiter(this, void 0, void 0, function* () {
  249. // Remove possible previous HTTPS instead of SSH
  250. yield this.removeSubmoduleGitConfig(this.insteadOfKey);
  251. if (this.settings.persistCredentials) {
  252. // Get the credentials config file path in RUNNER_TEMP
  253. const credentialsConfigPath = this.getCredentialsConfigPath();
  254. // Container credentials config path
  255. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  256. // Get submodule config file paths.
  257. const configPaths = yield this.git.getSubmoduleConfigPaths(this.settings.nestedSubmodules);
  258. // For each submodule, configure includeIf entries pointing to the shared credentials file.
  259. // Configure both host and container paths to support Docker container actions.
  260. for (const configPath of configPaths) {
  261. // Submodule Git directory
  262. let submoduleGitDir = path.dirname(configPath); // The config file is at .git/modules/submodule-name/config
  263. submoduleGitDir = submoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  264. // Configure host includeIf
  265. yield this.git.config(`includeIf.gitdir:${submoduleGitDir}.path`, credentialsConfigPath, false, // globalConfig?
  266. false, // add?
  267. configPath);
  268. // Container submodule git directory
  269. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  270. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  271. let relativeSubmoduleGitDir = path.relative(githubWorkspace, submoduleGitDir);
  272. relativeSubmoduleGitDir = relativeSubmoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  273. const containerSubmoduleGitDir = path.posix.join('/github/workspace', relativeSubmoduleGitDir);
  274. // Configure container includeIf
  275. yield this.git.config(`includeIf.gitdir:${containerSubmoduleGitDir}.path`, containerCredentialsPath, false, // globalConfig?
  276. false, // add?
  277. configPath);
  278. }
  279. if (this.settings.sshKey) {
  280. // Configure core.sshCommand
  281. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  282. }
  283. else {
  284. // Configure HTTPS instead of SSH
  285. for (const insteadOfValue of this.insteadOfValues) {
  286. yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
  287. }
  288. }
  289. }
  290. });
  291. }
  292. removeAuth() {
  293. return __awaiter(this, void 0, void 0, function* () {
  294. yield this.removeSsh();
  295. yield this.removeToken();
  296. });
  297. }
  298. removeGlobalConfig() {
  299. return __awaiter(this, void 0, void 0, function* () {
  300. var _a;
  301. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  302. core.debug(`Unsetting HOME override`);
  303. this.git.removeEnvironmentVariable('HOME');
  304. yield io.rmRF(this.temporaryHomePath);
  305. }
  306. });
  307. }
  308. /**
  309. * Configures SSH authentication by writing the SSH key and known hosts,
  310. * and setting up the GIT_SSH_COMMAND environment variable.
  311. */
  312. configureSsh() {
  313. return __awaiter(this, void 0, void 0, function* () {
  314. if (!this.settings.sshKey) {
  315. return;
  316. }
  317. // Write key
  318. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  319. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  320. const uniqueId = (0, uuid_1.v4)();
  321. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  322. stateHelper.setSshKeyPath(this.sshKeyPath);
  323. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  324. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  325. // Remove inherited permissions on Windows
  326. if (IS_WINDOWS) {
  327. const icacls = yield io.which('icacls.exe');
  328. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  329. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  330. }
  331. // Write known hosts
  332. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  333. let userKnownHosts = '';
  334. try {
  335. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  336. }
  337. catch (err) {
  338. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  339. throw err;
  340. }
  341. }
  342. let knownHosts = '';
  343. if (userKnownHosts) {
  344. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  345. }
  346. if (this.settings.sshKnownHosts) {
  347. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  348. }
  349. 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`;
  350. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  351. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  352. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  353. // Configure GIT_SSH_COMMAND
  354. const sshPath = yield io.which('ssh', true);
  355. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  356. if (this.settings.sshStrict) {
  357. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  358. }
  359. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  360. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  361. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  362. // Configure core.sshCommand
  363. if (this.settings.persistCredentials) {
  364. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  365. }
  366. });
  367. }
  368. /**
  369. * Configures token-based authentication by creating a credentials config file
  370. * and setting up includeIf entries to reference it.
  371. * @param globalConfig Whether to configure global config instead of local
  372. */
  373. configureToken(globalConfig) {
  374. return __awaiter(this, void 0, void 0, function* () {
  375. // Get the credentials config file path in RUNNER_TEMP
  376. const credentialsConfigPath = this.getCredentialsConfigPath();
  377. // Write placeholder to the separate credentials config file using git config.
  378. // This approach avoids the credential being captured by process creation audit events,
  379. // which are commonly logged. For more information, refer to
  380. // https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  381. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, false, // globalConfig?
  382. false, // add?
  383. credentialsConfigPath);
  384. // Replace the placeholder in the credentials config file
  385. let content = (yield fs.promises.readFile(credentialsConfigPath)).toString();
  386. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  387. if (placeholderIndex < 0 ||
  388. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  389. throw new Error(`Unable to replace auth placeholder in ${credentialsConfigPath}`);
  390. }
  391. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  392. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  393. yield fs.promises.writeFile(credentialsConfigPath, content);
  394. // Add include or includeIf to reference the credentials config
  395. if (globalConfig) {
  396. // Global config file is temporary
  397. yield this.git.config('include.path', credentialsConfigPath, true // globalConfig?
  398. );
  399. }
  400. else {
  401. // Host git directory
  402. let gitDir = path.join(this.git.getWorkingDirectory(), '.git');
  403. gitDir = gitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  404. // Configure host includeIf
  405. const hostIncludeKey = `includeIf.gitdir:${gitDir}.path`;
  406. yield this.git.config(hostIncludeKey, credentialsConfigPath);
  407. // Container git directory
  408. const workingDirectory = this.git.getWorkingDirectory();
  409. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  410. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  411. let relativePath = path.relative(githubWorkspace, workingDirectory);
  412. relativePath = relativePath.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  413. const containerGitDir = path.posix.join('/github/workspace', relativePath, '.git');
  414. // Container credentials config path
  415. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  416. // Configure container includeIf
  417. const containerIncludeKey = `includeIf.gitdir:${containerGitDir}.path`;
  418. yield this.git.config(containerIncludeKey, containerCredentialsPath);
  419. }
  420. });
  421. }
  422. /**
  423. * Gets or creates the path to the credentials config file in RUNNER_TEMP.
  424. * @returns The absolute path to the credentials config file
  425. */
  426. getCredentialsConfigPath() {
  427. if (this.credentialsConfigPath) {
  428. return this.credentialsConfigPath;
  429. }
  430. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  431. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  432. // Create a unique filename for this checkout instance
  433. const configFileName = `git-credentials-${(0, uuid_1.v4)()}.config`;
  434. this.credentialsConfigPath = path.join(runnerTemp, configFileName);
  435. core.debug(`Credentials config path: ${this.credentialsConfigPath}`);
  436. return this.credentialsConfigPath;
  437. }
  438. /**
  439. * Removes SSH authentication configuration by cleaning up SSH keys,
  440. * known hosts files, and SSH command configurations.
  441. */
  442. removeSsh() {
  443. return __awaiter(this, void 0, void 0, function* () {
  444. var _a, _b;
  445. // SSH key
  446. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  447. if (keyPath) {
  448. try {
  449. core.info(`Removing SSH key '${keyPath}'`);
  450. yield io.rmRF(keyPath);
  451. }
  452. catch (err) {
  453. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  454. core.warning(`Failed to remove SSH key '${keyPath}'`);
  455. }
  456. }
  457. // SSH known hosts
  458. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  459. if (knownHostsPath) {
  460. try {
  461. core.info(`Removing SSH known hosts '${knownHostsPath}'`);
  462. yield io.rmRF(knownHostsPath);
  463. }
  464. catch (err) {
  465. core.debug(`${(_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err}`);
  466. core.warning(`Failed to remove SSH known hosts '${knownHostsPath}'`);
  467. }
  468. }
  469. // SSH command
  470. core.info('Removing SSH command configuration');
  471. yield this.removeGitConfig(SSH_COMMAND_KEY);
  472. yield this.removeSubmoduleGitConfig(SSH_COMMAND_KEY);
  473. });
  474. }
  475. /**
  476. * Removes token-based authentication by cleaning up HTTP headers,
  477. * includeIf entries, and credentials config files.
  478. */
  479. removeToken() {
  480. return __awaiter(this, void 0, void 0, function* () {
  481. var _a;
  482. // Remove HTTP extra header
  483. core.info('Removing HTTP extra header');
  484. yield this.removeGitConfig(this.tokenConfigKey);
  485. yield this.removeSubmoduleGitConfig(this.tokenConfigKey);
  486. // Collect credentials config paths that need to be removed
  487. const credentialsPaths = new Set();
  488. // Remove includeIf entries that point to git-credentials-*.config files
  489. core.info('Removing includeIf entries pointing to credentials config files');
  490. const mainCredentialsPaths = yield this.removeIncludeIfCredentials();
  491. mainCredentialsPaths.forEach(path => credentialsPaths.add(path));
  492. // Remove submodule includeIf entries that point to git-credentials-*.config files
  493. const submoduleConfigPaths = yield this.git.getSubmoduleConfigPaths(true);
  494. for (const configPath of submoduleConfigPaths) {
  495. const submoduleCredentialsPaths = yield this.removeIncludeIfCredentials(configPath);
  496. submoduleCredentialsPaths.forEach(path => credentialsPaths.add(path));
  497. }
  498. // Remove credentials config files
  499. for (const credentialsPath of credentialsPaths) {
  500. // Only remove credentials config files if they are under RUNNER_TEMP
  501. const runnerTemp = process.env['RUNNER_TEMP'];
  502. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  503. if (credentialsPath.startsWith(runnerTemp)) {
  504. try {
  505. core.info(`Removing credentials config '${credentialsPath}'`);
  506. yield io.rmRF(credentialsPath);
  507. }
  508. catch (err) {
  509. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  510. core.warning(`Failed to remove credentials config '${credentialsPath}'`);
  511. }
  512. }
  513. else {
  514. core.debug(`Skipping removal of credentials config '${credentialsPath}' - not under RUNNER_TEMP`);
  515. }
  516. }
  517. });
  518. }
  519. /**
  520. * Removes a git config key from the local repository config.
  521. * @param configKey The git config key to remove
  522. */
  523. removeGitConfig(configKey) {
  524. return __awaiter(this, void 0, void 0, function* () {
  525. if ((yield this.git.configExists(configKey)) &&
  526. !(yield this.git.tryConfigUnset(configKey))) {
  527. // Load the config contents
  528. core.warning(`Failed to remove '${configKey}' from the git config`);
  529. }
  530. });
  531. }
  532. /**
  533. * Removes a git config key from all submodule configs.
  534. * @param configKey The git config key to remove
  535. */
  536. removeSubmoduleGitConfig(configKey) {
  537. return __awaiter(this, void 0, void 0, function* () {
  538. const pattern = regexpHelper.escape(configKey);
  539. yield this.git.submoduleForeach(
  540. // Wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline.
  541. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  542. });
  543. }
  544. /**
  545. * Removes includeIf entries that point to git-credentials-*.config files.
  546. * @param configPath Optional path to a specific git config file to operate on
  547. * @returns Array of unique credentials config file paths that were found and removed
  548. */
  549. removeIncludeIfCredentials(configPath) {
  550. return __awaiter(this, void 0, void 0, function* () {
  551. const credentialsPaths = new Set();
  552. try {
  553. // Get all includeIf.gitdir keys
  554. const keys = yield this.git.tryGetConfigKeys('^includeIf\\.gitdir:', false, // globalConfig?
  555. configPath);
  556. for (const key of keys) {
  557. // Get all values for this key
  558. const values = yield this.git.tryGetConfigValues(key, false, // globalConfig?
  559. configPath);
  560. if (values.length > 0) {
  561. // Remove only values that match git-credentials-<uuid>.config pattern
  562. for (const value of values) {
  563. if (this.testCredentialsConfigPath(value)) {
  564. credentialsPaths.add(value);
  565. yield this.git.tryConfigUnsetValue(key, value, false, configPath);
  566. }
  567. }
  568. }
  569. }
  570. }
  571. catch (err) {
  572. // Ignore errors - this is cleanup code
  573. if (configPath) {
  574. core.debug(`Error during includeIf cleanup for ${configPath}: ${err}`);
  575. }
  576. else {
  577. core.debug(`Error during includeIf cleanup: ${err}`);
  578. }
  579. }
  580. return Array.from(credentialsPaths);
  581. });
  582. }
  583. /**
  584. * Tests if a path matches the git-credentials-*.config pattern.
  585. * @param path The path to test
  586. * @returns True if the path matches the credentials config pattern
  587. */
  588. testCredentialsConfigPath(path) {
  589. return /git-credentials-[0-9a-f-]+\.config$/i.test(path);
  590. }
  591. }
  592. /***/ }),
  593. /***/ 738:
  594. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  595. "use strict";
  596. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  597. if (k2 === undefined) k2 = k;
  598. var desc = Object.getOwnPropertyDescriptor(m, k);
  599. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  600. desc = { enumerable: true, get: function() { return m[k]; } };
  601. }
  602. Object.defineProperty(o, k2, desc);
  603. }) : (function(o, m, k, k2) {
  604. if (k2 === undefined) k2 = k;
  605. o[k2] = m[k];
  606. }));
  607. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  608. Object.defineProperty(o, "default", { enumerable: true, value: v });
  609. }) : function(o, v) {
  610. o["default"] = v;
  611. });
  612. var __importStar = (this && this.__importStar) || function (mod) {
  613. if (mod && mod.__esModule) return mod;
  614. var result = {};
  615. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  616. __setModuleDefault(result, mod);
  617. return result;
  618. };
  619. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  620. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  621. return new (P || (P = Promise))(function (resolve, reject) {
  622. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  623. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  624. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  625. step((generator = generator.apply(thisArg, _arguments || [])).next());
  626. });
  627. };
  628. Object.defineProperty(exports, "__esModule", ({ value: true }));
  629. exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  630. exports.createCommandManager = createCommandManager;
  631. const core = __importStar(__nccwpck_require__(2186));
  632. const exec = __importStar(__nccwpck_require__(1514));
  633. const fs = __importStar(__nccwpck_require__(7147));
  634. const fshelper = __importStar(__nccwpck_require__(7219));
  635. const io = __importStar(__nccwpck_require__(7436));
  636. const path = __importStar(__nccwpck_require__(1017));
  637. const refHelper = __importStar(__nccwpck_require__(8601));
  638. const regexpHelper = __importStar(__nccwpck_require__(3120));
  639. const retryHelper = __importStar(__nccwpck_require__(2155));
  640. const git_version_1 = __nccwpck_require__(3142);
  641. // Auth header not supported before 2.9
  642. // Wire protocol v2 not supported before 2.18
  643. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  644. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  645. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  646. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  647. return __awaiter(this, void 0, void 0, function* () {
  648. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  649. });
  650. }
  651. class GitCommandManager {
  652. // Private constructor; use createCommandManager()
  653. constructor() {
  654. this.gitEnv = {
  655. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  656. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  657. };
  658. this.gitPath = '';
  659. this.lfs = false;
  660. this.doSparseCheckout = false;
  661. this.workingDirectory = '';
  662. this.gitVersion = new git_version_1.GitVersion();
  663. }
  664. branchDelete(remote, branch) {
  665. return __awaiter(this, void 0, void 0, function* () {
  666. const args = ['branch', '--delete', '--force'];
  667. if (remote) {
  668. args.push('--remote');
  669. }
  670. args.push(branch);
  671. yield this.execGit(args);
  672. });
  673. }
  674. branchExists(remote, pattern) {
  675. return __awaiter(this, void 0, void 0, function* () {
  676. const args = ['branch', '--list'];
  677. if (remote) {
  678. args.push('--remote');
  679. }
  680. args.push(pattern);
  681. const output = yield this.execGit(args);
  682. return !!output.stdout.trim();
  683. });
  684. }
  685. branchList(remote) {
  686. return __awaiter(this, void 0, void 0, function* () {
  687. const result = [];
  688. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  689. // "branch --list" is more difficult when in a detached HEAD state.
  690. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  691. // "rev-parse --symbolic-full-name" because there is a bug
  692. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  693. // 2.18 is no longer supported, we can switch back to --symbolic.
  694. const args = ['rev-parse', '--symbolic-full-name'];
  695. if (remote) {
  696. args.push('--remotes=origin');
  697. }
  698. else {
  699. args.push('--branches');
  700. }
  701. const stderr = [];
  702. const errline = [];
  703. const stdout = [];
  704. const stdline = [];
  705. const listeners = {
  706. stderr: (data) => {
  707. stderr.push(data.toString());
  708. },
  709. errline: (data) => {
  710. errline.push(data.toString());
  711. },
  712. stdout: (data) => {
  713. stdout.push(data.toString());
  714. },
  715. stdline: (data) => {
  716. stdline.push(data.toString());
  717. }
  718. };
  719. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  720. yield this.execGit(args, false, true, listeners);
  721. core.debug(`stderr callback is: ${stderr}`);
  722. core.debug(`errline callback is: ${errline}`);
  723. core.debug(`stdout callback is: ${stdout}`);
  724. core.debug(`stdline callback is: ${stdline}`);
  725. for (let branch of stdline) {
  726. branch = branch.trim();
  727. if (!branch) {
  728. continue;
  729. }
  730. if (branch.startsWith('refs/heads/')) {
  731. branch = branch.substring('refs/heads/'.length);
  732. }
  733. else if (branch.startsWith('refs/remotes/')) {
  734. branch = branch.substring('refs/remotes/'.length);
  735. }
  736. result.push(branch);
  737. }
  738. return result;
  739. });
  740. }
  741. disableSparseCheckout() {
  742. return __awaiter(this, void 0, void 0, function* () {
  743. yield this.execGit(['sparse-checkout', 'disable']);
  744. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  745. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  746. });
  747. }
  748. sparseCheckout(sparseCheckout) {
  749. return __awaiter(this, void 0, void 0, function* () {
  750. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  751. });
  752. }
  753. sparseCheckoutNonConeMode(sparseCheckout) {
  754. return __awaiter(this, void 0, void 0, function* () {
  755. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  756. const output = yield this.execGit([
  757. 'rev-parse',
  758. '--git-path',
  759. 'info/sparse-checkout'
  760. ]);
  761. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  762. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  763. });
  764. }
  765. checkout(ref, startPoint) {
  766. return __awaiter(this, void 0, void 0, function* () {
  767. const args = ['checkout', '--progress', '--force'];
  768. if (startPoint) {
  769. args.push('-B', ref, startPoint);
  770. }
  771. else {
  772. args.push(ref);
  773. }
  774. yield this.execGit(args);
  775. });
  776. }
  777. checkoutDetach() {
  778. return __awaiter(this, void 0, void 0, function* () {
  779. const args = ['checkout', '--detach'];
  780. yield this.execGit(args);
  781. });
  782. }
  783. config(configKey, configValue, globalConfig, add, configFile) {
  784. return __awaiter(this, void 0, void 0, function* () {
  785. const args = ['config'];
  786. if (configFile) {
  787. args.push('--file', configFile);
  788. }
  789. else {
  790. args.push(globalConfig ? '--global' : '--local');
  791. }
  792. if (add) {
  793. args.push('--add');
  794. }
  795. args.push(...[configKey, configValue]);
  796. yield this.execGit(args);
  797. });
  798. }
  799. configExists(configKey, globalConfig) {
  800. return __awaiter(this, void 0, void 0, function* () {
  801. const pattern = regexpHelper.escape(configKey);
  802. const output = yield this.execGit([
  803. 'config',
  804. globalConfig ? '--global' : '--local',
  805. '--name-only',
  806. '--get-regexp',
  807. pattern
  808. ], true);
  809. return output.exitCode === 0;
  810. });
  811. }
  812. fetch(refSpec, options) {
  813. return __awaiter(this, void 0, void 0, function* () {
  814. const args = ['-c', 'protocol.version=2', 'fetch'];
  815. if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
  816. args.push('--no-tags');
  817. }
  818. args.push('--prune', '--no-recurse-submodules');
  819. if (options.showProgress) {
  820. args.push('--progress');
  821. }
  822. if (options.filter) {
  823. args.push(`--filter=${options.filter}`);
  824. }
  825. if (options.fetchDepth && options.fetchDepth > 0) {
  826. args.push(`--depth=${options.fetchDepth}`);
  827. }
  828. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  829. args.push('--unshallow');
  830. }
  831. args.push('origin');
  832. for (const arg of refSpec) {
  833. args.push(arg);
  834. }
  835. const that = this;
  836. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  837. yield that.execGit(args);
  838. }));
  839. });
  840. }
  841. getDefaultBranch(repositoryUrl) {
  842. return __awaiter(this, void 0, void 0, function* () {
  843. let output;
  844. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  845. output = yield this.execGit([
  846. 'ls-remote',
  847. '--quiet',
  848. '--exit-code',
  849. '--symref',
  850. repositoryUrl,
  851. 'HEAD'
  852. ]);
  853. }));
  854. if (output) {
  855. // Satisfy compiler, will always be set
  856. for (let line of output.stdout.trim().split('\n')) {
  857. line = line.trim();
  858. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  859. return line
  860. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  861. .trim();
  862. }
  863. }
  864. }
  865. throw new Error('Unexpected output when retrieving default branch');
  866. });
  867. }
  868. getSubmoduleConfigPaths(recursive) {
  869. return __awaiter(this, void 0, void 0, function* () {
  870. // Get submodule config file paths.
  871. // Use `--show-origin` to get the config file path for each submodule.
  872. const output = yield this.submoduleForeach(`git config --local --show-origin --name-only --get-regexp remote.origin.url`, recursive);
  873. // Extract config file paths from the output (lines starting with "file:").
  874. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  875. return configPaths;
  876. });
  877. }
  878. getWorkingDirectory() {
  879. return this.workingDirectory;
  880. }
  881. init() {
  882. return __awaiter(this, void 0, void 0, function* () {
  883. yield this.execGit(['init', this.workingDirectory]);
  884. });
  885. }
  886. isDetached() {
  887. return __awaiter(this, void 0, void 0, function* () {
  888. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  889. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  890. return !output.stdout.trim().startsWith('refs/heads/');
  891. });
  892. }
  893. lfsFetch(ref) {
  894. return __awaiter(this, void 0, void 0, function* () {
  895. const args = ['lfs', 'fetch', 'origin', ref];
  896. const that = this;
  897. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  898. yield that.execGit(args);
  899. }));
  900. });
  901. }
  902. lfsInstall() {
  903. return __awaiter(this, void 0, void 0, function* () {
  904. yield this.execGit(['lfs', 'install', '--local']);
  905. });
  906. }
  907. log1(format) {
  908. return __awaiter(this, void 0, void 0, function* () {
  909. const args = format ? ['log', '-1', format] : ['log', '-1'];
  910. const silent = format ? false : true;
  911. const output = yield this.execGit(args, false, silent);
  912. return output.stdout;
  913. });
  914. }
  915. remoteAdd(remoteName, remoteUrl) {
  916. return __awaiter(this, void 0, void 0, function* () {
  917. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  918. });
  919. }
  920. removeEnvironmentVariable(name) {
  921. delete this.gitEnv[name];
  922. }
  923. /**
  924. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  925. * For an annotated tag, the tag SHA is returned.
  926. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  927. * @returns {Promise<string>}
  928. */
  929. revParse(ref) {
  930. return __awaiter(this, void 0, void 0, function* () {
  931. const output = yield this.execGit(['rev-parse', ref]);
  932. return output.stdout.trim();
  933. });
  934. }
  935. setEnvironmentVariable(name, value) {
  936. this.gitEnv[name] = value;
  937. }
  938. shaExists(sha) {
  939. return __awaiter(this, void 0, void 0, function* () {
  940. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  941. const output = yield this.execGit(args, true);
  942. return output.exitCode === 0;
  943. });
  944. }
  945. submoduleForeach(command, recursive) {
  946. return __awaiter(this, void 0, void 0, function* () {
  947. const args = ['submodule', 'foreach'];
  948. if (recursive) {
  949. args.push('--recursive');
  950. }
  951. args.push(command);
  952. const output = yield this.execGit(args);
  953. return output.stdout;
  954. });
  955. }
  956. submoduleSync(recursive) {
  957. return __awaiter(this, void 0, void 0, function* () {
  958. const args = ['submodule', 'sync'];
  959. if (recursive) {
  960. args.push('--recursive');
  961. }
  962. yield this.execGit(args);
  963. });
  964. }
  965. submoduleUpdate(fetchDepth, recursive) {
  966. return __awaiter(this, void 0, void 0, function* () {
  967. const args = ['-c', 'protocol.version=2'];
  968. args.push('submodule', 'update', '--init', '--force');
  969. if (fetchDepth > 0) {
  970. args.push(`--depth=${fetchDepth}`);
  971. }
  972. if (recursive) {
  973. args.push('--recursive');
  974. }
  975. yield this.execGit(args);
  976. });
  977. }
  978. submoduleStatus() {
  979. return __awaiter(this, void 0, void 0, function* () {
  980. const output = yield this.execGit(['submodule', 'status'], true);
  981. core.debug(output.stdout);
  982. return output.exitCode === 0;
  983. });
  984. }
  985. tagExists(pattern) {
  986. return __awaiter(this, void 0, void 0, function* () {
  987. const output = yield this.execGit(['tag', '--list', pattern]);
  988. return !!output.stdout.trim();
  989. });
  990. }
  991. tryClean() {
  992. return __awaiter(this, void 0, void 0, function* () {
  993. const output = yield this.execGit(['clean', '-ffdx'], true);
  994. return output.exitCode === 0;
  995. });
  996. }
  997. tryConfigUnset(configKey, globalConfig) {
  998. return __awaiter(this, void 0, void 0, function* () {
  999. const output = yield this.execGit([
  1000. 'config',
  1001. globalConfig ? '--global' : '--local',
  1002. '--unset-all',
  1003. configKey
  1004. ], true);
  1005. return output.exitCode === 0;
  1006. });
  1007. }
  1008. tryConfigUnsetValue(configKey, configValue, globalConfig, configFile) {
  1009. return __awaiter(this, void 0, void 0, function* () {
  1010. const args = ['config'];
  1011. if (configFile) {
  1012. args.push('--file', configFile);
  1013. }
  1014. else {
  1015. args.push(globalConfig ? '--global' : '--local');
  1016. }
  1017. args.push('--unset', configKey, configValue);
  1018. const output = yield this.execGit(args, true);
  1019. return output.exitCode === 0;
  1020. });
  1021. }
  1022. tryDisableAutomaticGarbageCollection() {
  1023. return __awaiter(this, void 0, void 0, function* () {
  1024. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  1025. return output.exitCode === 0;
  1026. });
  1027. }
  1028. tryGetFetchUrl() {
  1029. return __awaiter(this, void 0, void 0, function* () {
  1030. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  1031. if (output.exitCode !== 0) {
  1032. return '';
  1033. }
  1034. const stdout = output.stdout.trim();
  1035. if (stdout.includes('\n')) {
  1036. return '';
  1037. }
  1038. return stdout;
  1039. });
  1040. }
  1041. tryGetConfigValues(configKey, globalConfig, configFile) {
  1042. return __awaiter(this, void 0, void 0, function* () {
  1043. const args = ['config'];
  1044. if (configFile) {
  1045. args.push('--file', configFile);
  1046. }
  1047. else {
  1048. args.push(globalConfig ? '--global' : '--local');
  1049. }
  1050. args.push('--get-all', configKey);
  1051. const output = yield this.execGit(args, true);
  1052. if (output.exitCode !== 0) {
  1053. return [];
  1054. }
  1055. return output.stdout
  1056. .trim()
  1057. .split('\n')
  1058. .filter(value => value.trim());
  1059. });
  1060. }
  1061. tryGetConfigKeys(pattern, globalConfig, configFile) {
  1062. return __awaiter(this, void 0, void 0, function* () {
  1063. const args = ['config'];
  1064. if (configFile) {
  1065. args.push('--file', configFile);
  1066. }
  1067. else {
  1068. args.push(globalConfig ? '--global' : '--local');
  1069. }
  1070. args.push('--name-only', '--get-regexp', pattern);
  1071. const output = yield this.execGit(args, true);
  1072. if (output.exitCode !== 0) {
  1073. return [];
  1074. }
  1075. return output.stdout
  1076. .trim()
  1077. .split('\n')
  1078. .filter(key => key.trim());
  1079. });
  1080. }
  1081. tryReset() {
  1082. return __awaiter(this, void 0, void 0, function* () {
  1083. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  1084. return output.exitCode === 0;
  1085. });
  1086. }
  1087. version() {
  1088. return __awaiter(this, void 0, void 0, function* () {
  1089. return this.gitVersion;
  1090. });
  1091. }
  1092. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1093. return __awaiter(this, void 0, void 0, function* () {
  1094. const result = new GitCommandManager();
  1095. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  1096. return result;
  1097. });
  1098. }
  1099. execGit(args_1) {
  1100. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  1101. fshelper.directoryExistsSync(this.workingDirectory, true);
  1102. const result = new GitOutput();
  1103. const env = {};
  1104. for (const key of Object.keys(process.env)) {
  1105. env[key] = process.env[key];
  1106. }
  1107. for (const key of Object.keys(this.gitEnv)) {
  1108. env[key] = this.gitEnv[key];
  1109. }
  1110. const defaultListener = {
  1111. stdout: (data) => {
  1112. stdout.push(data.toString());
  1113. }
  1114. };
  1115. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  1116. const stdout = [];
  1117. const options = {
  1118. cwd: this.workingDirectory,
  1119. env,
  1120. silent,
  1121. ignoreReturnCode: allowAllExitCodes,
  1122. listeners: mergedListeners
  1123. };
  1124. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  1125. result.stdout = stdout.join('');
  1126. core.debug(result.exitCode.toString());
  1127. core.debug(result.stdout);
  1128. return result;
  1129. });
  1130. }
  1131. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1132. return __awaiter(this, void 0, void 0, function* () {
  1133. this.workingDirectory = workingDirectory;
  1134. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  1135. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  1136. this.lfs = lfs;
  1137. if (!this.lfs) {
  1138. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  1139. }
  1140. this.gitPath = yield io.which('git', true);
  1141. // Git version
  1142. core.debug('Getting git version');
  1143. this.gitVersion = new git_version_1.GitVersion();
  1144. let gitOutput = yield this.execGit(['version']);
  1145. let stdout = gitOutput.stdout.trim();
  1146. if (!stdout.includes('\n')) {
  1147. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1148. if (match) {
  1149. this.gitVersion = new git_version_1.GitVersion(match[0]);
  1150. }
  1151. }
  1152. if (!this.gitVersion.isValid()) {
  1153. throw new Error('Unable to determine git version');
  1154. }
  1155. // Minimum git version
  1156. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  1157. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1158. }
  1159. if (this.lfs) {
  1160. // Git-lfs version
  1161. core.debug('Getting git-lfs version');
  1162. let gitLfsVersion = new git_version_1.GitVersion();
  1163. const gitLfsPath = yield io.which('git-lfs', true);
  1164. gitOutput = yield this.execGit(['lfs', 'version']);
  1165. stdout = gitOutput.stdout.trim();
  1166. if (!stdout.includes('\n')) {
  1167. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1168. if (match) {
  1169. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  1170. }
  1171. }
  1172. if (!gitLfsVersion.isValid()) {
  1173. throw new Error('Unable to determine git-lfs version');
  1174. }
  1175. // Minimum git-lfs version
  1176. // Note:
  1177. // - Auth header not supported before 2.1
  1178. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  1179. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  1180. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  1181. }
  1182. }
  1183. this.doSparseCheckout = doSparseCheckout;
  1184. if (this.doSparseCheckout) {
  1185. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  1186. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1187. }
  1188. }
  1189. // Set the user agent
  1190. const gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  1191. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  1192. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  1193. });
  1194. }
  1195. }
  1196. class GitOutput {
  1197. constructor() {
  1198. this.stdout = '';
  1199. this.exitCode = 0;
  1200. }
  1201. }
  1202. /***/ }),
  1203. /***/ 8609:
  1204. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1205. "use strict";
  1206. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1207. if (k2 === undefined) k2 = k;
  1208. var desc = Object.getOwnPropertyDescriptor(m, k);
  1209. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1210. desc = { enumerable: true, get: function() { return m[k]; } };
  1211. }
  1212. Object.defineProperty(o, k2, desc);
  1213. }) : (function(o, m, k, k2) {
  1214. if (k2 === undefined) k2 = k;
  1215. o[k2] = m[k];
  1216. }));
  1217. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1218. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1219. }) : function(o, v) {
  1220. o["default"] = v;
  1221. });
  1222. var __importStar = (this && this.__importStar) || function (mod) {
  1223. if (mod && mod.__esModule) return mod;
  1224. var result = {};
  1225. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1226. __setModuleDefault(result, mod);
  1227. return result;
  1228. };
  1229. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1230. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1231. return new (P || (P = Promise))(function (resolve, reject) {
  1232. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1233. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1234. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1235. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1236. });
  1237. };
  1238. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1239. exports.prepareExistingDirectory = prepareExistingDirectory;
  1240. const assert = __importStar(__nccwpck_require__(9491));
  1241. const core = __importStar(__nccwpck_require__(2186));
  1242. const fs = __importStar(__nccwpck_require__(7147));
  1243. const fsHelper = __importStar(__nccwpck_require__(7219));
  1244. const io = __importStar(__nccwpck_require__(7436));
  1245. const path = __importStar(__nccwpck_require__(1017));
  1246. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1247. return __awaiter(this, void 0, void 0, function* () {
  1248. var _a;
  1249. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1250. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1251. // Indicates whether to delete the directory contents
  1252. let remove = false;
  1253. // Check whether using git or REST API
  1254. if (!git) {
  1255. remove = true;
  1256. }
  1257. // Fetch URL does not match
  1258. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1259. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1260. remove = true;
  1261. }
  1262. else {
  1263. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1264. const lockPaths = [
  1265. path.join(repositoryPath, '.git', 'index.lock'),
  1266. path.join(repositoryPath, '.git', 'shallow.lock')
  1267. ];
  1268. for (const lockPath of lockPaths) {
  1269. try {
  1270. yield io.rmRF(lockPath);
  1271. }
  1272. catch (error) {
  1273. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1274. }
  1275. }
  1276. try {
  1277. core.startGroup('Removing previously created refs, to avoid conflicts');
  1278. // Checkout detached HEAD
  1279. if (!(yield git.isDetached())) {
  1280. yield git.checkoutDetach();
  1281. }
  1282. // Remove all refs/heads/*
  1283. let branches = yield git.branchList(false);
  1284. for (const branch of branches) {
  1285. yield git.branchDelete(false, branch);
  1286. }
  1287. // Remove any conflicting refs/remotes/origin/*
  1288. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1289. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1290. if (ref) {
  1291. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1292. if (ref.startsWith('refs/heads/')) {
  1293. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1294. const upperName1Slash = `${upperName1}/`;
  1295. branches = yield git.branchList(true);
  1296. for (const branch of branches) {
  1297. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1298. const upperName2Slash = `${upperName2}/`;
  1299. if (upperName1.startsWith(upperName2Slash) ||
  1300. upperName2.startsWith(upperName1Slash)) {
  1301. yield git.branchDelete(true, branch);
  1302. }
  1303. }
  1304. }
  1305. }
  1306. core.endGroup();
  1307. // Check for submodules and delete any existing files if submodules are present
  1308. if (!(yield git.submoduleStatus())) {
  1309. remove = true;
  1310. core.info('Bad Submodules found, removing existing files');
  1311. }
  1312. // Clean
  1313. if (clean) {
  1314. core.startGroup('Cleaning the repository');
  1315. if (!(yield git.tryClean())) {
  1316. 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}'.`);
  1317. remove = true;
  1318. }
  1319. else if (!(yield git.tryReset())) {
  1320. remove = true;
  1321. }
  1322. core.endGroup();
  1323. if (remove) {
  1324. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1325. }
  1326. }
  1327. }
  1328. catch (error) {
  1329. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1330. remove = true;
  1331. }
  1332. }
  1333. if (remove) {
  1334. // Delete the contents of the directory. Don't delete the directory itself
  1335. // since it might be the current working directory.
  1336. core.info(`Deleting the contents of '${repositoryPath}'`);
  1337. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1338. yield io.rmRF(path.join(repositoryPath, file));
  1339. }
  1340. }
  1341. });
  1342. }
  1343. /***/ }),
  1344. /***/ 9210:
  1345. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1346. "use strict";
  1347. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1348. if (k2 === undefined) k2 = k;
  1349. var desc = Object.getOwnPropertyDescriptor(m, k);
  1350. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1351. desc = { enumerable: true, get: function() { return m[k]; } };
  1352. }
  1353. Object.defineProperty(o, k2, desc);
  1354. }) : (function(o, m, k, k2) {
  1355. if (k2 === undefined) k2 = k;
  1356. o[k2] = m[k];
  1357. }));
  1358. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1359. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1360. }) : function(o, v) {
  1361. o["default"] = v;
  1362. });
  1363. var __importStar = (this && this.__importStar) || function (mod) {
  1364. if (mod && mod.__esModule) return mod;
  1365. var result = {};
  1366. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1367. __setModuleDefault(result, mod);
  1368. return result;
  1369. };
  1370. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1371. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1372. return new (P || (P = Promise))(function (resolve, reject) {
  1373. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1374. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1375. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1376. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1377. });
  1378. };
  1379. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1380. exports.getSource = getSource;
  1381. exports.cleanup = cleanup;
  1382. const core = __importStar(__nccwpck_require__(2186));
  1383. const fsHelper = __importStar(__nccwpck_require__(7219));
  1384. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1385. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1386. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1387. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1388. const io = __importStar(__nccwpck_require__(7436));
  1389. const path = __importStar(__nccwpck_require__(1017));
  1390. const refHelper = __importStar(__nccwpck_require__(8601));
  1391. const stateHelper = __importStar(__nccwpck_require__(4866));
  1392. const urlHelper = __importStar(__nccwpck_require__(9437));
  1393. const git_command_manager_1 = __nccwpck_require__(738);
  1394. function getSource(settings) {
  1395. return __awaiter(this, void 0, void 0, function* () {
  1396. // Repository URL
  1397. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1398. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1399. // Remove conflicting file path
  1400. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1401. yield io.rmRF(settings.repositoryPath);
  1402. }
  1403. // Create directory
  1404. let isExisting = true;
  1405. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1406. isExisting = false;
  1407. yield io.mkdirP(settings.repositoryPath);
  1408. }
  1409. // Git command manager
  1410. core.startGroup('Getting Git version info');
  1411. const git = yield getGitCommandManager(settings);
  1412. core.endGroup();
  1413. let authHelper = null;
  1414. try {
  1415. if (git) {
  1416. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1417. if (settings.setSafeDirectory) {
  1418. // 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
  1419. // Otherwise all git commands we run in a container fail
  1420. yield authHelper.configureTempGlobalConfig();
  1421. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1422. yield git
  1423. .config('safe.directory', settings.repositoryPath, true, true)
  1424. .catch(error => {
  1425. core.info(`Failed to initialize safe directory with error: ${error}`);
  1426. });
  1427. stateHelper.setSafeDirectory();
  1428. }
  1429. }
  1430. // Prepare existing directory, otherwise recreate
  1431. if (isExisting) {
  1432. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1433. }
  1434. if (!git) {
  1435. // Downloading using REST API
  1436. core.info(`The repository will be downloaded using the GitHub REST API`);
  1437. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1438. if (settings.submodules) {
  1439. 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.`);
  1440. }
  1441. else if (settings.sshKey) {
  1442. 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.`);
  1443. }
  1444. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1445. return;
  1446. }
  1447. // Save state for POST action
  1448. stateHelper.setRepositoryPath(settings.repositoryPath);
  1449. // Initialize the repository
  1450. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1451. core.startGroup('Initializing the repository');
  1452. yield git.init();
  1453. yield git.remoteAdd('origin', repositoryUrl);
  1454. core.endGroup();
  1455. }
  1456. // Disable automatic garbage collection
  1457. core.startGroup('Disabling automatic garbage collection');
  1458. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1459. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1460. }
  1461. core.endGroup();
  1462. // If we didn't initialize it above, do it now
  1463. if (!authHelper) {
  1464. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1465. }
  1466. // Configure auth
  1467. core.startGroup('Setting up auth');
  1468. yield authHelper.configureAuth();
  1469. core.endGroup();
  1470. // Determine the default branch
  1471. if (!settings.ref && !settings.commit) {
  1472. core.startGroup('Determining the default branch');
  1473. if (settings.sshKey) {
  1474. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1475. }
  1476. else {
  1477. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1478. }
  1479. core.endGroup();
  1480. }
  1481. // LFS install
  1482. if (settings.lfs) {
  1483. yield git.lfsInstall();
  1484. }
  1485. // Fetch
  1486. core.startGroup('Fetching the repository');
  1487. const fetchOptions = {};
  1488. if (settings.filter) {
  1489. fetchOptions.filter = settings.filter;
  1490. }
  1491. else if (settings.sparseCheckout) {
  1492. fetchOptions.filter = 'blob:none';
  1493. }
  1494. if (settings.fetchDepth <= 0) {
  1495. // Fetch all branches and tags
  1496. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1497. yield git.fetch(refSpec, fetchOptions);
  1498. // When all history is fetched, the ref we're interested in may have moved to a different
  1499. // commit (push or force push). If so, fetch again with a targeted refspec.
  1500. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1501. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1502. yield git.fetch(refSpec, fetchOptions);
  1503. }
  1504. }
  1505. else {
  1506. fetchOptions.fetchDepth = settings.fetchDepth;
  1507. fetchOptions.fetchTags = settings.fetchTags;
  1508. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1509. yield git.fetch(refSpec, fetchOptions);
  1510. }
  1511. core.endGroup();
  1512. // Checkout info
  1513. core.startGroup('Determining the checkout info');
  1514. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1515. core.endGroup();
  1516. // LFS fetch
  1517. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1518. // Explicit lfs fetch will fetch lfs objects in parallel.
  1519. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1520. if (settings.lfs && !settings.sparseCheckout) {
  1521. core.startGroup('Fetching LFS objects');
  1522. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1523. core.endGroup();
  1524. }
  1525. // Sparse checkout
  1526. if (!settings.sparseCheckout) {
  1527. let gitVersion = yield git.version();
  1528. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1529. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1530. yield git.disableSparseCheckout();
  1531. }
  1532. }
  1533. else {
  1534. core.startGroup('Setting up sparse checkout');
  1535. if (settings.sparseCheckoutConeMode) {
  1536. yield git.sparseCheckout(settings.sparseCheckout);
  1537. }
  1538. else {
  1539. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1540. }
  1541. core.endGroup();
  1542. }
  1543. // Checkout
  1544. core.startGroup('Checking out the ref');
  1545. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1546. core.endGroup();
  1547. // Submodules
  1548. if (settings.submodules) {
  1549. // Temporarily override global config
  1550. core.startGroup('Setting up auth for fetching submodules');
  1551. yield authHelper.configureGlobalAuth();
  1552. core.endGroup();
  1553. // Checkout submodules
  1554. core.startGroup('Fetching submodules');
  1555. yield git.submoduleSync(settings.nestedSubmodules);
  1556. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1557. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1558. core.endGroup();
  1559. // Persist credentials
  1560. if (settings.persistCredentials) {
  1561. core.startGroup('Persisting credentials for submodules');
  1562. yield authHelper.configureSubmoduleAuth();
  1563. core.endGroup();
  1564. }
  1565. }
  1566. // Get commit information
  1567. const commitInfo = yield git.log1();
  1568. // Log commit sha
  1569. const commitSHA = yield git.log1('--format=%H');
  1570. core.setOutput('commit', commitSHA.trim());
  1571. // Check for incorrect pull request merge commit
  1572. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1573. }
  1574. finally {
  1575. // Remove auth
  1576. if (authHelper) {
  1577. if (!settings.persistCredentials) {
  1578. core.startGroup('Removing auth');
  1579. yield authHelper.removeAuth();
  1580. core.endGroup();
  1581. }
  1582. authHelper.removeGlobalConfig();
  1583. }
  1584. }
  1585. });
  1586. }
  1587. function cleanup(repositoryPath) {
  1588. return __awaiter(this, void 0, void 0, function* () {
  1589. // Repo exists?
  1590. if (!repositoryPath ||
  1591. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1592. return;
  1593. }
  1594. let git;
  1595. try {
  1596. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1597. }
  1598. catch (_a) {
  1599. return;
  1600. }
  1601. // Remove auth
  1602. const authHelper = gitAuthHelper.createAuthHelper(git);
  1603. try {
  1604. if (stateHelper.PostSetSafeDirectory) {
  1605. // 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
  1606. // Otherwise all git commands we run in a container fail
  1607. yield authHelper.configureTempGlobalConfig();
  1608. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1609. yield git
  1610. .config('safe.directory', repositoryPath, true, true)
  1611. .catch(error => {
  1612. core.info(`Failed to initialize safe directory with error: ${error}`);
  1613. });
  1614. }
  1615. yield authHelper.removeAuth();
  1616. }
  1617. finally {
  1618. yield authHelper.removeGlobalConfig();
  1619. }
  1620. });
  1621. }
  1622. function getGitCommandManager(settings) {
  1623. return __awaiter(this, void 0, void 0, function* () {
  1624. core.info(`Working directory is '${settings.repositoryPath}'`);
  1625. try {
  1626. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1627. }
  1628. catch (err) {
  1629. // Git is required for LFS
  1630. if (settings.lfs) {
  1631. throw err;
  1632. }
  1633. // Otherwise fallback to REST API
  1634. return undefined;
  1635. }
  1636. });
  1637. }
  1638. /***/ }),
  1639. /***/ 3142:
  1640. /***/ ((__unused_webpack_module, exports) => {
  1641. "use strict";
  1642. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1643. exports.GitVersion = void 0;
  1644. class GitVersion {
  1645. /**
  1646. * Used for comparing the version of git and git-lfs against the minimum required version
  1647. * @param version the version string, e.g. 1.2 or 1.2.3
  1648. */
  1649. constructor(version) {
  1650. this.major = NaN;
  1651. this.minor = NaN;
  1652. this.patch = NaN;
  1653. if (version) {
  1654. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1655. if (match) {
  1656. this.major = Number(match[1]);
  1657. this.minor = Number(match[2]);
  1658. if (match[4]) {
  1659. this.patch = Number(match[4]);
  1660. }
  1661. }
  1662. }
  1663. }
  1664. /**
  1665. * Compares the instance against a minimum required version
  1666. * @param minimum Minimum version
  1667. */
  1668. checkMinimum(minimum) {
  1669. if (!minimum.isValid()) {
  1670. throw new Error('Arg minimum is not a valid version');
  1671. }
  1672. // Major is insufficient
  1673. if (this.major < minimum.major) {
  1674. return false;
  1675. }
  1676. // Major is equal
  1677. if (this.major === minimum.major) {
  1678. // Minor is insufficient
  1679. if (this.minor < minimum.minor) {
  1680. return false;
  1681. }
  1682. // Minor is equal
  1683. if (this.minor === minimum.minor) {
  1684. // Patch is insufficient
  1685. if (this.patch && this.patch < (minimum.patch || 0)) {
  1686. return false;
  1687. }
  1688. }
  1689. }
  1690. return true;
  1691. }
  1692. /**
  1693. * Indicates whether the instance was constructed from a valid version string
  1694. */
  1695. isValid() {
  1696. return !isNaN(this.major);
  1697. }
  1698. /**
  1699. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1700. */
  1701. toString() {
  1702. let result = '';
  1703. if (this.isValid()) {
  1704. result = `${this.major}.${this.minor}`;
  1705. if (!isNaN(this.patch)) {
  1706. result += `.${this.patch}`;
  1707. }
  1708. }
  1709. return result;
  1710. }
  1711. }
  1712. exports.GitVersion = GitVersion;
  1713. /***/ }),
  1714. /***/ 138:
  1715. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1716. "use strict";
  1717. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1718. if (k2 === undefined) k2 = k;
  1719. var desc = Object.getOwnPropertyDescriptor(m, k);
  1720. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1721. desc = { enumerable: true, get: function() { return m[k]; } };
  1722. }
  1723. Object.defineProperty(o, k2, desc);
  1724. }) : (function(o, m, k, k2) {
  1725. if (k2 === undefined) k2 = k;
  1726. o[k2] = m[k];
  1727. }));
  1728. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1729. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1730. }) : function(o, v) {
  1731. o["default"] = v;
  1732. });
  1733. var __importStar = (this && this.__importStar) || function (mod) {
  1734. if (mod && mod.__esModule) return mod;
  1735. var result = {};
  1736. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1737. __setModuleDefault(result, mod);
  1738. return result;
  1739. };
  1740. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1741. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1742. return new (P || (P = Promise))(function (resolve, reject) {
  1743. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1744. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1745. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1746. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1747. });
  1748. };
  1749. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1750. exports.downloadRepository = downloadRepository;
  1751. exports.getDefaultBranch = getDefaultBranch;
  1752. const assert = __importStar(__nccwpck_require__(9491));
  1753. const core = __importStar(__nccwpck_require__(2186));
  1754. const fs = __importStar(__nccwpck_require__(7147));
  1755. const github = __importStar(__nccwpck_require__(5438));
  1756. const io = __importStar(__nccwpck_require__(7436));
  1757. const path = __importStar(__nccwpck_require__(1017));
  1758. const retryHelper = __importStar(__nccwpck_require__(2155));
  1759. const toolCache = __importStar(__nccwpck_require__(7784));
  1760. const uuid_1 = __nccwpck_require__(5840);
  1761. const url_helper_1 = __nccwpck_require__(9437);
  1762. const IS_WINDOWS = process.platform === 'win32';
  1763. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1764. return __awaiter(this, void 0, void 0, function* () {
  1765. // Determine the default branch
  1766. if (!ref && !commit) {
  1767. core.info('Determining the default branch');
  1768. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1769. }
  1770. // Download the archive
  1771. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1772. core.info('Downloading the archive');
  1773. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1774. }));
  1775. // Write archive to disk
  1776. core.info('Writing archive to disk');
  1777. const uniqueId = (0, uuid_1.v4)();
  1778. const archivePath = IS_WINDOWS
  1779. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1780. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1781. yield fs.promises.writeFile(archivePath, archiveData);
  1782. archiveData = Buffer.from(''); // Free memory
  1783. // Extract archive
  1784. core.info('Extracting the archive');
  1785. const extractPath = path.join(repositoryPath, uniqueId);
  1786. yield io.mkdirP(extractPath);
  1787. if (IS_WINDOWS) {
  1788. yield toolCache.extractZip(archivePath, extractPath);
  1789. }
  1790. else {
  1791. yield toolCache.extractTar(archivePath, extractPath);
  1792. }
  1793. yield io.rmRF(archivePath);
  1794. // Determine the path of the repository content. The archive contains
  1795. // a top-level folder and the repository content is inside.
  1796. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1797. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1798. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1799. core.info(`Resolved version ${archiveVersion}`);
  1800. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1801. // Move the files
  1802. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1803. const sourcePath = path.join(tempRepositoryPath, fileName);
  1804. const targetPath = path.join(repositoryPath, fileName);
  1805. if (IS_WINDOWS) {
  1806. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1807. }
  1808. else {
  1809. yield io.mv(sourcePath, targetPath);
  1810. }
  1811. }
  1812. yield io.rmRF(extractPath);
  1813. });
  1814. }
  1815. /**
  1816. * Looks up the default branch name
  1817. */
  1818. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1819. return __awaiter(this, void 0, void 0, function* () {
  1820. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1821. core.info('Retrieving the default branch name');
  1822. const octokit = github.getOctokit(authToken, {
  1823. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1824. });
  1825. let result;
  1826. try {
  1827. // Get the default branch from the repo info
  1828. const response = yield octokit.rest.repos.get({ owner, repo });
  1829. result = response.data.default_branch;
  1830. assert.ok(result, 'default_branch cannot be empty');
  1831. }
  1832. catch (err) {
  1833. // Handle .wiki repo
  1834. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1835. repo.toUpperCase().endsWith('.WIKI')) {
  1836. result = 'master';
  1837. }
  1838. // Otherwise error
  1839. else {
  1840. throw err;
  1841. }
  1842. }
  1843. // Print the default branch
  1844. core.info(`Default branch '${result}'`);
  1845. // Prefix with 'refs/heads'
  1846. if (!result.startsWith('refs/')) {
  1847. result = `refs/heads/${result}`;
  1848. }
  1849. return result;
  1850. }));
  1851. });
  1852. }
  1853. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1854. return __awaiter(this, void 0, void 0, function* () {
  1855. const octokit = github.getOctokit(authToken, {
  1856. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1857. });
  1858. const download = IS_WINDOWS
  1859. ? octokit.rest.repos.downloadZipballArchive
  1860. : octokit.rest.repos.downloadTarballArchive;
  1861. const response = yield download({
  1862. owner: owner,
  1863. repo: repo,
  1864. ref: commit || ref
  1865. });
  1866. return Buffer.from(response.data); // response.data is ArrayBuffer
  1867. });
  1868. }
  1869. /***/ }),
  1870. /***/ 5480:
  1871. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1872. "use strict";
  1873. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1874. if (k2 === undefined) k2 = k;
  1875. var desc = Object.getOwnPropertyDescriptor(m, k);
  1876. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1877. desc = { enumerable: true, get: function() { return m[k]; } };
  1878. }
  1879. Object.defineProperty(o, k2, desc);
  1880. }) : (function(o, m, k, k2) {
  1881. if (k2 === undefined) k2 = k;
  1882. o[k2] = m[k];
  1883. }));
  1884. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1885. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1886. }) : function(o, v) {
  1887. o["default"] = v;
  1888. });
  1889. var __importStar = (this && this.__importStar) || function (mod) {
  1890. if (mod && mod.__esModule) return mod;
  1891. var result = {};
  1892. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1893. __setModuleDefault(result, mod);
  1894. return result;
  1895. };
  1896. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1897. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1898. return new (P || (P = Promise))(function (resolve, reject) {
  1899. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1900. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1901. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1902. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1903. });
  1904. };
  1905. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1906. exports.getInputs = getInputs;
  1907. const core = __importStar(__nccwpck_require__(2186));
  1908. const fsHelper = __importStar(__nccwpck_require__(7219));
  1909. const github = __importStar(__nccwpck_require__(5438));
  1910. const path = __importStar(__nccwpck_require__(1017));
  1911. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1912. function getInputs() {
  1913. return __awaiter(this, void 0, void 0, function* () {
  1914. const result = {};
  1915. // GitHub workspace
  1916. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1917. if (!githubWorkspacePath) {
  1918. throw new Error('GITHUB_WORKSPACE not defined');
  1919. }
  1920. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1921. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1922. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1923. // Qualified repository
  1924. const qualifiedRepository = core.getInput('repository') ||
  1925. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1926. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1927. const splitRepository = qualifiedRepository.split('/');
  1928. if (splitRepository.length !== 2 ||
  1929. !splitRepository[0] ||
  1930. !splitRepository[1]) {
  1931. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1932. }
  1933. result.repositoryOwner = splitRepository[0];
  1934. result.repositoryName = splitRepository[1];
  1935. // Repository path
  1936. result.repositoryPath = core.getInput('path') || '.';
  1937. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1938. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1939. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1940. }
  1941. // Workflow repository?
  1942. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1943. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1944. // Source branch, source version
  1945. result.ref = core.getInput('ref');
  1946. if (!result.ref) {
  1947. if (isWorkflowRepository) {
  1948. result.ref = github.context.ref;
  1949. result.commit = github.context.sha;
  1950. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1951. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1952. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1953. result.ref = `refs/heads/${result.ref}`;
  1954. }
  1955. }
  1956. }
  1957. // SHA?
  1958. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1959. result.commit = result.ref;
  1960. result.ref = '';
  1961. }
  1962. core.debug(`ref = '${result.ref}'`);
  1963. core.debug(`commit = '${result.commit}'`);
  1964. // Clean
  1965. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1966. core.debug(`clean = ${result.clean}`);
  1967. // Filter
  1968. const filter = core.getInput('filter');
  1969. if (filter) {
  1970. result.filter = filter;
  1971. }
  1972. core.debug(`filter = ${result.filter}`);
  1973. // Sparse checkout
  1974. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1975. if (sparseCheckout.length) {
  1976. result.sparseCheckout = sparseCheckout;
  1977. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1978. }
  1979. result.sparseCheckoutConeMode =
  1980. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1981. 'TRUE';
  1982. // Fetch depth
  1983. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  1984. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  1985. result.fetchDepth = 0;
  1986. }
  1987. core.debug(`fetch depth = ${result.fetchDepth}`);
  1988. // Fetch tags
  1989. result.fetchTags =
  1990. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  1991. core.debug(`fetch tags = ${result.fetchTags}`);
  1992. // Show fetch progress
  1993. result.showProgress =
  1994. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  1995. core.debug(`show progress = ${result.showProgress}`);
  1996. // LFS
  1997. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  1998. core.debug(`lfs = ${result.lfs}`);
  1999. // Submodules
  2000. result.submodules = false;
  2001. result.nestedSubmodules = false;
  2002. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  2003. if (submodulesString == 'RECURSIVE') {
  2004. result.submodules = true;
  2005. result.nestedSubmodules = true;
  2006. }
  2007. else if (submodulesString == 'TRUE') {
  2008. result.submodules = true;
  2009. }
  2010. core.debug(`submodules = ${result.submodules}`);
  2011. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  2012. // Auth token
  2013. result.authToken = core.getInput('token', { required: true });
  2014. // SSH
  2015. result.sshKey = core.getInput('ssh-key');
  2016. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  2017. result.sshStrict =
  2018. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  2019. result.sshUser = core.getInput('ssh-user');
  2020. // Persist credentials
  2021. result.persistCredentials =
  2022. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  2023. // Workflow organization ID
  2024. result.workflowOrganizationId =
  2025. yield workflowContextHelper.getOrganizationId();
  2026. // Set safe.directory in git global config.
  2027. result.setSafeDirectory =
  2028. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  2029. // Determine the GitHub URL that the repository is being hosted from
  2030. result.githubServerUrl = core.getInput('github-server-url');
  2031. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  2032. return result;
  2033. });
  2034. }
  2035. /***/ }),
  2036. /***/ 3109:
  2037. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2038. "use strict";
  2039. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2040. if (k2 === undefined) k2 = k;
  2041. var desc = Object.getOwnPropertyDescriptor(m, k);
  2042. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2043. desc = { enumerable: true, get: function() { return m[k]; } };
  2044. }
  2045. Object.defineProperty(o, k2, desc);
  2046. }) : (function(o, m, k, k2) {
  2047. if (k2 === undefined) k2 = k;
  2048. o[k2] = m[k];
  2049. }));
  2050. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2051. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2052. }) : function(o, v) {
  2053. o["default"] = v;
  2054. });
  2055. var __importStar = (this && this.__importStar) || function (mod) {
  2056. if (mod && mod.__esModule) return mod;
  2057. var result = {};
  2058. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2059. __setModuleDefault(result, mod);
  2060. return result;
  2061. };
  2062. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2063. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2064. return new (P || (P = Promise))(function (resolve, reject) {
  2065. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2066. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2067. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2068. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2069. });
  2070. };
  2071. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2072. const core = __importStar(__nccwpck_require__(2186));
  2073. const coreCommand = __importStar(__nccwpck_require__(7351));
  2074. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  2075. const inputHelper = __importStar(__nccwpck_require__(5480));
  2076. const path = __importStar(__nccwpck_require__(1017));
  2077. const stateHelper = __importStar(__nccwpck_require__(4866));
  2078. function run() {
  2079. return __awaiter(this, void 0, void 0, function* () {
  2080. var _a;
  2081. try {
  2082. const sourceSettings = yield inputHelper.getInputs();
  2083. try {
  2084. // Register problem matcher
  2085. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2086. // Get sources
  2087. yield gitSourceProvider.getSource(sourceSettings);
  2088. core.setOutput('ref', sourceSettings.ref);
  2089. }
  2090. finally {
  2091. // Unregister problem matcher
  2092. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2093. }
  2094. }
  2095. catch (error) {
  2096. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2097. }
  2098. });
  2099. }
  2100. function cleanup() {
  2101. return __awaiter(this, void 0, void 0, function* () {
  2102. var _a;
  2103. try {
  2104. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2105. }
  2106. catch (error) {
  2107. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2108. }
  2109. });
  2110. }
  2111. // Main
  2112. if (!stateHelper.IsPost) {
  2113. run();
  2114. }
  2115. // Post
  2116. else {
  2117. cleanup();
  2118. }
  2119. /***/ }),
  2120. /***/ 8601:
  2121. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2122. "use strict";
  2123. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2124. if (k2 === undefined) k2 = k;
  2125. var desc = Object.getOwnPropertyDescriptor(m, k);
  2126. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2127. desc = { enumerable: true, get: function() { return m[k]; } };
  2128. }
  2129. Object.defineProperty(o, k2, desc);
  2130. }) : (function(o, m, k, k2) {
  2131. if (k2 === undefined) k2 = k;
  2132. o[k2] = m[k];
  2133. }));
  2134. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2135. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2136. }) : function(o, v) {
  2137. o["default"] = v;
  2138. });
  2139. var __importStar = (this && this.__importStar) || function (mod) {
  2140. if (mod && mod.__esModule) return mod;
  2141. var result = {};
  2142. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2143. __setModuleDefault(result, mod);
  2144. return result;
  2145. };
  2146. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2147. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2148. return new (P || (P = Promise))(function (resolve, reject) {
  2149. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2150. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2151. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2152. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2153. });
  2154. };
  2155. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2156. exports.tagsRefSpec = void 0;
  2157. exports.getCheckoutInfo = getCheckoutInfo;
  2158. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  2159. exports.getRefSpec = getRefSpec;
  2160. exports.testRef = testRef;
  2161. exports.checkCommitInfo = checkCommitInfo;
  2162. const core = __importStar(__nccwpck_require__(2186));
  2163. const github = __importStar(__nccwpck_require__(5438));
  2164. const url_helper_1 = __nccwpck_require__(9437);
  2165. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2166. function getCheckoutInfo(git, ref, commit) {
  2167. return __awaiter(this, void 0, void 0, function* () {
  2168. if (!git) {
  2169. throw new Error('Arg git cannot be empty');
  2170. }
  2171. if (!ref && !commit) {
  2172. throw new Error('Args ref and commit cannot both be empty');
  2173. }
  2174. const result = {};
  2175. const upperRef = (ref || '').toUpperCase();
  2176. // SHA only
  2177. if (!ref) {
  2178. result.ref = commit;
  2179. }
  2180. // refs/heads/
  2181. else if (upperRef.startsWith('REFS/HEADS/')) {
  2182. const branch = ref.substring('refs/heads/'.length);
  2183. result.ref = branch;
  2184. result.startPoint = `refs/remotes/origin/${branch}`;
  2185. }
  2186. // refs/pull/
  2187. else if (upperRef.startsWith('REFS/PULL/')) {
  2188. const branch = ref.substring('refs/pull/'.length);
  2189. result.ref = `refs/remotes/pull/${branch}`;
  2190. }
  2191. // refs/tags/
  2192. else if (upperRef.startsWith('REFS/TAGS/')) {
  2193. result.ref = ref;
  2194. }
  2195. // refs/
  2196. else if (upperRef.startsWith('REFS/')) {
  2197. result.ref = commit ? commit : ref;
  2198. }
  2199. // Unqualified ref, check for a matching branch or tag
  2200. else {
  2201. if (yield git.branchExists(true, `origin/${ref}`)) {
  2202. result.ref = ref;
  2203. result.startPoint = `refs/remotes/origin/${ref}`;
  2204. }
  2205. else if (yield git.tagExists(`${ref}`)) {
  2206. result.ref = `refs/tags/${ref}`;
  2207. }
  2208. else {
  2209. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2210. }
  2211. }
  2212. return result;
  2213. });
  2214. }
  2215. function getRefSpecForAllHistory(ref, commit) {
  2216. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  2217. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  2218. const branch = ref.substring('refs/pull/'.length);
  2219. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  2220. }
  2221. return result;
  2222. }
  2223. function getRefSpec(ref, commit) {
  2224. if (!ref && !commit) {
  2225. throw new Error('Args ref and commit cannot both be empty');
  2226. }
  2227. const upperRef = (ref || '').toUpperCase();
  2228. // SHA
  2229. if (commit) {
  2230. // refs/heads
  2231. if (upperRef.startsWith('REFS/HEADS/')) {
  2232. const branch = ref.substring('refs/heads/'.length);
  2233. return [`+${commit}:refs/remotes/origin/${branch}`];
  2234. }
  2235. // refs/pull/
  2236. else if (upperRef.startsWith('REFS/PULL/')) {
  2237. const branch = ref.substring('refs/pull/'.length);
  2238. return [`+${commit}:refs/remotes/pull/${branch}`];
  2239. }
  2240. // refs/tags/
  2241. else if (upperRef.startsWith('REFS/TAGS/')) {
  2242. return [`+${commit}:${ref}`];
  2243. }
  2244. // Otherwise no destination ref
  2245. else {
  2246. return [commit];
  2247. }
  2248. }
  2249. // Unqualified ref, check for a matching branch or tag
  2250. else if (!upperRef.startsWith('REFS/')) {
  2251. return [
  2252. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2253. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2254. ];
  2255. }
  2256. // refs/heads/
  2257. else if (upperRef.startsWith('REFS/HEADS/')) {
  2258. const branch = ref.substring('refs/heads/'.length);
  2259. return [`+${ref}:refs/remotes/origin/${branch}`];
  2260. }
  2261. // refs/pull/
  2262. else if (upperRef.startsWith('REFS/PULL/')) {
  2263. const branch = ref.substring('refs/pull/'.length);
  2264. return [`+${ref}:refs/remotes/pull/${branch}`];
  2265. }
  2266. // refs/tags/
  2267. else {
  2268. return [`+${ref}:${ref}`];
  2269. }
  2270. }
  2271. /**
  2272. * Tests whether the initial fetch created the ref at the expected commit
  2273. */
  2274. function testRef(git, ref, commit) {
  2275. return __awaiter(this, void 0, void 0, function* () {
  2276. if (!git) {
  2277. throw new Error('Arg git cannot be empty');
  2278. }
  2279. if (!ref && !commit) {
  2280. throw new Error('Args ref and commit cannot both be empty');
  2281. }
  2282. // No SHA? Nothing to test
  2283. if (!commit) {
  2284. return true;
  2285. }
  2286. // SHA only?
  2287. else if (!ref) {
  2288. return yield git.shaExists(commit);
  2289. }
  2290. const upperRef = ref.toUpperCase();
  2291. // refs/heads/
  2292. if (upperRef.startsWith('REFS/HEADS/')) {
  2293. const branch = ref.substring('refs/heads/'.length);
  2294. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2295. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2296. }
  2297. // refs/pull/
  2298. else if (upperRef.startsWith('REFS/PULL/')) {
  2299. // Assume matches because fetched using the commit
  2300. return true;
  2301. }
  2302. // refs/tags/
  2303. else if (upperRef.startsWith('REFS/TAGS/')) {
  2304. const tagName = ref.substring('refs/tags/'.length);
  2305. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2306. }
  2307. // Unexpected
  2308. else {
  2309. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2310. return true;
  2311. }
  2312. });
  2313. }
  2314. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2315. return __awaiter(this, void 0, void 0, function* () {
  2316. var _a;
  2317. try {
  2318. // GHES?
  2319. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2320. return;
  2321. }
  2322. // Auth token?
  2323. if (!token) {
  2324. return;
  2325. }
  2326. // Public PR synchronize, for workflow repo?
  2327. if (fromPayload('repository.private') !== false ||
  2328. github.context.eventName !== 'pull_request' ||
  2329. fromPayload('action') !== 'synchronize' ||
  2330. repositoryOwner !== github.context.repo.owner ||
  2331. repositoryName !== github.context.repo.repo ||
  2332. ref !== github.context.ref ||
  2333. !ref.startsWith('refs/pull/') ||
  2334. commit !== github.context.sha) {
  2335. return;
  2336. }
  2337. // Head SHA
  2338. const expectedHeadSha = fromPayload('after');
  2339. if (!expectedHeadSha) {
  2340. core.debug('Unable to determine head sha');
  2341. return;
  2342. }
  2343. // Base SHA
  2344. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2345. if (!expectedBaseSha) {
  2346. core.debug('Unable to determine base sha');
  2347. return;
  2348. }
  2349. // Expected message?
  2350. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2351. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2352. return;
  2353. }
  2354. // Extract details from message
  2355. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2356. if (!match) {
  2357. core.debug('Unexpected message format');
  2358. return;
  2359. }
  2360. // Post telemetry
  2361. const actualHeadSha = match[1];
  2362. if (actualHeadSha !== expectedHeadSha) {
  2363. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2364. const octokit = github.getOctokit(token, {
  2365. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2366. 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})`
  2367. });
  2368. yield octokit.rest.repos.get({
  2369. owner: repositoryOwner,
  2370. repo: repositoryName
  2371. });
  2372. }
  2373. }
  2374. catch (err) {
  2375. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2376. }
  2377. });
  2378. }
  2379. function fromPayload(path) {
  2380. return select(github.context.payload, path);
  2381. }
  2382. function select(obj, path) {
  2383. if (!obj) {
  2384. return undefined;
  2385. }
  2386. const i = path.indexOf('.');
  2387. if (i < 0) {
  2388. return obj[path];
  2389. }
  2390. const key = path.substr(0, i);
  2391. return select(obj[key], path.substr(i + 1));
  2392. }
  2393. /***/ }),
  2394. /***/ 3120:
  2395. /***/ ((__unused_webpack_module, exports) => {
  2396. "use strict";
  2397. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2398. exports.escape = escape;
  2399. function escape(value) {
  2400. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2401. return `\\${x}`;
  2402. });
  2403. }
  2404. /***/ }),
  2405. /***/ 2155:
  2406. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2407. "use strict";
  2408. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2409. if (k2 === undefined) k2 = k;
  2410. var desc = Object.getOwnPropertyDescriptor(m, k);
  2411. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2412. desc = { enumerable: true, get: function() { return m[k]; } };
  2413. }
  2414. Object.defineProperty(o, k2, desc);
  2415. }) : (function(o, m, k, k2) {
  2416. if (k2 === undefined) k2 = k;
  2417. o[k2] = m[k];
  2418. }));
  2419. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2420. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2421. }) : function(o, v) {
  2422. o["default"] = v;
  2423. });
  2424. var __importStar = (this && this.__importStar) || function (mod) {
  2425. if (mod && mod.__esModule) return mod;
  2426. var result = {};
  2427. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2428. __setModuleDefault(result, mod);
  2429. return result;
  2430. };
  2431. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2432. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2433. return new (P || (P = Promise))(function (resolve, reject) {
  2434. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2435. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2436. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2437. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2438. });
  2439. };
  2440. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2441. exports.RetryHelper = void 0;
  2442. exports.execute = execute;
  2443. const core = __importStar(__nccwpck_require__(2186));
  2444. const defaultMaxAttempts = 3;
  2445. const defaultMinSeconds = 10;
  2446. const defaultMaxSeconds = 20;
  2447. class RetryHelper {
  2448. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2449. this.maxAttempts = maxAttempts;
  2450. this.minSeconds = Math.floor(minSeconds);
  2451. this.maxSeconds = Math.floor(maxSeconds);
  2452. if (this.minSeconds > this.maxSeconds) {
  2453. throw new Error('min seconds should be less than or equal to max seconds');
  2454. }
  2455. }
  2456. execute(action) {
  2457. return __awaiter(this, void 0, void 0, function* () {
  2458. let attempt = 1;
  2459. while (attempt < this.maxAttempts) {
  2460. // Try
  2461. try {
  2462. return yield action();
  2463. }
  2464. catch (err) {
  2465. core.info(err === null || err === void 0 ? void 0 : err.message);
  2466. }
  2467. // Sleep
  2468. const seconds = this.getSleepAmount();
  2469. core.info(`Waiting ${seconds} seconds before trying again`);
  2470. yield this.sleep(seconds);
  2471. attempt++;
  2472. }
  2473. // Last attempt
  2474. return yield action();
  2475. });
  2476. }
  2477. getSleepAmount() {
  2478. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2479. this.minSeconds);
  2480. }
  2481. sleep(seconds) {
  2482. return __awaiter(this, void 0, void 0, function* () {
  2483. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2484. });
  2485. }
  2486. }
  2487. exports.RetryHelper = RetryHelper;
  2488. function execute(action) {
  2489. return __awaiter(this, void 0, void 0, function* () {
  2490. const retryHelper = new RetryHelper();
  2491. return yield retryHelper.execute(action);
  2492. });
  2493. }
  2494. /***/ }),
  2495. /***/ 4866:
  2496. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2497. "use strict";
  2498. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2499. if (k2 === undefined) k2 = k;
  2500. var desc = Object.getOwnPropertyDescriptor(m, k);
  2501. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2502. desc = { enumerable: true, get: function() { return m[k]; } };
  2503. }
  2504. Object.defineProperty(o, k2, desc);
  2505. }) : (function(o, m, k, k2) {
  2506. if (k2 === undefined) k2 = k;
  2507. o[k2] = m[k];
  2508. }));
  2509. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2510. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2511. }) : function(o, v) {
  2512. o["default"] = v;
  2513. });
  2514. var __importStar = (this && this.__importStar) || function (mod) {
  2515. if (mod && mod.__esModule) return mod;
  2516. var result = {};
  2517. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2518. __setModuleDefault(result, mod);
  2519. return result;
  2520. };
  2521. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2522. exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2523. exports.setRepositoryPath = setRepositoryPath;
  2524. exports.setSshKeyPath = setSshKeyPath;
  2525. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2526. exports.setSafeDirectory = setSafeDirectory;
  2527. const core = __importStar(__nccwpck_require__(2186));
  2528. /**
  2529. * Indicates whether the POST action is running
  2530. */
  2531. exports.IsPost = !!core.getState('isPost');
  2532. /**
  2533. * The repository path for the POST action. The value is empty during the MAIN action.
  2534. */
  2535. exports.RepositoryPath = core.getState('repositoryPath');
  2536. /**
  2537. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2538. */
  2539. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2540. /**
  2541. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2542. */
  2543. exports.SshKeyPath = core.getState('sshKeyPath');
  2544. /**
  2545. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2546. */
  2547. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2548. /**
  2549. * Save the repository path so the POST action can retrieve the value.
  2550. */
  2551. function setRepositoryPath(repositoryPath) {
  2552. core.saveState('repositoryPath', repositoryPath);
  2553. }
  2554. /**
  2555. * Save the SSH key path so the POST action can retrieve the value.
  2556. */
  2557. function setSshKeyPath(sshKeyPath) {
  2558. core.saveState('sshKeyPath', sshKeyPath);
  2559. }
  2560. /**
  2561. * Save the SSH known hosts path so the POST action can retrieve the value.
  2562. */
  2563. function setSshKnownHostsPath(sshKnownHostsPath) {
  2564. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2565. }
  2566. /**
  2567. * Save the set-safe-directory input so the POST action can retrieve the value.
  2568. */
  2569. function setSafeDirectory() {
  2570. core.saveState('setSafeDirectory', 'true');
  2571. }
  2572. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2573. // This is necessary since we don't have a separate entry point.
  2574. if (!exports.IsPost) {
  2575. core.saveState('isPost', 'true');
  2576. }
  2577. /***/ }),
  2578. /***/ 9437:
  2579. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2580. "use strict";
  2581. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2582. if (k2 === undefined) k2 = k;
  2583. var desc = Object.getOwnPropertyDescriptor(m, k);
  2584. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2585. desc = { enumerable: true, get: function() { return m[k]; } };
  2586. }
  2587. Object.defineProperty(o, k2, desc);
  2588. }) : (function(o, m, k, k2) {
  2589. if (k2 === undefined) k2 = k;
  2590. o[k2] = m[k];
  2591. }));
  2592. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2593. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2594. }) : function(o, v) {
  2595. o["default"] = v;
  2596. });
  2597. var __importStar = (this && this.__importStar) || function (mod) {
  2598. if (mod && mod.__esModule) return mod;
  2599. var result = {};
  2600. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2601. __setModuleDefault(result, mod);
  2602. return result;
  2603. };
  2604. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2605. exports.getFetchUrl = getFetchUrl;
  2606. exports.getServerUrl = getServerUrl;
  2607. exports.getServerApiUrl = getServerApiUrl;
  2608. exports.isGhes = isGhes;
  2609. const assert = __importStar(__nccwpck_require__(9491));
  2610. const url_1 = __nccwpck_require__(7310);
  2611. function getFetchUrl(settings) {
  2612. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2613. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2614. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2615. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2616. const encodedName = encodeURIComponent(settings.repositoryName);
  2617. if (settings.sshKey) {
  2618. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2619. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2620. }
  2621. // "origin" is SCHEME://HOSTNAME[:PORT]
  2622. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2623. }
  2624. function getServerUrl(url) {
  2625. let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2626. if (hasContent(url, WhitespaceMode.Trim)) {
  2627. resolvedUrl = url;
  2628. }
  2629. return new url_1.URL(resolvedUrl);
  2630. }
  2631. function getServerApiUrl(url) {
  2632. if (hasContent(url, WhitespaceMode.Trim)) {
  2633. let serverUrl = getServerUrl(url);
  2634. if (isGhes(url)) {
  2635. serverUrl.pathname = 'api/v3';
  2636. }
  2637. else {
  2638. serverUrl.hostname = 'api.' + serverUrl.hostname;
  2639. }
  2640. return pruneSuffix(serverUrl.toString(), '/');
  2641. }
  2642. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  2643. }
  2644. function isGhes(url) {
  2645. const ghUrl = new url_1.URL(url || process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  2646. const hostname = ghUrl.hostname.trimEnd().toUpperCase();
  2647. const isGitHubHost = hostname === 'GITHUB.COM';
  2648. const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
  2649. const isLocalHost = hostname.endsWith('.LOCALHOST');
  2650. return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
  2651. }
  2652. function pruneSuffix(text, suffix) {
  2653. if (hasContent(suffix, WhitespaceMode.Preserve) && (text === null || text === void 0 ? void 0 : text.endsWith(suffix))) {
  2654. return text.substring(0, text.length - suffix.length);
  2655. }
  2656. return text;
  2657. }
  2658. var WhitespaceMode;
  2659. (function (WhitespaceMode) {
  2660. WhitespaceMode[WhitespaceMode["Trim"] = 0] = "Trim";
  2661. WhitespaceMode[WhitespaceMode["Preserve"] = 1] = "Preserve";
  2662. })(WhitespaceMode || (WhitespaceMode = {}));
  2663. function hasContent(text, whitespaceMode) {
  2664. let refinedText = text !== null && text !== void 0 ? text : '';
  2665. if (whitespaceMode == WhitespaceMode.Trim) {
  2666. refinedText = refinedText.trim();
  2667. }
  2668. return refinedText.length > 0;
  2669. }
  2670. /***/ }),
  2671. /***/ 9568:
  2672. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2673. "use strict";
  2674. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2675. if (k2 === undefined) k2 = k;
  2676. var desc = Object.getOwnPropertyDescriptor(m, k);
  2677. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2678. desc = { enumerable: true, get: function() { return m[k]; } };
  2679. }
  2680. Object.defineProperty(o, k2, desc);
  2681. }) : (function(o, m, k, k2) {
  2682. if (k2 === undefined) k2 = k;
  2683. o[k2] = m[k];
  2684. }));
  2685. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2686. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2687. }) : function(o, v) {
  2688. o["default"] = v;
  2689. });
  2690. var __importStar = (this && this.__importStar) || function (mod) {
  2691. if (mod && mod.__esModule) return mod;
  2692. var result = {};
  2693. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2694. __setModuleDefault(result, mod);
  2695. return result;
  2696. };
  2697. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2698. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2699. return new (P || (P = Promise))(function (resolve, reject) {
  2700. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2701. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2702. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2703. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2704. });
  2705. };
  2706. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2707. exports.getOrganizationId = getOrganizationId;
  2708. const core = __importStar(__nccwpck_require__(2186));
  2709. const fs = __importStar(__nccwpck_require__(7147));
  2710. /**
  2711. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2712. */
  2713. function getOrganizationId() {
  2714. return __awaiter(this, void 0, void 0, function* () {
  2715. var _a, _b;
  2716. try {
  2717. const eventPath = process.env.GITHUB_EVENT_PATH;
  2718. if (!eventPath) {
  2719. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2720. return;
  2721. }
  2722. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2723. const event = JSON.parse(content);
  2724. 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;
  2725. if (typeof id !== 'number') {
  2726. core.debug('Repository owner ID not found within GITHUB event info');
  2727. return;
  2728. }
  2729. return id;
  2730. }
  2731. catch (err) {
  2732. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2733. }
  2734. });
  2735. }
  2736. /***/ }),
  2737. /***/ 7351:
  2738. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2739. "use strict";
  2740. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2741. if (k2 === undefined) k2 = k;
  2742. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2743. }) : (function(o, m, k, k2) {
  2744. if (k2 === undefined) k2 = k;
  2745. o[k2] = m[k];
  2746. }));
  2747. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2748. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2749. }) : function(o, v) {
  2750. o["default"] = v;
  2751. });
  2752. var __importStar = (this && this.__importStar) || function (mod) {
  2753. if (mod && mod.__esModule) return mod;
  2754. var result = {};
  2755. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2756. __setModuleDefault(result, mod);
  2757. return result;
  2758. };
  2759. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2760. exports.issue = exports.issueCommand = void 0;
  2761. const os = __importStar(__nccwpck_require__(2037));
  2762. const utils_1 = __nccwpck_require__(5278);
  2763. /**
  2764. * Commands
  2765. *
  2766. * Command Format:
  2767. * ::name key=value,key=value::message
  2768. *
  2769. * Examples:
  2770. * ::warning::This is the message
  2771. * ::set-env name=MY_VAR::some value
  2772. */
  2773. function issueCommand(command, properties, message) {
  2774. const cmd = new Command(command, properties, message);
  2775. process.stdout.write(cmd.toString() + os.EOL);
  2776. }
  2777. exports.issueCommand = issueCommand;
  2778. function issue(name, message = '') {
  2779. issueCommand(name, {}, message);
  2780. }
  2781. exports.issue = issue;
  2782. const CMD_STRING = '::';
  2783. class Command {
  2784. constructor(command, properties, message) {
  2785. if (!command) {
  2786. command = 'missing.command';
  2787. }
  2788. this.command = command;
  2789. this.properties = properties;
  2790. this.message = message;
  2791. }
  2792. toString() {
  2793. let cmdStr = CMD_STRING + this.command;
  2794. if (this.properties && Object.keys(this.properties).length > 0) {
  2795. cmdStr += ' ';
  2796. let first = true;
  2797. for (const key in this.properties) {
  2798. if (this.properties.hasOwnProperty(key)) {
  2799. const val = this.properties[key];
  2800. if (val) {
  2801. if (first) {
  2802. first = false;
  2803. }
  2804. else {
  2805. cmdStr += ',';
  2806. }
  2807. cmdStr += `${key}=${escapeProperty(val)}`;
  2808. }
  2809. }
  2810. }
  2811. }
  2812. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2813. return cmdStr;
  2814. }
  2815. }
  2816. function escapeData(s) {
  2817. return utils_1.toCommandValue(s)
  2818. .replace(/%/g, '%25')
  2819. .replace(/\r/g, '%0D')
  2820. .replace(/\n/g, '%0A');
  2821. }
  2822. function escapeProperty(s) {
  2823. return utils_1.toCommandValue(s)
  2824. .replace(/%/g, '%25')
  2825. .replace(/\r/g, '%0D')
  2826. .replace(/\n/g, '%0A')
  2827. .replace(/:/g, '%3A')
  2828. .replace(/,/g, '%2C');
  2829. }
  2830. //# sourceMappingURL=command.js.map
  2831. /***/ }),
  2832. /***/ 2186:
  2833. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2834. "use strict";
  2835. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2836. if (k2 === undefined) k2 = k;
  2837. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2838. }) : (function(o, m, k, k2) {
  2839. if (k2 === undefined) k2 = k;
  2840. o[k2] = m[k];
  2841. }));
  2842. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2843. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2844. }) : function(o, v) {
  2845. o["default"] = v;
  2846. });
  2847. var __importStar = (this && this.__importStar) || function (mod) {
  2848. if (mod && mod.__esModule) return mod;
  2849. var result = {};
  2850. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2851. __setModuleDefault(result, mod);
  2852. return result;
  2853. };
  2854. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2855. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2856. return new (P || (P = Promise))(function (resolve, reject) {
  2857. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2858. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2859. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2860. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2861. });
  2862. };
  2863. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2864. 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;
  2865. const command_1 = __nccwpck_require__(7351);
  2866. const file_command_1 = __nccwpck_require__(717);
  2867. const utils_1 = __nccwpck_require__(5278);
  2868. const os = __importStar(__nccwpck_require__(2037));
  2869. const path = __importStar(__nccwpck_require__(1017));
  2870. const oidc_utils_1 = __nccwpck_require__(8041);
  2871. /**
  2872. * The code to exit an action
  2873. */
  2874. var ExitCode;
  2875. (function (ExitCode) {
  2876. /**
  2877. * A code indicating that the action was successful
  2878. */
  2879. ExitCode[ExitCode["Success"] = 0] = "Success";
  2880. /**
  2881. * A code indicating that the action was a failure
  2882. */
  2883. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2884. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2885. //-----------------------------------------------------------------------
  2886. // Variables
  2887. //-----------------------------------------------------------------------
  2888. /**
  2889. * Sets env variable for this action and future actions in the job
  2890. * @param name the name of the variable to set
  2891. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2892. */
  2893. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2894. function exportVariable(name, val) {
  2895. const convertedVal = utils_1.toCommandValue(val);
  2896. process.env[name] = convertedVal;
  2897. const filePath = process.env['GITHUB_ENV'] || '';
  2898. if (filePath) {
  2899. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2900. }
  2901. command_1.issueCommand('set-env', { name }, convertedVal);
  2902. }
  2903. exports.exportVariable = exportVariable;
  2904. /**
  2905. * Registers a secret which will get masked from logs
  2906. * @param secret value of the secret
  2907. */
  2908. function setSecret(secret) {
  2909. command_1.issueCommand('add-mask', {}, secret);
  2910. }
  2911. exports.setSecret = setSecret;
  2912. /**
  2913. * Prepends inputPath to the PATH (for this action and future actions)
  2914. * @param inputPath
  2915. */
  2916. function addPath(inputPath) {
  2917. const filePath = process.env['GITHUB_PATH'] || '';
  2918. if (filePath) {
  2919. file_command_1.issueFileCommand('PATH', inputPath);
  2920. }
  2921. else {
  2922. command_1.issueCommand('add-path', {}, inputPath);
  2923. }
  2924. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2925. }
  2926. exports.addPath = addPath;
  2927. /**
  2928. * Gets the value of an input.
  2929. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2930. * Returns an empty string if the value is not defined.
  2931. *
  2932. * @param name name of the input to get
  2933. * @param options optional. See InputOptions.
  2934. * @returns string
  2935. */
  2936. function getInput(name, options) {
  2937. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2938. if (options && options.required && !val) {
  2939. throw new Error(`Input required and not supplied: ${name}`);
  2940. }
  2941. if (options && options.trimWhitespace === false) {
  2942. return val;
  2943. }
  2944. return val.trim();
  2945. }
  2946. exports.getInput = getInput;
  2947. /**
  2948. * Gets the values of an multiline input. Each value is also trimmed.
  2949. *
  2950. * @param name name of the input to get
  2951. * @param options optional. See InputOptions.
  2952. * @returns string[]
  2953. *
  2954. */
  2955. function getMultilineInput(name, options) {
  2956. const inputs = getInput(name, options)
  2957. .split('\n')
  2958. .filter(x => x !== '');
  2959. if (options && options.trimWhitespace === false) {
  2960. return inputs;
  2961. }
  2962. return inputs.map(input => input.trim());
  2963. }
  2964. exports.getMultilineInput = getMultilineInput;
  2965. /**
  2966. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2967. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2968. * The return value is also in boolean type.
  2969. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2970. *
  2971. * @param name name of the input to get
  2972. * @param options optional. See InputOptions.
  2973. * @returns boolean
  2974. */
  2975. function getBooleanInput(name, options) {
  2976. const trueValue = ['true', 'True', 'TRUE'];
  2977. const falseValue = ['false', 'False', 'FALSE'];
  2978. const val = getInput(name, options);
  2979. if (trueValue.includes(val))
  2980. return true;
  2981. if (falseValue.includes(val))
  2982. return false;
  2983. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  2984. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  2985. }
  2986. exports.getBooleanInput = getBooleanInput;
  2987. /**
  2988. * Sets the value of an output.
  2989. *
  2990. * @param name name of the output to set
  2991. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2992. */
  2993. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2994. function setOutput(name, value) {
  2995. const filePath = process.env['GITHUB_OUTPUT'] || '';
  2996. if (filePath) {
  2997. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  2998. }
  2999. process.stdout.write(os.EOL);
  3000. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  3001. }
  3002. exports.setOutput = setOutput;
  3003. /**
  3004. * Enables or disables the echoing of commands into stdout for the rest of the step.
  3005. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  3006. *
  3007. */
  3008. function setCommandEcho(enabled) {
  3009. command_1.issue('echo', enabled ? 'on' : 'off');
  3010. }
  3011. exports.setCommandEcho = setCommandEcho;
  3012. //-----------------------------------------------------------------------
  3013. // Results
  3014. //-----------------------------------------------------------------------
  3015. /**
  3016. * Sets the action status to failed.
  3017. * When the action exits it will be with an exit code of 1
  3018. * @param message add error issue message
  3019. */
  3020. function setFailed(message) {
  3021. process.exitCode = ExitCode.Failure;
  3022. error(message);
  3023. }
  3024. exports.setFailed = setFailed;
  3025. //-----------------------------------------------------------------------
  3026. // Logging Commands
  3027. //-----------------------------------------------------------------------
  3028. /**
  3029. * Gets whether Actions Step Debug is on or not
  3030. */
  3031. function isDebug() {
  3032. return process.env['RUNNER_DEBUG'] === '1';
  3033. }
  3034. exports.isDebug = isDebug;
  3035. /**
  3036. * Writes debug message to user log
  3037. * @param message debug message
  3038. */
  3039. function debug(message) {
  3040. command_1.issueCommand('debug', {}, message);
  3041. }
  3042. exports.debug = debug;
  3043. /**
  3044. * Adds an error issue
  3045. * @param message error issue message. Errors will be converted to string via toString()
  3046. * @param properties optional properties to add to the annotation.
  3047. */
  3048. function error(message, properties = {}) {
  3049. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3050. }
  3051. exports.error = error;
  3052. /**
  3053. * Adds a warning issue
  3054. * @param message warning issue message. Errors will be converted to string via toString()
  3055. * @param properties optional properties to add to the annotation.
  3056. */
  3057. function warning(message, properties = {}) {
  3058. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3059. }
  3060. exports.warning = warning;
  3061. /**
  3062. * Adds a notice issue
  3063. * @param message notice issue message. Errors will be converted to string via toString()
  3064. * @param properties optional properties to add to the annotation.
  3065. */
  3066. function notice(message, properties = {}) {
  3067. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3068. }
  3069. exports.notice = notice;
  3070. /**
  3071. * Writes info to log with console.log.
  3072. * @param message info message
  3073. */
  3074. function info(message) {
  3075. process.stdout.write(message + os.EOL);
  3076. }
  3077. exports.info = info;
  3078. /**
  3079. * Begin an output group.
  3080. *
  3081. * Output until the next `groupEnd` will be foldable in this group
  3082. *
  3083. * @param name The name of the output group
  3084. */
  3085. function startGroup(name) {
  3086. command_1.issue('group', name);
  3087. }
  3088. exports.startGroup = startGroup;
  3089. /**
  3090. * End an output group.
  3091. */
  3092. function endGroup() {
  3093. command_1.issue('endgroup');
  3094. }
  3095. exports.endGroup = endGroup;
  3096. /**
  3097. * Wrap an asynchronous function call in a group.
  3098. *
  3099. * Returns the same type as the function itself.
  3100. *
  3101. * @param name The name of the group
  3102. * @param fn The function to wrap in the group
  3103. */
  3104. function group(name, fn) {
  3105. return __awaiter(this, void 0, void 0, function* () {
  3106. startGroup(name);
  3107. let result;
  3108. try {
  3109. result = yield fn();
  3110. }
  3111. finally {
  3112. endGroup();
  3113. }
  3114. return result;
  3115. });
  3116. }
  3117. exports.group = group;
  3118. //-----------------------------------------------------------------------
  3119. // Wrapper action state
  3120. //-----------------------------------------------------------------------
  3121. /**
  3122. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  3123. *
  3124. * @param name name of the state to store
  3125. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3126. */
  3127. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3128. function saveState(name, value) {
  3129. const filePath = process.env['GITHUB_STATE'] || '';
  3130. if (filePath) {
  3131. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  3132. }
  3133. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  3134. }
  3135. exports.saveState = saveState;
  3136. /**
  3137. * Gets the value of an state set by this action's main execution.
  3138. *
  3139. * @param name name of the state to get
  3140. * @returns string
  3141. */
  3142. function getState(name) {
  3143. return process.env[`STATE_${name}`] || '';
  3144. }
  3145. exports.getState = getState;
  3146. function getIDToken(aud) {
  3147. return __awaiter(this, void 0, void 0, function* () {
  3148. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  3149. });
  3150. }
  3151. exports.getIDToken = getIDToken;
  3152. /**
  3153. * Summary exports
  3154. */
  3155. var summary_1 = __nccwpck_require__(1327);
  3156. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  3157. /**
  3158. * @deprecated use core.summary
  3159. */
  3160. var summary_2 = __nccwpck_require__(1327);
  3161. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  3162. /**
  3163. * Path exports
  3164. */
  3165. var path_utils_1 = __nccwpck_require__(2981);
  3166. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  3167. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  3168. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  3169. //# sourceMappingURL=core.js.map
  3170. /***/ }),
  3171. /***/ 717:
  3172. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3173. "use strict";
  3174. // For internal use, subject to change.
  3175. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3176. if (k2 === undefined) k2 = k;
  3177. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3178. }) : (function(o, m, k, k2) {
  3179. if (k2 === undefined) k2 = k;
  3180. o[k2] = m[k];
  3181. }));
  3182. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3183. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3184. }) : function(o, v) {
  3185. o["default"] = v;
  3186. });
  3187. var __importStar = (this && this.__importStar) || function (mod) {
  3188. if (mod && mod.__esModule) return mod;
  3189. var result = {};
  3190. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3191. __setModuleDefault(result, mod);
  3192. return result;
  3193. };
  3194. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3195. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  3196. // We use any as a valid input type
  3197. /* eslint-disable @typescript-eslint/no-explicit-any */
  3198. const fs = __importStar(__nccwpck_require__(7147));
  3199. const os = __importStar(__nccwpck_require__(2037));
  3200. const uuid_1 = __nccwpck_require__(8974);
  3201. const utils_1 = __nccwpck_require__(5278);
  3202. function issueFileCommand(command, message) {
  3203. const filePath = process.env[`GITHUB_${command}`];
  3204. if (!filePath) {
  3205. throw new Error(`Unable to find environment variable for file command ${command}`);
  3206. }
  3207. if (!fs.existsSync(filePath)) {
  3208. throw new Error(`Missing file at path: ${filePath}`);
  3209. }
  3210. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  3211. encoding: 'utf8'
  3212. });
  3213. }
  3214. exports.issueFileCommand = issueFileCommand;
  3215. function prepareKeyValueMessage(key, value) {
  3216. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  3217. const convertedValue = utils_1.toCommandValue(value);
  3218. // These should realistically never happen, but just in case someone finds a
  3219. // way to exploit uuid generation let's not allow keys or values that contain
  3220. // the delimiter.
  3221. if (key.includes(delimiter)) {
  3222. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  3223. }
  3224. if (convertedValue.includes(delimiter)) {
  3225. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  3226. }
  3227. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  3228. }
  3229. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  3230. //# sourceMappingURL=file-command.js.map
  3231. /***/ }),
  3232. /***/ 8041:
  3233. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3234. "use strict";
  3235. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3236. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3237. return new (P || (P = Promise))(function (resolve, reject) {
  3238. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3239. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3240. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3241. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3242. });
  3243. };
  3244. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3245. exports.OidcClient = void 0;
  3246. const http_client_1 = __nccwpck_require__(6255);
  3247. const auth_1 = __nccwpck_require__(5526);
  3248. const core_1 = __nccwpck_require__(2186);
  3249. class OidcClient {
  3250. static createHttpClient(allowRetry = true, maxRetry = 10) {
  3251. const requestOptions = {
  3252. allowRetries: allowRetry,
  3253. maxRetries: maxRetry
  3254. };
  3255. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3256. }
  3257. static getRequestToken() {
  3258. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3259. if (!token) {
  3260. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3261. }
  3262. return token;
  3263. }
  3264. static getIDTokenUrl() {
  3265. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3266. if (!runtimeUrl) {
  3267. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3268. }
  3269. return runtimeUrl;
  3270. }
  3271. static getCall(id_token_url) {
  3272. var _a;
  3273. return __awaiter(this, void 0, void 0, function* () {
  3274. const httpclient = OidcClient.createHttpClient();
  3275. const res = yield httpclient
  3276. .getJson(id_token_url)
  3277. .catch(error => {
  3278. throw new Error(`Failed to get ID Token. \n
  3279. Error Code : ${error.statusCode}\n
  3280. Error Message: ${error.message}`);
  3281. });
  3282. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3283. if (!id_token) {
  3284. throw new Error('Response json body do not have ID Token field');
  3285. }
  3286. return id_token;
  3287. });
  3288. }
  3289. static getIDToken(audience) {
  3290. return __awaiter(this, void 0, void 0, function* () {
  3291. try {
  3292. // New ID Token is requested from action service
  3293. let id_token_url = OidcClient.getIDTokenUrl();
  3294. if (audience) {
  3295. const encodedAudience = encodeURIComponent(audience);
  3296. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3297. }
  3298. core_1.debug(`ID token url is ${id_token_url}`);
  3299. const id_token = yield OidcClient.getCall(id_token_url);
  3300. core_1.setSecret(id_token);
  3301. return id_token;
  3302. }
  3303. catch (error) {
  3304. throw new Error(`Error message: ${error.message}`);
  3305. }
  3306. });
  3307. }
  3308. }
  3309. exports.OidcClient = OidcClient;
  3310. //# sourceMappingURL=oidc-utils.js.map
  3311. /***/ }),
  3312. /***/ 2981:
  3313. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3314. "use strict";
  3315. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3316. if (k2 === undefined) k2 = k;
  3317. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3318. }) : (function(o, m, k, k2) {
  3319. if (k2 === undefined) k2 = k;
  3320. o[k2] = m[k];
  3321. }));
  3322. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3323. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3324. }) : function(o, v) {
  3325. o["default"] = v;
  3326. });
  3327. var __importStar = (this && this.__importStar) || function (mod) {
  3328. if (mod && mod.__esModule) return mod;
  3329. var result = {};
  3330. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3331. __setModuleDefault(result, mod);
  3332. return result;
  3333. };
  3334. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3335. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3336. const path = __importStar(__nccwpck_require__(1017));
  3337. /**
  3338. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3339. * replaced with /.
  3340. *
  3341. * @param pth. Path to transform.
  3342. * @return string Posix path.
  3343. */
  3344. function toPosixPath(pth) {
  3345. return pth.replace(/[\\]/g, '/');
  3346. }
  3347. exports.toPosixPath = toPosixPath;
  3348. /**
  3349. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3350. * replaced with \\.
  3351. *
  3352. * @param pth. Path to transform.
  3353. * @return string Win32 path.
  3354. */
  3355. function toWin32Path(pth) {
  3356. return pth.replace(/[/]/g, '\\');
  3357. }
  3358. exports.toWin32Path = toWin32Path;
  3359. /**
  3360. * toPlatformPath converts the given path to a platform-specific path. It does
  3361. * this by replacing instances of / and \ with the platform-specific path
  3362. * separator.
  3363. *
  3364. * @param pth The path to platformize.
  3365. * @return string The platform-specific path.
  3366. */
  3367. function toPlatformPath(pth) {
  3368. return pth.replace(/[/\\]/g, path.sep);
  3369. }
  3370. exports.toPlatformPath = toPlatformPath;
  3371. //# sourceMappingURL=path-utils.js.map
  3372. /***/ }),
  3373. /***/ 1327:
  3374. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3375. "use strict";
  3376. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3377. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3378. return new (P || (P = Promise))(function (resolve, reject) {
  3379. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3380. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3381. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3382. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3383. });
  3384. };
  3385. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3386. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3387. const os_1 = __nccwpck_require__(2037);
  3388. const fs_1 = __nccwpck_require__(7147);
  3389. const { access, appendFile, writeFile } = fs_1.promises;
  3390. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3391. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3392. class Summary {
  3393. constructor() {
  3394. this._buffer = '';
  3395. }
  3396. /**
  3397. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3398. * Also checks r/w permissions.
  3399. *
  3400. * @returns step summary file path
  3401. */
  3402. filePath() {
  3403. return __awaiter(this, void 0, void 0, function* () {
  3404. if (this._filePath) {
  3405. return this._filePath;
  3406. }
  3407. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3408. if (!pathFromEnv) {
  3409. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3410. }
  3411. try {
  3412. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3413. }
  3414. catch (_a) {
  3415. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3416. }
  3417. this._filePath = pathFromEnv;
  3418. return this._filePath;
  3419. });
  3420. }
  3421. /**
  3422. * Wraps content in an HTML tag, adding any HTML attributes
  3423. *
  3424. * @param {string} tag HTML tag to wrap
  3425. * @param {string | null} content content within the tag
  3426. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3427. *
  3428. * @returns {string} content wrapped in HTML element
  3429. */
  3430. wrap(tag, content, attrs = {}) {
  3431. const htmlAttrs = Object.entries(attrs)
  3432. .map(([key, value]) => ` ${key}="${value}"`)
  3433. .join('');
  3434. if (!content) {
  3435. return `<${tag}${htmlAttrs}>`;
  3436. }
  3437. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3438. }
  3439. /**
  3440. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3441. *
  3442. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3443. *
  3444. * @returns {Promise<Summary>} summary instance
  3445. */
  3446. write(options) {
  3447. return __awaiter(this, void 0, void 0, function* () {
  3448. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3449. const filePath = yield this.filePath();
  3450. const writeFunc = overwrite ? writeFile : appendFile;
  3451. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3452. return this.emptyBuffer();
  3453. });
  3454. }
  3455. /**
  3456. * Clears the summary buffer and wipes the summary file
  3457. *
  3458. * @returns {Summary} summary instance
  3459. */
  3460. clear() {
  3461. return __awaiter(this, void 0, void 0, function* () {
  3462. return this.emptyBuffer().write({ overwrite: true });
  3463. });
  3464. }
  3465. /**
  3466. * Returns the current summary buffer as a string
  3467. *
  3468. * @returns {string} string of summary buffer
  3469. */
  3470. stringify() {
  3471. return this._buffer;
  3472. }
  3473. /**
  3474. * If the summary buffer is empty
  3475. *
  3476. * @returns {boolen} true if the buffer is empty
  3477. */
  3478. isEmptyBuffer() {
  3479. return this._buffer.length === 0;
  3480. }
  3481. /**
  3482. * Resets the summary buffer without writing to summary file
  3483. *
  3484. * @returns {Summary} summary instance
  3485. */
  3486. emptyBuffer() {
  3487. this._buffer = '';
  3488. return this;
  3489. }
  3490. /**
  3491. * Adds raw text to the summary buffer
  3492. *
  3493. * @param {string} text content to add
  3494. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3495. *
  3496. * @returns {Summary} summary instance
  3497. */
  3498. addRaw(text, addEOL = false) {
  3499. this._buffer += text;
  3500. return addEOL ? this.addEOL() : this;
  3501. }
  3502. /**
  3503. * Adds the operating system-specific end-of-line marker to the buffer
  3504. *
  3505. * @returns {Summary} summary instance
  3506. */
  3507. addEOL() {
  3508. return this.addRaw(os_1.EOL);
  3509. }
  3510. /**
  3511. * Adds an HTML codeblock to the summary buffer
  3512. *
  3513. * @param {string} code content to render within fenced code block
  3514. * @param {string} lang (optional) language to syntax highlight code
  3515. *
  3516. * @returns {Summary} summary instance
  3517. */
  3518. addCodeBlock(code, lang) {
  3519. const attrs = Object.assign({}, (lang && { lang }));
  3520. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3521. return this.addRaw(element).addEOL();
  3522. }
  3523. /**
  3524. * Adds an HTML list to the summary buffer
  3525. *
  3526. * @param {string[]} items list of items to render
  3527. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3528. *
  3529. * @returns {Summary} summary instance
  3530. */
  3531. addList(items, ordered = false) {
  3532. const tag = ordered ? 'ol' : 'ul';
  3533. const listItems = items.map(item => this.wrap('li', item)).join('');
  3534. const element = this.wrap(tag, listItems);
  3535. return this.addRaw(element).addEOL();
  3536. }
  3537. /**
  3538. * Adds an HTML table to the summary buffer
  3539. *
  3540. * @param {SummaryTableCell[]} rows table rows
  3541. *
  3542. * @returns {Summary} summary instance
  3543. */
  3544. addTable(rows) {
  3545. const tableBody = rows
  3546. .map(row => {
  3547. const cells = row
  3548. .map(cell => {
  3549. if (typeof cell === 'string') {
  3550. return this.wrap('td', cell);
  3551. }
  3552. const { header, data, colspan, rowspan } = cell;
  3553. const tag = header ? 'th' : 'td';
  3554. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3555. return this.wrap(tag, data, attrs);
  3556. })
  3557. .join('');
  3558. return this.wrap('tr', cells);
  3559. })
  3560. .join('');
  3561. const element = this.wrap('table', tableBody);
  3562. return this.addRaw(element).addEOL();
  3563. }
  3564. /**
  3565. * Adds a collapsable HTML details element to the summary buffer
  3566. *
  3567. * @param {string} label text for the closed state
  3568. * @param {string} content collapsable content
  3569. *
  3570. * @returns {Summary} summary instance
  3571. */
  3572. addDetails(label, content) {
  3573. const element = this.wrap('details', this.wrap('summary', label) + content);
  3574. return this.addRaw(element).addEOL();
  3575. }
  3576. /**
  3577. * Adds an HTML image tag to the summary buffer
  3578. *
  3579. * @param {string} src path to the image you to embed
  3580. * @param {string} alt text description of the image
  3581. * @param {SummaryImageOptions} options (optional) addition image attributes
  3582. *
  3583. * @returns {Summary} summary instance
  3584. */
  3585. addImage(src, alt, options) {
  3586. const { width, height } = options || {};
  3587. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3588. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3589. return this.addRaw(element).addEOL();
  3590. }
  3591. /**
  3592. * Adds an HTML section heading element
  3593. *
  3594. * @param {string} text heading text
  3595. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3596. *
  3597. * @returns {Summary} summary instance
  3598. */
  3599. addHeading(text, level) {
  3600. const tag = `h${level}`;
  3601. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3602. ? tag
  3603. : 'h1';
  3604. const element = this.wrap(allowedTag, text);
  3605. return this.addRaw(element).addEOL();
  3606. }
  3607. /**
  3608. * Adds an HTML thematic break (<hr>) to the summary buffer
  3609. *
  3610. * @returns {Summary} summary instance
  3611. */
  3612. addSeparator() {
  3613. const element = this.wrap('hr', null);
  3614. return this.addRaw(element).addEOL();
  3615. }
  3616. /**
  3617. * Adds an HTML line break (<br>) to the summary buffer
  3618. *
  3619. * @returns {Summary} summary instance
  3620. */
  3621. addBreak() {
  3622. const element = this.wrap('br', null);
  3623. return this.addRaw(element).addEOL();
  3624. }
  3625. /**
  3626. * Adds an HTML blockquote to the summary buffer
  3627. *
  3628. * @param {string} text quote text
  3629. * @param {string} cite (optional) citation url
  3630. *
  3631. * @returns {Summary} summary instance
  3632. */
  3633. addQuote(text, cite) {
  3634. const attrs = Object.assign({}, (cite && { cite }));
  3635. const element = this.wrap('blockquote', text, attrs);
  3636. return this.addRaw(element).addEOL();
  3637. }
  3638. /**
  3639. * Adds an HTML anchor tag to the summary buffer
  3640. *
  3641. * @param {string} text link text/content
  3642. * @param {string} href hyperlink
  3643. *
  3644. * @returns {Summary} summary instance
  3645. */
  3646. addLink(text, href) {
  3647. const element = this.wrap('a', text, { href });
  3648. return this.addRaw(element).addEOL();
  3649. }
  3650. }
  3651. const _summary = new Summary();
  3652. /**
  3653. * @deprecated use `core.summary`
  3654. */
  3655. exports.markdownSummary = _summary;
  3656. exports.summary = _summary;
  3657. //# sourceMappingURL=summary.js.map
  3658. /***/ }),
  3659. /***/ 5278:
  3660. /***/ ((__unused_webpack_module, exports) => {
  3661. "use strict";
  3662. // We use any as a valid input type
  3663. /* eslint-disable @typescript-eslint/no-explicit-any */
  3664. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3665. exports.toCommandProperties = exports.toCommandValue = void 0;
  3666. /**
  3667. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3668. * @param input input to sanitize into a string
  3669. */
  3670. function toCommandValue(input) {
  3671. if (input === null || input === undefined) {
  3672. return '';
  3673. }
  3674. else if (typeof input === 'string' || input instanceof String) {
  3675. return input;
  3676. }
  3677. return JSON.stringify(input);
  3678. }
  3679. exports.toCommandValue = toCommandValue;
  3680. /**
  3681. *
  3682. * @param annotationProperties
  3683. * @returns The command properties to send with the actual annotation command
  3684. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3685. */
  3686. function toCommandProperties(annotationProperties) {
  3687. if (!Object.keys(annotationProperties).length) {
  3688. return {};
  3689. }
  3690. return {
  3691. title: annotationProperties.title,
  3692. file: annotationProperties.file,
  3693. line: annotationProperties.startLine,
  3694. endLine: annotationProperties.endLine,
  3695. col: annotationProperties.startColumn,
  3696. endColumn: annotationProperties.endColumn
  3697. };
  3698. }
  3699. exports.toCommandProperties = toCommandProperties;
  3700. //# sourceMappingURL=utils.js.map
  3701. /***/ }),
  3702. /***/ 8974:
  3703. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3704. "use strict";
  3705. Object.defineProperty(exports, "__esModule", ({
  3706. value: true
  3707. }));
  3708. Object.defineProperty(exports, "v1", ({
  3709. enumerable: true,
  3710. get: function () {
  3711. return _v.default;
  3712. }
  3713. }));
  3714. Object.defineProperty(exports, "v3", ({
  3715. enumerable: true,
  3716. get: function () {
  3717. return _v2.default;
  3718. }
  3719. }));
  3720. Object.defineProperty(exports, "v4", ({
  3721. enumerable: true,
  3722. get: function () {
  3723. return _v3.default;
  3724. }
  3725. }));
  3726. Object.defineProperty(exports, "v5", ({
  3727. enumerable: true,
  3728. get: function () {
  3729. return _v4.default;
  3730. }
  3731. }));
  3732. Object.defineProperty(exports, "NIL", ({
  3733. enumerable: true,
  3734. get: function () {
  3735. return _nil.default;
  3736. }
  3737. }));
  3738. Object.defineProperty(exports, "version", ({
  3739. enumerable: true,
  3740. get: function () {
  3741. return _version.default;
  3742. }
  3743. }));
  3744. Object.defineProperty(exports, "validate", ({
  3745. enumerable: true,
  3746. get: function () {
  3747. return _validate.default;
  3748. }
  3749. }));
  3750. Object.defineProperty(exports, "stringify", ({
  3751. enumerable: true,
  3752. get: function () {
  3753. return _stringify.default;
  3754. }
  3755. }));
  3756. Object.defineProperty(exports, "parse", ({
  3757. enumerable: true,
  3758. get: function () {
  3759. return _parse.default;
  3760. }
  3761. }));
  3762. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3763. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3764. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3765. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3766. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3767. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3768. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3769. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3770. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3771. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3772. /***/ }),
  3773. /***/ 5842:
  3774. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3775. "use strict";
  3776. Object.defineProperty(exports, "__esModule", ({
  3777. value: true
  3778. }));
  3779. exports["default"] = void 0;
  3780. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3781. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3782. function md5(bytes) {
  3783. if (Array.isArray(bytes)) {
  3784. bytes = Buffer.from(bytes);
  3785. } else if (typeof bytes === 'string') {
  3786. bytes = Buffer.from(bytes, 'utf8');
  3787. }
  3788. return _crypto.default.createHash('md5').update(bytes).digest();
  3789. }
  3790. var _default = md5;
  3791. exports["default"] = _default;
  3792. /***/ }),
  3793. /***/ 2381:
  3794. /***/ ((__unused_webpack_module, exports) => {
  3795. "use strict";
  3796. Object.defineProperty(exports, "__esModule", ({
  3797. value: true
  3798. }));
  3799. exports["default"] = void 0;
  3800. var _default = '00000000-0000-0000-0000-000000000000';
  3801. exports["default"] = _default;
  3802. /***/ }),
  3803. /***/ 6385:
  3804. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3805. "use strict";
  3806. Object.defineProperty(exports, "__esModule", ({
  3807. value: true
  3808. }));
  3809. exports["default"] = void 0;
  3810. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3811. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3812. function parse(uuid) {
  3813. if (!(0, _validate.default)(uuid)) {
  3814. throw TypeError('Invalid UUID');
  3815. }
  3816. let v;
  3817. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3818. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3819. arr[1] = v >>> 16 & 0xff;
  3820. arr[2] = v >>> 8 & 0xff;
  3821. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3822. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3823. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3824. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3825. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3826. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3827. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3828. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3829. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3830. arr[11] = v / 0x100000000 & 0xff;
  3831. arr[12] = v >>> 24 & 0xff;
  3832. arr[13] = v >>> 16 & 0xff;
  3833. arr[14] = v >>> 8 & 0xff;
  3834. arr[15] = v & 0xff;
  3835. return arr;
  3836. }
  3837. var _default = parse;
  3838. exports["default"] = _default;
  3839. /***/ }),
  3840. /***/ 6230:
  3841. /***/ ((__unused_webpack_module, exports) => {
  3842. "use strict";
  3843. Object.defineProperty(exports, "__esModule", ({
  3844. value: true
  3845. }));
  3846. exports["default"] = void 0;
  3847. 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;
  3848. exports["default"] = _default;
  3849. /***/ }),
  3850. /***/ 9784:
  3851. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3852. "use strict";
  3853. Object.defineProperty(exports, "__esModule", ({
  3854. value: true
  3855. }));
  3856. exports["default"] = rng;
  3857. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3858. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3859. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3860. let poolPtr = rnds8Pool.length;
  3861. function rng() {
  3862. if (poolPtr > rnds8Pool.length - 16) {
  3863. _crypto.default.randomFillSync(rnds8Pool);
  3864. poolPtr = 0;
  3865. }
  3866. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3867. }
  3868. /***/ }),
  3869. /***/ 8844:
  3870. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3871. "use strict";
  3872. Object.defineProperty(exports, "__esModule", ({
  3873. value: true
  3874. }));
  3875. exports["default"] = void 0;
  3876. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3877. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3878. function sha1(bytes) {
  3879. if (Array.isArray(bytes)) {
  3880. bytes = Buffer.from(bytes);
  3881. } else if (typeof bytes === 'string') {
  3882. bytes = Buffer.from(bytes, 'utf8');
  3883. }
  3884. return _crypto.default.createHash('sha1').update(bytes).digest();
  3885. }
  3886. var _default = sha1;
  3887. exports["default"] = _default;
  3888. /***/ }),
  3889. /***/ 1458:
  3890. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3891. "use strict";
  3892. Object.defineProperty(exports, "__esModule", ({
  3893. value: true
  3894. }));
  3895. exports["default"] = void 0;
  3896. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3897. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3898. /**
  3899. * Convert array of 16 byte values to UUID string format of the form:
  3900. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3901. */
  3902. const byteToHex = [];
  3903. for (let i = 0; i < 256; ++i) {
  3904. byteToHex.push((i + 0x100).toString(16).substr(1));
  3905. }
  3906. function stringify(arr, offset = 0) {
  3907. // Note: Be careful editing this code! It's been tuned for performance
  3908. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3909. 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
  3910. // of the following:
  3911. // - One or more input array values don't map to a hex octet (leading to
  3912. // "undefined" in the uuid)
  3913. // - Invalid input values for the RFC `version` or `variant` fields
  3914. if (!(0, _validate.default)(uuid)) {
  3915. throw TypeError('Stringified UUID is invalid');
  3916. }
  3917. return uuid;
  3918. }
  3919. var _default = stringify;
  3920. exports["default"] = _default;
  3921. /***/ }),
  3922. /***/ 1595:
  3923. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3924. "use strict";
  3925. Object.defineProperty(exports, "__esModule", ({
  3926. value: true
  3927. }));
  3928. exports["default"] = void 0;
  3929. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3930. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3931. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3932. // **`v1()` - Generate time-based UUID**
  3933. //
  3934. // Inspired by https://github.com/LiosK/UUID.js
  3935. // and http://docs.python.org/library/uuid.html
  3936. let _nodeId;
  3937. let _clockseq; // Previous uuid creation time
  3938. let _lastMSecs = 0;
  3939. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3940. function v1(options, buf, offset) {
  3941. let i = buf && offset || 0;
  3942. const b = buf || new Array(16);
  3943. options = options || {};
  3944. let node = options.node || _nodeId;
  3945. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3946. // specified. We do this lazily to minimize issues related to insufficient
  3947. // system entropy. See #189
  3948. if (node == null || clockseq == null) {
  3949. const seedBytes = options.random || (options.rng || _rng.default)();
  3950. if (node == null) {
  3951. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3952. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3953. }
  3954. if (clockseq == null) {
  3955. // Per 4.2.2, randomize (14 bit) clockseq
  3956. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3957. }
  3958. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3959. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3960. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3961. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3962. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3963. // cycle to simulate higher resolution clock
  3964. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3965. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3966. if (dt < 0 && options.clockseq === undefined) {
  3967. clockseq = clockseq + 1 & 0x3fff;
  3968. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3969. // time interval
  3970. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3971. nsecs = 0;
  3972. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3973. if (nsecs >= 10000) {
  3974. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3975. }
  3976. _lastMSecs = msecs;
  3977. _lastNSecs = nsecs;
  3978. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3979. msecs += 12219292800000; // `time_low`
  3980. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3981. b[i++] = tl >>> 24 & 0xff;
  3982. b[i++] = tl >>> 16 & 0xff;
  3983. b[i++] = tl >>> 8 & 0xff;
  3984. b[i++] = tl & 0xff; // `time_mid`
  3985. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  3986. b[i++] = tmh >>> 8 & 0xff;
  3987. b[i++] = tmh & 0xff; // `time_high_and_version`
  3988. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  3989. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  3990. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  3991. b[i++] = clockseq & 0xff; // `node`
  3992. for (let n = 0; n < 6; ++n) {
  3993. b[i + n] = node[n];
  3994. }
  3995. return buf || (0, _stringify.default)(b);
  3996. }
  3997. var _default = v1;
  3998. exports["default"] = _default;
  3999. /***/ }),
  4000. /***/ 6993:
  4001. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4002. "use strict";
  4003. Object.defineProperty(exports, "__esModule", ({
  4004. value: true
  4005. }));
  4006. exports["default"] = void 0;
  4007. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4008. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  4009. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4010. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  4011. var _default = v3;
  4012. exports["default"] = _default;
  4013. /***/ }),
  4014. /***/ 5920:
  4015. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4016. "use strict";
  4017. Object.defineProperty(exports, "__esModule", ({
  4018. value: true
  4019. }));
  4020. exports["default"] = _default;
  4021. exports.URL = exports.DNS = void 0;
  4022. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4023. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  4024. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4025. function stringToBytes(str) {
  4026. str = unescape(encodeURIComponent(str)); // UTF8 escape
  4027. const bytes = [];
  4028. for (let i = 0; i < str.length; ++i) {
  4029. bytes.push(str.charCodeAt(i));
  4030. }
  4031. return bytes;
  4032. }
  4033. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  4034. exports.DNS = DNS;
  4035. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  4036. exports.URL = URL;
  4037. function _default(name, version, hashfunc) {
  4038. function generateUUID(value, namespace, buf, offset) {
  4039. if (typeof value === 'string') {
  4040. value = stringToBytes(value);
  4041. }
  4042. if (typeof namespace === 'string') {
  4043. namespace = (0, _parse.default)(namespace);
  4044. }
  4045. if (namespace.length !== 16) {
  4046. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  4047. } // Compute hash of namespace and value, Per 4.3
  4048. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  4049. // hashfunc([...namespace, ... value])`
  4050. let bytes = new Uint8Array(16 + value.length);
  4051. bytes.set(namespace);
  4052. bytes.set(value, namespace.length);
  4053. bytes = hashfunc(bytes);
  4054. bytes[6] = bytes[6] & 0x0f | version;
  4055. bytes[8] = bytes[8] & 0x3f | 0x80;
  4056. if (buf) {
  4057. offset = offset || 0;
  4058. for (let i = 0; i < 16; ++i) {
  4059. buf[offset + i] = bytes[i];
  4060. }
  4061. return buf;
  4062. }
  4063. return (0, _stringify.default)(bytes);
  4064. } // Function#name is not settable on some platforms (#270)
  4065. try {
  4066. generateUUID.name = name; // eslint-disable-next-line no-empty
  4067. } catch (err) {} // For CommonJS default export support
  4068. generateUUID.DNS = DNS;
  4069. generateUUID.URL = URL;
  4070. return generateUUID;
  4071. }
  4072. /***/ }),
  4073. /***/ 1472:
  4074. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4075. "use strict";
  4076. Object.defineProperty(exports, "__esModule", ({
  4077. value: true
  4078. }));
  4079. exports["default"] = void 0;
  4080. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4081. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4082. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4083. function v4(options, buf, offset) {
  4084. options = options || {};
  4085. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  4086. rnds[6] = rnds[6] & 0x0f | 0x40;
  4087. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  4088. if (buf) {
  4089. offset = offset || 0;
  4090. for (let i = 0; i < 16; ++i) {
  4091. buf[offset + i] = rnds[i];
  4092. }
  4093. return buf;
  4094. }
  4095. return (0, _stringify.default)(rnds);
  4096. }
  4097. var _default = v4;
  4098. exports["default"] = _default;
  4099. /***/ }),
  4100. /***/ 6217:
  4101. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4102. "use strict";
  4103. Object.defineProperty(exports, "__esModule", ({
  4104. value: true
  4105. }));
  4106. exports["default"] = void 0;
  4107. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4108. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  4109. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4110. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  4111. var _default = v5;
  4112. exports["default"] = _default;
  4113. /***/ }),
  4114. /***/ 2609:
  4115. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4116. "use strict";
  4117. Object.defineProperty(exports, "__esModule", ({
  4118. value: true
  4119. }));
  4120. exports["default"] = void 0;
  4121. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  4122. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4123. function validate(uuid) {
  4124. return typeof uuid === 'string' && _regex.default.test(uuid);
  4125. }
  4126. var _default = validate;
  4127. exports["default"] = _default;
  4128. /***/ }),
  4129. /***/ 427:
  4130. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4131. "use strict";
  4132. Object.defineProperty(exports, "__esModule", ({
  4133. value: true
  4134. }));
  4135. exports["default"] = void 0;
  4136. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4137. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4138. function version(uuid) {
  4139. if (!(0, _validate.default)(uuid)) {
  4140. throw TypeError('Invalid UUID');
  4141. }
  4142. return parseInt(uuid.substr(14, 1), 16);
  4143. }
  4144. var _default = version;
  4145. exports["default"] = _default;
  4146. /***/ }),
  4147. /***/ 1514:
  4148. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4149. "use strict";
  4150. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4151. if (k2 === undefined) k2 = k;
  4152. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4153. }) : (function(o, m, k, k2) {
  4154. if (k2 === undefined) k2 = k;
  4155. o[k2] = m[k];
  4156. }));
  4157. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4158. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4159. }) : function(o, v) {
  4160. o["default"] = v;
  4161. });
  4162. var __importStar = (this && this.__importStar) || function (mod) {
  4163. if (mod && mod.__esModule) return mod;
  4164. var result = {};
  4165. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4166. __setModuleDefault(result, mod);
  4167. return result;
  4168. };
  4169. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4170. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4171. return new (P || (P = Promise))(function (resolve, reject) {
  4172. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4173. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4174. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4175. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4176. });
  4177. };
  4178. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4179. exports.getExecOutput = exports.exec = void 0;
  4180. const string_decoder_1 = __nccwpck_require__(1576);
  4181. const tr = __importStar(__nccwpck_require__(8159));
  4182. /**
  4183. * Exec a command.
  4184. * Output will be streamed to the live console.
  4185. * Returns promise with return code
  4186. *
  4187. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4188. * @param args optional arguments for tool. Escaping is handled by the lib.
  4189. * @param options optional exec options. See ExecOptions
  4190. * @returns Promise<number> exit code
  4191. */
  4192. function exec(commandLine, args, options) {
  4193. return __awaiter(this, void 0, void 0, function* () {
  4194. const commandArgs = tr.argStringToArray(commandLine);
  4195. if (commandArgs.length === 0) {
  4196. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  4197. }
  4198. // Path to tool to execute should be first arg
  4199. const toolPath = commandArgs[0];
  4200. args = commandArgs.slice(1).concat(args || []);
  4201. const runner = new tr.ToolRunner(toolPath, args, options);
  4202. return runner.exec();
  4203. });
  4204. }
  4205. exports.exec = exec;
  4206. /**
  4207. * Exec a command and get the output.
  4208. * Output will be streamed to the live console.
  4209. * Returns promise with the exit code and collected stdout and stderr
  4210. *
  4211. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4212. * @param args optional arguments for tool. Escaping is handled by the lib.
  4213. * @param options optional exec options. See ExecOptions
  4214. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  4215. */
  4216. function getExecOutput(commandLine, args, options) {
  4217. var _a, _b;
  4218. return __awaiter(this, void 0, void 0, function* () {
  4219. let stdout = '';
  4220. let stderr = '';
  4221. //Using string decoder covers the case where a mult-byte character is split
  4222. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  4223. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  4224. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  4225. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  4226. const stdErrListener = (data) => {
  4227. stderr += stderrDecoder.write(data);
  4228. if (originalStdErrListener) {
  4229. originalStdErrListener(data);
  4230. }
  4231. };
  4232. const stdOutListener = (data) => {
  4233. stdout += stdoutDecoder.write(data);
  4234. if (originalStdoutListener) {
  4235. originalStdoutListener(data);
  4236. }
  4237. };
  4238. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  4239. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  4240. //flush any remaining characters
  4241. stdout += stdoutDecoder.end();
  4242. stderr += stderrDecoder.end();
  4243. return {
  4244. exitCode,
  4245. stdout,
  4246. stderr
  4247. };
  4248. });
  4249. }
  4250. exports.getExecOutput = getExecOutput;
  4251. //# sourceMappingURL=exec.js.map
  4252. /***/ }),
  4253. /***/ 8159:
  4254. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4255. "use strict";
  4256. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4257. if (k2 === undefined) k2 = k;
  4258. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4259. }) : (function(o, m, k, k2) {
  4260. if (k2 === undefined) k2 = k;
  4261. o[k2] = m[k];
  4262. }));
  4263. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4264. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4265. }) : function(o, v) {
  4266. o["default"] = v;
  4267. });
  4268. var __importStar = (this && this.__importStar) || function (mod) {
  4269. if (mod && mod.__esModule) return mod;
  4270. var result = {};
  4271. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4272. __setModuleDefault(result, mod);
  4273. return result;
  4274. };
  4275. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4276. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4277. return new (P || (P = Promise))(function (resolve, reject) {
  4278. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4279. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4280. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4281. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4282. });
  4283. };
  4284. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4285. exports.argStringToArray = exports.ToolRunner = void 0;
  4286. const os = __importStar(__nccwpck_require__(2037));
  4287. const events = __importStar(__nccwpck_require__(2361));
  4288. const child = __importStar(__nccwpck_require__(2081));
  4289. const path = __importStar(__nccwpck_require__(1017));
  4290. const io = __importStar(__nccwpck_require__(7436));
  4291. const ioUtil = __importStar(__nccwpck_require__(1962));
  4292. const timers_1 = __nccwpck_require__(9512);
  4293. /* eslint-disable @typescript-eslint/unbound-method */
  4294. const IS_WINDOWS = process.platform === 'win32';
  4295. /*
  4296. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4297. */
  4298. class ToolRunner extends events.EventEmitter {
  4299. constructor(toolPath, args, options) {
  4300. super();
  4301. if (!toolPath) {
  4302. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4303. }
  4304. this.toolPath = toolPath;
  4305. this.args = args || [];
  4306. this.options = options || {};
  4307. }
  4308. _debug(message) {
  4309. if (this.options.listeners && this.options.listeners.debug) {
  4310. this.options.listeners.debug(message);
  4311. }
  4312. }
  4313. _getCommandString(options, noPrefix) {
  4314. const toolPath = this._getSpawnFileName();
  4315. const args = this._getSpawnArgs(options);
  4316. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4317. if (IS_WINDOWS) {
  4318. // Windows + cmd file
  4319. if (this._isCmdFile()) {
  4320. cmd += toolPath;
  4321. for (const a of args) {
  4322. cmd += ` ${a}`;
  4323. }
  4324. }
  4325. // Windows + verbatim
  4326. else if (options.windowsVerbatimArguments) {
  4327. cmd += `"${toolPath}"`;
  4328. for (const a of args) {
  4329. cmd += ` ${a}`;
  4330. }
  4331. }
  4332. // Windows (regular)
  4333. else {
  4334. cmd += this._windowsQuoteCmdArg(toolPath);
  4335. for (const a of args) {
  4336. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4337. }
  4338. }
  4339. }
  4340. else {
  4341. // OSX/Linux - this can likely be improved with some form of quoting.
  4342. // creating processes on Unix is fundamentally different than Windows.
  4343. // on Unix, execvp() takes an arg array.
  4344. cmd += toolPath;
  4345. for (const a of args) {
  4346. cmd += ` ${a}`;
  4347. }
  4348. }
  4349. return cmd;
  4350. }
  4351. _processLineBuffer(data, strBuffer, onLine) {
  4352. try {
  4353. let s = strBuffer + data.toString();
  4354. let n = s.indexOf(os.EOL);
  4355. while (n > -1) {
  4356. const line = s.substring(0, n);
  4357. onLine(line);
  4358. // the rest of the string ...
  4359. s = s.substring(n + os.EOL.length);
  4360. n = s.indexOf(os.EOL);
  4361. }
  4362. return s;
  4363. }
  4364. catch (err) {
  4365. // streaming lines to console is best effort. Don't fail a build.
  4366. this._debug(`error processing line. Failed with error ${err}`);
  4367. return '';
  4368. }
  4369. }
  4370. _getSpawnFileName() {
  4371. if (IS_WINDOWS) {
  4372. if (this._isCmdFile()) {
  4373. return process.env['COMSPEC'] || 'cmd.exe';
  4374. }
  4375. }
  4376. return this.toolPath;
  4377. }
  4378. _getSpawnArgs(options) {
  4379. if (IS_WINDOWS) {
  4380. if (this._isCmdFile()) {
  4381. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4382. for (const a of this.args) {
  4383. argline += ' ';
  4384. argline += options.windowsVerbatimArguments
  4385. ? a
  4386. : this._windowsQuoteCmdArg(a);
  4387. }
  4388. argline += '"';
  4389. return [argline];
  4390. }
  4391. }
  4392. return this.args;
  4393. }
  4394. _endsWith(str, end) {
  4395. return str.endsWith(end);
  4396. }
  4397. _isCmdFile() {
  4398. const upperToolPath = this.toolPath.toUpperCase();
  4399. return (this._endsWith(upperToolPath, '.CMD') ||
  4400. this._endsWith(upperToolPath, '.BAT'));
  4401. }
  4402. _windowsQuoteCmdArg(arg) {
  4403. // for .exe, apply the normal quoting rules that libuv applies
  4404. if (!this._isCmdFile()) {
  4405. return this._uvQuoteCmdArg(arg);
  4406. }
  4407. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4408. // the libuv rules are generic and are not designed specifically for cmd.exe
  4409. // command line parser.
  4410. //
  4411. // for a detailed description of the cmd.exe command line parser, refer to
  4412. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4413. // need quotes for empty arg
  4414. if (!arg) {
  4415. return '""';
  4416. }
  4417. // determine whether the arg needs to be quoted
  4418. const cmdSpecialChars = [
  4419. ' ',
  4420. '\t',
  4421. '&',
  4422. '(',
  4423. ')',
  4424. '[',
  4425. ']',
  4426. '{',
  4427. '}',
  4428. '^',
  4429. '=',
  4430. ';',
  4431. '!',
  4432. "'",
  4433. '+',
  4434. ',',
  4435. '`',
  4436. '~',
  4437. '|',
  4438. '<',
  4439. '>',
  4440. '"'
  4441. ];
  4442. let needsQuotes = false;
  4443. for (const char of arg) {
  4444. if (cmdSpecialChars.some(x => x === char)) {
  4445. needsQuotes = true;
  4446. break;
  4447. }
  4448. }
  4449. // short-circuit if quotes not needed
  4450. if (!needsQuotes) {
  4451. return arg;
  4452. }
  4453. // the following quoting rules are very similar to the rules that by libuv applies.
  4454. //
  4455. // 1) wrap the string in quotes
  4456. //
  4457. // 2) double-up quotes - i.e. " => ""
  4458. //
  4459. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4460. // doesn't work well with a cmd.exe command line.
  4461. //
  4462. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4463. // for example, the command line:
  4464. // foo.exe "myarg:""my val"""
  4465. // is parsed by a .NET console app into an arg array:
  4466. // [ "myarg:\"my val\"" ]
  4467. // which is the same end result when applying libuv quoting rules. although the actual
  4468. // command line from libuv quoting rules would look like:
  4469. // foo.exe "myarg:\"my val\""
  4470. //
  4471. // 3) double-up slashes that precede a quote,
  4472. // e.g. hello \world => "hello \world"
  4473. // hello\"world => "hello\\""world"
  4474. // hello\\"world => "hello\\\\""world"
  4475. // hello world\ => "hello world\\"
  4476. //
  4477. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4478. // the reasons for including this as a .cmd quoting rule are:
  4479. //
  4480. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4481. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4482. //
  4483. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4484. // haven't heard any complaints about that aspect.
  4485. //
  4486. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4487. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4488. // by using %%.
  4489. //
  4490. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4491. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4492. //
  4493. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4494. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4495. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4496. // to an external program.
  4497. //
  4498. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4499. // % can be escaped within a .cmd file.
  4500. let reverse = '"';
  4501. let quoteHit = true;
  4502. for (let i = arg.length; i > 0; i--) {
  4503. // walk the string in reverse
  4504. reverse += arg[i - 1];
  4505. if (quoteHit && arg[i - 1] === '\\') {
  4506. reverse += '\\'; // double the slash
  4507. }
  4508. else if (arg[i - 1] === '"') {
  4509. quoteHit = true;
  4510. reverse += '"'; // double the quote
  4511. }
  4512. else {
  4513. quoteHit = false;
  4514. }
  4515. }
  4516. reverse += '"';
  4517. return reverse
  4518. .split('')
  4519. .reverse()
  4520. .join('');
  4521. }
  4522. _uvQuoteCmdArg(arg) {
  4523. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4524. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4525. // is used.
  4526. //
  4527. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4528. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4529. // pasting copyright notice from Node within this function:
  4530. //
  4531. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4532. //
  4533. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4534. // of this software and associated documentation files (the "Software"), to
  4535. // deal in the Software without restriction, including without limitation the
  4536. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4537. // sell copies of the Software, and to permit persons to whom the Software is
  4538. // furnished to do so, subject to the following conditions:
  4539. //
  4540. // The above copyright notice and this permission notice shall be included in
  4541. // all copies or substantial portions of the Software.
  4542. //
  4543. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4544. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4545. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4546. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4547. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4548. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4549. // IN THE SOFTWARE.
  4550. if (!arg) {
  4551. // Need double quotation for empty argument
  4552. return '""';
  4553. }
  4554. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4555. // No quotation needed
  4556. return arg;
  4557. }
  4558. if (!arg.includes('"') && !arg.includes('\\')) {
  4559. // No embedded double quotes or backslashes, so I can just wrap
  4560. // quote marks around the whole thing.
  4561. return `"${arg}"`;
  4562. }
  4563. // Expected input/output:
  4564. // input : hello"world
  4565. // output: "hello\"world"
  4566. // input : hello""world
  4567. // output: "hello\"\"world"
  4568. // input : hello\world
  4569. // output: hello\world
  4570. // input : hello\\world
  4571. // output: hello\\world
  4572. // input : hello\"world
  4573. // output: "hello\\\"world"
  4574. // input : hello\\"world
  4575. // output: "hello\\\\\"world"
  4576. // input : hello world\
  4577. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4578. // but it appears the comment is wrong, it should be "hello world\\"
  4579. let reverse = '"';
  4580. let quoteHit = true;
  4581. for (let i = arg.length; i > 0; i--) {
  4582. // walk the string in reverse
  4583. reverse += arg[i - 1];
  4584. if (quoteHit && arg[i - 1] === '\\') {
  4585. reverse += '\\';
  4586. }
  4587. else if (arg[i - 1] === '"') {
  4588. quoteHit = true;
  4589. reverse += '\\';
  4590. }
  4591. else {
  4592. quoteHit = false;
  4593. }
  4594. }
  4595. reverse += '"';
  4596. return reverse
  4597. .split('')
  4598. .reverse()
  4599. .join('');
  4600. }
  4601. _cloneExecOptions(options) {
  4602. options = options || {};
  4603. const result = {
  4604. cwd: options.cwd || process.cwd(),
  4605. env: options.env || process.env,
  4606. silent: options.silent || false,
  4607. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4608. failOnStdErr: options.failOnStdErr || false,
  4609. ignoreReturnCode: options.ignoreReturnCode || false,
  4610. delay: options.delay || 10000
  4611. };
  4612. result.outStream = options.outStream || process.stdout;
  4613. result.errStream = options.errStream || process.stderr;
  4614. return result;
  4615. }
  4616. _getSpawnOptions(options, toolPath) {
  4617. options = options || {};
  4618. const result = {};
  4619. result.cwd = options.cwd;
  4620. result.env = options.env;
  4621. result['windowsVerbatimArguments'] =
  4622. options.windowsVerbatimArguments || this._isCmdFile();
  4623. if (options.windowsVerbatimArguments) {
  4624. result.argv0 = `"${toolPath}"`;
  4625. }
  4626. return result;
  4627. }
  4628. /**
  4629. * Exec a tool.
  4630. * Output will be streamed to the live console.
  4631. * Returns promise with return code
  4632. *
  4633. * @param tool path to tool to exec
  4634. * @param options optional exec options. See ExecOptions
  4635. * @returns number
  4636. */
  4637. exec() {
  4638. return __awaiter(this, void 0, void 0, function* () {
  4639. // root the tool path if it is unrooted and contains relative pathing
  4640. if (!ioUtil.isRooted(this.toolPath) &&
  4641. (this.toolPath.includes('/') ||
  4642. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4643. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4644. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4645. }
  4646. // if the tool is only a file name, then resolve it from the PATH
  4647. // otherwise verify it exists (add extension on Windows if necessary)
  4648. this.toolPath = yield io.which(this.toolPath, true);
  4649. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4650. this._debug(`exec tool: ${this.toolPath}`);
  4651. this._debug('arguments:');
  4652. for (const arg of this.args) {
  4653. this._debug(` ${arg}`);
  4654. }
  4655. const optionsNonNull = this._cloneExecOptions(this.options);
  4656. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4657. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4658. }
  4659. const state = new ExecState(optionsNonNull, this.toolPath);
  4660. state.on('debug', (message) => {
  4661. this._debug(message);
  4662. });
  4663. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4664. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4665. }
  4666. const fileName = this._getSpawnFileName();
  4667. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4668. let stdbuffer = '';
  4669. if (cp.stdout) {
  4670. cp.stdout.on('data', (data) => {
  4671. if (this.options.listeners && this.options.listeners.stdout) {
  4672. this.options.listeners.stdout(data);
  4673. }
  4674. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4675. optionsNonNull.outStream.write(data);
  4676. }
  4677. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4678. if (this.options.listeners && this.options.listeners.stdline) {
  4679. this.options.listeners.stdline(line);
  4680. }
  4681. });
  4682. });
  4683. }
  4684. let errbuffer = '';
  4685. if (cp.stderr) {
  4686. cp.stderr.on('data', (data) => {
  4687. state.processStderr = true;
  4688. if (this.options.listeners && this.options.listeners.stderr) {
  4689. this.options.listeners.stderr(data);
  4690. }
  4691. if (!optionsNonNull.silent &&
  4692. optionsNonNull.errStream &&
  4693. optionsNonNull.outStream) {
  4694. const s = optionsNonNull.failOnStdErr
  4695. ? optionsNonNull.errStream
  4696. : optionsNonNull.outStream;
  4697. s.write(data);
  4698. }
  4699. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4700. if (this.options.listeners && this.options.listeners.errline) {
  4701. this.options.listeners.errline(line);
  4702. }
  4703. });
  4704. });
  4705. }
  4706. cp.on('error', (err) => {
  4707. state.processError = err.message;
  4708. state.processExited = true;
  4709. state.processClosed = true;
  4710. state.CheckComplete();
  4711. });
  4712. cp.on('exit', (code) => {
  4713. state.processExitCode = code;
  4714. state.processExited = true;
  4715. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4716. state.CheckComplete();
  4717. });
  4718. cp.on('close', (code) => {
  4719. state.processExitCode = code;
  4720. state.processExited = true;
  4721. state.processClosed = true;
  4722. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4723. state.CheckComplete();
  4724. });
  4725. state.on('done', (error, exitCode) => {
  4726. if (stdbuffer.length > 0) {
  4727. this.emit('stdline', stdbuffer);
  4728. }
  4729. if (errbuffer.length > 0) {
  4730. this.emit('errline', errbuffer);
  4731. }
  4732. cp.removeAllListeners();
  4733. if (error) {
  4734. reject(error);
  4735. }
  4736. else {
  4737. resolve(exitCode);
  4738. }
  4739. });
  4740. if (this.options.input) {
  4741. if (!cp.stdin) {
  4742. throw new Error('child process missing stdin');
  4743. }
  4744. cp.stdin.end(this.options.input);
  4745. }
  4746. }));
  4747. });
  4748. }
  4749. }
  4750. exports.ToolRunner = ToolRunner;
  4751. /**
  4752. * Convert an arg string to an array of args. Handles escaping
  4753. *
  4754. * @param argString string of arguments
  4755. * @returns string[] array of arguments
  4756. */
  4757. function argStringToArray(argString) {
  4758. const args = [];
  4759. let inQuotes = false;
  4760. let escaped = false;
  4761. let arg = '';
  4762. function append(c) {
  4763. // we only escape double quotes.
  4764. if (escaped && c !== '"') {
  4765. arg += '\\';
  4766. }
  4767. arg += c;
  4768. escaped = false;
  4769. }
  4770. for (let i = 0; i < argString.length; i++) {
  4771. const c = argString.charAt(i);
  4772. if (c === '"') {
  4773. if (!escaped) {
  4774. inQuotes = !inQuotes;
  4775. }
  4776. else {
  4777. append(c);
  4778. }
  4779. continue;
  4780. }
  4781. if (c === '\\' && escaped) {
  4782. append(c);
  4783. continue;
  4784. }
  4785. if (c === '\\' && inQuotes) {
  4786. escaped = true;
  4787. continue;
  4788. }
  4789. if (c === ' ' && !inQuotes) {
  4790. if (arg.length > 0) {
  4791. args.push(arg);
  4792. arg = '';
  4793. }
  4794. continue;
  4795. }
  4796. append(c);
  4797. }
  4798. if (arg.length > 0) {
  4799. args.push(arg.trim());
  4800. }
  4801. return args;
  4802. }
  4803. exports.argStringToArray = argStringToArray;
  4804. class ExecState extends events.EventEmitter {
  4805. constructor(options, toolPath) {
  4806. super();
  4807. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4808. this.processError = '';
  4809. this.processExitCode = 0;
  4810. this.processExited = false; // tracks whether the process has exited
  4811. this.processStderr = false; // tracks whether stderr was written to
  4812. this.delay = 10000; // 10 seconds
  4813. this.done = false;
  4814. this.timeout = null;
  4815. if (!toolPath) {
  4816. throw new Error('toolPath must not be empty');
  4817. }
  4818. this.options = options;
  4819. this.toolPath = toolPath;
  4820. if (options.delay) {
  4821. this.delay = options.delay;
  4822. }
  4823. }
  4824. CheckComplete() {
  4825. if (this.done) {
  4826. return;
  4827. }
  4828. if (this.processClosed) {
  4829. this._setResult();
  4830. }
  4831. else if (this.processExited) {
  4832. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4833. }
  4834. }
  4835. _debug(message) {
  4836. this.emit('debug', message);
  4837. }
  4838. _setResult() {
  4839. // determine whether there is an error
  4840. let error;
  4841. if (this.processExited) {
  4842. if (this.processError) {
  4843. 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}`);
  4844. }
  4845. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4846. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4847. }
  4848. else if (this.processStderr && this.options.failOnStdErr) {
  4849. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4850. }
  4851. }
  4852. // clear the timeout
  4853. if (this.timeout) {
  4854. clearTimeout(this.timeout);
  4855. this.timeout = null;
  4856. }
  4857. this.done = true;
  4858. this.emit('done', error, this.processExitCode);
  4859. }
  4860. static HandleTimeout(state) {
  4861. if (state.done) {
  4862. return;
  4863. }
  4864. if (!state.processClosed && state.processExited) {
  4865. const message = `The STDIO streams did not close within ${state.delay /
  4866. 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.`;
  4867. state._debug(message);
  4868. }
  4869. state._setResult();
  4870. }
  4871. }
  4872. //# sourceMappingURL=toolrunner.js.map
  4873. /***/ }),
  4874. /***/ 4087:
  4875. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4876. "use strict";
  4877. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4878. exports.Context = void 0;
  4879. const fs_1 = __nccwpck_require__(7147);
  4880. const os_1 = __nccwpck_require__(2037);
  4881. class Context {
  4882. /**
  4883. * Hydrate the context from the environment
  4884. */
  4885. constructor() {
  4886. var _a, _b, _c;
  4887. this.payload = {};
  4888. if (process.env.GITHUB_EVENT_PATH) {
  4889. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4890. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4891. }
  4892. else {
  4893. const path = process.env.GITHUB_EVENT_PATH;
  4894. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4895. }
  4896. }
  4897. this.eventName = process.env.GITHUB_EVENT_NAME;
  4898. this.sha = process.env.GITHUB_SHA;
  4899. this.ref = process.env.GITHUB_REF;
  4900. this.workflow = process.env.GITHUB_WORKFLOW;
  4901. this.action = process.env.GITHUB_ACTION;
  4902. this.actor = process.env.GITHUB_ACTOR;
  4903. this.job = process.env.GITHUB_JOB;
  4904. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4905. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4906. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4907. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4908. this.graphqlUrl =
  4909. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4910. }
  4911. get issue() {
  4912. const payload = this.payload;
  4913. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4914. }
  4915. get repo() {
  4916. if (process.env.GITHUB_REPOSITORY) {
  4917. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4918. return { owner, repo };
  4919. }
  4920. if (this.payload.repository) {
  4921. return {
  4922. owner: this.payload.repository.owner.login,
  4923. repo: this.payload.repository.name
  4924. };
  4925. }
  4926. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4927. }
  4928. }
  4929. exports.Context = Context;
  4930. //# sourceMappingURL=context.js.map
  4931. /***/ }),
  4932. /***/ 5438:
  4933. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4934. "use strict";
  4935. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4936. if (k2 === undefined) k2 = k;
  4937. var desc = Object.getOwnPropertyDescriptor(m, k);
  4938. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4939. desc = { enumerable: true, get: function() { return m[k]; } };
  4940. }
  4941. Object.defineProperty(o, k2, desc);
  4942. }) : (function(o, m, k, k2) {
  4943. if (k2 === undefined) k2 = k;
  4944. o[k2] = m[k];
  4945. }));
  4946. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4947. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4948. }) : function(o, v) {
  4949. o["default"] = v;
  4950. });
  4951. var __importStar = (this && this.__importStar) || function (mod) {
  4952. if (mod && mod.__esModule) return mod;
  4953. var result = {};
  4954. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4955. __setModuleDefault(result, mod);
  4956. return result;
  4957. };
  4958. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4959. exports.getOctokit = exports.context = void 0;
  4960. const Context = __importStar(__nccwpck_require__(4087));
  4961. const utils_1 = __nccwpck_require__(3030);
  4962. exports.context = new Context.Context();
  4963. /**
  4964. * Returns a hydrated octokit ready to use for GitHub Actions
  4965. *
  4966. * @param token the repo PAT or GITHUB_TOKEN
  4967. * @param options other options to set
  4968. */
  4969. function getOctokit(token, options, ...additionalPlugins) {
  4970. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4971. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4972. }
  4973. exports.getOctokit = getOctokit;
  4974. //# sourceMappingURL=github.js.map
  4975. /***/ }),
  4976. /***/ 7914:
  4977. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4978. "use strict";
  4979. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4980. if (k2 === undefined) k2 = k;
  4981. var desc = Object.getOwnPropertyDescriptor(m, k);
  4982. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4983. desc = { enumerable: true, get: function() { return m[k]; } };
  4984. }
  4985. Object.defineProperty(o, k2, desc);
  4986. }) : (function(o, m, k, k2) {
  4987. if (k2 === undefined) k2 = k;
  4988. o[k2] = m[k];
  4989. }));
  4990. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4991. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4992. }) : function(o, v) {
  4993. o["default"] = v;
  4994. });
  4995. var __importStar = (this && this.__importStar) || function (mod) {
  4996. if (mod && mod.__esModule) return mod;
  4997. var result = {};
  4998. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4999. __setModuleDefault(result, mod);
  5000. return result;
  5001. };
  5002. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5003. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5004. return new (P || (P = Promise))(function (resolve, reject) {
  5005. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5006. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5007. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5008. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5009. });
  5010. };
  5011. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5012. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  5013. const httpClient = __importStar(__nccwpck_require__(6255));
  5014. const undici_1 = __nccwpck_require__(1773);
  5015. function getAuthString(token, options) {
  5016. if (!token && !options.auth) {
  5017. throw new Error('Parameter token or opts.auth is required');
  5018. }
  5019. else if (token && options.auth) {
  5020. throw new Error('Parameters token and opts.auth may not both be specified');
  5021. }
  5022. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  5023. }
  5024. exports.getAuthString = getAuthString;
  5025. function getProxyAgent(destinationUrl) {
  5026. const hc = new httpClient.HttpClient();
  5027. return hc.getAgent(destinationUrl);
  5028. }
  5029. exports.getProxyAgent = getProxyAgent;
  5030. function getProxyAgentDispatcher(destinationUrl) {
  5031. const hc = new httpClient.HttpClient();
  5032. return hc.getAgentDispatcher(destinationUrl);
  5033. }
  5034. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  5035. function getProxyFetch(destinationUrl) {
  5036. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  5037. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  5038. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  5039. });
  5040. return proxyFetch;
  5041. }
  5042. exports.getProxyFetch = getProxyFetch;
  5043. function getApiBaseUrl() {
  5044. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  5045. }
  5046. exports.getApiBaseUrl = getApiBaseUrl;
  5047. //# sourceMappingURL=utils.js.map
  5048. /***/ }),
  5049. /***/ 3030:
  5050. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5051. "use strict";
  5052. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5053. if (k2 === undefined) k2 = k;
  5054. var desc = Object.getOwnPropertyDescriptor(m, k);
  5055. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5056. desc = { enumerable: true, get: function() { return m[k]; } };
  5057. }
  5058. Object.defineProperty(o, k2, desc);
  5059. }) : (function(o, m, k, k2) {
  5060. if (k2 === undefined) k2 = k;
  5061. o[k2] = m[k];
  5062. }));
  5063. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5064. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5065. }) : function(o, v) {
  5066. o["default"] = v;
  5067. });
  5068. var __importStar = (this && this.__importStar) || function (mod) {
  5069. if (mod && mod.__esModule) return mod;
  5070. var result = {};
  5071. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5072. __setModuleDefault(result, mod);
  5073. return result;
  5074. };
  5075. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5076. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  5077. const Context = __importStar(__nccwpck_require__(4087));
  5078. const Utils = __importStar(__nccwpck_require__(7914));
  5079. // octokit + plugins
  5080. const core_1 = __nccwpck_require__(6762);
  5081. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  5082. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  5083. exports.context = new Context.Context();
  5084. const baseUrl = Utils.getApiBaseUrl();
  5085. exports.defaults = {
  5086. baseUrl,
  5087. request: {
  5088. agent: Utils.getProxyAgent(baseUrl),
  5089. fetch: Utils.getProxyFetch(baseUrl)
  5090. }
  5091. };
  5092. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  5093. /**
  5094. * Convience function to correctly format Octokit Options to pass into the constructor.
  5095. *
  5096. * @param token the repo PAT or GITHUB_TOKEN
  5097. * @param options other options to set
  5098. */
  5099. function getOctokitOptions(token, options) {
  5100. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  5101. // Auth
  5102. const auth = Utils.getAuthString(token, opts);
  5103. if (auth) {
  5104. opts.auth = auth;
  5105. }
  5106. return opts;
  5107. }
  5108. exports.getOctokitOptions = getOctokitOptions;
  5109. //# sourceMappingURL=utils.js.map
  5110. /***/ }),
  5111. /***/ 5526:
  5112. /***/ (function(__unused_webpack_module, exports) {
  5113. "use strict";
  5114. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5115. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5116. return new (P || (P = Promise))(function (resolve, reject) {
  5117. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5118. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5119. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5120. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5121. });
  5122. };
  5123. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5124. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  5125. class BasicCredentialHandler {
  5126. constructor(username, password) {
  5127. this.username = username;
  5128. this.password = password;
  5129. }
  5130. prepareRequest(options) {
  5131. if (!options.headers) {
  5132. throw Error('The request has no headers');
  5133. }
  5134. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  5135. }
  5136. // This handler cannot handle 401
  5137. canHandleAuthentication() {
  5138. return false;
  5139. }
  5140. handleAuthentication() {
  5141. return __awaiter(this, void 0, void 0, function* () {
  5142. throw new Error('not implemented');
  5143. });
  5144. }
  5145. }
  5146. exports.BasicCredentialHandler = BasicCredentialHandler;
  5147. class BearerCredentialHandler {
  5148. constructor(token) {
  5149. this.token = token;
  5150. }
  5151. // currently implements pre-authorization
  5152. // TODO: support preAuth = false where it hooks on 401
  5153. prepareRequest(options) {
  5154. if (!options.headers) {
  5155. throw Error('The request has no headers');
  5156. }
  5157. options.headers['Authorization'] = `Bearer ${this.token}`;
  5158. }
  5159. // This handler cannot handle 401
  5160. canHandleAuthentication() {
  5161. return false;
  5162. }
  5163. handleAuthentication() {
  5164. return __awaiter(this, void 0, void 0, function* () {
  5165. throw new Error('not implemented');
  5166. });
  5167. }
  5168. }
  5169. exports.BearerCredentialHandler = BearerCredentialHandler;
  5170. class PersonalAccessTokenCredentialHandler {
  5171. constructor(token) {
  5172. this.token = token;
  5173. }
  5174. // currently implements pre-authorization
  5175. // TODO: support preAuth = false where it hooks on 401
  5176. prepareRequest(options) {
  5177. if (!options.headers) {
  5178. throw Error('The request has no headers');
  5179. }
  5180. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  5181. }
  5182. // This handler cannot handle 401
  5183. canHandleAuthentication() {
  5184. return false;
  5185. }
  5186. handleAuthentication() {
  5187. return __awaiter(this, void 0, void 0, function* () {
  5188. throw new Error('not implemented');
  5189. });
  5190. }
  5191. }
  5192. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  5193. //# sourceMappingURL=auth.js.map
  5194. /***/ }),
  5195. /***/ 6255:
  5196. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5197. "use strict";
  5198. /* eslint-disable @typescript-eslint/no-explicit-any */
  5199. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5200. if (k2 === undefined) k2 = k;
  5201. var desc = Object.getOwnPropertyDescriptor(m, k);
  5202. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5203. desc = { enumerable: true, get: function() { return m[k]; } };
  5204. }
  5205. Object.defineProperty(o, k2, desc);
  5206. }) : (function(o, m, k, k2) {
  5207. if (k2 === undefined) k2 = k;
  5208. o[k2] = m[k];
  5209. }));
  5210. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5211. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5212. }) : function(o, v) {
  5213. o["default"] = v;
  5214. });
  5215. var __importStar = (this && this.__importStar) || function (mod) {
  5216. if (mod && mod.__esModule) return mod;
  5217. var result = {};
  5218. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5219. __setModuleDefault(result, mod);
  5220. return result;
  5221. };
  5222. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5223. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5224. return new (P || (P = Promise))(function (resolve, reject) {
  5225. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5226. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5227. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5228. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5229. });
  5230. };
  5231. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5232. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  5233. const http = __importStar(__nccwpck_require__(3685));
  5234. const https = __importStar(__nccwpck_require__(5687));
  5235. const pm = __importStar(__nccwpck_require__(9835));
  5236. const tunnel = __importStar(__nccwpck_require__(4294));
  5237. const undici_1 = __nccwpck_require__(1773);
  5238. var HttpCodes;
  5239. (function (HttpCodes) {
  5240. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  5241. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  5242. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  5243. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  5244. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  5245. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  5246. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  5247. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  5248. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  5249. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  5250. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  5251. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  5252. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  5253. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  5254. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5255. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5256. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5257. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5258. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5259. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5260. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5261. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5262. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5263. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5264. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5265. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5266. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5267. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5268. var Headers;
  5269. (function (Headers) {
  5270. Headers["Accept"] = "accept";
  5271. Headers["ContentType"] = "content-type";
  5272. })(Headers || (exports.Headers = Headers = {}));
  5273. var MediaTypes;
  5274. (function (MediaTypes) {
  5275. MediaTypes["ApplicationJson"] = "application/json";
  5276. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5277. /**
  5278. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5279. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5280. */
  5281. function getProxyUrl(serverUrl) {
  5282. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5283. return proxyUrl ? proxyUrl.href : '';
  5284. }
  5285. exports.getProxyUrl = getProxyUrl;
  5286. const HttpRedirectCodes = [
  5287. HttpCodes.MovedPermanently,
  5288. HttpCodes.ResourceMoved,
  5289. HttpCodes.SeeOther,
  5290. HttpCodes.TemporaryRedirect,
  5291. HttpCodes.PermanentRedirect
  5292. ];
  5293. const HttpResponseRetryCodes = [
  5294. HttpCodes.BadGateway,
  5295. HttpCodes.ServiceUnavailable,
  5296. HttpCodes.GatewayTimeout
  5297. ];
  5298. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5299. const ExponentialBackoffCeiling = 10;
  5300. const ExponentialBackoffTimeSlice = 5;
  5301. class HttpClientError extends Error {
  5302. constructor(message, statusCode) {
  5303. super(message);
  5304. this.name = 'HttpClientError';
  5305. this.statusCode = statusCode;
  5306. Object.setPrototypeOf(this, HttpClientError.prototype);
  5307. }
  5308. }
  5309. exports.HttpClientError = HttpClientError;
  5310. class HttpClientResponse {
  5311. constructor(message) {
  5312. this.message = message;
  5313. }
  5314. readBody() {
  5315. return __awaiter(this, void 0, void 0, function* () {
  5316. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5317. let output = Buffer.alloc(0);
  5318. this.message.on('data', (chunk) => {
  5319. output = Buffer.concat([output, chunk]);
  5320. });
  5321. this.message.on('end', () => {
  5322. resolve(output.toString());
  5323. });
  5324. }));
  5325. });
  5326. }
  5327. readBodyBuffer() {
  5328. return __awaiter(this, void 0, void 0, function* () {
  5329. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5330. const chunks = [];
  5331. this.message.on('data', (chunk) => {
  5332. chunks.push(chunk);
  5333. });
  5334. this.message.on('end', () => {
  5335. resolve(Buffer.concat(chunks));
  5336. });
  5337. }));
  5338. });
  5339. }
  5340. }
  5341. exports.HttpClientResponse = HttpClientResponse;
  5342. function isHttps(requestUrl) {
  5343. const parsedUrl = new URL(requestUrl);
  5344. return parsedUrl.protocol === 'https:';
  5345. }
  5346. exports.isHttps = isHttps;
  5347. class HttpClient {
  5348. constructor(userAgent, handlers, requestOptions) {
  5349. this._ignoreSslError = false;
  5350. this._allowRedirects = true;
  5351. this._allowRedirectDowngrade = false;
  5352. this._maxRedirects = 50;
  5353. this._allowRetries = false;
  5354. this._maxRetries = 1;
  5355. this._keepAlive = false;
  5356. this._disposed = false;
  5357. this.userAgent = userAgent;
  5358. this.handlers = handlers || [];
  5359. this.requestOptions = requestOptions;
  5360. if (requestOptions) {
  5361. if (requestOptions.ignoreSslError != null) {
  5362. this._ignoreSslError = requestOptions.ignoreSslError;
  5363. }
  5364. this._socketTimeout = requestOptions.socketTimeout;
  5365. if (requestOptions.allowRedirects != null) {
  5366. this._allowRedirects = requestOptions.allowRedirects;
  5367. }
  5368. if (requestOptions.allowRedirectDowngrade != null) {
  5369. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5370. }
  5371. if (requestOptions.maxRedirects != null) {
  5372. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5373. }
  5374. if (requestOptions.keepAlive != null) {
  5375. this._keepAlive = requestOptions.keepAlive;
  5376. }
  5377. if (requestOptions.allowRetries != null) {
  5378. this._allowRetries = requestOptions.allowRetries;
  5379. }
  5380. if (requestOptions.maxRetries != null) {
  5381. this._maxRetries = requestOptions.maxRetries;
  5382. }
  5383. }
  5384. }
  5385. options(requestUrl, additionalHeaders) {
  5386. return __awaiter(this, void 0, void 0, function* () {
  5387. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5388. });
  5389. }
  5390. get(requestUrl, additionalHeaders) {
  5391. return __awaiter(this, void 0, void 0, function* () {
  5392. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5393. });
  5394. }
  5395. del(requestUrl, additionalHeaders) {
  5396. return __awaiter(this, void 0, void 0, function* () {
  5397. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5398. });
  5399. }
  5400. post(requestUrl, data, additionalHeaders) {
  5401. return __awaiter(this, void 0, void 0, function* () {
  5402. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5403. });
  5404. }
  5405. patch(requestUrl, data, additionalHeaders) {
  5406. return __awaiter(this, void 0, void 0, function* () {
  5407. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5408. });
  5409. }
  5410. put(requestUrl, data, additionalHeaders) {
  5411. return __awaiter(this, void 0, void 0, function* () {
  5412. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5413. });
  5414. }
  5415. head(requestUrl, additionalHeaders) {
  5416. return __awaiter(this, void 0, void 0, function* () {
  5417. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5418. });
  5419. }
  5420. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5421. return __awaiter(this, void 0, void 0, function* () {
  5422. return this.request(verb, requestUrl, stream, additionalHeaders);
  5423. });
  5424. }
  5425. /**
  5426. * Gets a typed object from an endpoint
  5427. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5428. */
  5429. getJson(requestUrl, additionalHeaders = {}) {
  5430. return __awaiter(this, void 0, void 0, function* () {
  5431. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5432. const res = yield this.get(requestUrl, additionalHeaders);
  5433. return this._processResponse(res, this.requestOptions);
  5434. });
  5435. }
  5436. postJson(requestUrl, obj, additionalHeaders = {}) {
  5437. return __awaiter(this, void 0, void 0, function* () {
  5438. const data = JSON.stringify(obj, null, 2);
  5439. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5440. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5441. const res = yield this.post(requestUrl, data, additionalHeaders);
  5442. return this._processResponse(res, this.requestOptions);
  5443. });
  5444. }
  5445. putJson(requestUrl, obj, additionalHeaders = {}) {
  5446. return __awaiter(this, void 0, void 0, function* () {
  5447. const data = JSON.stringify(obj, null, 2);
  5448. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5449. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5450. const res = yield this.put(requestUrl, data, additionalHeaders);
  5451. return this._processResponse(res, this.requestOptions);
  5452. });
  5453. }
  5454. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5455. return __awaiter(this, void 0, void 0, function* () {
  5456. const data = JSON.stringify(obj, null, 2);
  5457. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5458. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5459. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5460. return this._processResponse(res, this.requestOptions);
  5461. });
  5462. }
  5463. /**
  5464. * Makes a raw http request.
  5465. * All other methods such as get, post, patch, and request ultimately call this.
  5466. * Prefer get, del, post and patch
  5467. */
  5468. request(verb, requestUrl, data, headers) {
  5469. return __awaiter(this, void 0, void 0, function* () {
  5470. if (this._disposed) {
  5471. throw new Error('Client has already been disposed.');
  5472. }
  5473. const parsedUrl = new URL(requestUrl);
  5474. let info = this._prepareRequest(verb, parsedUrl, headers);
  5475. // Only perform retries on reads since writes may not be idempotent.
  5476. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5477. ? this._maxRetries + 1
  5478. : 1;
  5479. let numTries = 0;
  5480. let response;
  5481. do {
  5482. response = yield this.requestRaw(info, data);
  5483. // Check if it's an authentication challenge
  5484. if (response &&
  5485. response.message &&
  5486. response.message.statusCode === HttpCodes.Unauthorized) {
  5487. let authenticationHandler;
  5488. for (const handler of this.handlers) {
  5489. if (handler.canHandleAuthentication(response)) {
  5490. authenticationHandler = handler;
  5491. break;
  5492. }
  5493. }
  5494. if (authenticationHandler) {
  5495. return authenticationHandler.handleAuthentication(this, info, data);
  5496. }
  5497. else {
  5498. // We have received an unauthorized response but have no handlers to handle it.
  5499. // Let the response return to the caller.
  5500. return response;
  5501. }
  5502. }
  5503. let redirectsRemaining = this._maxRedirects;
  5504. while (response.message.statusCode &&
  5505. HttpRedirectCodes.includes(response.message.statusCode) &&
  5506. this._allowRedirects &&
  5507. redirectsRemaining > 0) {
  5508. const redirectUrl = response.message.headers['location'];
  5509. if (!redirectUrl) {
  5510. // if there's no location to redirect to, we won't
  5511. break;
  5512. }
  5513. const parsedRedirectUrl = new URL(redirectUrl);
  5514. if (parsedUrl.protocol === 'https:' &&
  5515. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5516. !this._allowRedirectDowngrade) {
  5517. 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.');
  5518. }
  5519. // we need to finish reading the response before reassigning response
  5520. // which will leak the open socket.
  5521. yield response.readBody();
  5522. // strip authorization header if redirected to a different hostname
  5523. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5524. for (const header in headers) {
  5525. // header names are case insensitive
  5526. if (header.toLowerCase() === 'authorization') {
  5527. delete headers[header];
  5528. }
  5529. }
  5530. }
  5531. // let's make the request with the new redirectUrl
  5532. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5533. response = yield this.requestRaw(info, data);
  5534. redirectsRemaining--;
  5535. }
  5536. if (!response.message.statusCode ||
  5537. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5538. // If not a retry code, return immediately instead of retrying
  5539. return response;
  5540. }
  5541. numTries += 1;
  5542. if (numTries < maxTries) {
  5543. yield response.readBody();
  5544. yield this._performExponentialBackoff(numTries);
  5545. }
  5546. } while (numTries < maxTries);
  5547. return response;
  5548. });
  5549. }
  5550. /**
  5551. * Needs to be called if keepAlive is set to true in request options.
  5552. */
  5553. dispose() {
  5554. if (this._agent) {
  5555. this._agent.destroy();
  5556. }
  5557. this._disposed = true;
  5558. }
  5559. /**
  5560. * Raw request.
  5561. * @param info
  5562. * @param data
  5563. */
  5564. requestRaw(info, data) {
  5565. return __awaiter(this, void 0, void 0, function* () {
  5566. return new Promise((resolve, reject) => {
  5567. function callbackForResult(err, res) {
  5568. if (err) {
  5569. reject(err);
  5570. }
  5571. else if (!res) {
  5572. // If `err` is not passed, then `res` must be passed.
  5573. reject(new Error('Unknown error'));
  5574. }
  5575. else {
  5576. resolve(res);
  5577. }
  5578. }
  5579. this.requestRawWithCallback(info, data, callbackForResult);
  5580. });
  5581. });
  5582. }
  5583. /**
  5584. * Raw request with callback.
  5585. * @param info
  5586. * @param data
  5587. * @param onResult
  5588. */
  5589. requestRawWithCallback(info, data, onResult) {
  5590. if (typeof data === 'string') {
  5591. if (!info.options.headers) {
  5592. info.options.headers = {};
  5593. }
  5594. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5595. }
  5596. let callbackCalled = false;
  5597. function handleResult(err, res) {
  5598. if (!callbackCalled) {
  5599. callbackCalled = true;
  5600. onResult(err, res);
  5601. }
  5602. }
  5603. const req = info.httpModule.request(info.options, (msg) => {
  5604. const res = new HttpClientResponse(msg);
  5605. handleResult(undefined, res);
  5606. });
  5607. let socket;
  5608. req.on('socket', sock => {
  5609. socket = sock;
  5610. });
  5611. // If we ever get disconnected, we want the socket to timeout eventually
  5612. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5613. if (socket) {
  5614. socket.end();
  5615. }
  5616. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5617. });
  5618. req.on('error', function (err) {
  5619. // err has statusCode property
  5620. // res should have headers
  5621. handleResult(err);
  5622. });
  5623. if (data && typeof data === 'string') {
  5624. req.write(data, 'utf8');
  5625. }
  5626. if (data && typeof data !== 'string') {
  5627. data.on('close', function () {
  5628. req.end();
  5629. });
  5630. data.pipe(req);
  5631. }
  5632. else {
  5633. req.end();
  5634. }
  5635. }
  5636. /**
  5637. * Gets an http agent. This function is useful when you need an http agent that handles
  5638. * routing through a proxy server - depending upon the url and proxy environment variables.
  5639. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5640. */
  5641. getAgent(serverUrl) {
  5642. const parsedUrl = new URL(serverUrl);
  5643. return this._getAgent(parsedUrl);
  5644. }
  5645. getAgentDispatcher(serverUrl) {
  5646. const parsedUrl = new URL(serverUrl);
  5647. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5648. const useProxy = proxyUrl && proxyUrl.hostname;
  5649. if (!useProxy) {
  5650. return;
  5651. }
  5652. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5653. }
  5654. _prepareRequest(method, requestUrl, headers) {
  5655. const info = {};
  5656. info.parsedUrl = requestUrl;
  5657. const usingSsl = info.parsedUrl.protocol === 'https:';
  5658. info.httpModule = usingSsl ? https : http;
  5659. const defaultPort = usingSsl ? 443 : 80;
  5660. info.options = {};
  5661. info.options.host = info.parsedUrl.hostname;
  5662. info.options.port = info.parsedUrl.port
  5663. ? parseInt(info.parsedUrl.port)
  5664. : defaultPort;
  5665. info.options.path =
  5666. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5667. info.options.method = method;
  5668. info.options.headers = this._mergeHeaders(headers);
  5669. if (this.userAgent != null) {
  5670. info.options.headers['user-agent'] = this.userAgent;
  5671. }
  5672. info.options.agent = this._getAgent(info.parsedUrl);
  5673. // gives handlers an opportunity to participate
  5674. if (this.handlers) {
  5675. for (const handler of this.handlers) {
  5676. handler.prepareRequest(info.options);
  5677. }
  5678. }
  5679. return info;
  5680. }
  5681. _mergeHeaders(headers) {
  5682. if (this.requestOptions && this.requestOptions.headers) {
  5683. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5684. }
  5685. return lowercaseKeys(headers || {});
  5686. }
  5687. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5688. let clientHeader;
  5689. if (this.requestOptions && this.requestOptions.headers) {
  5690. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5691. }
  5692. return additionalHeaders[header] || clientHeader || _default;
  5693. }
  5694. _getAgent(parsedUrl) {
  5695. let agent;
  5696. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5697. const useProxy = proxyUrl && proxyUrl.hostname;
  5698. if (this._keepAlive && useProxy) {
  5699. agent = this._proxyAgent;
  5700. }
  5701. if (!useProxy) {
  5702. agent = this._agent;
  5703. }
  5704. // if agent is already assigned use that agent.
  5705. if (agent) {
  5706. return agent;
  5707. }
  5708. const usingSsl = parsedUrl.protocol === 'https:';
  5709. let maxSockets = 100;
  5710. if (this.requestOptions) {
  5711. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5712. }
  5713. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5714. if (proxyUrl && proxyUrl.hostname) {
  5715. const agentOptions = {
  5716. maxSockets,
  5717. keepAlive: this._keepAlive,
  5718. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5719. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5720. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5721. };
  5722. let tunnelAgent;
  5723. const overHttps = proxyUrl.protocol === 'https:';
  5724. if (usingSsl) {
  5725. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5726. }
  5727. else {
  5728. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5729. }
  5730. agent = tunnelAgent(agentOptions);
  5731. this._proxyAgent = agent;
  5732. }
  5733. // if tunneling agent isn't assigned create a new agent
  5734. if (!agent) {
  5735. const options = { keepAlive: this._keepAlive, maxSockets };
  5736. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5737. this._agent = agent;
  5738. }
  5739. if (usingSsl && this._ignoreSslError) {
  5740. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5741. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5742. // we have to cast it to any and change it directly
  5743. agent.options = Object.assign(agent.options || {}, {
  5744. rejectUnauthorized: false
  5745. });
  5746. }
  5747. return agent;
  5748. }
  5749. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5750. let proxyAgent;
  5751. if (this._keepAlive) {
  5752. proxyAgent = this._proxyAgentDispatcher;
  5753. }
  5754. // if agent is already assigned use that agent.
  5755. if (proxyAgent) {
  5756. return proxyAgent;
  5757. }
  5758. const usingSsl = parsedUrl.protocol === 'https:';
  5759. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5760. token: `${proxyUrl.username}:${proxyUrl.password}`
  5761. })));
  5762. this._proxyAgentDispatcher = proxyAgent;
  5763. if (usingSsl && this._ignoreSslError) {
  5764. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5765. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5766. // we have to cast it to any and change it directly
  5767. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5768. rejectUnauthorized: false
  5769. });
  5770. }
  5771. return proxyAgent;
  5772. }
  5773. _performExponentialBackoff(retryNumber) {
  5774. return __awaiter(this, void 0, void 0, function* () {
  5775. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5776. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5777. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5778. });
  5779. }
  5780. _processResponse(res, options) {
  5781. return __awaiter(this, void 0, void 0, function* () {
  5782. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5783. const statusCode = res.message.statusCode || 0;
  5784. const response = {
  5785. statusCode,
  5786. result: null,
  5787. headers: {}
  5788. };
  5789. // not found leads to null obj returned
  5790. if (statusCode === HttpCodes.NotFound) {
  5791. resolve(response);
  5792. }
  5793. // get the result from the body
  5794. function dateTimeDeserializer(key, value) {
  5795. if (typeof value === 'string') {
  5796. const a = new Date(value);
  5797. if (!isNaN(a.valueOf())) {
  5798. return a;
  5799. }
  5800. }
  5801. return value;
  5802. }
  5803. let obj;
  5804. let contents;
  5805. try {
  5806. contents = yield res.readBody();
  5807. if (contents && contents.length > 0) {
  5808. if (options && options.deserializeDates) {
  5809. obj = JSON.parse(contents, dateTimeDeserializer);
  5810. }
  5811. else {
  5812. obj = JSON.parse(contents);
  5813. }
  5814. response.result = obj;
  5815. }
  5816. response.headers = res.message.headers;
  5817. }
  5818. catch (err) {
  5819. // Invalid resource (contents not json); leaving result obj null
  5820. }
  5821. // note that 3xx redirects are handled by the http layer.
  5822. if (statusCode > 299) {
  5823. let msg;
  5824. // if exception/error in body, attempt to get better error
  5825. if (obj && obj.message) {
  5826. msg = obj.message;
  5827. }
  5828. else if (contents && contents.length > 0) {
  5829. // it may be the case that the exception is in the body message as string
  5830. msg = contents;
  5831. }
  5832. else {
  5833. msg = `Failed request: (${statusCode})`;
  5834. }
  5835. const err = new HttpClientError(msg, statusCode);
  5836. err.result = response.result;
  5837. reject(err);
  5838. }
  5839. else {
  5840. resolve(response);
  5841. }
  5842. }));
  5843. });
  5844. }
  5845. }
  5846. exports.HttpClient = HttpClient;
  5847. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5848. //# sourceMappingURL=index.js.map
  5849. /***/ }),
  5850. /***/ 9835:
  5851. /***/ ((__unused_webpack_module, exports) => {
  5852. "use strict";
  5853. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5854. exports.checkBypass = exports.getProxyUrl = void 0;
  5855. function getProxyUrl(reqUrl) {
  5856. const usingSsl = reqUrl.protocol === 'https:';
  5857. if (checkBypass(reqUrl)) {
  5858. return undefined;
  5859. }
  5860. const proxyVar = (() => {
  5861. if (usingSsl) {
  5862. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5863. }
  5864. else {
  5865. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5866. }
  5867. })();
  5868. if (proxyVar) {
  5869. try {
  5870. return new URL(proxyVar);
  5871. }
  5872. catch (_a) {
  5873. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5874. return new URL(`http://${proxyVar}`);
  5875. }
  5876. }
  5877. else {
  5878. return undefined;
  5879. }
  5880. }
  5881. exports.getProxyUrl = getProxyUrl;
  5882. function checkBypass(reqUrl) {
  5883. if (!reqUrl.hostname) {
  5884. return false;
  5885. }
  5886. const reqHost = reqUrl.hostname;
  5887. if (isLoopbackAddress(reqHost)) {
  5888. return true;
  5889. }
  5890. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5891. if (!noProxy) {
  5892. return false;
  5893. }
  5894. // Determine the request port
  5895. let reqPort;
  5896. if (reqUrl.port) {
  5897. reqPort = Number(reqUrl.port);
  5898. }
  5899. else if (reqUrl.protocol === 'http:') {
  5900. reqPort = 80;
  5901. }
  5902. else if (reqUrl.protocol === 'https:') {
  5903. reqPort = 443;
  5904. }
  5905. // Format the request hostname and hostname with port
  5906. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5907. if (typeof reqPort === 'number') {
  5908. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5909. }
  5910. // Compare request host against noproxy
  5911. for (const upperNoProxyItem of noProxy
  5912. .split(',')
  5913. .map(x => x.trim().toUpperCase())
  5914. .filter(x => x)) {
  5915. if (upperNoProxyItem === '*' ||
  5916. upperReqHosts.some(x => x === upperNoProxyItem ||
  5917. x.endsWith(`.${upperNoProxyItem}`) ||
  5918. (upperNoProxyItem.startsWith('.') &&
  5919. x.endsWith(`${upperNoProxyItem}`)))) {
  5920. return true;
  5921. }
  5922. }
  5923. return false;
  5924. }
  5925. exports.checkBypass = checkBypass;
  5926. function isLoopbackAddress(host) {
  5927. const hostLower = host.toLowerCase();
  5928. return (hostLower === 'localhost' ||
  5929. hostLower.startsWith('127.') ||
  5930. hostLower.startsWith('[::1]') ||
  5931. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5932. }
  5933. //# sourceMappingURL=proxy.js.map
  5934. /***/ }),
  5935. /***/ 1962:
  5936. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5937. "use strict";
  5938. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5939. if (k2 === undefined) k2 = k;
  5940. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5941. }) : (function(o, m, k, k2) {
  5942. if (k2 === undefined) k2 = k;
  5943. o[k2] = m[k];
  5944. }));
  5945. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5946. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5947. }) : function(o, v) {
  5948. o["default"] = v;
  5949. });
  5950. var __importStar = (this && this.__importStar) || function (mod) {
  5951. if (mod && mod.__esModule) return mod;
  5952. var result = {};
  5953. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5954. __setModuleDefault(result, mod);
  5955. return result;
  5956. };
  5957. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5958. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5959. return new (P || (P = Promise))(function (resolve, reject) {
  5960. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5961. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5962. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5963. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5964. });
  5965. };
  5966. var _a;
  5967. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5968. 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;
  5969. const fs = __importStar(__nccwpck_require__(7147));
  5970. const path = __importStar(__nccwpck_require__(1017));
  5971. _a = fs.promises
  5972. // export const {open} = 'fs'
  5973. , 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;
  5974. // export const {open} = 'fs'
  5975. exports.IS_WINDOWS = process.platform === 'win32';
  5976. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5977. exports.UV_FS_O_EXLOCK = 0x10000000;
  5978. exports.READONLY = fs.constants.O_RDONLY;
  5979. function exists(fsPath) {
  5980. return __awaiter(this, void 0, void 0, function* () {
  5981. try {
  5982. yield exports.stat(fsPath);
  5983. }
  5984. catch (err) {
  5985. if (err.code === 'ENOENT') {
  5986. return false;
  5987. }
  5988. throw err;
  5989. }
  5990. return true;
  5991. });
  5992. }
  5993. exports.exists = exists;
  5994. function isDirectory(fsPath, useStat = false) {
  5995. return __awaiter(this, void 0, void 0, function* () {
  5996. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  5997. return stats.isDirectory();
  5998. });
  5999. }
  6000. exports.isDirectory = isDirectory;
  6001. /**
  6002. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  6003. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  6004. */
  6005. function isRooted(p) {
  6006. p = normalizeSeparators(p);
  6007. if (!p) {
  6008. throw new Error('isRooted() parameter "p" cannot be empty');
  6009. }
  6010. if (exports.IS_WINDOWS) {
  6011. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  6012. ); // e.g. C: or C:\hello
  6013. }
  6014. return p.startsWith('/');
  6015. }
  6016. exports.isRooted = isRooted;
  6017. /**
  6018. * Best effort attempt to determine whether a file exists and is executable.
  6019. * @param filePath file path to check
  6020. * @param extensions additional file extensions to try
  6021. * @return if file exists and is executable, returns the file path. otherwise empty string.
  6022. */
  6023. function tryGetExecutablePath(filePath, extensions) {
  6024. return __awaiter(this, void 0, void 0, function* () {
  6025. let stats = undefined;
  6026. try {
  6027. // test file exists
  6028. stats = yield exports.stat(filePath);
  6029. }
  6030. catch (err) {
  6031. if (err.code !== 'ENOENT') {
  6032. // eslint-disable-next-line no-console
  6033. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6034. }
  6035. }
  6036. if (stats && stats.isFile()) {
  6037. if (exports.IS_WINDOWS) {
  6038. // on Windows, test for valid extension
  6039. const upperExt = path.extname(filePath).toUpperCase();
  6040. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  6041. return filePath;
  6042. }
  6043. }
  6044. else {
  6045. if (isUnixExecutable(stats)) {
  6046. return filePath;
  6047. }
  6048. }
  6049. }
  6050. // try each extension
  6051. const originalFilePath = filePath;
  6052. for (const extension of extensions) {
  6053. filePath = originalFilePath + extension;
  6054. stats = undefined;
  6055. try {
  6056. stats = yield exports.stat(filePath);
  6057. }
  6058. catch (err) {
  6059. if (err.code !== 'ENOENT') {
  6060. // eslint-disable-next-line no-console
  6061. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6062. }
  6063. }
  6064. if (stats && stats.isFile()) {
  6065. if (exports.IS_WINDOWS) {
  6066. // preserve the case of the actual file (since an extension was appended)
  6067. try {
  6068. const directory = path.dirname(filePath);
  6069. const upperName = path.basename(filePath).toUpperCase();
  6070. for (const actualName of yield exports.readdir(directory)) {
  6071. if (upperName === actualName.toUpperCase()) {
  6072. filePath = path.join(directory, actualName);
  6073. break;
  6074. }
  6075. }
  6076. }
  6077. catch (err) {
  6078. // eslint-disable-next-line no-console
  6079. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  6080. }
  6081. return filePath;
  6082. }
  6083. else {
  6084. if (isUnixExecutable(stats)) {
  6085. return filePath;
  6086. }
  6087. }
  6088. }
  6089. }
  6090. return '';
  6091. });
  6092. }
  6093. exports.tryGetExecutablePath = tryGetExecutablePath;
  6094. function normalizeSeparators(p) {
  6095. p = p || '';
  6096. if (exports.IS_WINDOWS) {
  6097. // convert slashes on Windows
  6098. p = p.replace(/\//g, '\\');
  6099. // remove redundant slashes
  6100. return p.replace(/\\\\+/g, '\\');
  6101. }
  6102. // remove redundant slashes
  6103. return p.replace(/\/\/+/g, '/');
  6104. }
  6105. // on Mac/Linux, test the execute bit
  6106. // R W X R W X R W X
  6107. // 256 128 64 32 16 8 4 2 1
  6108. function isUnixExecutable(stats) {
  6109. return ((stats.mode & 1) > 0 ||
  6110. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  6111. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  6112. }
  6113. // Get the path of cmd.exe in windows
  6114. function getCmdPath() {
  6115. var _a;
  6116. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  6117. }
  6118. exports.getCmdPath = getCmdPath;
  6119. //# sourceMappingURL=io-util.js.map
  6120. /***/ }),
  6121. /***/ 7436:
  6122. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6123. "use strict";
  6124. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6125. if (k2 === undefined) k2 = k;
  6126. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6127. }) : (function(o, m, k, k2) {
  6128. if (k2 === undefined) k2 = k;
  6129. o[k2] = m[k];
  6130. }));
  6131. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6132. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6133. }) : function(o, v) {
  6134. o["default"] = v;
  6135. });
  6136. var __importStar = (this && this.__importStar) || function (mod) {
  6137. if (mod && mod.__esModule) return mod;
  6138. var result = {};
  6139. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6140. __setModuleDefault(result, mod);
  6141. return result;
  6142. };
  6143. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6144. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6145. return new (P || (P = Promise))(function (resolve, reject) {
  6146. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6147. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6148. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6149. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6150. });
  6151. };
  6152. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6153. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  6154. const assert_1 = __nccwpck_require__(9491);
  6155. const path = __importStar(__nccwpck_require__(1017));
  6156. const ioUtil = __importStar(__nccwpck_require__(1962));
  6157. /**
  6158. * Copies a file or folder.
  6159. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  6160. *
  6161. * @param source source path
  6162. * @param dest destination path
  6163. * @param options optional. See CopyOptions.
  6164. */
  6165. function cp(source, dest, options = {}) {
  6166. return __awaiter(this, void 0, void 0, function* () {
  6167. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  6168. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  6169. // Dest is an existing file, but not forcing
  6170. if (destStat && destStat.isFile() && !force) {
  6171. return;
  6172. }
  6173. // If dest is an existing directory, should copy inside.
  6174. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  6175. ? path.join(dest, path.basename(source))
  6176. : dest;
  6177. if (!(yield ioUtil.exists(source))) {
  6178. throw new Error(`no such file or directory: ${source}`);
  6179. }
  6180. const sourceStat = yield ioUtil.stat(source);
  6181. if (sourceStat.isDirectory()) {
  6182. if (!recursive) {
  6183. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  6184. }
  6185. else {
  6186. yield cpDirRecursive(source, newDest, 0, force);
  6187. }
  6188. }
  6189. else {
  6190. if (path.relative(source, newDest) === '') {
  6191. // a file cannot be copied to itself
  6192. throw new Error(`'${newDest}' and '${source}' are the same file`);
  6193. }
  6194. yield copyFile(source, newDest, force);
  6195. }
  6196. });
  6197. }
  6198. exports.cp = cp;
  6199. /**
  6200. * Moves a path.
  6201. *
  6202. * @param source source path
  6203. * @param dest destination path
  6204. * @param options optional. See MoveOptions.
  6205. */
  6206. function mv(source, dest, options = {}) {
  6207. return __awaiter(this, void 0, void 0, function* () {
  6208. if (yield ioUtil.exists(dest)) {
  6209. let destExists = true;
  6210. if (yield ioUtil.isDirectory(dest)) {
  6211. // If dest is directory copy src into dest
  6212. dest = path.join(dest, path.basename(source));
  6213. destExists = yield ioUtil.exists(dest);
  6214. }
  6215. if (destExists) {
  6216. if (options.force == null || options.force) {
  6217. yield rmRF(dest);
  6218. }
  6219. else {
  6220. throw new Error('Destination already exists');
  6221. }
  6222. }
  6223. }
  6224. yield mkdirP(path.dirname(dest));
  6225. yield ioUtil.rename(source, dest);
  6226. });
  6227. }
  6228. exports.mv = mv;
  6229. /**
  6230. * Remove a path recursively with force
  6231. *
  6232. * @param inputPath path to remove
  6233. */
  6234. function rmRF(inputPath) {
  6235. return __awaiter(this, void 0, void 0, function* () {
  6236. if (ioUtil.IS_WINDOWS) {
  6237. // Check for invalid characters
  6238. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  6239. if (/[*"<>|]/.test(inputPath)) {
  6240. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  6241. }
  6242. }
  6243. try {
  6244. // note if path does not exist, error is silent
  6245. yield ioUtil.rm(inputPath, {
  6246. force: true,
  6247. maxRetries: 3,
  6248. recursive: true,
  6249. retryDelay: 300
  6250. });
  6251. }
  6252. catch (err) {
  6253. throw new Error(`File was unable to be removed ${err}`);
  6254. }
  6255. });
  6256. }
  6257. exports.rmRF = rmRF;
  6258. /**
  6259. * Make a directory. Creates the full path with folders in between
  6260. * Will throw if it fails
  6261. *
  6262. * @param fsPath path to create
  6263. * @returns Promise<void>
  6264. */
  6265. function mkdirP(fsPath) {
  6266. return __awaiter(this, void 0, void 0, function* () {
  6267. assert_1.ok(fsPath, 'a path argument must be provided');
  6268. yield ioUtil.mkdir(fsPath, { recursive: true });
  6269. });
  6270. }
  6271. exports.mkdirP = mkdirP;
  6272. /**
  6273. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6274. * If you check and the tool does not exist, it will throw.
  6275. *
  6276. * @param tool name of the tool
  6277. * @param check whether to check if tool exists
  6278. * @returns Promise<string> path to tool
  6279. */
  6280. function which(tool, check) {
  6281. return __awaiter(this, void 0, void 0, function* () {
  6282. if (!tool) {
  6283. throw new Error("parameter 'tool' is required");
  6284. }
  6285. // recursive when check=true
  6286. if (check) {
  6287. const result = yield which(tool, false);
  6288. if (!result) {
  6289. if (ioUtil.IS_WINDOWS) {
  6290. 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.`);
  6291. }
  6292. else {
  6293. 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.`);
  6294. }
  6295. }
  6296. return result;
  6297. }
  6298. const matches = yield findInPath(tool);
  6299. if (matches && matches.length > 0) {
  6300. return matches[0];
  6301. }
  6302. return '';
  6303. });
  6304. }
  6305. exports.which = which;
  6306. /**
  6307. * Returns a list of all occurrences of the given tool on the system path.
  6308. *
  6309. * @returns Promise<string[]> the paths of the tool
  6310. */
  6311. function findInPath(tool) {
  6312. return __awaiter(this, void 0, void 0, function* () {
  6313. if (!tool) {
  6314. throw new Error("parameter 'tool' is required");
  6315. }
  6316. // build the list of extensions to try
  6317. const extensions = [];
  6318. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6319. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6320. if (extension) {
  6321. extensions.push(extension);
  6322. }
  6323. }
  6324. }
  6325. // if it's rooted, return it if exists. otherwise return empty.
  6326. if (ioUtil.isRooted(tool)) {
  6327. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6328. if (filePath) {
  6329. return [filePath];
  6330. }
  6331. return [];
  6332. }
  6333. // if any path separators, return empty
  6334. if (tool.includes(path.sep)) {
  6335. return [];
  6336. }
  6337. // build the list of directories
  6338. //
  6339. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6340. // it feels like we should not do this. Checking the current directory seems like more of a use
  6341. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6342. // across platforms.
  6343. const directories = [];
  6344. if (process.env.PATH) {
  6345. for (const p of process.env.PATH.split(path.delimiter)) {
  6346. if (p) {
  6347. directories.push(p);
  6348. }
  6349. }
  6350. }
  6351. // find all matches
  6352. const matches = [];
  6353. for (const directory of directories) {
  6354. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6355. if (filePath) {
  6356. matches.push(filePath);
  6357. }
  6358. }
  6359. return matches;
  6360. });
  6361. }
  6362. exports.findInPath = findInPath;
  6363. function readCopyOptions(options) {
  6364. const force = options.force == null ? true : options.force;
  6365. const recursive = Boolean(options.recursive);
  6366. const copySourceDirectory = options.copySourceDirectory == null
  6367. ? true
  6368. : Boolean(options.copySourceDirectory);
  6369. return { force, recursive, copySourceDirectory };
  6370. }
  6371. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6372. return __awaiter(this, void 0, void 0, function* () {
  6373. // Ensure there is not a run away recursive copy
  6374. if (currentDepth >= 255)
  6375. return;
  6376. currentDepth++;
  6377. yield mkdirP(destDir);
  6378. const files = yield ioUtil.readdir(sourceDir);
  6379. for (const fileName of files) {
  6380. const srcFile = `${sourceDir}/${fileName}`;
  6381. const destFile = `${destDir}/${fileName}`;
  6382. const srcFileStat = yield ioUtil.lstat(srcFile);
  6383. if (srcFileStat.isDirectory()) {
  6384. // Recurse
  6385. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6386. }
  6387. else {
  6388. yield copyFile(srcFile, destFile, force);
  6389. }
  6390. }
  6391. // Change the mode for the newly created directory
  6392. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6393. });
  6394. }
  6395. // Buffered file copy
  6396. function copyFile(srcFile, destFile, force) {
  6397. return __awaiter(this, void 0, void 0, function* () {
  6398. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6399. // unlink/re-link it
  6400. try {
  6401. yield ioUtil.lstat(destFile);
  6402. yield ioUtil.unlink(destFile);
  6403. }
  6404. catch (e) {
  6405. // Try to override file permission
  6406. if (e.code === 'EPERM') {
  6407. yield ioUtil.chmod(destFile, '0666');
  6408. yield ioUtil.unlink(destFile);
  6409. }
  6410. // other errors = it doesn't exist, no work to do
  6411. }
  6412. // Copy over symlink
  6413. const symlinkFull = yield ioUtil.readlink(srcFile);
  6414. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6415. }
  6416. else if (!(yield ioUtil.exists(destFile)) || force) {
  6417. yield ioUtil.copyFile(srcFile, destFile);
  6418. }
  6419. });
  6420. }
  6421. //# sourceMappingURL=io.js.map
  6422. /***/ }),
  6423. /***/ 2473:
  6424. /***/ (function(module, exports, __nccwpck_require__) {
  6425. "use strict";
  6426. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6427. if (k2 === undefined) k2 = k;
  6428. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6429. }) : (function(o, m, k, k2) {
  6430. if (k2 === undefined) k2 = k;
  6431. o[k2] = m[k];
  6432. }));
  6433. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6434. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6435. }) : function(o, v) {
  6436. o["default"] = v;
  6437. });
  6438. var __importStar = (this && this.__importStar) || function (mod) {
  6439. if (mod && mod.__esModule) return mod;
  6440. var result = {};
  6441. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6442. __setModuleDefault(result, mod);
  6443. return result;
  6444. };
  6445. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6446. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6447. return new (P || (P = Promise))(function (resolve, reject) {
  6448. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6449. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6450. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6451. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6452. });
  6453. };
  6454. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6455. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6456. const semver = __importStar(__nccwpck_require__(5911));
  6457. const core_1 = __nccwpck_require__(2186);
  6458. // needs to be require for core node modules to be mocked
  6459. /* eslint @typescript-eslint/no-require-imports: 0 */
  6460. const os = __nccwpck_require__(2037);
  6461. const cp = __nccwpck_require__(2081);
  6462. const fs = __nccwpck_require__(7147);
  6463. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6464. return __awaiter(this, void 0, void 0, function* () {
  6465. const platFilter = os.platform();
  6466. let result;
  6467. let match;
  6468. let file;
  6469. for (const candidate of candidates) {
  6470. const version = candidate.version;
  6471. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6472. if (semver.satisfies(version, versionSpec) &&
  6473. (!stable || candidate.stable === stable)) {
  6474. file = candidate.files.find(item => {
  6475. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6476. let chk = item.arch === archFilter && item.platform === platFilter;
  6477. if (chk && item.platform_version) {
  6478. const osVersion = module.exports._getOsVersion();
  6479. if (osVersion === item.platform_version) {
  6480. chk = true;
  6481. }
  6482. else {
  6483. chk = semver.satisfies(osVersion, item.platform_version);
  6484. }
  6485. }
  6486. return chk;
  6487. });
  6488. if (file) {
  6489. core_1.debug(`matched ${candidate.version}`);
  6490. match = candidate;
  6491. break;
  6492. }
  6493. }
  6494. }
  6495. if (match && file) {
  6496. // clone since we're mutating the file list to be only the file that matches
  6497. result = Object.assign({}, match);
  6498. result.files = [file];
  6499. }
  6500. return result;
  6501. });
  6502. }
  6503. exports._findMatch = _findMatch;
  6504. function _getOsVersion() {
  6505. // TODO: add windows and other linux, arm variants
  6506. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6507. const plat = os.platform();
  6508. let version = '';
  6509. if (plat === 'darwin') {
  6510. version = cp.execSync('sw_vers -productVersion').toString();
  6511. }
  6512. else if (plat === 'linux') {
  6513. // lsb_release process not in some containers, readfile
  6514. // Run cat /etc/lsb-release
  6515. // DISTRIB_ID=Ubuntu
  6516. // DISTRIB_RELEASE=18.04
  6517. // DISTRIB_CODENAME=bionic
  6518. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6519. const lsbContents = module.exports._readLinuxVersionFile();
  6520. if (lsbContents) {
  6521. const lines = lsbContents.split('\n');
  6522. for (const line of lines) {
  6523. const parts = line.split('=');
  6524. if (parts.length === 2 &&
  6525. (parts[0].trim() === 'VERSION_ID' ||
  6526. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6527. version = parts[1]
  6528. .trim()
  6529. .replace(/^"/, '')
  6530. .replace(/"$/, '');
  6531. break;
  6532. }
  6533. }
  6534. }
  6535. }
  6536. return version;
  6537. }
  6538. exports._getOsVersion = _getOsVersion;
  6539. function _readLinuxVersionFile() {
  6540. const lsbReleaseFile = '/etc/lsb-release';
  6541. const osReleaseFile = '/etc/os-release';
  6542. let contents = '';
  6543. if (fs.existsSync(lsbReleaseFile)) {
  6544. contents = fs.readFileSync(lsbReleaseFile).toString();
  6545. }
  6546. else if (fs.existsSync(osReleaseFile)) {
  6547. contents = fs.readFileSync(osReleaseFile).toString();
  6548. }
  6549. return contents;
  6550. }
  6551. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6552. //# sourceMappingURL=manifest.js.map
  6553. /***/ }),
  6554. /***/ 8279:
  6555. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6556. "use strict";
  6557. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6558. if (k2 === undefined) k2 = k;
  6559. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6560. }) : (function(o, m, k, k2) {
  6561. if (k2 === undefined) k2 = k;
  6562. o[k2] = m[k];
  6563. }));
  6564. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6565. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6566. }) : function(o, v) {
  6567. o["default"] = v;
  6568. });
  6569. var __importStar = (this && this.__importStar) || function (mod) {
  6570. if (mod && mod.__esModule) return mod;
  6571. var result = {};
  6572. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6573. __setModuleDefault(result, mod);
  6574. return result;
  6575. };
  6576. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6577. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6578. return new (P || (P = Promise))(function (resolve, reject) {
  6579. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6580. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6581. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6582. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6583. });
  6584. };
  6585. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6586. exports.RetryHelper = void 0;
  6587. const core = __importStar(__nccwpck_require__(2186));
  6588. /**
  6589. * Internal class for retries
  6590. */
  6591. class RetryHelper {
  6592. constructor(maxAttempts, minSeconds, maxSeconds) {
  6593. if (maxAttempts < 1) {
  6594. throw new Error('max attempts should be greater than or equal to 1');
  6595. }
  6596. this.maxAttempts = maxAttempts;
  6597. this.minSeconds = Math.floor(minSeconds);
  6598. this.maxSeconds = Math.floor(maxSeconds);
  6599. if (this.minSeconds > this.maxSeconds) {
  6600. throw new Error('min seconds should be less than or equal to max seconds');
  6601. }
  6602. }
  6603. execute(action, isRetryable) {
  6604. return __awaiter(this, void 0, void 0, function* () {
  6605. let attempt = 1;
  6606. while (attempt < this.maxAttempts) {
  6607. // Try
  6608. try {
  6609. return yield action();
  6610. }
  6611. catch (err) {
  6612. if (isRetryable && !isRetryable(err)) {
  6613. throw err;
  6614. }
  6615. core.info(err.message);
  6616. }
  6617. // Sleep
  6618. const seconds = this.getSleepAmount();
  6619. core.info(`Waiting ${seconds} seconds before trying again`);
  6620. yield this.sleep(seconds);
  6621. attempt++;
  6622. }
  6623. // Last attempt
  6624. return yield action();
  6625. });
  6626. }
  6627. getSleepAmount() {
  6628. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6629. this.minSeconds);
  6630. }
  6631. sleep(seconds) {
  6632. return __awaiter(this, void 0, void 0, function* () {
  6633. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6634. });
  6635. }
  6636. }
  6637. exports.RetryHelper = RetryHelper;
  6638. //# sourceMappingURL=retry-helper.js.map
  6639. /***/ }),
  6640. /***/ 7784:
  6641. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6642. "use strict";
  6643. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6644. if (k2 === undefined) k2 = k;
  6645. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6646. }) : (function(o, m, k, k2) {
  6647. if (k2 === undefined) k2 = k;
  6648. o[k2] = m[k];
  6649. }));
  6650. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6651. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6652. }) : function(o, v) {
  6653. o["default"] = v;
  6654. });
  6655. var __importStar = (this && this.__importStar) || function (mod) {
  6656. if (mod && mod.__esModule) return mod;
  6657. var result = {};
  6658. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6659. __setModuleDefault(result, mod);
  6660. return result;
  6661. };
  6662. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6663. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6664. return new (P || (P = Promise))(function (resolve, reject) {
  6665. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6666. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6667. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6668. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6669. });
  6670. };
  6671. var __importDefault = (this && this.__importDefault) || function (mod) {
  6672. return (mod && mod.__esModule) ? mod : { "default": mod };
  6673. };
  6674. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6675. 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;
  6676. const core = __importStar(__nccwpck_require__(2186));
  6677. const io = __importStar(__nccwpck_require__(7436));
  6678. const fs = __importStar(__nccwpck_require__(7147));
  6679. const mm = __importStar(__nccwpck_require__(2473));
  6680. const os = __importStar(__nccwpck_require__(2037));
  6681. const path = __importStar(__nccwpck_require__(1017));
  6682. const httpm = __importStar(__nccwpck_require__(6255));
  6683. const semver = __importStar(__nccwpck_require__(5911));
  6684. const stream = __importStar(__nccwpck_require__(2781));
  6685. const util = __importStar(__nccwpck_require__(3837));
  6686. const assert_1 = __nccwpck_require__(9491);
  6687. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6688. const exec_1 = __nccwpck_require__(1514);
  6689. const retry_helper_1 = __nccwpck_require__(8279);
  6690. class HTTPError extends Error {
  6691. constructor(httpStatusCode) {
  6692. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6693. this.httpStatusCode = httpStatusCode;
  6694. Object.setPrototypeOf(this, new.target.prototype);
  6695. }
  6696. }
  6697. exports.HTTPError = HTTPError;
  6698. const IS_WINDOWS = process.platform === 'win32';
  6699. const IS_MAC = process.platform === 'darwin';
  6700. const userAgent = 'actions/tool-cache';
  6701. /**
  6702. * Download a tool from an url and stream it into a file
  6703. *
  6704. * @param url url of tool to download
  6705. * @param dest path to download tool
  6706. * @param auth authorization header
  6707. * @param headers other headers
  6708. * @returns path to downloaded tool
  6709. */
  6710. function downloadTool(url, dest, auth, headers) {
  6711. return __awaiter(this, void 0, void 0, function* () {
  6712. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6713. yield io.mkdirP(path.dirname(dest));
  6714. core.debug(`Downloading ${url}`);
  6715. core.debug(`Destination ${dest}`);
  6716. const maxAttempts = 3;
  6717. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6718. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6719. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6720. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6721. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6722. }), (err) => {
  6723. if (err instanceof HTTPError && err.httpStatusCode) {
  6724. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6725. if (err.httpStatusCode < 500 &&
  6726. err.httpStatusCode !== 408 &&
  6727. err.httpStatusCode !== 429) {
  6728. return false;
  6729. }
  6730. }
  6731. // Otherwise retry
  6732. return true;
  6733. });
  6734. });
  6735. }
  6736. exports.downloadTool = downloadTool;
  6737. function downloadToolAttempt(url, dest, auth, headers) {
  6738. return __awaiter(this, void 0, void 0, function* () {
  6739. if (fs.existsSync(dest)) {
  6740. throw new Error(`Destination file path ${dest} already exists`);
  6741. }
  6742. // Get the response headers
  6743. const http = new httpm.HttpClient(userAgent, [], {
  6744. allowRetries: false
  6745. });
  6746. if (auth) {
  6747. core.debug('set auth');
  6748. if (headers === undefined) {
  6749. headers = {};
  6750. }
  6751. headers.authorization = auth;
  6752. }
  6753. const response = yield http.get(url, headers);
  6754. if (response.message.statusCode !== 200) {
  6755. const err = new HTTPError(response.message.statusCode);
  6756. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6757. throw err;
  6758. }
  6759. // Download the response body
  6760. const pipeline = util.promisify(stream.pipeline);
  6761. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6762. const readStream = responseMessageFactory();
  6763. let succeeded = false;
  6764. try {
  6765. yield pipeline(readStream, fs.createWriteStream(dest));
  6766. core.debug('download complete');
  6767. succeeded = true;
  6768. return dest;
  6769. }
  6770. finally {
  6771. // Error, delete dest before retry
  6772. if (!succeeded) {
  6773. core.debug('download failed');
  6774. try {
  6775. yield io.rmRF(dest);
  6776. }
  6777. catch (err) {
  6778. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6779. }
  6780. }
  6781. }
  6782. });
  6783. }
  6784. /**
  6785. * Extract a .7z file
  6786. *
  6787. * @param file path to the .7z file
  6788. * @param dest destination directory. Optional.
  6789. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6790. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6791. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6792. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6793. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6794. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6795. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6796. * to 7zr.exe can be pass to this function.
  6797. * @returns path to the destination directory
  6798. */
  6799. function extract7z(file, dest, _7zPath) {
  6800. return __awaiter(this, void 0, void 0, function* () {
  6801. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6802. assert_1.ok(file, 'parameter "file" is required');
  6803. dest = yield _createExtractFolder(dest);
  6804. const originalCwd = process.cwd();
  6805. process.chdir(dest);
  6806. if (_7zPath) {
  6807. try {
  6808. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6809. const args = [
  6810. 'x',
  6811. logLevel,
  6812. '-bd',
  6813. '-sccUTF-8',
  6814. file
  6815. ];
  6816. const options = {
  6817. silent: true
  6818. };
  6819. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6820. }
  6821. finally {
  6822. process.chdir(originalCwd);
  6823. }
  6824. }
  6825. else {
  6826. const escapedScript = path
  6827. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6828. .replace(/'/g, "''")
  6829. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6830. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6831. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6832. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6833. const args = [
  6834. '-NoLogo',
  6835. '-Sta',
  6836. '-NoProfile',
  6837. '-NonInteractive',
  6838. '-ExecutionPolicy',
  6839. 'Unrestricted',
  6840. '-Command',
  6841. command
  6842. ];
  6843. const options = {
  6844. silent: true
  6845. };
  6846. try {
  6847. const powershellPath = yield io.which('powershell', true);
  6848. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6849. }
  6850. finally {
  6851. process.chdir(originalCwd);
  6852. }
  6853. }
  6854. return dest;
  6855. });
  6856. }
  6857. exports.extract7z = extract7z;
  6858. /**
  6859. * Extract a compressed tar archive
  6860. *
  6861. * @param file path to the tar
  6862. * @param dest destination directory. Optional.
  6863. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6864. * @returns path to the destination directory
  6865. */
  6866. function extractTar(file, dest, flags = 'xz') {
  6867. return __awaiter(this, void 0, void 0, function* () {
  6868. if (!file) {
  6869. throw new Error("parameter 'file' is required");
  6870. }
  6871. // Create dest
  6872. dest = yield _createExtractFolder(dest);
  6873. // Determine whether GNU tar
  6874. core.debug('Checking tar --version');
  6875. let versionOutput = '';
  6876. yield exec_1.exec('tar --version', [], {
  6877. ignoreReturnCode: true,
  6878. silent: true,
  6879. listeners: {
  6880. stdout: (data) => (versionOutput += data.toString()),
  6881. stderr: (data) => (versionOutput += data.toString())
  6882. }
  6883. });
  6884. core.debug(versionOutput.trim());
  6885. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6886. // Initialize args
  6887. let args;
  6888. if (flags instanceof Array) {
  6889. args = flags;
  6890. }
  6891. else {
  6892. args = [flags];
  6893. }
  6894. if (core.isDebug() && !flags.includes('v')) {
  6895. args.push('-v');
  6896. }
  6897. let destArg = dest;
  6898. let fileArg = file;
  6899. if (IS_WINDOWS && isGnuTar) {
  6900. args.push('--force-local');
  6901. destArg = dest.replace(/\\/g, '/');
  6902. // Technically only the dest needs to have `/` but for aesthetic consistency
  6903. // convert slashes in the file arg too.
  6904. fileArg = file.replace(/\\/g, '/');
  6905. }
  6906. if (isGnuTar) {
  6907. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6908. args.push('--warning=no-unknown-keyword');
  6909. args.push('--overwrite');
  6910. }
  6911. args.push('-C', destArg, '-f', fileArg);
  6912. yield exec_1.exec(`tar`, args);
  6913. return dest;
  6914. });
  6915. }
  6916. exports.extractTar = extractTar;
  6917. /**
  6918. * Extract a xar compatible archive
  6919. *
  6920. * @param file path to the archive
  6921. * @param dest destination directory. Optional.
  6922. * @param flags flags for the xar. Optional.
  6923. * @returns path to the destination directory
  6924. */
  6925. function extractXar(file, dest, flags = []) {
  6926. return __awaiter(this, void 0, void 0, function* () {
  6927. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6928. assert_1.ok(file, 'parameter "file" is required');
  6929. dest = yield _createExtractFolder(dest);
  6930. let args;
  6931. if (flags instanceof Array) {
  6932. args = flags;
  6933. }
  6934. else {
  6935. args = [flags];
  6936. }
  6937. args.push('-x', '-C', dest, '-f', file);
  6938. if (core.isDebug()) {
  6939. args.push('-v');
  6940. }
  6941. const xarPath = yield io.which('xar', true);
  6942. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6943. return dest;
  6944. });
  6945. }
  6946. exports.extractXar = extractXar;
  6947. /**
  6948. * Extract a zip
  6949. *
  6950. * @param file path to the zip
  6951. * @param dest destination directory. Optional.
  6952. * @returns path to the destination directory
  6953. */
  6954. function extractZip(file, dest) {
  6955. return __awaiter(this, void 0, void 0, function* () {
  6956. if (!file) {
  6957. throw new Error("parameter 'file' is required");
  6958. }
  6959. dest = yield _createExtractFolder(dest);
  6960. if (IS_WINDOWS) {
  6961. yield extractZipWin(file, dest);
  6962. }
  6963. else {
  6964. yield extractZipNix(file, dest);
  6965. }
  6966. return dest;
  6967. });
  6968. }
  6969. exports.extractZip = extractZip;
  6970. function extractZipWin(file, dest) {
  6971. return __awaiter(this, void 0, void 0, function* () {
  6972. // build the powershell command
  6973. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6974. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6975. const pwshPath = yield io.which('pwsh', false);
  6976. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6977. //and the -Force flag for Expand-Archive as a fallback
  6978. if (pwshPath) {
  6979. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6980. const pwshCommand = [
  6981. `$ErrorActionPreference = 'Stop' ;`,
  6982. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6983. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  6984. `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 $_ } } ;`
  6985. ].join(' ');
  6986. const args = [
  6987. '-NoLogo',
  6988. '-NoProfile',
  6989. '-NonInteractive',
  6990. '-ExecutionPolicy',
  6991. 'Unrestricted',
  6992. '-Command',
  6993. pwshCommand
  6994. ];
  6995. core.debug(`Using pwsh at path: ${pwshPath}`);
  6996. yield exec_1.exec(`"${pwshPath}"`, args);
  6997. }
  6998. else {
  6999. const powershellCommand = [
  7000. `$ErrorActionPreference = 'Stop' ;`,
  7001. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  7002. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  7003. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  7004. ].join(' ');
  7005. const args = [
  7006. '-NoLogo',
  7007. '-Sta',
  7008. '-NoProfile',
  7009. '-NonInteractive',
  7010. '-ExecutionPolicy',
  7011. 'Unrestricted',
  7012. '-Command',
  7013. powershellCommand
  7014. ];
  7015. const powershellPath = yield io.which('powershell', true);
  7016. core.debug(`Using powershell at path: ${powershellPath}`);
  7017. yield exec_1.exec(`"${powershellPath}"`, args);
  7018. }
  7019. });
  7020. }
  7021. function extractZipNix(file, dest) {
  7022. return __awaiter(this, void 0, void 0, function* () {
  7023. const unzipPath = yield io.which('unzip', true);
  7024. const args = [file];
  7025. if (!core.isDebug()) {
  7026. args.unshift('-q');
  7027. }
  7028. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  7029. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  7030. });
  7031. }
  7032. /**
  7033. * Caches a directory and installs it into the tool cacheDir
  7034. *
  7035. * @param sourceDir the directory to cache into tools
  7036. * @param tool tool name
  7037. * @param version version of the tool. semver format
  7038. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7039. */
  7040. function cacheDir(sourceDir, tool, version, arch) {
  7041. return __awaiter(this, void 0, void 0, function* () {
  7042. version = semver.clean(version) || version;
  7043. arch = arch || os.arch();
  7044. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7045. core.debug(`source dir: ${sourceDir}`);
  7046. if (!fs.statSync(sourceDir).isDirectory()) {
  7047. throw new Error('sourceDir is not a directory');
  7048. }
  7049. // Create the tool dir
  7050. const destPath = yield _createToolPath(tool, version, arch);
  7051. // copy each child item. do not move. move can fail on Windows
  7052. // due to anti-virus software having an open handle on a file.
  7053. for (const itemName of fs.readdirSync(sourceDir)) {
  7054. const s = path.join(sourceDir, itemName);
  7055. yield io.cp(s, destPath, { recursive: true });
  7056. }
  7057. // write .complete
  7058. _completeToolPath(tool, version, arch);
  7059. return destPath;
  7060. });
  7061. }
  7062. exports.cacheDir = cacheDir;
  7063. /**
  7064. * Caches a downloaded file (GUID) and installs it
  7065. * into the tool cache with a given targetName
  7066. *
  7067. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  7068. * @param targetFile the name of the file name in the tools directory
  7069. * @param tool tool name
  7070. * @param version version of the tool. semver format
  7071. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7072. */
  7073. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  7074. return __awaiter(this, void 0, void 0, function* () {
  7075. version = semver.clean(version) || version;
  7076. arch = arch || os.arch();
  7077. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7078. core.debug(`source file: ${sourceFile}`);
  7079. if (!fs.statSync(sourceFile).isFile()) {
  7080. throw new Error('sourceFile is not a file');
  7081. }
  7082. // create the tool dir
  7083. const destFolder = yield _createToolPath(tool, version, arch);
  7084. // copy instead of move. move can fail on Windows due to
  7085. // anti-virus software having an open handle on a file.
  7086. const destPath = path.join(destFolder, targetFile);
  7087. core.debug(`destination file ${destPath}`);
  7088. yield io.cp(sourceFile, destPath);
  7089. // write .complete
  7090. _completeToolPath(tool, version, arch);
  7091. return destFolder;
  7092. });
  7093. }
  7094. exports.cacheFile = cacheFile;
  7095. /**
  7096. * Finds the path to a tool version in the local installed tool cache
  7097. *
  7098. * @param toolName name of the tool
  7099. * @param versionSpec version of the tool
  7100. * @param arch optional arch. defaults to arch of computer
  7101. */
  7102. function find(toolName, versionSpec, arch) {
  7103. if (!toolName) {
  7104. throw new Error('toolName parameter is required');
  7105. }
  7106. if (!versionSpec) {
  7107. throw new Error('versionSpec parameter is required');
  7108. }
  7109. arch = arch || os.arch();
  7110. // attempt to resolve an explicit version
  7111. if (!isExplicitVersion(versionSpec)) {
  7112. const localVersions = findAllVersions(toolName, arch);
  7113. const match = evaluateVersions(localVersions, versionSpec);
  7114. versionSpec = match;
  7115. }
  7116. // check for the explicit version in the cache
  7117. let toolPath = '';
  7118. if (versionSpec) {
  7119. versionSpec = semver.clean(versionSpec) || '';
  7120. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  7121. core.debug(`checking cache: ${cachePath}`);
  7122. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  7123. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  7124. toolPath = cachePath;
  7125. }
  7126. else {
  7127. core.debug('not found');
  7128. }
  7129. }
  7130. return toolPath;
  7131. }
  7132. exports.find = find;
  7133. /**
  7134. * Finds the paths to all versions of a tool that are installed in the local tool cache
  7135. *
  7136. * @param toolName name of the tool
  7137. * @param arch optional arch. defaults to arch of computer
  7138. */
  7139. function findAllVersions(toolName, arch) {
  7140. const versions = [];
  7141. arch = arch || os.arch();
  7142. const toolPath = path.join(_getCacheDirectory(), toolName);
  7143. if (fs.existsSync(toolPath)) {
  7144. const children = fs.readdirSync(toolPath);
  7145. for (const child of children) {
  7146. if (isExplicitVersion(child)) {
  7147. const fullPath = path.join(toolPath, child, arch || '');
  7148. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  7149. versions.push(child);
  7150. }
  7151. }
  7152. }
  7153. }
  7154. return versions;
  7155. }
  7156. exports.findAllVersions = findAllVersions;
  7157. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  7158. return __awaiter(this, void 0, void 0, function* () {
  7159. let releases = [];
  7160. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  7161. const http = new httpm.HttpClient('tool-cache');
  7162. const headers = {};
  7163. if (auth) {
  7164. core.debug('set auth');
  7165. headers.authorization = auth;
  7166. }
  7167. const response = yield http.getJson(treeUrl, headers);
  7168. if (!response.result) {
  7169. return releases;
  7170. }
  7171. let manifestUrl = '';
  7172. for (const item of response.result.tree) {
  7173. if (item.path === 'versions-manifest.json') {
  7174. manifestUrl = item.url;
  7175. break;
  7176. }
  7177. }
  7178. headers['accept'] = 'application/vnd.github.VERSION.raw';
  7179. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  7180. if (versionsRaw) {
  7181. // shouldn't be needed but protects against invalid json saved with BOM
  7182. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  7183. try {
  7184. releases = JSON.parse(versionsRaw);
  7185. }
  7186. catch (_a) {
  7187. core.debug('Invalid json');
  7188. }
  7189. }
  7190. return releases;
  7191. });
  7192. }
  7193. exports.getManifestFromRepo = getManifestFromRepo;
  7194. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  7195. return __awaiter(this, void 0, void 0, function* () {
  7196. // wrap the internal impl
  7197. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  7198. return match;
  7199. });
  7200. }
  7201. exports.findFromManifest = findFromManifest;
  7202. function _createExtractFolder(dest) {
  7203. return __awaiter(this, void 0, void 0, function* () {
  7204. if (!dest) {
  7205. // create a temp dir
  7206. dest = path.join(_getTempDirectory(), v4_1.default());
  7207. }
  7208. yield io.mkdirP(dest);
  7209. return dest;
  7210. });
  7211. }
  7212. function _createToolPath(tool, version, arch) {
  7213. return __awaiter(this, void 0, void 0, function* () {
  7214. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7215. core.debug(`destination ${folderPath}`);
  7216. const markerPath = `${folderPath}.complete`;
  7217. yield io.rmRF(folderPath);
  7218. yield io.rmRF(markerPath);
  7219. yield io.mkdirP(folderPath);
  7220. return folderPath;
  7221. });
  7222. }
  7223. function _completeToolPath(tool, version, arch) {
  7224. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7225. const markerPath = `${folderPath}.complete`;
  7226. fs.writeFileSync(markerPath, '');
  7227. core.debug('finished caching tool');
  7228. }
  7229. /**
  7230. * Check if version string is explicit
  7231. *
  7232. * @param versionSpec version string to check
  7233. */
  7234. function isExplicitVersion(versionSpec) {
  7235. const c = semver.clean(versionSpec) || '';
  7236. core.debug(`isExplicit: ${c}`);
  7237. const valid = semver.valid(c) != null;
  7238. core.debug(`explicit? ${valid}`);
  7239. return valid;
  7240. }
  7241. exports.isExplicitVersion = isExplicitVersion;
  7242. /**
  7243. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  7244. *
  7245. * @param versions array of versions to evaluate
  7246. * @param versionSpec semantic version spec to satisfy
  7247. */
  7248. function evaluateVersions(versions, versionSpec) {
  7249. let version = '';
  7250. core.debug(`evaluating ${versions.length} versions`);
  7251. versions = versions.sort((a, b) => {
  7252. if (semver.gt(a, b)) {
  7253. return 1;
  7254. }
  7255. return -1;
  7256. });
  7257. for (let i = versions.length - 1; i >= 0; i--) {
  7258. const potential = versions[i];
  7259. const satisfied = semver.satisfies(potential, versionSpec);
  7260. if (satisfied) {
  7261. version = potential;
  7262. break;
  7263. }
  7264. }
  7265. if (version) {
  7266. core.debug(`matched: ${version}`);
  7267. }
  7268. else {
  7269. core.debug('match not found');
  7270. }
  7271. return version;
  7272. }
  7273. exports.evaluateVersions = evaluateVersions;
  7274. /**
  7275. * Gets RUNNER_TOOL_CACHE
  7276. */
  7277. function _getCacheDirectory() {
  7278. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7279. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7280. return cacheDirectory;
  7281. }
  7282. /**
  7283. * Gets RUNNER_TEMP
  7284. */
  7285. function _getTempDirectory() {
  7286. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7287. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7288. return tempDirectory;
  7289. }
  7290. /**
  7291. * Gets a global variable
  7292. */
  7293. function _getGlobal(key, defaultValue) {
  7294. /* eslint-disable @typescript-eslint/no-explicit-any */
  7295. const value = global[key];
  7296. /* eslint-enable @typescript-eslint/no-explicit-any */
  7297. return value !== undefined ? value : defaultValue;
  7298. }
  7299. /**
  7300. * Returns an array of unique values.
  7301. * @param values Values to make unique.
  7302. */
  7303. function _unique(values) {
  7304. return Array.from(new Set(values));
  7305. }
  7306. //# sourceMappingURL=tool-cache.js.map
  7307. /***/ }),
  7308. /***/ 7701:
  7309. /***/ ((module) => {
  7310. /**
  7311. * Convert array of 16 byte values to UUID string format of the form:
  7312. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7313. */
  7314. var byteToHex = [];
  7315. for (var i = 0; i < 256; ++i) {
  7316. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7317. }
  7318. function bytesToUuid(buf, offset) {
  7319. var i = offset || 0;
  7320. var bth = byteToHex;
  7321. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7322. return ([
  7323. bth[buf[i++]], bth[buf[i++]],
  7324. bth[buf[i++]], bth[buf[i++]], '-',
  7325. bth[buf[i++]], bth[buf[i++]], '-',
  7326. bth[buf[i++]], bth[buf[i++]], '-',
  7327. bth[buf[i++]], bth[buf[i++]], '-',
  7328. bth[buf[i++]], bth[buf[i++]],
  7329. bth[buf[i++]], bth[buf[i++]],
  7330. bth[buf[i++]], bth[buf[i++]]
  7331. ]).join('');
  7332. }
  7333. module.exports = bytesToUuid;
  7334. /***/ }),
  7335. /***/ 7269:
  7336. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7337. // Unique ID creation requires a high quality random # generator. In node.js
  7338. // this is pretty straight-forward - we use the crypto API.
  7339. var crypto = __nccwpck_require__(6113);
  7340. module.exports = function nodeRNG() {
  7341. return crypto.randomBytes(16);
  7342. };
  7343. /***/ }),
  7344. /***/ 7468:
  7345. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7346. var rng = __nccwpck_require__(7269);
  7347. var bytesToUuid = __nccwpck_require__(7701);
  7348. function v4(options, buf, offset) {
  7349. var i = buf && offset || 0;
  7350. if (typeof(options) == 'string') {
  7351. buf = options === 'binary' ? new Array(16) : null;
  7352. options = null;
  7353. }
  7354. options = options || {};
  7355. var rnds = options.random || (options.rng || rng)();
  7356. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7357. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7358. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7359. // Copy bytes to buffer, if provided
  7360. if (buf) {
  7361. for (var ii = 0; ii < 16; ++ii) {
  7362. buf[i + ii] = rnds[ii];
  7363. }
  7364. }
  7365. return buf || bytesToUuid(rnds);
  7366. }
  7367. module.exports = v4;
  7368. /***/ }),
  7369. /***/ 334:
  7370. /***/ ((module) => {
  7371. "use strict";
  7372. var __defProp = Object.defineProperty;
  7373. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7374. var __getOwnPropNames = Object.getOwnPropertyNames;
  7375. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7376. var __export = (target, all) => {
  7377. for (var name in all)
  7378. __defProp(target, name, { get: all[name], enumerable: true });
  7379. };
  7380. var __copyProps = (to, from, except, desc) => {
  7381. if (from && typeof from === "object" || typeof from === "function") {
  7382. for (let key of __getOwnPropNames(from))
  7383. if (!__hasOwnProp.call(to, key) && key !== except)
  7384. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7385. }
  7386. return to;
  7387. };
  7388. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7389. // pkg/dist-src/index.js
  7390. var dist_src_exports = {};
  7391. __export(dist_src_exports, {
  7392. createTokenAuth: () => createTokenAuth
  7393. });
  7394. module.exports = __toCommonJS(dist_src_exports);
  7395. // pkg/dist-src/auth.js
  7396. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7397. var REGEX_IS_INSTALLATION = /^ghs_/;
  7398. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7399. async function auth(token) {
  7400. const isApp = token.split(/\./).length === 3;
  7401. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7402. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7403. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7404. return {
  7405. type: "token",
  7406. token,
  7407. tokenType
  7408. };
  7409. }
  7410. // pkg/dist-src/with-authorization-prefix.js
  7411. function withAuthorizationPrefix(token) {
  7412. if (token.split(/\./).length === 3) {
  7413. return `bearer ${token}`;
  7414. }
  7415. return `token ${token}`;
  7416. }
  7417. // pkg/dist-src/hook.js
  7418. async function hook(token, request, route, parameters) {
  7419. const endpoint = request.endpoint.merge(
  7420. route,
  7421. parameters
  7422. );
  7423. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7424. return request(endpoint);
  7425. }
  7426. // pkg/dist-src/index.js
  7427. var createTokenAuth = function createTokenAuth2(token) {
  7428. if (!token) {
  7429. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7430. }
  7431. if (typeof token !== "string") {
  7432. throw new Error(
  7433. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7434. );
  7435. }
  7436. token = token.replace(/^(token|bearer) +/i, "");
  7437. return Object.assign(auth.bind(null, token), {
  7438. hook: hook.bind(null, token)
  7439. });
  7440. };
  7441. // Annotate the CommonJS export names for ESM import in node:
  7442. 0 && (0);
  7443. /***/ }),
  7444. /***/ 6762:
  7445. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7446. "use strict";
  7447. var __defProp = Object.defineProperty;
  7448. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7449. var __getOwnPropNames = Object.getOwnPropertyNames;
  7450. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7451. var __export = (target, all) => {
  7452. for (var name in all)
  7453. __defProp(target, name, { get: all[name], enumerable: true });
  7454. };
  7455. var __copyProps = (to, from, except, desc) => {
  7456. if (from && typeof from === "object" || typeof from === "function") {
  7457. for (let key of __getOwnPropNames(from))
  7458. if (!__hasOwnProp.call(to, key) && key !== except)
  7459. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7460. }
  7461. return to;
  7462. };
  7463. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7464. // pkg/dist-src/index.js
  7465. var dist_src_exports = {};
  7466. __export(dist_src_exports, {
  7467. Octokit: () => Octokit
  7468. });
  7469. module.exports = __toCommonJS(dist_src_exports);
  7470. var import_universal_user_agent = __nccwpck_require__(5030);
  7471. var import_before_after_hook = __nccwpck_require__(3682);
  7472. var import_request = __nccwpck_require__(6234);
  7473. var import_graphql = __nccwpck_require__(8467);
  7474. var import_auth_token = __nccwpck_require__(334);
  7475. // pkg/dist-src/version.js
  7476. var VERSION = "5.2.0";
  7477. // pkg/dist-src/index.js
  7478. var noop = () => {
  7479. };
  7480. var consoleWarn = console.warn.bind(console);
  7481. var consoleError = console.error.bind(console);
  7482. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7483. var Octokit = class {
  7484. static {
  7485. this.VERSION = VERSION;
  7486. }
  7487. static defaults(defaults) {
  7488. const OctokitWithDefaults = class extends this {
  7489. constructor(...args) {
  7490. const options = args[0] || {};
  7491. if (typeof defaults === "function") {
  7492. super(defaults(options));
  7493. return;
  7494. }
  7495. super(
  7496. Object.assign(
  7497. {},
  7498. defaults,
  7499. options,
  7500. options.userAgent && defaults.userAgent ? {
  7501. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7502. } : null
  7503. )
  7504. );
  7505. }
  7506. };
  7507. return OctokitWithDefaults;
  7508. }
  7509. static {
  7510. this.plugins = [];
  7511. }
  7512. /**
  7513. * Attach a plugin (or many) to your Octokit instance.
  7514. *
  7515. * @example
  7516. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7517. */
  7518. static plugin(...newPlugins) {
  7519. const currentPlugins = this.plugins;
  7520. const NewOctokit = class extends this {
  7521. static {
  7522. this.plugins = currentPlugins.concat(
  7523. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7524. );
  7525. }
  7526. };
  7527. return NewOctokit;
  7528. }
  7529. constructor(options = {}) {
  7530. const hook = new import_before_after_hook.Collection();
  7531. const requestDefaults = {
  7532. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7533. headers: {},
  7534. request: Object.assign({}, options.request, {
  7535. // @ts-ignore internal usage only, no need to type
  7536. hook: hook.bind(null, "request")
  7537. }),
  7538. mediaType: {
  7539. previews: [],
  7540. format: ""
  7541. }
  7542. };
  7543. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7544. if (options.baseUrl) {
  7545. requestDefaults.baseUrl = options.baseUrl;
  7546. }
  7547. if (options.previews) {
  7548. requestDefaults.mediaType.previews = options.previews;
  7549. }
  7550. if (options.timeZone) {
  7551. requestDefaults.headers["time-zone"] = options.timeZone;
  7552. }
  7553. this.request = import_request.request.defaults(requestDefaults);
  7554. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7555. this.log = Object.assign(
  7556. {
  7557. debug: noop,
  7558. info: noop,
  7559. warn: consoleWarn,
  7560. error: consoleError
  7561. },
  7562. options.log
  7563. );
  7564. this.hook = hook;
  7565. if (!options.authStrategy) {
  7566. if (!options.auth) {
  7567. this.auth = async () => ({
  7568. type: "unauthenticated"
  7569. });
  7570. } else {
  7571. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7572. hook.wrap("request", auth.hook);
  7573. this.auth = auth;
  7574. }
  7575. } else {
  7576. const { authStrategy, ...otherOptions } = options;
  7577. const auth = authStrategy(
  7578. Object.assign(
  7579. {
  7580. request: this.request,
  7581. log: this.log,
  7582. // we pass the current octokit instance as well as its constructor options
  7583. // to allow for authentication strategies that return a new octokit instance
  7584. // that shares the same internal state as the current one. The original
  7585. // requirement for this was the "event-octokit" authentication strategy
  7586. // of https://github.com/probot/octokit-auth-probot.
  7587. octokit: this,
  7588. octokitOptions: otherOptions
  7589. },
  7590. options.auth
  7591. )
  7592. );
  7593. hook.wrap("request", auth.hook);
  7594. this.auth = auth;
  7595. }
  7596. const classConstructor = this.constructor;
  7597. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7598. Object.assign(this, classConstructor.plugins[i](this, options));
  7599. }
  7600. }
  7601. };
  7602. // Annotate the CommonJS export names for ESM import in node:
  7603. 0 && (0);
  7604. /***/ }),
  7605. /***/ 9440:
  7606. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7607. "use strict";
  7608. var __defProp = Object.defineProperty;
  7609. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7610. var __getOwnPropNames = Object.getOwnPropertyNames;
  7611. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7612. var __export = (target, all) => {
  7613. for (var name in all)
  7614. __defProp(target, name, { get: all[name], enumerable: true });
  7615. };
  7616. var __copyProps = (to, from, except, desc) => {
  7617. if (from && typeof from === "object" || typeof from === "function") {
  7618. for (let key of __getOwnPropNames(from))
  7619. if (!__hasOwnProp.call(to, key) && key !== except)
  7620. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7621. }
  7622. return to;
  7623. };
  7624. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7625. // pkg/dist-src/index.js
  7626. var dist_src_exports = {};
  7627. __export(dist_src_exports, {
  7628. endpoint: () => endpoint
  7629. });
  7630. module.exports = __toCommonJS(dist_src_exports);
  7631. // pkg/dist-src/defaults.js
  7632. var import_universal_user_agent = __nccwpck_require__(5030);
  7633. // pkg/dist-src/version.js
  7634. var VERSION = "9.0.6";
  7635. // pkg/dist-src/defaults.js
  7636. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7637. var DEFAULTS = {
  7638. method: "GET",
  7639. baseUrl: "https://api.github.com",
  7640. headers: {
  7641. accept: "application/vnd.github.v3+json",
  7642. "user-agent": userAgent
  7643. },
  7644. mediaType: {
  7645. format: ""
  7646. }
  7647. };
  7648. // pkg/dist-src/util/lowercase-keys.js
  7649. function lowercaseKeys(object) {
  7650. if (!object) {
  7651. return {};
  7652. }
  7653. return Object.keys(object).reduce((newObj, key) => {
  7654. newObj[key.toLowerCase()] = object[key];
  7655. return newObj;
  7656. }, {});
  7657. }
  7658. // pkg/dist-src/util/is-plain-object.js
  7659. function isPlainObject(value) {
  7660. if (typeof value !== "object" || value === null)
  7661. return false;
  7662. if (Object.prototype.toString.call(value) !== "[object Object]")
  7663. return false;
  7664. const proto = Object.getPrototypeOf(value);
  7665. if (proto === null)
  7666. return true;
  7667. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7668. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7669. }
  7670. // pkg/dist-src/util/merge-deep.js
  7671. function mergeDeep(defaults, options) {
  7672. const result = Object.assign({}, defaults);
  7673. Object.keys(options).forEach((key) => {
  7674. if (isPlainObject(options[key])) {
  7675. if (!(key in defaults))
  7676. Object.assign(result, { [key]: options[key] });
  7677. else
  7678. result[key] = mergeDeep(defaults[key], options[key]);
  7679. } else {
  7680. Object.assign(result, { [key]: options[key] });
  7681. }
  7682. });
  7683. return result;
  7684. }
  7685. // pkg/dist-src/util/remove-undefined-properties.js
  7686. function removeUndefinedProperties(obj) {
  7687. for (const key in obj) {
  7688. if (obj[key] === void 0) {
  7689. delete obj[key];
  7690. }
  7691. }
  7692. return obj;
  7693. }
  7694. // pkg/dist-src/merge.js
  7695. function merge(defaults, route, options) {
  7696. if (typeof route === "string") {
  7697. let [method, url] = route.split(" ");
  7698. options = Object.assign(url ? { method, url } : { url: method }, options);
  7699. } else {
  7700. options = Object.assign({}, route);
  7701. }
  7702. options.headers = lowercaseKeys(options.headers);
  7703. removeUndefinedProperties(options);
  7704. removeUndefinedProperties(options.headers);
  7705. const mergedOptions = mergeDeep(defaults || {}, options);
  7706. if (options.url === "/graphql") {
  7707. if (defaults && defaults.mediaType.previews?.length) {
  7708. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7709. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7710. ).concat(mergedOptions.mediaType.previews);
  7711. }
  7712. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7713. }
  7714. return mergedOptions;
  7715. }
  7716. // pkg/dist-src/util/add-query-parameters.js
  7717. function addQueryParameters(url, parameters) {
  7718. const separator = /\?/.test(url) ? "&" : "?";
  7719. const names = Object.keys(parameters);
  7720. if (names.length === 0) {
  7721. return url;
  7722. }
  7723. return url + separator + names.map((name) => {
  7724. if (name === "q") {
  7725. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7726. }
  7727. return `${name}=${encodeURIComponent(parameters[name])}`;
  7728. }).join("&");
  7729. }
  7730. // pkg/dist-src/util/extract-url-variable-names.js
  7731. var urlVariableRegex = /\{[^{}}]+\}/g;
  7732. function removeNonChars(variableName) {
  7733. return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
  7734. }
  7735. function extractUrlVariableNames(url) {
  7736. const matches = url.match(urlVariableRegex);
  7737. if (!matches) {
  7738. return [];
  7739. }
  7740. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7741. }
  7742. // pkg/dist-src/util/omit.js
  7743. function omit(object, keysToOmit) {
  7744. const result = { __proto__: null };
  7745. for (const key of Object.keys(object)) {
  7746. if (keysToOmit.indexOf(key) === -1) {
  7747. result[key] = object[key];
  7748. }
  7749. }
  7750. return result;
  7751. }
  7752. // pkg/dist-src/util/url-template.js
  7753. function encodeReserved(str) {
  7754. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7755. if (!/%[0-9A-Fa-f]/.test(part)) {
  7756. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7757. }
  7758. return part;
  7759. }).join("");
  7760. }
  7761. function encodeUnreserved(str) {
  7762. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7763. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7764. });
  7765. }
  7766. function encodeValue(operator, value, key) {
  7767. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7768. if (key) {
  7769. return encodeUnreserved(key) + "=" + value;
  7770. } else {
  7771. return value;
  7772. }
  7773. }
  7774. function isDefined(value) {
  7775. return value !== void 0 && value !== null;
  7776. }
  7777. function isKeyOperator(operator) {
  7778. return operator === ";" || operator === "&" || operator === "?";
  7779. }
  7780. function getValues(context, operator, key, modifier) {
  7781. var value = context[key], result = [];
  7782. if (isDefined(value) && value !== "") {
  7783. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7784. value = value.toString();
  7785. if (modifier && modifier !== "*") {
  7786. value = value.substring(0, parseInt(modifier, 10));
  7787. }
  7788. result.push(
  7789. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7790. );
  7791. } else {
  7792. if (modifier === "*") {
  7793. if (Array.isArray(value)) {
  7794. value.filter(isDefined).forEach(function(value2) {
  7795. result.push(
  7796. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7797. );
  7798. });
  7799. } else {
  7800. Object.keys(value).forEach(function(k) {
  7801. if (isDefined(value[k])) {
  7802. result.push(encodeValue(operator, value[k], k));
  7803. }
  7804. });
  7805. }
  7806. } else {
  7807. const tmp = [];
  7808. if (Array.isArray(value)) {
  7809. value.filter(isDefined).forEach(function(value2) {
  7810. tmp.push(encodeValue(operator, value2));
  7811. });
  7812. } else {
  7813. Object.keys(value).forEach(function(k) {
  7814. if (isDefined(value[k])) {
  7815. tmp.push(encodeUnreserved(k));
  7816. tmp.push(encodeValue(operator, value[k].toString()));
  7817. }
  7818. });
  7819. }
  7820. if (isKeyOperator(operator)) {
  7821. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7822. } else if (tmp.length !== 0) {
  7823. result.push(tmp.join(","));
  7824. }
  7825. }
  7826. }
  7827. } else {
  7828. if (operator === ";") {
  7829. if (isDefined(value)) {
  7830. result.push(encodeUnreserved(key));
  7831. }
  7832. } else if (value === "" && (operator === "&" || operator === "?")) {
  7833. result.push(encodeUnreserved(key) + "=");
  7834. } else if (value === "") {
  7835. result.push("");
  7836. }
  7837. }
  7838. return result;
  7839. }
  7840. function parseUrl(template) {
  7841. return {
  7842. expand: expand.bind(null, template)
  7843. };
  7844. }
  7845. function expand(template, context) {
  7846. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7847. template = template.replace(
  7848. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7849. function(_, expression, literal) {
  7850. if (expression) {
  7851. let operator = "";
  7852. const values = [];
  7853. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7854. operator = expression.charAt(0);
  7855. expression = expression.substr(1);
  7856. }
  7857. expression.split(/,/g).forEach(function(variable) {
  7858. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7859. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7860. });
  7861. if (operator && operator !== "+") {
  7862. var separator = ",";
  7863. if (operator === "?") {
  7864. separator = "&";
  7865. } else if (operator !== "#") {
  7866. separator = operator;
  7867. }
  7868. return (values.length !== 0 ? operator : "") + values.join(separator);
  7869. } else {
  7870. return values.join(",");
  7871. }
  7872. } else {
  7873. return encodeReserved(literal);
  7874. }
  7875. }
  7876. );
  7877. if (template === "/") {
  7878. return template;
  7879. } else {
  7880. return template.replace(/\/$/, "");
  7881. }
  7882. }
  7883. // pkg/dist-src/parse.js
  7884. function parse(options) {
  7885. let method = options.method.toUpperCase();
  7886. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7887. let headers = Object.assign({}, options.headers);
  7888. let body;
  7889. let parameters = omit(options, [
  7890. "method",
  7891. "baseUrl",
  7892. "url",
  7893. "headers",
  7894. "request",
  7895. "mediaType"
  7896. ]);
  7897. const urlVariableNames = extractUrlVariableNames(url);
  7898. url = parseUrl(url).expand(parameters);
  7899. if (!/^http/.test(url)) {
  7900. url = options.baseUrl + url;
  7901. }
  7902. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7903. const remainingParameters = omit(parameters, omittedParameters);
  7904. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7905. if (!isBinaryRequest) {
  7906. if (options.mediaType.format) {
  7907. headers.accept = headers.accept.split(/,/).map(
  7908. (format) => format.replace(
  7909. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7910. `application/vnd$1$2.${options.mediaType.format}`
  7911. )
  7912. ).join(",");
  7913. }
  7914. if (url.endsWith("/graphql")) {
  7915. if (options.mediaType.previews?.length) {
  7916. const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
  7917. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7918. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7919. return `application/vnd.github.${preview}-preview${format}`;
  7920. }).join(",");
  7921. }
  7922. }
  7923. }
  7924. if (["GET", "HEAD"].includes(method)) {
  7925. url = addQueryParameters(url, remainingParameters);
  7926. } else {
  7927. if ("data" in remainingParameters) {
  7928. body = remainingParameters.data;
  7929. } else {
  7930. if (Object.keys(remainingParameters).length) {
  7931. body = remainingParameters;
  7932. }
  7933. }
  7934. }
  7935. if (!headers["content-type"] && typeof body !== "undefined") {
  7936. headers["content-type"] = "application/json; charset=utf-8";
  7937. }
  7938. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7939. body = "";
  7940. }
  7941. return Object.assign(
  7942. { method, url, headers },
  7943. typeof body !== "undefined" ? { body } : null,
  7944. options.request ? { request: options.request } : null
  7945. );
  7946. }
  7947. // pkg/dist-src/endpoint-with-defaults.js
  7948. function endpointWithDefaults(defaults, route, options) {
  7949. return parse(merge(defaults, route, options));
  7950. }
  7951. // pkg/dist-src/with-defaults.js
  7952. function withDefaults(oldDefaults, newDefaults) {
  7953. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7954. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7955. return Object.assign(endpoint2, {
  7956. DEFAULTS: DEFAULTS2,
  7957. defaults: withDefaults.bind(null, DEFAULTS2),
  7958. merge: merge.bind(null, DEFAULTS2),
  7959. parse
  7960. });
  7961. }
  7962. // pkg/dist-src/index.js
  7963. var endpoint = withDefaults(null, DEFAULTS);
  7964. // Annotate the CommonJS export names for ESM import in node:
  7965. 0 && (0);
  7966. /***/ }),
  7967. /***/ 8467:
  7968. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7969. "use strict";
  7970. var __defProp = Object.defineProperty;
  7971. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7972. var __getOwnPropNames = Object.getOwnPropertyNames;
  7973. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7974. var __export = (target, all) => {
  7975. for (var name in all)
  7976. __defProp(target, name, { get: all[name], enumerable: true });
  7977. };
  7978. var __copyProps = (to, from, except, desc) => {
  7979. if (from && typeof from === "object" || typeof from === "function") {
  7980. for (let key of __getOwnPropNames(from))
  7981. if (!__hasOwnProp.call(to, key) && key !== except)
  7982. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7983. }
  7984. return to;
  7985. };
  7986. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7987. // pkg/dist-src/index.js
  7988. var dist_src_exports = {};
  7989. __export(dist_src_exports, {
  7990. GraphqlResponseError: () => GraphqlResponseError,
  7991. graphql: () => graphql2,
  7992. withCustomRequest: () => withCustomRequest
  7993. });
  7994. module.exports = __toCommonJS(dist_src_exports);
  7995. var import_request3 = __nccwpck_require__(6234);
  7996. var import_universal_user_agent = __nccwpck_require__(5030);
  7997. // pkg/dist-src/version.js
  7998. var VERSION = "7.1.0";
  7999. // pkg/dist-src/with-defaults.js
  8000. var import_request2 = __nccwpck_require__(6234);
  8001. // pkg/dist-src/graphql.js
  8002. var import_request = __nccwpck_require__(6234);
  8003. // pkg/dist-src/error.js
  8004. function _buildMessageForResponseErrors(data) {
  8005. return `Request failed due to following response errors:
  8006. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  8007. }
  8008. var GraphqlResponseError = class extends Error {
  8009. constructor(request2, headers, response) {
  8010. super(_buildMessageForResponseErrors(response));
  8011. this.request = request2;
  8012. this.headers = headers;
  8013. this.response = response;
  8014. this.name = "GraphqlResponseError";
  8015. this.errors = response.errors;
  8016. this.data = response.data;
  8017. if (Error.captureStackTrace) {
  8018. Error.captureStackTrace(this, this.constructor);
  8019. }
  8020. }
  8021. };
  8022. // pkg/dist-src/graphql.js
  8023. var NON_VARIABLE_OPTIONS = [
  8024. "method",
  8025. "baseUrl",
  8026. "url",
  8027. "headers",
  8028. "request",
  8029. "query",
  8030. "mediaType"
  8031. ];
  8032. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  8033. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  8034. function graphql(request2, query, options) {
  8035. if (options) {
  8036. if (typeof query === "string" && "query" in options) {
  8037. return Promise.reject(
  8038. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  8039. );
  8040. }
  8041. for (const key in options) {
  8042. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  8043. continue;
  8044. return Promise.reject(
  8045. new Error(
  8046. `[@octokit/graphql] "${key}" cannot be used as variable name`
  8047. )
  8048. );
  8049. }
  8050. }
  8051. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  8052. const requestOptions = Object.keys(
  8053. parsedOptions
  8054. ).reduce((result, key) => {
  8055. if (NON_VARIABLE_OPTIONS.includes(key)) {
  8056. result[key] = parsedOptions[key];
  8057. return result;
  8058. }
  8059. if (!result.variables) {
  8060. result.variables = {};
  8061. }
  8062. result.variables[key] = parsedOptions[key];
  8063. return result;
  8064. }, {});
  8065. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  8066. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  8067. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  8068. }
  8069. return request2(requestOptions).then((response) => {
  8070. if (response.data.errors) {
  8071. const headers = {};
  8072. for (const key of Object.keys(response.headers)) {
  8073. headers[key] = response.headers[key];
  8074. }
  8075. throw new GraphqlResponseError(
  8076. requestOptions,
  8077. headers,
  8078. response.data
  8079. );
  8080. }
  8081. return response.data.data;
  8082. });
  8083. }
  8084. // pkg/dist-src/with-defaults.js
  8085. function withDefaults(request2, newDefaults) {
  8086. const newRequest = request2.defaults(newDefaults);
  8087. const newApi = (query, options) => {
  8088. return graphql(newRequest, query, options);
  8089. };
  8090. return Object.assign(newApi, {
  8091. defaults: withDefaults.bind(null, newRequest),
  8092. endpoint: newRequest.endpoint
  8093. });
  8094. }
  8095. // pkg/dist-src/index.js
  8096. var graphql2 = withDefaults(import_request3.request, {
  8097. headers: {
  8098. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  8099. },
  8100. method: "POST",
  8101. url: "/graphql"
  8102. });
  8103. function withCustomRequest(customRequest) {
  8104. return withDefaults(customRequest, {
  8105. method: "POST",
  8106. url: "/graphql"
  8107. });
  8108. }
  8109. // Annotate the CommonJS export names for ESM import in node:
  8110. 0 && (0);
  8111. /***/ }),
  8112. /***/ 4193:
  8113. /***/ ((module) => {
  8114. "use strict";
  8115. var __defProp = Object.defineProperty;
  8116. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8117. var __getOwnPropNames = Object.getOwnPropertyNames;
  8118. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8119. var __export = (target, all) => {
  8120. for (var name in all)
  8121. __defProp(target, name, { get: all[name], enumerable: true });
  8122. };
  8123. var __copyProps = (to, from, except, desc) => {
  8124. if (from && typeof from === "object" || typeof from === "function") {
  8125. for (let key of __getOwnPropNames(from))
  8126. if (!__hasOwnProp.call(to, key) && key !== except)
  8127. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8128. }
  8129. return to;
  8130. };
  8131. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8132. // pkg/dist-src/index.js
  8133. var dist_src_exports = {};
  8134. __export(dist_src_exports, {
  8135. composePaginateRest: () => composePaginateRest,
  8136. isPaginatingEndpoint: () => isPaginatingEndpoint,
  8137. paginateRest: () => paginateRest,
  8138. paginatingEndpoints: () => paginatingEndpoints
  8139. });
  8140. module.exports = __toCommonJS(dist_src_exports);
  8141. // pkg/dist-src/version.js
  8142. var VERSION = "9.2.2";
  8143. // pkg/dist-src/normalize-paginated-list-response.js
  8144. function normalizePaginatedListResponse(response) {
  8145. if (!response.data) {
  8146. return {
  8147. ...response,
  8148. data: []
  8149. };
  8150. }
  8151. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  8152. if (!responseNeedsNormalization)
  8153. return response;
  8154. const incompleteResults = response.data.incomplete_results;
  8155. const repositorySelection = response.data.repository_selection;
  8156. const totalCount = response.data.total_count;
  8157. delete response.data.incomplete_results;
  8158. delete response.data.repository_selection;
  8159. delete response.data.total_count;
  8160. const namespaceKey = Object.keys(response.data)[0];
  8161. const data = response.data[namespaceKey];
  8162. response.data = data;
  8163. if (typeof incompleteResults !== "undefined") {
  8164. response.data.incomplete_results = incompleteResults;
  8165. }
  8166. if (typeof repositorySelection !== "undefined") {
  8167. response.data.repository_selection = repositorySelection;
  8168. }
  8169. response.data.total_count = totalCount;
  8170. return response;
  8171. }
  8172. // pkg/dist-src/iterator.js
  8173. function iterator(octokit, route, parameters) {
  8174. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  8175. const requestMethod = typeof route === "function" ? route : octokit.request;
  8176. const method = options.method;
  8177. const headers = options.headers;
  8178. let url = options.url;
  8179. return {
  8180. [Symbol.asyncIterator]: () => ({
  8181. async next() {
  8182. if (!url)
  8183. return { done: true };
  8184. try {
  8185. const response = await requestMethod({ method, url, headers });
  8186. const normalizedResponse = normalizePaginatedListResponse(response);
  8187. url = ((normalizedResponse.headers.link || "").match(
  8188. /<([^<>]+)>;\s*rel="next"/
  8189. ) || [])[1];
  8190. return { value: normalizedResponse };
  8191. } catch (error) {
  8192. if (error.status !== 409)
  8193. throw error;
  8194. url = "";
  8195. return {
  8196. value: {
  8197. status: 200,
  8198. headers: {},
  8199. data: []
  8200. }
  8201. };
  8202. }
  8203. }
  8204. })
  8205. };
  8206. }
  8207. // pkg/dist-src/paginate.js
  8208. function paginate(octokit, route, parameters, mapFn) {
  8209. if (typeof parameters === "function") {
  8210. mapFn = parameters;
  8211. parameters = void 0;
  8212. }
  8213. return gather(
  8214. octokit,
  8215. [],
  8216. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  8217. mapFn
  8218. );
  8219. }
  8220. function gather(octokit, results, iterator2, mapFn) {
  8221. return iterator2.next().then((result) => {
  8222. if (result.done) {
  8223. return results;
  8224. }
  8225. let earlyExit = false;
  8226. function done() {
  8227. earlyExit = true;
  8228. }
  8229. results = results.concat(
  8230. mapFn ? mapFn(result.value, done) : result.value.data
  8231. );
  8232. if (earlyExit) {
  8233. return results;
  8234. }
  8235. return gather(octokit, results, iterator2, mapFn);
  8236. });
  8237. }
  8238. // pkg/dist-src/compose-paginate.js
  8239. var composePaginateRest = Object.assign(paginate, {
  8240. iterator
  8241. });
  8242. // pkg/dist-src/generated/paginating-endpoints.js
  8243. var paginatingEndpoints = [
  8244. "GET /advisories",
  8245. "GET /app/hook/deliveries",
  8246. "GET /app/installation-requests",
  8247. "GET /app/installations",
  8248. "GET /assignments/{assignment_id}/accepted_assignments",
  8249. "GET /classrooms",
  8250. "GET /classrooms/{classroom_id}/assignments",
  8251. "GET /enterprises/{enterprise}/dependabot/alerts",
  8252. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  8253. "GET /events",
  8254. "GET /gists",
  8255. "GET /gists/public",
  8256. "GET /gists/starred",
  8257. "GET /gists/{gist_id}/comments",
  8258. "GET /gists/{gist_id}/commits",
  8259. "GET /gists/{gist_id}/forks",
  8260. "GET /installation/repositories",
  8261. "GET /issues",
  8262. "GET /licenses",
  8263. "GET /marketplace_listing/plans",
  8264. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8265. "GET /marketplace_listing/stubbed/plans",
  8266. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8267. "GET /networks/{owner}/{repo}/events",
  8268. "GET /notifications",
  8269. "GET /organizations",
  8270. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8271. "GET /orgs/{org}/actions/permissions/repositories",
  8272. "GET /orgs/{org}/actions/runners",
  8273. "GET /orgs/{org}/actions/secrets",
  8274. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8275. "GET /orgs/{org}/actions/variables",
  8276. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8277. "GET /orgs/{org}/blocks",
  8278. "GET /orgs/{org}/code-scanning/alerts",
  8279. "GET /orgs/{org}/codespaces",
  8280. "GET /orgs/{org}/codespaces/secrets",
  8281. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8282. "GET /orgs/{org}/copilot/billing/seats",
  8283. "GET /orgs/{org}/dependabot/alerts",
  8284. "GET /orgs/{org}/dependabot/secrets",
  8285. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8286. "GET /orgs/{org}/events",
  8287. "GET /orgs/{org}/failed_invitations",
  8288. "GET /orgs/{org}/hooks",
  8289. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8290. "GET /orgs/{org}/installations",
  8291. "GET /orgs/{org}/invitations",
  8292. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8293. "GET /orgs/{org}/issues",
  8294. "GET /orgs/{org}/members",
  8295. "GET /orgs/{org}/members/{username}/codespaces",
  8296. "GET /orgs/{org}/migrations",
  8297. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8298. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8299. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8300. "GET /orgs/{org}/outside_collaborators",
  8301. "GET /orgs/{org}/packages",
  8302. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8303. "GET /orgs/{org}/personal-access-token-requests",
  8304. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8305. "GET /orgs/{org}/personal-access-tokens",
  8306. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8307. "GET /orgs/{org}/projects",
  8308. "GET /orgs/{org}/properties/values",
  8309. "GET /orgs/{org}/public_members",
  8310. "GET /orgs/{org}/repos",
  8311. "GET /orgs/{org}/rulesets",
  8312. "GET /orgs/{org}/rulesets/rule-suites",
  8313. "GET /orgs/{org}/secret-scanning/alerts",
  8314. "GET /orgs/{org}/security-advisories",
  8315. "GET /orgs/{org}/teams",
  8316. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8317. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8318. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8319. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8320. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8321. "GET /orgs/{org}/teams/{team_slug}/members",
  8322. "GET /orgs/{org}/teams/{team_slug}/projects",
  8323. "GET /orgs/{org}/teams/{team_slug}/repos",
  8324. "GET /orgs/{org}/teams/{team_slug}/teams",
  8325. "GET /projects/columns/{column_id}/cards",
  8326. "GET /projects/{project_id}/collaborators",
  8327. "GET /projects/{project_id}/columns",
  8328. "GET /repos/{owner}/{repo}/actions/artifacts",
  8329. "GET /repos/{owner}/{repo}/actions/caches",
  8330. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8331. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8332. "GET /repos/{owner}/{repo}/actions/runners",
  8333. "GET /repos/{owner}/{repo}/actions/runs",
  8334. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8335. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8336. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8337. "GET /repos/{owner}/{repo}/actions/secrets",
  8338. "GET /repos/{owner}/{repo}/actions/variables",
  8339. "GET /repos/{owner}/{repo}/actions/workflows",
  8340. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8341. "GET /repos/{owner}/{repo}/activity",
  8342. "GET /repos/{owner}/{repo}/assignees",
  8343. "GET /repos/{owner}/{repo}/branches",
  8344. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8345. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8346. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8347. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8348. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8349. "GET /repos/{owner}/{repo}/codespaces",
  8350. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8351. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8352. "GET /repos/{owner}/{repo}/collaborators",
  8353. "GET /repos/{owner}/{repo}/comments",
  8354. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8355. "GET /repos/{owner}/{repo}/commits",
  8356. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8357. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8358. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8359. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8360. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8361. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8362. "GET /repos/{owner}/{repo}/contributors",
  8363. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8364. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8365. "GET /repos/{owner}/{repo}/deployments",
  8366. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8367. "GET /repos/{owner}/{repo}/environments",
  8368. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8369. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8370. "GET /repos/{owner}/{repo}/events",
  8371. "GET /repos/{owner}/{repo}/forks",
  8372. "GET /repos/{owner}/{repo}/hooks",
  8373. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8374. "GET /repos/{owner}/{repo}/invitations",
  8375. "GET /repos/{owner}/{repo}/issues",
  8376. "GET /repos/{owner}/{repo}/issues/comments",
  8377. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8378. "GET /repos/{owner}/{repo}/issues/events",
  8379. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8380. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8381. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8382. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8383. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8384. "GET /repos/{owner}/{repo}/keys",
  8385. "GET /repos/{owner}/{repo}/labels",
  8386. "GET /repos/{owner}/{repo}/milestones",
  8387. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8388. "GET /repos/{owner}/{repo}/notifications",
  8389. "GET /repos/{owner}/{repo}/pages/builds",
  8390. "GET /repos/{owner}/{repo}/projects",
  8391. "GET /repos/{owner}/{repo}/pulls",
  8392. "GET /repos/{owner}/{repo}/pulls/comments",
  8393. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8394. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8395. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8396. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8397. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8398. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8399. "GET /repos/{owner}/{repo}/releases",
  8400. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8401. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8402. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8403. "GET /repos/{owner}/{repo}/rulesets",
  8404. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8405. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8406. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8407. "GET /repos/{owner}/{repo}/security-advisories",
  8408. "GET /repos/{owner}/{repo}/stargazers",
  8409. "GET /repos/{owner}/{repo}/subscribers",
  8410. "GET /repos/{owner}/{repo}/tags",
  8411. "GET /repos/{owner}/{repo}/teams",
  8412. "GET /repos/{owner}/{repo}/topics",
  8413. "GET /repositories",
  8414. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8415. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8416. "GET /search/code",
  8417. "GET /search/commits",
  8418. "GET /search/issues",
  8419. "GET /search/labels",
  8420. "GET /search/repositories",
  8421. "GET /search/topics",
  8422. "GET /search/users",
  8423. "GET /teams/{team_id}/discussions",
  8424. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8425. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8426. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8427. "GET /teams/{team_id}/invitations",
  8428. "GET /teams/{team_id}/members",
  8429. "GET /teams/{team_id}/projects",
  8430. "GET /teams/{team_id}/repos",
  8431. "GET /teams/{team_id}/teams",
  8432. "GET /user/blocks",
  8433. "GET /user/codespaces",
  8434. "GET /user/codespaces/secrets",
  8435. "GET /user/emails",
  8436. "GET /user/followers",
  8437. "GET /user/following",
  8438. "GET /user/gpg_keys",
  8439. "GET /user/installations",
  8440. "GET /user/installations/{installation_id}/repositories",
  8441. "GET /user/issues",
  8442. "GET /user/keys",
  8443. "GET /user/marketplace_purchases",
  8444. "GET /user/marketplace_purchases/stubbed",
  8445. "GET /user/memberships/orgs",
  8446. "GET /user/migrations",
  8447. "GET /user/migrations/{migration_id}/repositories",
  8448. "GET /user/orgs",
  8449. "GET /user/packages",
  8450. "GET /user/packages/{package_type}/{package_name}/versions",
  8451. "GET /user/public_emails",
  8452. "GET /user/repos",
  8453. "GET /user/repository_invitations",
  8454. "GET /user/social_accounts",
  8455. "GET /user/ssh_signing_keys",
  8456. "GET /user/starred",
  8457. "GET /user/subscriptions",
  8458. "GET /user/teams",
  8459. "GET /users",
  8460. "GET /users/{username}/events",
  8461. "GET /users/{username}/events/orgs/{org}",
  8462. "GET /users/{username}/events/public",
  8463. "GET /users/{username}/followers",
  8464. "GET /users/{username}/following",
  8465. "GET /users/{username}/gists",
  8466. "GET /users/{username}/gpg_keys",
  8467. "GET /users/{username}/keys",
  8468. "GET /users/{username}/orgs",
  8469. "GET /users/{username}/packages",
  8470. "GET /users/{username}/projects",
  8471. "GET /users/{username}/received_events",
  8472. "GET /users/{username}/received_events/public",
  8473. "GET /users/{username}/repos",
  8474. "GET /users/{username}/social_accounts",
  8475. "GET /users/{username}/ssh_signing_keys",
  8476. "GET /users/{username}/starred",
  8477. "GET /users/{username}/subscriptions"
  8478. ];
  8479. // pkg/dist-src/paginating-endpoints.js
  8480. function isPaginatingEndpoint(arg) {
  8481. if (typeof arg === "string") {
  8482. return paginatingEndpoints.includes(arg);
  8483. } else {
  8484. return false;
  8485. }
  8486. }
  8487. // pkg/dist-src/index.js
  8488. function paginateRest(octokit) {
  8489. return {
  8490. paginate: Object.assign(paginate.bind(null, octokit), {
  8491. iterator: iterator.bind(null, octokit)
  8492. })
  8493. };
  8494. }
  8495. paginateRest.VERSION = VERSION;
  8496. // Annotate the CommonJS export names for ESM import in node:
  8497. 0 && (0);
  8498. /***/ }),
  8499. /***/ 3044:
  8500. /***/ ((module) => {
  8501. "use strict";
  8502. var __defProp = Object.defineProperty;
  8503. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8504. var __getOwnPropNames = Object.getOwnPropertyNames;
  8505. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8506. var __export = (target, all) => {
  8507. for (var name in all)
  8508. __defProp(target, name, { get: all[name], enumerable: true });
  8509. };
  8510. var __copyProps = (to, from, except, desc) => {
  8511. if (from && typeof from === "object" || typeof from === "function") {
  8512. for (let key of __getOwnPropNames(from))
  8513. if (!__hasOwnProp.call(to, key) && key !== except)
  8514. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8515. }
  8516. return to;
  8517. };
  8518. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8519. // pkg/dist-src/index.js
  8520. var dist_src_exports = {};
  8521. __export(dist_src_exports, {
  8522. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8523. restEndpointMethods: () => restEndpointMethods
  8524. });
  8525. module.exports = __toCommonJS(dist_src_exports);
  8526. // pkg/dist-src/version.js
  8527. var VERSION = "10.4.1";
  8528. // pkg/dist-src/generated/endpoints.js
  8529. var Endpoints = {
  8530. actions: {
  8531. addCustomLabelsToSelfHostedRunnerForOrg: [
  8532. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8533. ],
  8534. addCustomLabelsToSelfHostedRunnerForRepo: [
  8535. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8536. ],
  8537. addSelectedRepoToOrgSecret: [
  8538. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8539. ],
  8540. addSelectedRepoToOrgVariable: [
  8541. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8542. ],
  8543. approveWorkflowRun: [
  8544. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8545. ],
  8546. cancelWorkflowRun: [
  8547. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8548. ],
  8549. createEnvironmentVariable: [
  8550. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8551. ],
  8552. createOrUpdateEnvironmentSecret: [
  8553. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8554. ],
  8555. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8556. createOrUpdateRepoSecret: [
  8557. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8558. ],
  8559. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8560. createRegistrationTokenForOrg: [
  8561. "POST /orgs/{org}/actions/runners/registration-token"
  8562. ],
  8563. createRegistrationTokenForRepo: [
  8564. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8565. ],
  8566. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8567. createRemoveTokenForRepo: [
  8568. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8569. ],
  8570. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8571. createWorkflowDispatch: [
  8572. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8573. ],
  8574. deleteActionsCacheById: [
  8575. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8576. ],
  8577. deleteActionsCacheByKey: [
  8578. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8579. ],
  8580. deleteArtifact: [
  8581. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8582. ],
  8583. deleteEnvironmentSecret: [
  8584. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8585. ],
  8586. deleteEnvironmentVariable: [
  8587. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8588. ],
  8589. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8590. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8591. deleteRepoSecret: [
  8592. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8593. ],
  8594. deleteRepoVariable: [
  8595. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8596. ],
  8597. deleteSelfHostedRunnerFromOrg: [
  8598. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8599. ],
  8600. deleteSelfHostedRunnerFromRepo: [
  8601. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8602. ],
  8603. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8604. deleteWorkflowRunLogs: [
  8605. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8606. ],
  8607. disableSelectedRepositoryGithubActionsOrganization: [
  8608. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8609. ],
  8610. disableWorkflow: [
  8611. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8612. ],
  8613. downloadArtifact: [
  8614. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8615. ],
  8616. downloadJobLogsForWorkflowRun: [
  8617. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8618. ],
  8619. downloadWorkflowRunAttemptLogs: [
  8620. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8621. ],
  8622. downloadWorkflowRunLogs: [
  8623. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8624. ],
  8625. enableSelectedRepositoryGithubActionsOrganization: [
  8626. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8627. ],
  8628. enableWorkflow: [
  8629. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8630. ],
  8631. forceCancelWorkflowRun: [
  8632. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8633. ],
  8634. generateRunnerJitconfigForOrg: [
  8635. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8636. ],
  8637. generateRunnerJitconfigForRepo: [
  8638. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8639. ],
  8640. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8641. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8642. getActionsCacheUsageByRepoForOrg: [
  8643. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8644. ],
  8645. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8646. getAllowedActionsOrganization: [
  8647. "GET /orgs/{org}/actions/permissions/selected-actions"
  8648. ],
  8649. getAllowedActionsRepository: [
  8650. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8651. ],
  8652. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8653. getCustomOidcSubClaimForRepo: [
  8654. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8655. ],
  8656. getEnvironmentPublicKey: [
  8657. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8658. ],
  8659. getEnvironmentSecret: [
  8660. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8661. ],
  8662. getEnvironmentVariable: [
  8663. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8664. ],
  8665. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8666. "GET /orgs/{org}/actions/permissions/workflow"
  8667. ],
  8668. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8669. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8670. ],
  8671. getGithubActionsPermissionsOrganization: [
  8672. "GET /orgs/{org}/actions/permissions"
  8673. ],
  8674. getGithubActionsPermissionsRepository: [
  8675. "GET /repos/{owner}/{repo}/actions/permissions"
  8676. ],
  8677. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8678. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8679. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8680. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8681. getPendingDeploymentsForRun: [
  8682. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8683. ],
  8684. getRepoPermissions: [
  8685. "GET /repos/{owner}/{repo}/actions/permissions",
  8686. {},
  8687. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8688. ],
  8689. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8690. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8691. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8692. getReviewsForRun: [
  8693. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8694. ],
  8695. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8696. getSelfHostedRunnerForRepo: [
  8697. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8698. ],
  8699. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8700. getWorkflowAccessToRepository: [
  8701. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8702. ],
  8703. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8704. getWorkflowRunAttempt: [
  8705. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8706. ],
  8707. getWorkflowRunUsage: [
  8708. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8709. ],
  8710. getWorkflowUsage: [
  8711. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8712. ],
  8713. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8714. listEnvironmentSecrets: [
  8715. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8716. ],
  8717. listEnvironmentVariables: [
  8718. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8719. ],
  8720. listJobsForWorkflowRun: [
  8721. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8722. ],
  8723. listJobsForWorkflowRunAttempt: [
  8724. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8725. ],
  8726. listLabelsForSelfHostedRunnerForOrg: [
  8727. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8728. ],
  8729. listLabelsForSelfHostedRunnerForRepo: [
  8730. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8731. ],
  8732. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8733. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8734. listRepoOrganizationSecrets: [
  8735. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8736. ],
  8737. listRepoOrganizationVariables: [
  8738. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8739. ],
  8740. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8741. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8742. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8743. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8744. listRunnerApplicationsForRepo: [
  8745. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8746. ],
  8747. listSelectedReposForOrgSecret: [
  8748. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8749. ],
  8750. listSelectedReposForOrgVariable: [
  8751. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8752. ],
  8753. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8754. "GET /orgs/{org}/actions/permissions/repositories"
  8755. ],
  8756. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8757. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8758. listWorkflowRunArtifacts: [
  8759. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8760. ],
  8761. listWorkflowRuns: [
  8762. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8763. ],
  8764. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8765. reRunJobForWorkflowRun: [
  8766. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8767. ],
  8768. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8769. reRunWorkflowFailedJobs: [
  8770. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8771. ],
  8772. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8773. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8774. ],
  8775. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8776. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8777. ],
  8778. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8779. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8780. ],
  8781. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8782. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8783. ],
  8784. removeSelectedRepoFromOrgSecret: [
  8785. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8786. ],
  8787. removeSelectedRepoFromOrgVariable: [
  8788. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8789. ],
  8790. reviewCustomGatesForRun: [
  8791. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8792. ],
  8793. reviewPendingDeploymentsForRun: [
  8794. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8795. ],
  8796. setAllowedActionsOrganization: [
  8797. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8798. ],
  8799. setAllowedActionsRepository: [
  8800. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8801. ],
  8802. setCustomLabelsForSelfHostedRunnerForOrg: [
  8803. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8804. ],
  8805. setCustomLabelsForSelfHostedRunnerForRepo: [
  8806. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8807. ],
  8808. setCustomOidcSubClaimForRepo: [
  8809. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8810. ],
  8811. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8812. "PUT /orgs/{org}/actions/permissions/workflow"
  8813. ],
  8814. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8815. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8816. ],
  8817. setGithubActionsPermissionsOrganization: [
  8818. "PUT /orgs/{org}/actions/permissions"
  8819. ],
  8820. setGithubActionsPermissionsRepository: [
  8821. "PUT /repos/{owner}/{repo}/actions/permissions"
  8822. ],
  8823. setSelectedReposForOrgSecret: [
  8824. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8825. ],
  8826. setSelectedReposForOrgVariable: [
  8827. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8828. ],
  8829. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8830. "PUT /orgs/{org}/actions/permissions/repositories"
  8831. ],
  8832. setWorkflowAccessToRepository: [
  8833. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8834. ],
  8835. updateEnvironmentVariable: [
  8836. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8837. ],
  8838. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8839. updateRepoVariable: [
  8840. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8841. ]
  8842. },
  8843. activity: {
  8844. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8845. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8846. deleteThreadSubscription: [
  8847. "DELETE /notifications/threads/{thread_id}/subscription"
  8848. ],
  8849. getFeeds: ["GET /feeds"],
  8850. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8851. getThread: ["GET /notifications/threads/{thread_id}"],
  8852. getThreadSubscriptionForAuthenticatedUser: [
  8853. "GET /notifications/threads/{thread_id}/subscription"
  8854. ],
  8855. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8856. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8857. listOrgEventsForAuthenticatedUser: [
  8858. "GET /users/{username}/events/orgs/{org}"
  8859. ],
  8860. listPublicEvents: ["GET /events"],
  8861. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8862. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8863. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8864. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8865. listReceivedPublicEventsForUser: [
  8866. "GET /users/{username}/received_events/public"
  8867. ],
  8868. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8869. listRepoNotificationsForAuthenticatedUser: [
  8870. "GET /repos/{owner}/{repo}/notifications"
  8871. ],
  8872. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8873. listReposStarredByUser: ["GET /users/{username}/starred"],
  8874. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8875. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8876. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8877. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8878. markNotificationsAsRead: ["PUT /notifications"],
  8879. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8880. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8881. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8882. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8883. setThreadSubscription: [
  8884. "PUT /notifications/threads/{thread_id}/subscription"
  8885. ],
  8886. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8887. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8888. },
  8889. apps: {
  8890. addRepoToInstallation: [
  8891. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8892. {},
  8893. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8894. ],
  8895. addRepoToInstallationForAuthenticatedUser: [
  8896. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8897. ],
  8898. checkToken: ["POST /applications/{client_id}/token"],
  8899. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8900. createInstallationAccessToken: [
  8901. "POST /app/installations/{installation_id}/access_tokens"
  8902. ],
  8903. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8904. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8905. deleteToken: ["DELETE /applications/{client_id}/token"],
  8906. getAuthenticated: ["GET /app"],
  8907. getBySlug: ["GET /apps/{app_slug}"],
  8908. getInstallation: ["GET /app/installations/{installation_id}"],
  8909. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8910. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8911. getSubscriptionPlanForAccount: [
  8912. "GET /marketplace_listing/accounts/{account_id}"
  8913. ],
  8914. getSubscriptionPlanForAccountStubbed: [
  8915. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8916. ],
  8917. getUserInstallation: ["GET /users/{username}/installation"],
  8918. getWebhookConfigForApp: ["GET /app/hook/config"],
  8919. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8920. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8921. listAccountsForPlanStubbed: [
  8922. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8923. ],
  8924. listInstallationReposForAuthenticatedUser: [
  8925. "GET /user/installations/{installation_id}/repositories"
  8926. ],
  8927. listInstallationRequestsForAuthenticatedApp: [
  8928. "GET /app/installation-requests"
  8929. ],
  8930. listInstallations: ["GET /app/installations"],
  8931. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8932. listPlans: ["GET /marketplace_listing/plans"],
  8933. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8934. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8935. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8936. listSubscriptionsForAuthenticatedUserStubbed: [
  8937. "GET /user/marketplace_purchases/stubbed"
  8938. ],
  8939. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8940. redeliverWebhookDelivery: [
  8941. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8942. ],
  8943. removeRepoFromInstallation: [
  8944. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8945. {},
  8946. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8947. ],
  8948. removeRepoFromInstallationForAuthenticatedUser: [
  8949. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8950. ],
  8951. resetToken: ["PATCH /applications/{client_id}/token"],
  8952. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8953. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8954. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8955. unsuspendInstallation: [
  8956. "DELETE /app/installations/{installation_id}/suspended"
  8957. ],
  8958. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8959. },
  8960. billing: {
  8961. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8962. getGithubActionsBillingUser: [
  8963. "GET /users/{username}/settings/billing/actions"
  8964. ],
  8965. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8966. getGithubPackagesBillingUser: [
  8967. "GET /users/{username}/settings/billing/packages"
  8968. ],
  8969. getSharedStorageBillingOrg: [
  8970. "GET /orgs/{org}/settings/billing/shared-storage"
  8971. ],
  8972. getSharedStorageBillingUser: [
  8973. "GET /users/{username}/settings/billing/shared-storage"
  8974. ]
  8975. },
  8976. checks: {
  8977. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8978. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8979. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8980. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8981. listAnnotations: [
  8982. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8983. ],
  8984. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  8985. listForSuite: [
  8986. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  8987. ],
  8988. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  8989. rerequestRun: [
  8990. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  8991. ],
  8992. rerequestSuite: [
  8993. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  8994. ],
  8995. setSuitesPreferences: [
  8996. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  8997. ],
  8998. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  8999. },
  9000. codeScanning: {
  9001. deleteAnalysis: [
  9002. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  9003. ],
  9004. getAlert: [
  9005. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  9006. {},
  9007. { renamedParameters: { alert_id: "alert_number" } }
  9008. ],
  9009. getAnalysis: [
  9010. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  9011. ],
  9012. getCodeqlDatabase: [
  9013. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  9014. ],
  9015. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  9016. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  9017. listAlertInstances: [
  9018. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  9019. ],
  9020. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  9021. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  9022. listAlertsInstances: [
  9023. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  9024. {},
  9025. { renamed: ["codeScanning", "listAlertInstances"] }
  9026. ],
  9027. listCodeqlDatabases: [
  9028. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  9029. ],
  9030. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  9031. updateAlert: [
  9032. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  9033. ],
  9034. updateDefaultSetup: [
  9035. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  9036. ],
  9037. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  9038. },
  9039. codesOfConduct: {
  9040. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  9041. getConductCode: ["GET /codes_of_conduct/{key}"]
  9042. },
  9043. codespaces: {
  9044. addRepositoryForSecretForAuthenticatedUser: [
  9045. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9046. ],
  9047. addSelectedRepoToOrgSecret: [
  9048. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9049. ],
  9050. checkPermissionsForDevcontainer: [
  9051. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  9052. ],
  9053. codespaceMachinesForAuthenticatedUser: [
  9054. "GET /user/codespaces/{codespace_name}/machines"
  9055. ],
  9056. createForAuthenticatedUser: ["POST /user/codespaces"],
  9057. createOrUpdateOrgSecret: [
  9058. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  9059. ],
  9060. createOrUpdateRepoSecret: [
  9061. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9062. ],
  9063. createOrUpdateSecretForAuthenticatedUser: [
  9064. "PUT /user/codespaces/secrets/{secret_name}"
  9065. ],
  9066. createWithPrForAuthenticatedUser: [
  9067. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  9068. ],
  9069. createWithRepoForAuthenticatedUser: [
  9070. "POST /repos/{owner}/{repo}/codespaces"
  9071. ],
  9072. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  9073. deleteFromOrganization: [
  9074. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  9075. ],
  9076. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  9077. deleteRepoSecret: [
  9078. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9079. ],
  9080. deleteSecretForAuthenticatedUser: [
  9081. "DELETE /user/codespaces/secrets/{secret_name}"
  9082. ],
  9083. exportForAuthenticatedUser: [
  9084. "POST /user/codespaces/{codespace_name}/exports"
  9085. ],
  9086. getCodespacesForUserInOrg: [
  9087. "GET /orgs/{org}/members/{username}/codespaces"
  9088. ],
  9089. getExportDetailsForAuthenticatedUser: [
  9090. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  9091. ],
  9092. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  9093. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  9094. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  9095. getPublicKeyForAuthenticatedUser: [
  9096. "GET /user/codespaces/secrets/public-key"
  9097. ],
  9098. getRepoPublicKey: [
  9099. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  9100. ],
  9101. getRepoSecret: [
  9102. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9103. ],
  9104. getSecretForAuthenticatedUser: [
  9105. "GET /user/codespaces/secrets/{secret_name}"
  9106. ],
  9107. listDevcontainersInRepositoryForAuthenticatedUser: [
  9108. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  9109. ],
  9110. listForAuthenticatedUser: ["GET /user/codespaces"],
  9111. listInOrganization: [
  9112. "GET /orgs/{org}/codespaces",
  9113. {},
  9114. { renamedParameters: { org_id: "org" } }
  9115. ],
  9116. listInRepositoryForAuthenticatedUser: [
  9117. "GET /repos/{owner}/{repo}/codespaces"
  9118. ],
  9119. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  9120. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  9121. listRepositoriesForSecretForAuthenticatedUser: [
  9122. "GET /user/codespaces/secrets/{secret_name}/repositories"
  9123. ],
  9124. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  9125. listSelectedReposForOrgSecret: [
  9126. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9127. ],
  9128. preFlightWithRepoForAuthenticatedUser: [
  9129. "GET /repos/{owner}/{repo}/codespaces/new"
  9130. ],
  9131. publishForAuthenticatedUser: [
  9132. "POST /user/codespaces/{codespace_name}/publish"
  9133. ],
  9134. removeRepositoryForSecretForAuthenticatedUser: [
  9135. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9136. ],
  9137. removeSelectedRepoFromOrgSecret: [
  9138. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9139. ],
  9140. repoMachinesForAuthenticatedUser: [
  9141. "GET /repos/{owner}/{repo}/codespaces/machines"
  9142. ],
  9143. setRepositoriesForSecretForAuthenticatedUser: [
  9144. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  9145. ],
  9146. setSelectedReposForOrgSecret: [
  9147. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9148. ],
  9149. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  9150. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  9151. stopInOrganization: [
  9152. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  9153. ],
  9154. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  9155. },
  9156. copilot: {
  9157. addCopilotSeatsForTeams: [
  9158. "POST /orgs/{org}/copilot/billing/selected_teams"
  9159. ],
  9160. addCopilotSeatsForUsers: [
  9161. "POST /orgs/{org}/copilot/billing/selected_users"
  9162. ],
  9163. cancelCopilotSeatAssignmentForTeams: [
  9164. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  9165. ],
  9166. cancelCopilotSeatAssignmentForUsers: [
  9167. "DELETE /orgs/{org}/copilot/billing/selected_users"
  9168. ],
  9169. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  9170. getCopilotSeatDetailsForUser: [
  9171. "GET /orgs/{org}/members/{username}/copilot"
  9172. ],
  9173. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  9174. },
  9175. dependabot: {
  9176. addSelectedRepoToOrgSecret: [
  9177. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9178. ],
  9179. createOrUpdateOrgSecret: [
  9180. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  9181. ],
  9182. createOrUpdateRepoSecret: [
  9183. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9184. ],
  9185. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  9186. deleteRepoSecret: [
  9187. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9188. ],
  9189. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  9190. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  9191. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  9192. getRepoPublicKey: [
  9193. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  9194. ],
  9195. getRepoSecret: [
  9196. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9197. ],
  9198. listAlertsForEnterprise: [
  9199. "GET /enterprises/{enterprise}/dependabot/alerts"
  9200. ],
  9201. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  9202. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  9203. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  9204. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  9205. listSelectedReposForOrgSecret: [
  9206. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9207. ],
  9208. removeSelectedRepoFromOrgSecret: [
  9209. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9210. ],
  9211. setSelectedReposForOrgSecret: [
  9212. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9213. ],
  9214. updateAlert: [
  9215. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  9216. ]
  9217. },
  9218. dependencyGraph: {
  9219. createRepositorySnapshot: [
  9220. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  9221. ],
  9222. diffRange: [
  9223. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  9224. ],
  9225. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  9226. },
  9227. emojis: { get: ["GET /emojis"] },
  9228. gists: {
  9229. checkIsStarred: ["GET /gists/{gist_id}/star"],
  9230. create: ["POST /gists"],
  9231. createComment: ["POST /gists/{gist_id}/comments"],
  9232. delete: ["DELETE /gists/{gist_id}"],
  9233. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  9234. fork: ["POST /gists/{gist_id}/forks"],
  9235. get: ["GET /gists/{gist_id}"],
  9236. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  9237. getRevision: ["GET /gists/{gist_id}/{sha}"],
  9238. list: ["GET /gists"],
  9239. listComments: ["GET /gists/{gist_id}/comments"],
  9240. listCommits: ["GET /gists/{gist_id}/commits"],
  9241. listForUser: ["GET /users/{username}/gists"],
  9242. listForks: ["GET /gists/{gist_id}/forks"],
  9243. listPublic: ["GET /gists/public"],
  9244. listStarred: ["GET /gists/starred"],
  9245. star: ["PUT /gists/{gist_id}/star"],
  9246. unstar: ["DELETE /gists/{gist_id}/star"],
  9247. update: ["PATCH /gists/{gist_id}"],
  9248. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  9249. },
  9250. git: {
  9251. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  9252. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  9253. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  9254. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9255. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9256. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9257. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9258. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9259. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9260. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9261. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9262. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9263. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9264. },
  9265. gitignore: {
  9266. getAllTemplates: ["GET /gitignore/templates"],
  9267. getTemplate: ["GET /gitignore/templates/{name}"]
  9268. },
  9269. interactions: {
  9270. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9271. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9272. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9273. getRestrictionsForYourPublicRepos: [
  9274. "GET /user/interaction-limits",
  9275. {},
  9276. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9277. ],
  9278. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9279. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9280. removeRestrictionsForRepo: [
  9281. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9282. ],
  9283. removeRestrictionsForYourPublicRepos: [
  9284. "DELETE /user/interaction-limits",
  9285. {},
  9286. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9287. ],
  9288. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9289. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9290. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9291. setRestrictionsForYourPublicRepos: [
  9292. "PUT /user/interaction-limits",
  9293. {},
  9294. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9295. ]
  9296. },
  9297. issues: {
  9298. addAssignees: [
  9299. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9300. ],
  9301. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9302. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9303. checkUserCanBeAssignedToIssue: [
  9304. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9305. ],
  9306. create: ["POST /repos/{owner}/{repo}/issues"],
  9307. createComment: [
  9308. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9309. ],
  9310. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9311. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9312. deleteComment: [
  9313. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9314. ],
  9315. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9316. deleteMilestone: [
  9317. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9318. ],
  9319. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9320. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9321. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9322. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9323. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9324. list: ["GET /issues"],
  9325. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9326. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9327. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9328. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9329. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9330. listEventsForTimeline: [
  9331. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9332. ],
  9333. listForAuthenticatedUser: ["GET /user/issues"],
  9334. listForOrg: ["GET /orgs/{org}/issues"],
  9335. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9336. listLabelsForMilestone: [
  9337. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9338. ],
  9339. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9340. listLabelsOnIssue: [
  9341. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9342. ],
  9343. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9344. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9345. removeAllLabels: [
  9346. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9347. ],
  9348. removeAssignees: [
  9349. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9350. ],
  9351. removeLabel: [
  9352. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9353. ],
  9354. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9355. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9356. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9357. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9358. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9359. updateMilestone: [
  9360. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9361. ]
  9362. },
  9363. licenses: {
  9364. get: ["GET /licenses/{license}"],
  9365. getAllCommonlyUsed: ["GET /licenses"],
  9366. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9367. },
  9368. markdown: {
  9369. render: ["POST /markdown"],
  9370. renderRaw: [
  9371. "POST /markdown/raw",
  9372. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9373. ]
  9374. },
  9375. meta: {
  9376. get: ["GET /meta"],
  9377. getAllVersions: ["GET /versions"],
  9378. getOctocat: ["GET /octocat"],
  9379. getZen: ["GET /zen"],
  9380. root: ["GET /"]
  9381. },
  9382. migrations: {
  9383. cancelImport: [
  9384. "DELETE /repos/{owner}/{repo}/import",
  9385. {},
  9386. {
  9387. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9388. }
  9389. ],
  9390. deleteArchiveForAuthenticatedUser: [
  9391. "DELETE /user/migrations/{migration_id}/archive"
  9392. ],
  9393. deleteArchiveForOrg: [
  9394. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9395. ],
  9396. downloadArchiveForOrg: [
  9397. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9398. ],
  9399. getArchiveForAuthenticatedUser: [
  9400. "GET /user/migrations/{migration_id}/archive"
  9401. ],
  9402. getCommitAuthors: [
  9403. "GET /repos/{owner}/{repo}/import/authors",
  9404. {},
  9405. {
  9406. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9407. }
  9408. ],
  9409. getImportStatus: [
  9410. "GET /repos/{owner}/{repo}/import",
  9411. {},
  9412. {
  9413. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9414. }
  9415. ],
  9416. getLargeFiles: [
  9417. "GET /repos/{owner}/{repo}/import/large_files",
  9418. {},
  9419. {
  9420. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9421. }
  9422. ],
  9423. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9424. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9425. listForAuthenticatedUser: ["GET /user/migrations"],
  9426. listForOrg: ["GET /orgs/{org}/migrations"],
  9427. listReposForAuthenticatedUser: [
  9428. "GET /user/migrations/{migration_id}/repositories"
  9429. ],
  9430. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9431. listReposForUser: [
  9432. "GET /user/migrations/{migration_id}/repositories",
  9433. {},
  9434. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9435. ],
  9436. mapCommitAuthor: [
  9437. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9438. {},
  9439. {
  9440. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9441. }
  9442. ],
  9443. setLfsPreference: [
  9444. "PATCH /repos/{owner}/{repo}/import/lfs",
  9445. {},
  9446. {
  9447. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9448. }
  9449. ],
  9450. startForAuthenticatedUser: ["POST /user/migrations"],
  9451. startForOrg: ["POST /orgs/{org}/migrations"],
  9452. startImport: [
  9453. "PUT /repos/{owner}/{repo}/import",
  9454. {},
  9455. {
  9456. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9457. }
  9458. ],
  9459. unlockRepoForAuthenticatedUser: [
  9460. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9461. ],
  9462. unlockRepoForOrg: [
  9463. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9464. ],
  9465. updateImport: [
  9466. "PATCH /repos/{owner}/{repo}/import",
  9467. {},
  9468. {
  9469. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9470. }
  9471. ]
  9472. },
  9473. oidc: {
  9474. getOidcCustomSubTemplateForOrg: [
  9475. "GET /orgs/{org}/actions/oidc/customization/sub"
  9476. ],
  9477. updateOidcCustomSubTemplateForOrg: [
  9478. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9479. ]
  9480. },
  9481. orgs: {
  9482. addSecurityManagerTeam: [
  9483. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9484. ],
  9485. assignTeamToOrgRole: [
  9486. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9487. ],
  9488. assignUserToOrgRole: [
  9489. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9490. ],
  9491. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9492. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9493. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9494. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9495. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9496. convertMemberToOutsideCollaborator: [
  9497. "PUT /orgs/{org}/outside_collaborators/{username}"
  9498. ],
  9499. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9500. createInvitation: ["POST /orgs/{org}/invitations"],
  9501. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9502. createOrUpdateCustomPropertiesValuesForRepos: [
  9503. "PATCH /orgs/{org}/properties/values"
  9504. ],
  9505. createOrUpdateCustomProperty: [
  9506. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9507. ],
  9508. createWebhook: ["POST /orgs/{org}/hooks"],
  9509. delete: ["DELETE /orgs/{org}"],
  9510. deleteCustomOrganizationRole: [
  9511. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9512. ],
  9513. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9514. enableOrDisableSecurityProductOnAllOrgRepos: [
  9515. "POST /orgs/{org}/{security_product}/{enablement}"
  9516. ],
  9517. get: ["GET /orgs/{org}"],
  9518. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9519. getCustomProperty: [
  9520. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9521. ],
  9522. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9523. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9524. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9525. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9526. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9527. getWebhookDelivery: [
  9528. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9529. ],
  9530. list: ["GET /organizations"],
  9531. listAppInstallations: ["GET /orgs/{org}/installations"],
  9532. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9533. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9534. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9535. listForAuthenticatedUser: ["GET /user/orgs"],
  9536. listForUser: ["GET /users/{username}/orgs"],
  9537. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9538. listMembers: ["GET /orgs/{org}/members"],
  9539. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9540. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9541. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9542. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9543. listOrganizationFineGrainedPermissions: [
  9544. "GET /orgs/{org}/organization-fine-grained-permissions"
  9545. ],
  9546. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9547. listPatGrantRepositories: [
  9548. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9549. ],
  9550. listPatGrantRequestRepositories: [
  9551. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9552. ],
  9553. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9554. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9555. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9556. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9557. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9558. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9559. listWebhooks: ["GET /orgs/{org}/hooks"],
  9560. patchCustomOrganizationRole: [
  9561. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9562. ],
  9563. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9564. redeliverWebhookDelivery: [
  9565. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9566. ],
  9567. removeCustomProperty: [
  9568. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9569. ],
  9570. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9571. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9572. removeOutsideCollaborator: [
  9573. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9574. ],
  9575. removePublicMembershipForAuthenticatedUser: [
  9576. "DELETE /orgs/{org}/public_members/{username}"
  9577. ],
  9578. removeSecurityManagerTeam: [
  9579. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9580. ],
  9581. reviewPatGrantRequest: [
  9582. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9583. ],
  9584. reviewPatGrantRequestsInBulk: [
  9585. "POST /orgs/{org}/personal-access-token-requests"
  9586. ],
  9587. revokeAllOrgRolesTeam: [
  9588. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9589. ],
  9590. revokeAllOrgRolesUser: [
  9591. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9592. ],
  9593. revokeOrgRoleTeam: [
  9594. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9595. ],
  9596. revokeOrgRoleUser: [
  9597. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9598. ],
  9599. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9600. setPublicMembershipForAuthenticatedUser: [
  9601. "PUT /orgs/{org}/public_members/{username}"
  9602. ],
  9603. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9604. update: ["PATCH /orgs/{org}"],
  9605. updateMembershipForAuthenticatedUser: [
  9606. "PATCH /user/memberships/orgs/{org}"
  9607. ],
  9608. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9609. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9610. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9611. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9612. },
  9613. packages: {
  9614. deletePackageForAuthenticatedUser: [
  9615. "DELETE /user/packages/{package_type}/{package_name}"
  9616. ],
  9617. deletePackageForOrg: [
  9618. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9619. ],
  9620. deletePackageForUser: [
  9621. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9622. ],
  9623. deletePackageVersionForAuthenticatedUser: [
  9624. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9625. ],
  9626. deletePackageVersionForOrg: [
  9627. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9628. ],
  9629. deletePackageVersionForUser: [
  9630. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9631. ],
  9632. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9633. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9634. {},
  9635. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9636. ],
  9637. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9638. "GET /user/packages/{package_type}/{package_name}/versions",
  9639. {},
  9640. {
  9641. renamed: [
  9642. "packages",
  9643. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9644. ]
  9645. }
  9646. ],
  9647. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9648. "GET /user/packages/{package_type}/{package_name}/versions"
  9649. ],
  9650. getAllPackageVersionsForPackageOwnedByOrg: [
  9651. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9652. ],
  9653. getAllPackageVersionsForPackageOwnedByUser: [
  9654. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9655. ],
  9656. getPackageForAuthenticatedUser: [
  9657. "GET /user/packages/{package_type}/{package_name}"
  9658. ],
  9659. getPackageForOrganization: [
  9660. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9661. ],
  9662. getPackageForUser: [
  9663. "GET /users/{username}/packages/{package_type}/{package_name}"
  9664. ],
  9665. getPackageVersionForAuthenticatedUser: [
  9666. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9667. ],
  9668. getPackageVersionForOrganization: [
  9669. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9670. ],
  9671. getPackageVersionForUser: [
  9672. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9673. ],
  9674. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9675. "GET /user/docker/conflicts"
  9676. ],
  9677. listDockerMigrationConflictingPackagesForOrganization: [
  9678. "GET /orgs/{org}/docker/conflicts"
  9679. ],
  9680. listDockerMigrationConflictingPackagesForUser: [
  9681. "GET /users/{username}/docker/conflicts"
  9682. ],
  9683. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9684. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9685. listPackagesForUser: ["GET /users/{username}/packages"],
  9686. restorePackageForAuthenticatedUser: [
  9687. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9688. ],
  9689. restorePackageForOrg: [
  9690. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9691. ],
  9692. restorePackageForUser: [
  9693. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9694. ],
  9695. restorePackageVersionForAuthenticatedUser: [
  9696. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9697. ],
  9698. restorePackageVersionForOrg: [
  9699. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9700. ],
  9701. restorePackageVersionForUser: [
  9702. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9703. ]
  9704. },
  9705. projects: {
  9706. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9707. createCard: ["POST /projects/columns/{column_id}/cards"],
  9708. createColumn: ["POST /projects/{project_id}/columns"],
  9709. createForAuthenticatedUser: ["POST /user/projects"],
  9710. createForOrg: ["POST /orgs/{org}/projects"],
  9711. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9712. delete: ["DELETE /projects/{project_id}"],
  9713. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9714. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9715. get: ["GET /projects/{project_id}"],
  9716. getCard: ["GET /projects/columns/cards/{card_id}"],
  9717. getColumn: ["GET /projects/columns/{column_id}"],
  9718. getPermissionForUser: [
  9719. "GET /projects/{project_id}/collaborators/{username}/permission"
  9720. ],
  9721. listCards: ["GET /projects/columns/{column_id}/cards"],
  9722. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9723. listColumns: ["GET /projects/{project_id}/columns"],
  9724. listForOrg: ["GET /orgs/{org}/projects"],
  9725. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9726. listForUser: ["GET /users/{username}/projects"],
  9727. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9728. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9729. removeCollaborator: [
  9730. "DELETE /projects/{project_id}/collaborators/{username}"
  9731. ],
  9732. update: ["PATCH /projects/{project_id}"],
  9733. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9734. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9735. },
  9736. pulls: {
  9737. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9738. create: ["POST /repos/{owner}/{repo}/pulls"],
  9739. createReplyForReviewComment: [
  9740. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9741. ],
  9742. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9743. createReviewComment: [
  9744. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9745. ],
  9746. deletePendingReview: [
  9747. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9748. ],
  9749. deleteReviewComment: [
  9750. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9751. ],
  9752. dismissReview: [
  9753. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9754. ],
  9755. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9756. getReview: [
  9757. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9758. ],
  9759. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9760. list: ["GET /repos/{owner}/{repo}/pulls"],
  9761. listCommentsForReview: [
  9762. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9763. ],
  9764. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9765. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9766. listRequestedReviewers: [
  9767. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9768. ],
  9769. listReviewComments: [
  9770. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9771. ],
  9772. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9773. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9774. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9775. removeRequestedReviewers: [
  9776. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9777. ],
  9778. requestReviewers: [
  9779. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9780. ],
  9781. submitReview: [
  9782. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9783. ],
  9784. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9785. updateBranch: [
  9786. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9787. ],
  9788. updateReview: [
  9789. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9790. ],
  9791. updateReviewComment: [
  9792. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9793. ]
  9794. },
  9795. rateLimit: { get: ["GET /rate_limit"] },
  9796. reactions: {
  9797. createForCommitComment: [
  9798. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9799. ],
  9800. createForIssue: [
  9801. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9802. ],
  9803. createForIssueComment: [
  9804. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9805. ],
  9806. createForPullRequestReviewComment: [
  9807. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9808. ],
  9809. createForRelease: [
  9810. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9811. ],
  9812. createForTeamDiscussionCommentInOrg: [
  9813. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9814. ],
  9815. createForTeamDiscussionInOrg: [
  9816. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9817. ],
  9818. deleteForCommitComment: [
  9819. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9820. ],
  9821. deleteForIssue: [
  9822. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9823. ],
  9824. deleteForIssueComment: [
  9825. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9826. ],
  9827. deleteForPullRequestComment: [
  9828. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9829. ],
  9830. deleteForRelease: [
  9831. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9832. ],
  9833. deleteForTeamDiscussion: [
  9834. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9835. ],
  9836. deleteForTeamDiscussionComment: [
  9837. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9838. ],
  9839. listForCommitComment: [
  9840. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9841. ],
  9842. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9843. listForIssueComment: [
  9844. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9845. ],
  9846. listForPullRequestReviewComment: [
  9847. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9848. ],
  9849. listForRelease: [
  9850. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9851. ],
  9852. listForTeamDiscussionCommentInOrg: [
  9853. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9854. ],
  9855. listForTeamDiscussionInOrg: [
  9856. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9857. ]
  9858. },
  9859. repos: {
  9860. acceptInvitation: [
  9861. "PATCH /user/repository_invitations/{invitation_id}",
  9862. {},
  9863. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9864. ],
  9865. acceptInvitationForAuthenticatedUser: [
  9866. "PATCH /user/repository_invitations/{invitation_id}"
  9867. ],
  9868. addAppAccessRestrictions: [
  9869. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9870. {},
  9871. { mapToData: "apps" }
  9872. ],
  9873. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9874. addStatusCheckContexts: [
  9875. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9876. {},
  9877. { mapToData: "contexts" }
  9878. ],
  9879. addTeamAccessRestrictions: [
  9880. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9881. {},
  9882. { mapToData: "teams" }
  9883. ],
  9884. addUserAccessRestrictions: [
  9885. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9886. {},
  9887. { mapToData: "users" }
  9888. ],
  9889. cancelPagesDeployment: [
  9890. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9891. ],
  9892. checkAutomatedSecurityFixes: [
  9893. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9894. ],
  9895. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9896. checkVulnerabilityAlerts: [
  9897. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9898. ],
  9899. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9900. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9901. compareCommitsWithBasehead: [
  9902. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9903. ],
  9904. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9905. createCommitComment: [
  9906. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9907. ],
  9908. createCommitSignatureProtection: [
  9909. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9910. ],
  9911. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9912. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9913. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9914. createDeploymentBranchPolicy: [
  9915. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9916. ],
  9917. createDeploymentProtectionRule: [
  9918. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9919. ],
  9920. createDeploymentStatus: [
  9921. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9922. ],
  9923. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9924. createForAuthenticatedUser: ["POST /user/repos"],
  9925. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9926. createInOrg: ["POST /orgs/{org}/repos"],
  9927. createOrUpdateCustomPropertiesValues: [
  9928. "PATCH /repos/{owner}/{repo}/properties/values"
  9929. ],
  9930. createOrUpdateEnvironment: [
  9931. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9932. ],
  9933. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9934. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9935. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9936. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9937. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9938. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9939. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9940. createUsingTemplate: [
  9941. "POST /repos/{template_owner}/{template_repo}/generate"
  9942. ],
  9943. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9944. declineInvitation: [
  9945. "DELETE /user/repository_invitations/{invitation_id}",
  9946. {},
  9947. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9948. ],
  9949. declineInvitationForAuthenticatedUser: [
  9950. "DELETE /user/repository_invitations/{invitation_id}"
  9951. ],
  9952. delete: ["DELETE /repos/{owner}/{repo}"],
  9953. deleteAccessRestrictions: [
  9954. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9955. ],
  9956. deleteAdminBranchProtection: [
  9957. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9958. ],
  9959. deleteAnEnvironment: [
  9960. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9961. ],
  9962. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9963. deleteBranchProtection: [
  9964. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9965. ],
  9966. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9967. deleteCommitSignatureProtection: [
  9968. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9969. ],
  9970. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9971. deleteDeployment: [
  9972. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9973. ],
  9974. deleteDeploymentBranchPolicy: [
  9975. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9976. ],
  9977. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9978. deleteInvitation: [
  9979. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9980. ],
  9981. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9982. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9983. deletePullRequestReviewProtection: [
  9984. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9985. ],
  9986. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  9987. deleteReleaseAsset: [
  9988. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9989. ],
  9990. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9991. deleteTagProtection: [
  9992. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  9993. ],
  9994. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  9995. disableAutomatedSecurityFixes: [
  9996. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  9997. ],
  9998. disableDeploymentProtectionRule: [
  9999. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10000. ],
  10001. disablePrivateVulnerabilityReporting: [
  10002. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  10003. ],
  10004. disableVulnerabilityAlerts: [
  10005. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  10006. ],
  10007. downloadArchive: [
  10008. "GET /repos/{owner}/{repo}/zipball/{ref}",
  10009. {},
  10010. { renamed: ["repos", "downloadZipballArchive"] }
  10011. ],
  10012. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  10013. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  10014. enableAutomatedSecurityFixes: [
  10015. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  10016. ],
  10017. enablePrivateVulnerabilityReporting: [
  10018. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  10019. ],
  10020. enableVulnerabilityAlerts: [
  10021. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  10022. ],
  10023. generateReleaseNotes: [
  10024. "POST /repos/{owner}/{repo}/releases/generate-notes"
  10025. ],
  10026. get: ["GET /repos/{owner}/{repo}"],
  10027. getAccessRestrictions: [
  10028. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10029. ],
  10030. getAdminBranchProtection: [
  10031. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10032. ],
  10033. getAllDeploymentProtectionRules: [
  10034. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10035. ],
  10036. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  10037. getAllStatusCheckContexts: [
  10038. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  10039. ],
  10040. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  10041. getAppsWithAccessToProtectedBranch: [
  10042. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  10043. ],
  10044. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10045. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  10046. getBranchProtection: [
  10047. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  10048. ],
  10049. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  10050. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  10051. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  10052. getCollaboratorPermissionLevel: [
  10053. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  10054. ],
  10055. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  10056. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  10057. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  10058. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  10059. getCommitSignatureProtection: [
  10060. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10061. ],
  10062. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  10063. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  10064. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  10065. getCustomDeploymentProtectionRule: [
  10066. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10067. ],
  10068. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  10069. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  10070. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  10071. getDeploymentBranchPolicy: [
  10072. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10073. ],
  10074. getDeploymentStatus: [
  10075. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  10076. ],
  10077. getEnvironment: [
  10078. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  10079. ],
  10080. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  10081. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  10082. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  10083. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  10084. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  10085. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  10086. getPages: ["GET /repos/{owner}/{repo}/pages"],
  10087. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  10088. getPagesDeployment: [
  10089. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  10090. ],
  10091. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  10092. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  10093. getPullRequestReviewProtection: [
  10094. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10095. ],
  10096. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  10097. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  10098. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  10099. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  10100. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  10101. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  10102. getRepoRuleSuite: [
  10103. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  10104. ],
  10105. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  10106. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10107. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  10108. getStatusChecksProtection: [
  10109. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10110. ],
  10111. getTeamsWithAccessToProtectedBranch: [
  10112. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  10113. ],
  10114. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  10115. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  10116. getUsersWithAccessToProtectedBranch: [
  10117. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  10118. ],
  10119. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  10120. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  10121. getWebhookConfigForRepo: [
  10122. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10123. ],
  10124. getWebhookDelivery: [
  10125. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  10126. ],
  10127. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  10128. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  10129. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  10130. listBranchesForHeadCommit: [
  10131. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  10132. ],
  10133. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  10134. listCommentsForCommit: [
  10135. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10136. ],
  10137. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  10138. listCommitStatusesForRef: [
  10139. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  10140. ],
  10141. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  10142. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  10143. listCustomDeploymentRuleIntegrations: [
  10144. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  10145. ],
  10146. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  10147. listDeploymentBranchPolicies: [
  10148. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10149. ],
  10150. listDeploymentStatuses: [
  10151. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10152. ],
  10153. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  10154. listForAuthenticatedUser: ["GET /user/repos"],
  10155. listForOrg: ["GET /orgs/{org}/repos"],
  10156. listForUser: ["GET /users/{username}/repos"],
  10157. listForks: ["GET /repos/{owner}/{repo}/forks"],
  10158. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  10159. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  10160. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  10161. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  10162. listPublic: ["GET /repositories"],
  10163. listPullRequestsAssociatedWithCommit: [
  10164. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  10165. ],
  10166. listReleaseAssets: [
  10167. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  10168. ],
  10169. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  10170. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  10171. listTags: ["GET /repos/{owner}/{repo}/tags"],
  10172. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  10173. listWebhookDeliveries: [
  10174. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  10175. ],
  10176. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  10177. merge: ["POST /repos/{owner}/{repo}/merges"],
  10178. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  10179. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  10180. redeliverWebhookDelivery: [
  10181. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  10182. ],
  10183. removeAppAccessRestrictions: [
  10184. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10185. {},
  10186. { mapToData: "apps" }
  10187. ],
  10188. removeCollaborator: [
  10189. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  10190. ],
  10191. removeStatusCheckContexts: [
  10192. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10193. {},
  10194. { mapToData: "contexts" }
  10195. ],
  10196. removeStatusCheckProtection: [
  10197. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10198. ],
  10199. removeTeamAccessRestrictions: [
  10200. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10201. {},
  10202. { mapToData: "teams" }
  10203. ],
  10204. removeUserAccessRestrictions: [
  10205. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10206. {},
  10207. { mapToData: "users" }
  10208. ],
  10209. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  10210. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  10211. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  10212. setAdminBranchProtection: [
  10213. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10214. ],
  10215. setAppAccessRestrictions: [
  10216. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10217. {},
  10218. { mapToData: "apps" }
  10219. ],
  10220. setStatusCheckContexts: [
  10221. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10222. {},
  10223. { mapToData: "contexts" }
  10224. ],
  10225. setTeamAccessRestrictions: [
  10226. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10227. {},
  10228. { mapToData: "teams" }
  10229. ],
  10230. setUserAccessRestrictions: [
  10231. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10232. {},
  10233. { mapToData: "users" }
  10234. ],
  10235. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  10236. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  10237. update: ["PATCH /repos/{owner}/{repo}"],
  10238. updateBranchProtection: [
  10239. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  10240. ],
  10241. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  10242. updateDeploymentBranchPolicy: [
  10243. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10244. ],
  10245. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  10246. updateInvitation: [
  10247. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  10248. ],
  10249. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  10250. updatePullRequestReviewProtection: [
  10251. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10252. ],
  10253. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  10254. updateReleaseAsset: [
  10255. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10256. ],
  10257. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10258. updateStatusCheckPotection: [
  10259. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10260. {},
  10261. { renamed: ["repos", "updateStatusCheckProtection"] }
  10262. ],
  10263. updateStatusCheckProtection: [
  10264. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10265. ],
  10266. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10267. updateWebhookConfigForRepo: [
  10268. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10269. ],
  10270. uploadReleaseAsset: [
  10271. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10272. { baseUrl: "https://uploads.github.com" }
  10273. ]
  10274. },
  10275. search: {
  10276. code: ["GET /search/code"],
  10277. commits: ["GET /search/commits"],
  10278. issuesAndPullRequests: ["GET /search/issues"],
  10279. labels: ["GET /search/labels"],
  10280. repos: ["GET /search/repositories"],
  10281. topics: ["GET /search/topics"],
  10282. users: ["GET /search/users"]
  10283. },
  10284. secretScanning: {
  10285. getAlert: [
  10286. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10287. ],
  10288. listAlertsForEnterprise: [
  10289. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10290. ],
  10291. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10292. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10293. listLocationsForAlert: [
  10294. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10295. ],
  10296. updateAlert: [
  10297. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10298. ]
  10299. },
  10300. securityAdvisories: {
  10301. createFork: [
  10302. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10303. ],
  10304. createPrivateVulnerabilityReport: [
  10305. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10306. ],
  10307. createRepositoryAdvisory: [
  10308. "POST /repos/{owner}/{repo}/security-advisories"
  10309. ],
  10310. createRepositoryAdvisoryCveRequest: [
  10311. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10312. ],
  10313. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10314. getRepositoryAdvisory: [
  10315. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10316. ],
  10317. listGlobalAdvisories: ["GET /advisories"],
  10318. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10319. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10320. updateRepositoryAdvisory: [
  10321. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10322. ]
  10323. },
  10324. teams: {
  10325. addOrUpdateMembershipForUserInOrg: [
  10326. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10327. ],
  10328. addOrUpdateProjectPermissionsInOrg: [
  10329. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10330. ],
  10331. addOrUpdateRepoPermissionsInOrg: [
  10332. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10333. ],
  10334. checkPermissionsForProjectInOrg: [
  10335. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10336. ],
  10337. checkPermissionsForRepoInOrg: [
  10338. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10339. ],
  10340. create: ["POST /orgs/{org}/teams"],
  10341. createDiscussionCommentInOrg: [
  10342. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10343. ],
  10344. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10345. deleteDiscussionCommentInOrg: [
  10346. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10347. ],
  10348. deleteDiscussionInOrg: [
  10349. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10350. ],
  10351. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10352. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10353. getDiscussionCommentInOrg: [
  10354. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10355. ],
  10356. getDiscussionInOrg: [
  10357. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10358. ],
  10359. getMembershipForUserInOrg: [
  10360. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10361. ],
  10362. list: ["GET /orgs/{org}/teams"],
  10363. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10364. listDiscussionCommentsInOrg: [
  10365. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10366. ],
  10367. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10368. listForAuthenticatedUser: ["GET /user/teams"],
  10369. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10370. listPendingInvitationsInOrg: [
  10371. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10372. ],
  10373. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10374. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10375. removeMembershipForUserInOrg: [
  10376. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10377. ],
  10378. removeProjectInOrg: [
  10379. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10380. ],
  10381. removeRepoInOrg: [
  10382. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10383. ],
  10384. updateDiscussionCommentInOrg: [
  10385. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10386. ],
  10387. updateDiscussionInOrg: [
  10388. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10389. ],
  10390. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10391. },
  10392. users: {
  10393. addEmailForAuthenticated: [
  10394. "POST /user/emails",
  10395. {},
  10396. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10397. ],
  10398. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10399. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10400. block: ["PUT /user/blocks/{username}"],
  10401. checkBlocked: ["GET /user/blocks/{username}"],
  10402. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10403. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10404. createGpgKeyForAuthenticated: [
  10405. "POST /user/gpg_keys",
  10406. {},
  10407. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10408. ],
  10409. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10410. createPublicSshKeyForAuthenticated: [
  10411. "POST /user/keys",
  10412. {},
  10413. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10414. ],
  10415. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10416. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10417. deleteEmailForAuthenticated: [
  10418. "DELETE /user/emails",
  10419. {},
  10420. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10421. ],
  10422. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10423. deleteGpgKeyForAuthenticated: [
  10424. "DELETE /user/gpg_keys/{gpg_key_id}",
  10425. {},
  10426. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10427. ],
  10428. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10429. deletePublicSshKeyForAuthenticated: [
  10430. "DELETE /user/keys/{key_id}",
  10431. {},
  10432. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10433. ],
  10434. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10435. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10436. deleteSshSigningKeyForAuthenticatedUser: [
  10437. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10438. ],
  10439. follow: ["PUT /user/following/{username}"],
  10440. getAuthenticated: ["GET /user"],
  10441. getByUsername: ["GET /users/{username}"],
  10442. getContextForUser: ["GET /users/{username}/hovercard"],
  10443. getGpgKeyForAuthenticated: [
  10444. "GET /user/gpg_keys/{gpg_key_id}",
  10445. {},
  10446. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10447. ],
  10448. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10449. getPublicSshKeyForAuthenticated: [
  10450. "GET /user/keys/{key_id}",
  10451. {},
  10452. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10453. ],
  10454. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10455. getSshSigningKeyForAuthenticatedUser: [
  10456. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10457. ],
  10458. list: ["GET /users"],
  10459. listBlockedByAuthenticated: [
  10460. "GET /user/blocks",
  10461. {},
  10462. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10463. ],
  10464. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10465. listEmailsForAuthenticated: [
  10466. "GET /user/emails",
  10467. {},
  10468. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10469. ],
  10470. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10471. listFollowedByAuthenticated: [
  10472. "GET /user/following",
  10473. {},
  10474. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10475. ],
  10476. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10477. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10478. listFollowersForUser: ["GET /users/{username}/followers"],
  10479. listFollowingForUser: ["GET /users/{username}/following"],
  10480. listGpgKeysForAuthenticated: [
  10481. "GET /user/gpg_keys",
  10482. {},
  10483. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10484. ],
  10485. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10486. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10487. listPublicEmailsForAuthenticated: [
  10488. "GET /user/public_emails",
  10489. {},
  10490. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10491. ],
  10492. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10493. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10494. listPublicSshKeysForAuthenticated: [
  10495. "GET /user/keys",
  10496. {},
  10497. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10498. ],
  10499. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10500. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10501. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10502. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10503. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10504. setPrimaryEmailVisibilityForAuthenticated: [
  10505. "PATCH /user/email/visibility",
  10506. {},
  10507. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10508. ],
  10509. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10510. "PATCH /user/email/visibility"
  10511. ],
  10512. unblock: ["DELETE /user/blocks/{username}"],
  10513. unfollow: ["DELETE /user/following/{username}"],
  10514. updateAuthenticated: ["PATCH /user"]
  10515. }
  10516. };
  10517. var endpoints_default = Endpoints;
  10518. // pkg/dist-src/endpoints-to-methods.js
  10519. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10520. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10521. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10522. const [route, defaults, decorations] = endpoint;
  10523. const [method, url] = route.split(/ /);
  10524. const endpointDefaults = Object.assign(
  10525. {
  10526. method,
  10527. url
  10528. },
  10529. defaults
  10530. );
  10531. if (!endpointMethodsMap.has(scope)) {
  10532. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10533. }
  10534. endpointMethodsMap.get(scope).set(methodName, {
  10535. scope,
  10536. methodName,
  10537. endpointDefaults,
  10538. decorations
  10539. });
  10540. }
  10541. }
  10542. var handler = {
  10543. has({ scope }, methodName) {
  10544. return endpointMethodsMap.get(scope).has(methodName);
  10545. },
  10546. getOwnPropertyDescriptor(target, methodName) {
  10547. return {
  10548. value: this.get(target, methodName),
  10549. // ensures method is in the cache
  10550. configurable: true,
  10551. writable: true,
  10552. enumerable: true
  10553. };
  10554. },
  10555. defineProperty(target, methodName, descriptor) {
  10556. Object.defineProperty(target.cache, methodName, descriptor);
  10557. return true;
  10558. },
  10559. deleteProperty(target, methodName) {
  10560. delete target.cache[methodName];
  10561. return true;
  10562. },
  10563. ownKeys({ scope }) {
  10564. return [...endpointMethodsMap.get(scope).keys()];
  10565. },
  10566. set(target, methodName, value) {
  10567. return target.cache[methodName] = value;
  10568. },
  10569. get({ octokit, scope, cache }, methodName) {
  10570. if (cache[methodName]) {
  10571. return cache[methodName];
  10572. }
  10573. const method = endpointMethodsMap.get(scope).get(methodName);
  10574. if (!method) {
  10575. return void 0;
  10576. }
  10577. const { endpointDefaults, decorations } = method;
  10578. if (decorations) {
  10579. cache[methodName] = decorate(
  10580. octokit,
  10581. scope,
  10582. methodName,
  10583. endpointDefaults,
  10584. decorations
  10585. );
  10586. } else {
  10587. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10588. }
  10589. return cache[methodName];
  10590. }
  10591. };
  10592. function endpointsToMethods(octokit) {
  10593. const newMethods = {};
  10594. for (const scope of endpointMethodsMap.keys()) {
  10595. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10596. }
  10597. return newMethods;
  10598. }
  10599. function decorate(octokit, scope, methodName, defaults, decorations) {
  10600. const requestWithDefaults = octokit.request.defaults(defaults);
  10601. function withDecorations(...args) {
  10602. let options = requestWithDefaults.endpoint.merge(...args);
  10603. if (decorations.mapToData) {
  10604. options = Object.assign({}, options, {
  10605. data: options[decorations.mapToData],
  10606. [decorations.mapToData]: void 0
  10607. });
  10608. return requestWithDefaults(options);
  10609. }
  10610. if (decorations.renamed) {
  10611. const [newScope, newMethodName] = decorations.renamed;
  10612. octokit.log.warn(
  10613. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10614. );
  10615. }
  10616. if (decorations.deprecated) {
  10617. octokit.log.warn(decorations.deprecated);
  10618. }
  10619. if (decorations.renamedParameters) {
  10620. const options2 = requestWithDefaults.endpoint.merge(...args);
  10621. for (const [name, alias] of Object.entries(
  10622. decorations.renamedParameters
  10623. )) {
  10624. if (name in options2) {
  10625. octokit.log.warn(
  10626. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10627. );
  10628. if (!(alias in options2)) {
  10629. options2[alias] = options2[name];
  10630. }
  10631. delete options2[name];
  10632. }
  10633. }
  10634. return requestWithDefaults(options2);
  10635. }
  10636. return requestWithDefaults(...args);
  10637. }
  10638. return Object.assign(withDecorations, requestWithDefaults);
  10639. }
  10640. // pkg/dist-src/index.js
  10641. function restEndpointMethods(octokit) {
  10642. const api = endpointsToMethods(octokit);
  10643. return {
  10644. rest: api
  10645. };
  10646. }
  10647. restEndpointMethods.VERSION = VERSION;
  10648. function legacyRestEndpointMethods(octokit) {
  10649. const api = endpointsToMethods(octokit);
  10650. return {
  10651. ...api,
  10652. rest: api
  10653. };
  10654. }
  10655. legacyRestEndpointMethods.VERSION = VERSION;
  10656. // Annotate the CommonJS export names for ESM import in node:
  10657. 0 && (0);
  10658. /***/ }),
  10659. /***/ 537:
  10660. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10661. "use strict";
  10662. var __create = Object.create;
  10663. var __defProp = Object.defineProperty;
  10664. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10665. var __getOwnPropNames = Object.getOwnPropertyNames;
  10666. var __getProtoOf = Object.getPrototypeOf;
  10667. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10668. var __export = (target, all) => {
  10669. for (var name in all)
  10670. __defProp(target, name, { get: all[name], enumerable: true });
  10671. };
  10672. var __copyProps = (to, from, except, desc) => {
  10673. if (from && typeof from === "object" || typeof from === "function") {
  10674. for (let key of __getOwnPropNames(from))
  10675. if (!__hasOwnProp.call(to, key) && key !== except)
  10676. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10677. }
  10678. return to;
  10679. };
  10680. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10681. // If the importer is in node compatibility mode or this is not an ESM
  10682. // file that has been converted to a CommonJS file using a Babel-
  10683. // compatible transform (i.e. "__esModule" has not been set), then set
  10684. // "default" to the CommonJS "module.exports" for node compatibility.
  10685. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10686. mod
  10687. ));
  10688. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10689. // pkg/dist-src/index.js
  10690. var dist_src_exports = {};
  10691. __export(dist_src_exports, {
  10692. RequestError: () => RequestError
  10693. });
  10694. module.exports = __toCommonJS(dist_src_exports);
  10695. var import_deprecation = __nccwpck_require__(8932);
  10696. var import_once = __toESM(__nccwpck_require__(1223));
  10697. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10698. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10699. var RequestError = class extends Error {
  10700. constructor(message, statusCode, options) {
  10701. super(message);
  10702. if (Error.captureStackTrace) {
  10703. Error.captureStackTrace(this, this.constructor);
  10704. }
  10705. this.name = "HttpError";
  10706. this.status = statusCode;
  10707. let headers;
  10708. if ("headers" in options && typeof options.headers !== "undefined") {
  10709. headers = options.headers;
  10710. }
  10711. if ("response" in options) {
  10712. this.response = options.response;
  10713. headers = options.response.headers;
  10714. }
  10715. const requestCopy = Object.assign({}, options.request);
  10716. if (options.request.headers.authorization) {
  10717. requestCopy.headers = Object.assign({}, options.request.headers, {
  10718. authorization: options.request.headers.authorization.replace(
  10719. /(?<! ) .*$/,
  10720. " [REDACTED]"
  10721. )
  10722. });
  10723. }
  10724. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10725. this.request = requestCopy;
  10726. Object.defineProperty(this, "code", {
  10727. get() {
  10728. logOnceCode(
  10729. new import_deprecation.Deprecation(
  10730. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10731. )
  10732. );
  10733. return statusCode;
  10734. }
  10735. });
  10736. Object.defineProperty(this, "headers", {
  10737. get() {
  10738. logOnceHeaders(
  10739. new import_deprecation.Deprecation(
  10740. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10741. )
  10742. );
  10743. return headers || {};
  10744. }
  10745. });
  10746. }
  10747. };
  10748. // Annotate the CommonJS export names for ESM import in node:
  10749. 0 && (0);
  10750. /***/ }),
  10751. /***/ 6234:
  10752. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10753. "use strict";
  10754. var __defProp = Object.defineProperty;
  10755. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10756. var __getOwnPropNames = Object.getOwnPropertyNames;
  10757. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10758. var __export = (target, all) => {
  10759. for (var name in all)
  10760. __defProp(target, name, { get: all[name], enumerable: true });
  10761. };
  10762. var __copyProps = (to, from, except, desc) => {
  10763. if (from && typeof from === "object" || typeof from === "function") {
  10764. for (let key of __getOwnPropNames(from))
  10765. if (!__hasOwnProp.call(to, key) && key !== except)
  10766. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10767. }
  10768. return to;
  10769. };
  10770. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10771. // pkg/dist-src/index.js
  10772. var dist_src_exports = {};
  10773. __export(dist_src_exports, {
  10774. request: () => request
  10775. });
  10776. module.exports = __toCommonJS(dist_src_exports);
  10777. var import_endpoint = __nccwpck_require__(9440);
  10778. var import_universal_user_agent = __nccwpck_require__(5030);
  10779. // pkg/dist-src/version.js
  10780. var VERSION = "8.4.1";
  10781. // pkg/dist-src/is-plain-object.js
  10782. function isPlainObject(value) {
  10783. if (typeof value !== "object" || value === null)
  10784. return false;
  10785. if (Object.prototype.toString.call(value) !== "[object Object]")
  10786. return false;
  10787. const proto = Object.getPrototypeOf(value);
  10788. if (proto === null)
  10789. return true;
  10790. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10791. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10792. }
  10793. // pkg/dist-src/fetch-wrapper.js
  10794. var import_request_error = __nccwpck_require__(537);
  10795. // pkg/dist-src/get-buffer-response.js
  10796. function getBufferResponse(response) {
  10797. return response.arrayBuffer();
  10798. }
  10799. // pkg/dist-src/fetch-wrapper.js
  10800. function fetchWrapper(requestOptions) {
  10801. var _a, _b, _c, _d;
  10802. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10803. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10804. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10805. requestOptions.body = JSON.stringify(requestOptions.body);
  10806. }
  10807. let headers = {};
  10808. let status;
  10809. let url;
  10810. let { fetch } = globalThis;
  10811. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10812. fetch = requestOptions.request.fetch;
  10813. }
  10814. if (!fetch) {
  10815. throw new Error(
  10816. "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"
  10817. );
  10818. }
  10819. return fetch(requestOptions.url, {
  10820. method: requestOptions.method,
  10821. body: requestOptions.body,
  10822. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10823. headers: requestOptions.headers,
  10824. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10825. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10826. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10827. ...requestOptions.body && { duplex: "half" }
  10828. }).then(async (response) => {
  10829. url = response.url;
  10830. status = response.status;
  10831. for (const keyAndValue of response.headers) {
  10832. headers[keyAndValue[0]] = keyAndValue[1];
  10833. }
  10834. if ("deprecation" in headers) {
  10835. const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
  10836. const deprecationLink = matches && matches.pop();
  10837. log.warn(
  10838. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10839. );
  10840. }
  10841. if (status === 204 || status === 205) {
  10842. return;
  10843. }
  10844. if (requestOptions.method === "HEAD") {
  10845. if (status < 400) {
  10846. return;
  10847. }
  10848. throw new import_request_error.RequestError(response.statusText, status, {
  10849. response: {
  10850. url,
  10851. status,
  10852. headers,
  10853. data: void 0
  10854. },
  10855. request: requestOptions
  10856. });
  10857. }
  10858. if (status === 304) {
  10859. throw new import_request_error.RequestError("Not modified", status, {
  10860. response: {
  10861. url,
  10862. status,
  10863. headers,
  10864. data: await getResponseData(response)
  10865. },
  10866. request: requestOptions
  10867. });
  10868. }
  10869. if (status >= 400) {
  10870. const data = await getResponseData(response);
  10871. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10872. response: {
  10873. url,
  10874. status,
  10875. headers,
  10876. data
  10877. },
  10878. request: requestOptions
  10879. });
  10880. throw error;
  10881. }
  10882. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10883. }).then((data) => {
  10884. return {
  10885. status,
  10886. url,
  10887. headers,
  10888. data
  10889. };
  10890. }).catch((error) => {
  10891. if (error instanceof import_request_error.RequestError)
  10892. throw error;
  10893. else if (error.name === "AbortError")
  10894. throw error;
  10895. let message = error.message;
  10896. if (error.name === "TypeError" && "cause" in error) {
  10897. if (error.cause instanceof Error) {
  10898. message = error.cause.message;
  10899. } else if (typeof error.cause === "string") {
  10900. message = error.cause;
  10901. }
  10902. }
  10903. throw new import_request_error.RequestError(message, 500, {
  10904. request: requestOptions
  10905. });
  10906. });
  10907. }
  10908. async function getResponseData(response) {
  10909. const contentType = response.headers.get("content-type");
  10910. if (/application\/json/.test(contentType)) {
  10911. return response.json().catch(() => response.text()).catch(() => "");
  10912. }
  10913. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10914. return response.text();
  10915. }
  10916. return getBufferResponse(response);
  10917. }
  10918. function toErrorMessage(data) {
  10919. if (typeof data === "string")
  10920. return data;
  10921. let suffix;
  10922. if ("documentation_url" in data) {
  10923. suffix = ` - ${data.documentation_url}`;
  10924. } else {
  10925. suffix = "";
  10926. }
  10927. if ("message" in data) {
  10928. if (Array.isArray(data.errors)) {
  10929. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10930. }
  10931. return `${data.message}${suffix}`;
  10932. }
  10933. return `Unknown error: ${JSON.stringify(data)}`;
  10934. }
  10935. // pkg/dist-src/with-defaults.js
  10936. function withDefaults(oldEndpoint, newDefaults) {
  10937. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10938. const newApi = function(route, parameters) {
  10939. const endpointOptions = endpoint2.merge(route, parameters);
  10940. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10941. return fetchWrapper(endpoint2.parse(endpointOptions));
  10942. }
  10943. const request2 = (route2, parameters2) => {
  10944. return fetchWrapper(
  10945. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10946. );
  10947. };
  10948. Object.assign(request2, {
  10949. endpoint: endpoint2,
  10950. defaults: withDefaults.bind(null, endpoint2)
  10951. });
  10952. return endpointOptions.request.hook(request2, endpointOptions);
  10953. };
  10954. return Object.assign(newApi, {
  10955. endpoint: endpoint2,
  10956. defaults: withDefaults.bind(null, endpoint2)
  10957. });
  10958. }
  10959. // pkg/dist-src/index.js
  10960. var request = withDefaults(import_endpoint.endpoint, {
  10961. headers: {
  10962. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10963. }
  10964. });
  10965. // Annotate the CommonJS export names for ESM import in node:
  10966. 0 && (0);
  10967. /***/ }),
  10968. /***/ 3682:
  10969. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10970. var register = __nccwpck_require__(4670);
  10971. var addHook = __nccwpck_require__(5549);
  10972. var removeHook = __nccwpck_require__(6819);
  10973. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10974. var bind = Function.bind;
  10975. var bindable = bind.bind(bind);
  10976. function bindApi(hook, state, name) {
  10977. var removeHookRef = bindable(removeHook, null).apply(
  10978. null,
  10979. name ? [state, name] : [state]
  10980. );
  10981. hook.api = { remove: removeHookRef };
  10982. hook.remove = removeHookRef;
  10983. ["before", "error", "after", "wrap"].forEach(function (kind) {
  10984. var args = name ? [state, kind, name] : [state, kind];
  10985. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  10986. });
  10987. }
  10988. function HookSingular() {
  10989. var singularHookName = "h";
  10990. var singularHookState = {
  10991. registry: {},
  10992. };
  10993. var singularHook = register.bind(null, singularHookState, singularHookName);
  10994. bindApi(singularHook, singularHookState, singularHookName);
  10995. return singularHook;
  10996. }
  10997. function HookCollection() {
  10998. var state = {
  10999. registry: {},
  11000. };
  11001. var hook = register.bind(null, state);
  11002. bindApi(hook, state);
  11003. return hook;
  11004. }
  11005. var collectionHookDeprecationMessageDisplayed = false;
  11006. function Hook() {
  11007. if (!collectionHookDeprecationMessageDisplayed) {
  11008. console.warn(
  11009. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  11010. );
  11011. collectionHookDeprecationMessageDisplayed = true;
  11012. }
  11013. return HookCollection();
  11014. }
  11015. Hook.Singular = HookSingular.bind();
  11016. Hook.Collection = HookCollection.bind();
  11017. module.exports = Hook;
  11018. // expose constructors as a named property for TypeScript
  11019. module.exports.Hook = Hook;
  11020. module.exports.Singular = Hook.Singular;
  11021. module.exports.Collection = Hook.Collection;
  11022. /***/ }),
  11023. /***/ 5549:
  11024. /***/ ((module) => {
  11025. module.exports = addHook;
  11026. function addHook(state, kind, name, hook) {
  11027. var orig = hook;
  11028. if (!state.registry[name]) {
  11029. state.registry[name] = [];
  11030. }
  11031. if (kind === "before") {
  11032. hook = function (method, options) {
  11033. return Promise.resolve()
  11034. .then(orig.bind(null, options))
  11035. .then(method.bind(null, options));
  11036. };
  11037. }
  11038. if (kind === "after") {
  11039. hook = function (method, options) {
  11040. var result;
  11041. return Promise.resolve()
  11042. .then(method.bind(null, options))
  11043. .then(function (result_) {
  11044. result = result_;
  11045. return orig(result, options);
  11046. })
  11047. .then(function () {
  11048. return result;
  11049. });
  11050. };
  11051. }
  11052. if (kind === "error") {
  11053. hook = function (method, options) {
  11054. return Promise.resolve()
  11055. .then(method.bind(null, options))
  11056. .catch(function (error) {
  11057. return orig(error, options);
  11058. });
  11059. };
  11060. }
  11061. state.registry[name].push({
  11062. hook: hook,
  11063. orig: orig,
  11064. });
  11065. }
  11066. /***/ }),
  11067. /***/ 4670:
  11068. /***/ ((module) => {
  11069. module.exports = register;
  11070. function register(state, name, method, options) {
  11071. if (typeof method !== "function") {
  11072. throw new Error("method for before hook must be a function");
  11073. }
  11074. if (!options) {
  11075. options = {};
  11076. }
  11077. if (Array.isArray(name)) {
  11078. return name.reverse().reduce(function (callback, name) {
  11079. return register.bind(null, state, name, callback, options);
  11080. }, method)();
  11081. }
  11082. return Promise.resolve().then(function () {
  11083. if (!state.registry[name]) {
  11084. return method(options);
  11085. }
  11086. return state.registry[name].reduce(function (method, registered) {
  11087. return registered.hook.bind(null, method, options);
  11088. }, method)();
  11089. });
  11090. }
  11091. /***/ }),
  11092. /***/ 6819:
  11093. /***/ ((module) => {
  11094. module.exports = removeHook;
  11095. function removeHook(state, name, method) {
  11096. if (!state.registry[name]) {
  11097. return;
  11098. }
  11099. var index = state.registry[name]
  11100. .map(function (registered) {
  11101. return registered.orig;
  11102. })
  11103. .indexOf(method);
  11104. if (index === -1) {
  11105. return;
  11106. }
  11107. state.registry[name].splice(index, 1);
  11108. }
  11109. /***/ }),
  11110. /***/ 8932:
  11111. /***/ ((__unused_webpack_module, exports) => {
  11112. "use strict";
  11113. Object.defineProperty(exports, "__esModule", ({ value: true }));
  11114. class Deprecation extends Error {
  11115. constructor(message) {
  11116. super(message); // Maintains proper stack trace (only available on V8)
  11117. /* istanbul ignore next */
  11118. if (Error.captureStackTrace) {
  11119. Error.captureStackTrace(this, this.constructor);
  11120. }
  11121. this.name = 'Deprecation';
  11122. }
  11123. }
  11124. exports.Deprecation = Deprecation;
  11125. /***/ }),
  11126. /***/ 1223:
  11127. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11128. var wrappy = __nccwpck_require__(2940)
  11129. module.exports = wrappy(once)
  11130. module.exports.strict = wrappy(onceStrict)
  11131. once.proto = once(function () {
  11132. Object.defineProperty(Function.prototype, 'once', {
  11133. value: function () {
  11134. return once(this)
  11135. },
  11136. configurable: true
  11137. })
  11138. Object.defineProperty(Function.prototype, 'onceStrict', {
  11139. value: function () {
  11140. return onceStrict(this)
  11141. },
  11142. configurable: true
  11143. })
  11144. })
  11145. function once (fn) {
  11146. var f = function () {
  11147. if (f.called) return f.value
  11148. f.called = true
  11149. return f.value = fn.apply(this, arguments)
  11150. }
  11151. f.called = false
  11152. return f
  11153. }
  11154. function onceStrict (fn) {
  11155. var f = function () {
  11156. if (f.called)
  11157. throw new Error(f.onceError)
  11158. f.called = true
  11159. return f.value = fn.apply(this, arguments)
  11160. }
  11161. var name = fn.name || 'Function wrapped with `once`'
  11162. f.onceError = name + " shouldn't be called more than once"
  11163. f.called = false
  11164. return f
  11165. }
  11166. /***/ }),
  11167. /***/ 5911:
  11168. /***/ ((module, exports) => {
  11169. exports = module.exports = SemVer
  11170. var debug
  11171. /* istanbul ignore next */
  11172. if (typeof process === 'object' &&
  11173. process.env &&
  11174. process.env.NODE_DEBUG &&
  11175. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  11176. debug = function () {
  11177. var args = Array.prototype.slice.call(arguments, 0)
  11178. args.unshift('SEMVER')
  11179. console.log.apply(console, args)
  11180. }
  11181. } else {
  11182. debug = function () {}
  11183. }
  11184. // Note: this is the semver.org version of the spec that it implements
  11185. // Not necessarily the package version of this code.
  11186. exports.SEMVER_SPEC_VERSION = '2.0.0'
  11187. var MAX_LENGTH = 256
  11188. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  11189. /* istanbul ignore next */ 9007199254740991
  11190. // Max safe segment length for coercion.
  11191. var MAX_SAFE_COMPONENT_LENGTH = 16
  11192. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  11193. // The actual regexps go on exports.re
  11194. var re = exports.re = []
  11195. var safeRe = exports.safeRe = []
  11196. var src = exports.src = []
  11197. var t = exports.tokens = {}
  11198. var R = 0
  11199. function tok (n) {
  11200. t[n] = R++
  11201. }
  11202. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  11203. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  11204. // used internally via the safeRe object since all inputs in this library get
  11205. // normalized first to trim and collapse all extra whitespace. The original
  11206. // regexes are exported for userland consumption and lower level usage. A
  11207. // future breaking change could export the safer regex only with a note that
  11208. // all input should have extra whitespace removed.
  11209. var safeRegexReplacements = [
  11210. ['\\s', 1],
  11211. ['\\d', MAX_LENGTH],
  11212. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  11213. ]
  11214. function makeSafeRe (value) {
  11215. for (var i = 0; i < safeRegexReplacements.length; i++) {
  11216. var token = safeRegexReplacements[i][0]
  11217. var max = safeRegexReplacements[i][1]
  11218. value = value
  11219. .split(token + '*').join(token + '{0,' + max + '}')
  11220. .split(token + '+').join(token + '{1,' + max + '}')
  11221. }
  11222. return value
  11223. }
  11224. // The following Regular Expressions can be used for tokenizing,
  11225. // validating, and parsing SemVer version strings.
  11226. // ## Numeric Identifier
  11227. // A single `0`, or a non-zero digit followed by zero or more digits.
  11228. tok('NUMERICIDENTIFIER')
  11229. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  11230. tok('NUMERICIDENTIFIERLOOSE')
  11231. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  11232. // ## Non-numeric Identifier
  11233. // Zero or more digits, followed by a letter or hyphen, and then zero or
  11234. // more letters, digits, or hyphens.
  11235. tok('NONNUMERICIDENTIFIER')
  11236. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  11237. // ## Main Version
  11238. // Three dot-separated numeric identifiers.
  11239. tok('MAINVERSION')
  11240. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11241. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11242. '(' + src[t.NUMERICIDENTIFIER] + ')'
  11243. tok('MAINVERSIONLOOSE')
  11244. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11245. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11246. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  11247. // ## Pre-release Version Identifier
  11248. // A numeric identifier, or a non-numeric identifier.
  11249. tok('PRERELEASEIDENTIFIER')
  11250. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  11251. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11252. tok('PRERELEASEIDENTIFIERLOOSE')
  11253. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  11254. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11255. // ## Pre-release Version
  11256. // Hyphen, followed by one or more dot-separated pre-release version
  11257. // identifiers.
  11258. tok('PRERELEASE')
  11259. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11260. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11261. tok('PRERELEASELOOSE')
  11262. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11263. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11264. // ## Build Metadata Identifier
  11265. // Any combination of digits, letters, or hyphens.
  11266. tok('BUILDIDENTIFIER')
  11267. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11268. // ## Build Metadata
  11269. // Plus sign, followed by one or more period-separated build metadata
  11270. // identifiers.
  11271. tok('BUILD')
  11272. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11273. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11274. // ## Full Version String
  11275. // A main version, followed optionally by a pre-release version and
  11276. // build metadata.
  11277. // Note that the only major, minor, patch, and pre-release sections of
  11278. // the version string are capturing groups. The build metadata is not a
  11279. // capturing group, because it should not ever be used in version
  11280. // comparison.
  11281. tok('FULL')
  11282. tok('FULLPLAIN')
  11283. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11284. src[t.PRERELEASE] + '?' +
  11285. src[t.BUILD] + '?'
  11286. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11287. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11288. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11289. // common in the npm registry.
  11290. tok('LOOSEPLAIN')
  11291. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11292. src[t.PRERELEASELOOSE] + '?' +
  11293. src[t.BUILD] + '?'
  11294. tok('LOOSE')
  11295. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11296. tok('GTLT')
  11297. src[t.GTLT] = '((?:<|>)?=?)'
  11298. // Something like "2.*" or "1.2.x".
  11299. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11300. // Only the first item is strictly required.
  11301. tok('XRANGEIDENTIFIERLOOSE')
  11302. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11303. tok('XRANGEIDENTIFIER')
  11304. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11305. tok('XRANGEPLAIN')
  11306. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11307. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11308. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11309. '(?:' + src[t.PRERELEASE] + ')?' +
  11310. src[t.BUILD] + '?' +
  11311. ')?)?'
  11312. tok('XRANGEPLAINLOOSE')
  11313. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11314. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11315. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11316. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11317. src[t.BUILD] + '?' +
  11318. ')?)?'
  11319. tok('XRANGE')
  11320. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11321. tok('XRANGELOOSE')
  11322. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11323. // Coercion.
  11324. // Extract anything that could conceivably be a part of a valid semver
  11325. tok('COERCE')
  11326. src[t.COERCE] = '(^|[^\\d])' +
  11327. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11328. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11329. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11330. '(?:$|[^\\d])'
  11331. tok('COERCERTL')
  11332. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11333. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11334. // Tilde ranges.
  11335. // Meaning is "reasonably at or greater than"
  11336. tok('LONETILDE')
  11337. src[t.LONETILDE] = '(?:~>?)'
  11338. tok('TILDETRIM')
  11339. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11340. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11341. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11342. var tildeTrimReplace = '$1~'
  11343. tok('TILDE')
  11344. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11345. tok('TILDELOOSE')
  11346. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11347. // Caret ranges.
  11348. // Meaning is "at least and backwards compatible with"
  11349. tok('LONECARET')
  11350. src[t.LONECARET] = '(?:\\^)'
  11351. tok('CARETTRIM')
  11352. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11353. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11354. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11355. var caretTrimReplace = '$1^'
  11356. tok('CARET')
  11357. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11358. tok('CARETLOOSE')
  11359. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11360. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11361. tok('COMPARATORLOOSE')
  11362. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11363. tok('COMPARATOR')
  11364. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11365. // An expression to strip any whitespace between the gtlt and the thing
  11366. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11367. tok('COMPARATORTRIM')
  11368. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11369. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11370. // this one has to use the /g flag
  11371. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11372. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11373. var comparatorTrimReplace = '$1$2$3'
  11374. // Something like `1.2.3 - 1.2.4`
  11375. // Note that these all use the loose form, because they'll be
  11376. // checked against either the strict or loose comparator form
  11377. // later.
  11378. tok('HYPHENRANGE')
  11379. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11380. '\\s+-\\s+' +
  11381. '(' + src[t.XRANGEPLAIN] + ')' +
  11382. '\\s*$'
  11383. tok('HYPHENRANGELOOSE')
  11384. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11385. '\\s+-\\s+' +
  11386. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11387. '\\s*$'
  11388. // Star ranges basically just allow anything at all.
  11389. tok('STAR')
  11390. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11391. // Compile to actual regexp objects.
  11392. // All are flag-free, unless they were created above with a flag.
  11393. for (var i = 0; i < R; i++) {
  11394. debug(i, src[i])
  11395. if (!re[i]) {
  11396. re[i] = new RegExp(src[i])
  11397. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11398. // used internally via the safeRe object since all inputs in this library get
  11399. // normalized first to trim and collapse all extra whitespace. The original
  11400. // regexes are exported for userland consumption and lower level usage. A
  11401. // future breaking change could export the safer regex only with a note that
  11402. // all input should have extra whitespace removed.
  11403. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11404. }
  11405. }
  11406. exports.parse = parse
  11407. function parse (version, options) {
  11408. if (!options || typeof options !== 'object') {
  11409. options = {
  11410. loose: !!options,
  11411. includePrerelease: false
  11412. }
  11413. }
  11414. if (version instanceof SemVer) {
  11415. return version
  11416. }
  11417. if (typeof version !== 'string') {
  11418. return null
  11419. }
  11420. if (version.length > MAX_LENGTH) {
  11421. return null
  11422. }
  11423. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11424. if (!r.test(version)) {
  11425. return null
  11426. }
  11427. try {
  11428. return new SemVer(version, options)
  11429. } catch (er) {
  11430. return null
  11431. }
  11432. }
  11433. exports.valid = valid
  11434. function valid (version, options) {
  11435. var v = parse(version, options)
  11436. return v ? v.version : null
  11437. }
  11438. exports.clean = clean
  11439. function clean (version, options) {
  11440. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11441. return s ? s.version : null
  11442. }
  11443. exports.SemVer = SemVer
  11444. function SemVer (version, options) {
  11445. if (!options || typeof options !== 'object') {
  11446. options = {
  11447. loose: !!options,
  11448. includePrerelease: false
  11449. }
  11450. }
  11451. if (version instanceof SemVer) {
  11452. if (version.loose === options.loose) {
  11453. return version
  11454. } else {
  11455. version = version.version
  11456. }
  11457. } else if (typeof version !== 'string') {
  11458. throw new TypeError('Invalid Version: ' + version)
  11459. }
  11460. if (version.length > MAX_LENGTH) {
  11461. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11462. }
  11463. if (!(this instanceof SemVer)) {
  11464. return new SemVer(version, options)
  11465. }
  11466. debug('SemVer', version, options)
  11467. this.options = options
  11468. this.loose = !!options.loose
  11469. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11470. if (!m) {
  11471. throw new TypeError('Invalid Version: ' + version)
  11472. }
  11473. this.raw = version
  11474. // these are actually numbers
  11475. this.major = +m[1]
  11476. this.minor = +m[2]
  11477. this.patch = +m[3]
  11478. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11479. throw new TypeError('Invalid major version')
  11480. }
  11481. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11482. throw new TypeError('Invalid minor version')
  11483. }
  11484. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11485. throw new TypeError('Invalid patch version')
  11486. }
  11487. // numberify any prerelease numeric ids
  11488. if (!m[4]) {
  11489. this.prerelease = []
  11490. } else {
  11491. this.prerelease = m[4].split('.').map(function (id) {
  11492. if (/^[0-9]+$/.test(id)) {
  11493. var num = +id
  11494. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11495. return num
  11496. }
  11497. }
  11498. return id
  11499. })
  11500. }
  11501. this.build = m[5] ? m[5].split('.') : []
  11502. this.format()
  11503. }
  11504. SemVer.prototype.format = function () {
  11505. this.version = this.major + '.' + this.minor + '.' + this.patch
  11506. if (this.prerelease.length) {
  11507. this.version += '-' + this.prerelease.join('.')
  11508. }
  11509. return this.version
  11510. }
  11511. SemVer.prototype.toString = function () {
  11512. return this.version
  11513. }
  11514. SemVer.prototype.compare = function (other) {
  11515. debug('SemVer.compare', this.version, this.options, other)
  11516. if (!(other instanceof SemVer)) {
  11517. other = new SemVer(other, this.options)
  11518. }
  11519. return this.compareMain(other) || this.comparePre(other)
  11520. }
  11521. SemVer.prototype.compareMain = function (other) {
  11522. if (!(other instanceof SemVer)) {
  11523. other = new SemVer(other, this.options)
  11524. }
  11525. return compareIdentifiers(this.major, other.major) ||
  11526. compareIdentifiers(this.minor, other.minor) ||
  11527. compareIdentifiers(this.patch, other.patch)
  11528. }
  11529. SemVer.prototype.comparePre = function (other) {
  11530. if (!(other instanceof SemVer)) {
  11531. other = new SemVer(other, this.options)
  11532. }
  11533. // NOT having a prerelease is > having one
  11534. if (this.prerelease.length && !other.prerelease.length) {
  11535. return -1
  11536. } else if (!this.prerelease.length && other.prerelease.length) {
  11537. return 1
  11538. } else if (!this.prerelease.length && !other.prerelease.length) {
  11539. return 0
  11540. }
  11541. var i = 0
  11542. do {
  11543. var a = this.prerelease[i]
  11544. var b = other.prerelease[i]
  11545. debug('prerelease compare', i, a, b)
  11546. if (a === undefined && b === undefined) {
  11547. return 0
  11548. } else if (b === undefined) {
  11549. return 1
  11550. } else if (a === undefined) {
  11551. return -1
  11552. } else if (a === b) {
  11553. continue
  11554. } else {
  11555. return compareIdentifiers(a, b)
  11556. }
  11557. } while (++i)
  11558. }
  11559. SemVer.prototype.compareBuild = function (other) {
  11560. if (!(other instanceof SemVer)) {
  11561. other = new SemVer(other, this.options)
  11562. }
  11563. var i = 0
  11564. do {
  11565. var a = this.build[i]
  11566. var b = other.build[i]
  11567. debug('prerelease compare', i, a, b)
  11568. if (a === undefined && b === undefined) {
  11569. return 0
  11570. } else if (b === undefined) {
  11571. return 1
  11572. } else if (a === undefined) {
  11573. return -1
  11574. } else if (a === b) {
  11575. continue
  11576. } else {
  11577. return compareIdentifiers(a, b)
  11578. }
  11579. } while (++i)
  11580. }
  11581. // preminor will bump the version up to the next minor release, and immediately
  11582. // down to pre-release. premajor and prepatch work the same way.
  11583. SemVer.prototype.inc = function (release, identifier) {
  11584. switch (release) {
  11585. case 'premajor':
  11586. this.prerelease.length = 0
  11587. this.patch = 0
  11588. this.minor = 0
  11589. this.major++
  11590. this.inc('pre', identifier)
  11591. break
  11592. case 'preminor':
  11593. this.prerelease.length = 0
  11594. this.patch = 0
  11595. this.minor++
  11596. this.inc('pre', identifier)
  11597. break
  11598. case 'prepatch':
  11599. // If this is already a prerelease, it will bump to the next version
  11600. // drop any prereleases that might already exist, since they are not
  11601. // relevant at this point.
  11602. this.prerelease.length = 0
  11603. this.inc('patch', identifier)
  11604. this.inc('pre', identifier)
  11605. break
  11606. // If the input is a non-prerelease version, this acts the same as
  11607. // prepatch.
  11608. case 'prerelease':
  11609. if (this.prerelease.length === 0) {
  11610. this.inc('patch', identifier)
  11611. }
  11612. this.inc('pre', identifier)
  11613. break
  11614. case 'major':
  11615. // If this is a pre-major version, bump up to the same major version.
  11616. // Otherwise increment major.
  11617. // 1.0.0-5 bumps to 1.0.0
  11618. // 1.1.0 bumps to 2.0.0
  11619. if (this.minor !== 0 ||
  11620. this.patch !== 0 ||
  11621. this.prerelease.length === 0) {
  11622. this.major++
  11623. }
  11624. this.minor = 0
  11625. this.patch = 0
  11626. this.prerelease = []
  11627. break
  11628. case 'minor':
  11629. // If this is a pre-minor version, bump up to the same minor version.
  11630. // Otherwise increment minor.
  11631. // 1.2.0-5 bumps to 1.2.0
  11632. // 1.2.1 bumps to 1.3.0
  11633. if (this.patch !== 0 || this.prerelease.length === 0) {
  11634. this.minor++
  11635. }
  11636. this.patch = 0
  11637. this.prerelease = []
  11638. break
  11639. case 'patch':
  11640. // If this is not a pre-release version, it will increment the patch.
  11641. // If it is a pre-release it will bump up to the same patch version.
  11642. // 1.2.0-5 patches to 1.2.0
  11643. // 1.2.0 patches to 1.2.1
  11644. if (this.prerelease.length === 0) {
  11645. this.patch++
  11646. }
  11647. this.prerelease = []
  11648. break
  11649. // This probably shouldn't be used publicly.
  11650. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11651. case 'pre':
  11652. if (this.prerelease.length === 0) {
  11653. this.prerelease = [0]
  11654. } else {
  11655. var i = this.prerelease.length
  11656. while (--i >= 0) {
  11657. if (typeof this.prerelease[i] === 'number') {
  11658. this.prerelease[i]++
  11659. i = -2
  11660. }
  11661. }
  11662. if (i === -1) {
  11663. // didn't increment anything
  11664. this.prerelease.push(0)
  11665. }
  11666. }
  11667. if (identifier) {
  11668. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11669. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11670. if (this.prerelease[0] === identifier) {
  11671. if (isNaN(this.prerelease[1])) {
  11672. this.prerelease = [identifier, 0]
  11673. }
  11674. } else {
  11675. this.prerelease = [identifier, 0]
  11676. }
  11677. }
  11678. break
  11679. default:
  11680. throw new Error('invalid increment argument: ' + release)
  11681. }
  11682. this.format()
  11683. this.raw = this.version
  11684. return this
  11685. }
  11686. exports.inc = inc
  11687. function inc (version, release, loose, identifier) {
  11688. if (typeof (loose) === 'string') {
  11689. identifier = loose
  11690. loose = undefined
  11691. }
  11692. try {
  11693. return new SemVer(version, loose).inc(release, identifier).version
  11694. } catch (er) {
  11695. return null
  11696. }
  11697. }
  11698. exports.diff = diff
  11699. function diff (version1, version2) {
  11700. if (eq(version1, version2)) {
  11701. return null
  11702. } else {
  11703. var v1 = parse(version1)
  11704. var v2 = parse(version2)
  11705. var prefix = ''
  11706. if (v1.prerelease.length || v2.prerelease.length) {
  11707. prefix = 'pre'
  11708. var defaultResult = 'prerelease'
  11709. }
  11710. for (var key in v1) {
  11711. if (key === 'major' || key === 'minor' || key === 'patch') {
  11712. if (v1[key] !== v2[key]) {
  11713. return prefix + key
  11714. }
  11715. }
  11716. }
  11717. return defaultResult // may be undefined
  11718. }
  11719. }
  11720. exports.compareIdentifiers = compareIdentifiers
  11721. var numeric = /^[0-9]+$/
  11722. function compareIdentifiers (a, b) {
  11723. var anum = numeric.test(a)
  11724. var bnum = numeric.test(b)
  11725. if (anum && bnum) {
  11726. a = +a
  11727. b = +b
  11728. }
  11729. return a === b ? 0
  11730. : (anum && !bnum) ? -1
  11731. : (bnum && !anum) ? 1
  11732. : a < b ? -1
  11733. : 1
  11734. }
  11735. exports.rcompareIdentifiers = rcompareIdentifiers
  11736. function rcompareIdentifiers (a, b) {
  11737. return compareIdentifiers(b, a)
  11738. }
  11739. exports.major = major
  11740. function major (a, loose) {
  11741. return new SemVer(a, loose).major
  11742. }
  11743. exports.minor = minor
  11744. function minor (a, loose) {
  11745. return new SemVer(a, loose).minor
  11746. }
  11747. exports.patch = patch
  11748. function patch (a, loose) {
  11749. return new SemVer(a, loose).patch
  11750. }
  11751. exports.compare = compare
  11752. function compare (a, b, loose) {
  11753. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11754. }
  11755. exports.compareLoose = compareLoose
  11756. function compareLoose (a, b) {
  11757. return compare(a, b, true)
  11758. }
  11759. exports.compareBuild = compareBuild
  11760. function compareBuild (a, b, loose) {
  11761. var versionA = new SemVer(a, loose)
  11762. var versionB = new SemVer(b, loose)
  11763. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11764. }
  11765. exports.rcompare = rcompare
  11766. function rcompare (a, b, loose) {
  11767. return compare(b, a, loose)
  11768. }
  11769. exports.sort = sort
  11770. function sort (list, loose) {
  11771. return list.sort(function (a, b) {
  11772. return exports.compareBuild(a, b, loose)
  11773. })
  11774. }
  11775. exports.rsort = rsort
  11776. function rsort (list, loose) {
  11777. return list.sort(function (a, b) {
  11778. return exports.compareBuild(b, a, loose)
  11779. })
  11780. }
  11781. exports.gt = gt
  11782. function gt (a, b, loose) {
  11783. return compare(a, b, loose) > 0
  11784. }
  11785. exports.lt = lt
  11786. function lt (a, b, loose) {
  11787. return compare(a, b, loose) < 0
  11788. }
  11789. exports.eq = eq
  11790. function eq (a, b, loose) {
  11791. return compare(a, b, loose) === 0
  11792. }
  11793. exports.neq = neq
  11794. function neq (a, b, loose) {
  11795. return compare(a, b, loose) !== 0
  11796. }
  11797. exports.gte = gte
  11798. function gte (a, b, loose) {
  11799. return compare(a, b, loose) >= 0
  11800. }
  11801. exports.lte = lte
  11802. function lte (a, b, loose) {
  11803. return compare(a, b, loose) <= 0
  11804. }
  11805. exports.cmp = cmp
  11806. function cmp (a, op, b, loose) {
  11807. switch (op) {
  11808. case '===':
  11809. if (typeof a === 'object')
  11810. a = a.version
  11811. if (typeof b === 'object')
  11812. b = b.version
  11813. return a === b
  11814. case '!==':
  11815. if (typeof a === 'object')
  11816. a = a.version
  11817. if (typeof b === 'object')
  11818. b = b.version
  11819. return a !== b
  11820. case '':
  11821. case '=':
  11822. case '==':
  11823. return eq(a, b, loose)
  11824. case '!=':
  11825. return neq(a, b, loose)
  11826. case '>':
  11827. return gt(a, b, loose)
  11828. case '>=':
  11829. return gte(a, b, loose)
  11830. case '<':
  11831. return lt(a, b, loose)
  11832. case '<=':
  11833. return lte(a, b, loose)
  11834. default:
  11835. throw new TypeError('Invalid operator: ' + op)
  11836. }
  11837. }
  11838. exports.Comparator = Comparator
  11839. function Comparator (comp, options) {
  11840. if (!options || typeof options !== 'object') {
  11841. options = {
  11842. loose: !!options,
  11843. includePrerelease: false
  11844. }
  11845. }
  11846. if (comp instanceof Comparator) {
  11847. if (comp.loose === !!options.loose) {
  11848. return comp
  11849. } else {
  11850. comp = comp.value
  11851. }
  11852. }
  11853. if (!(this instanceof Comparator)) {
  11854. return new Comparator(comp, options)
  11855. }
  11856. comp = comp.trim().split(/\s+/).join(' ')
  11857. debug('comparator', comp, options)
  11858. this.options = options
  11859. this.loose = !!options.loose
  11860. this.parse(comp)
  11861. if (this.semver === ANY) {
  11862. this.value = ''
  11863. } else {
  11864. this.value = this.operator + this.semver.version
  11865. }
  11866. debug('comp', this)
  11867. }
  11868. var ANY = {}
  11869. Comparator.prototype.parse = function (comp) {
  11870. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11871. var m = comp.match(r)
  11872. if (!m) {
  11873. throw new TypeError('Invalid comparator: ' + comp)
  11874. }
  11875. this.operator = m[1] !== undefined ? m[1] : ''
  11876. if (this.operator === '=') {
  11877. this.operator = ''
  11878. }
  11879. // if it literally is just '>' or '' then allow anything.
  11880. if (!m[2]) {
  11881. this.semver = ANY
  11882. } else {
  11883. this.semver = new SemVer(m[2], this.options.loose)
  11884. }
  11885. }
  11886. Comparator.prototype.toString = function () {
  11887. return this.value
  11888. }
  11889. Comparator.prototype.test = function (version) {
  11890. debug('Comparator.test', version, this.options.loose)
  11891. if (this.semver === ANY || version === ANY) {
  11892. return true
  11893. }
  11894. if (typeof version === 'string') {
  11895. try {
  11896. version = new SemVer(version, this.options)
  11897. } catch (er) {
  11898. return false
  11899. }
  11900. }
  11901. return cmp(version, this.operator, this.semver, this.options)
  11902. }
  11903. Comparator.prototype.intersects = function (comp, options) {
  11904. if (!(comp instanceof Comparator)) {
  11905. throw new TypeError('a Comparator is required')
  11906. }
  11907. if (!options || typeof options !== 'object') {
  11908. options = {
  11909. loose: !!options,
  11910. includePrerelease: false
  11911. }
  11912. }
  11913. var rangeTmp
  11914. if (this.operator === '') {
  11915. if (this.value === '') {
  11916. return true
  11917. }
  11918. rangeTmp = new Range(comp.value, options)
  11919. return satisfies(this.value, rangeTmp, options)
  11920. } else if (comp.operator === '') {
  11921. if (comp.value === '') {
  11922. return true
  11923. }
  11924. rangeTmp = new Range(this.value, options)
  11925. return satisfies(comp.semver, rangeTmp, options)
  11926. }
  11927. var sameDirectionIncreasing =
  11928. (this.operator === '>=' || this.operator === '>') &&
  11929. (comp.operator === '>=' || comp.operator === '>')
  11930. var sameDirectionDecreasing =
  11931. (this.operator === '<=' || this.operator === '<') &&
  11932. (comp.operator === '<=' || comp.operator === '<')
  11933. var sameSemVer = this.semver.version === comp.semver.version
  11934. var differentDirectionsInclusive =
  11935. (this.operator === '>=' || this.operator === '<=') &&
  11936. (comp.operator === '>=' || comp.operator === '<=')
  11937. var oppositeDirectionsLessThan =
  11938. cmp(this.semver, '<', comp.semver, options) &&
  11939. ((this.operator === '>=' || this.operator === '>') &&
  11940. (comp.operator === '<=' || comp.operator === '<'))
  11941. var oppositeDirectionsGreaterThan =
  11942. cmp(this.semver, '>', comp.semver, options) &&
  11943. ((this.operator === '<=' || this.operator === '<') &&
  11944. (comp.operator === '>=' || comp.operator === '>'))
  11945. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11946. (sameSemVer && differentDirectionsInclusive) ||
  11947. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11948. }
  11949. exports.Range = Range
  11950. function Range (range, options) {
  11951. if (!options || typeof options !== 'object') {
  11952. options = {
  11953. loose: !!options,
  11954. includePrerelease: false
  11955. }
  11956. }
  11957. if (range instanceof Range) {
  11958. if (range.loose === !!options.loose &&
  11959. range.includePrerelease === !!options.includePrerelease) {
  11960. return range
  11961. } else {
  11962. return new Range(range.raw, options)
  11963. }
  11964. }
  11965. if (range instanceof Comparator) {
  11966. return new Range(range.value, options)
  11967. }
  11968. if (!(this instanceof Range)) {
  11969. return new Range(range, options)
  11970. }
  11971. this.options = options
  11972. this.loose = !!options.loose
  11973. this.includePrerelease = !!options.includePrerelease
  11974. // First reduce all whitespace as much as possible so we do not have to rely
  11975. // on potentially slow regexes like \s*. This is then stored and used for
  11976. // future error messages as well.
  11977. this.raw = range
  11978. .trim()
  11979. .split(/\s+/)
  11980. .join(' ')
  11981. // First, split based on boolean or ||
  11982. this.set = this.raw.split('||').map(function (range) {
  11983. return this.parseRange(range.trim())
  11984. }, this).filter(function (c) {
  11985. // throw out any that are not relevant for whatever reason
  11986. return c.length
  11987. })
  11988. if (!this.set.length) {
  11989. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  11990. }
  11991. this.format()
  11992. }
  11993. Range.prototype.format = function () {
  11994. this.range = this.set.map(function (comps) {
  11995. return comps.join(' ').trim()
  11996. }).join('||').trim()
  11997. return this.range
  11998. }
  11999. Range.prototype.toString = function () {
  12000. return this.range
  12001. }
  12002. Range.prototype.parseRange = function (range) {
  12003. var loose = this.options.loose
  12004. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  12005. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  12006. range = range.replace(hr, hyphenReplace)
  12007. debug('hyphen replace', range)
  12008. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  12009. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  12010. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  12011. // `~ 1.2.3` => `~1.2.3`
  12012. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  12013. // `^ 1.2.3` => `^1.2.3`
  12014. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  12015. // normalize spaces
  12016. range = range.split(/\s+/).join(' ')
  12017. // At this point, the range is completely trimmed and
  12018. // ready to be split into comparators.
  12019. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12020. var set = range.split(' ').map(function (comp) {
  12021. return parseComparator(comp, this.options)
  12022. }, this).join(' ').split(/\s+/)
  12023. if (this.options.loose) {
  12024. // in loose mode, throw out any that are not valid comparators
  12025. set = set.filter(function (comp) {
  12026. return !!comp.match(compRe)
  12027. })
  12028. }
  12029. set = set.map(function (comp) {
  12030. return new Comparator(comp, this.options)
  12031. }, this)
  12032. return set
  12033. }
  12034. Range.prototype.intersects = function (range, options) {
  12035. if (!(range instanceof Range)) {
  12036. throw new TypeError('a Range is required')
  12037. }
  12038. return this.set.some(function (thisComparators) {
  12039. return (
  12040. isSatisfiable(thisComparators, options) &&
  12041. range.set.some(function (rangeComparators) {
  12042. return (
  12043. isSatisfiable(rangeComparators, options) &&
  12044. thisComparators.every(function (thisComparator) {
  12045. return rangeComparators.every(function (rangeComparator) {
  12046. return thisComparator.intersects(rangeComparator, options)
  12047. })
  12048. })
  12049. )
  12050. })
  12051. )
  12052. })
  12053. }
  12054. // take a set of comparators and determine whether there
  12055. // exists a version which can satisfy it
  12056. function isSatisfiable (comparators, options) {
  12057. var result = true
  12058. var remainingComparators = comparators.slice()
  12059. var testComparator = remainingComparators.pop()
  12060. while (result && remainingComparators.length) {
  12061. result = remainingComparators.every(function (otherComparator) {
  12062. return testComparator.intersects(otherComparator, options)
  12063. })
  12064. testComparator = remainingComparators.pop()
  12065. }
  12066. return result
  12067. }
  12068. // Mostly just for testing and legacy API reasons
  12069. exports.toComparators = toComparators
  12070. function toComparators (range, options) {
  12071. return new Range(range, options).set.map(function (comp) {
  12072. return comp.map(function (c) {
  12073. return c.value
  12074. }).join(' ').trim().split(' ')
  12075. })
  12076. }
  12077. // comprised of xranges, tildes, stars, and gtlt's at this point.
  12078. // already replaced the hyphen ranges
  12079. // turn into a set of JUST comparators.
  12080. function parseComparator (comp, options) {
  12081. debug('comp', comp, options)
  12082. comp = replaceCarets(comp, options)
  12083. debug('caret', comp)
  12084. comp = replaceTildes(comp, options)
  12085. debug('tildes', comp)
  12086. comp = replaceXRanges(comp, options)
  12087. debug('xrange', comp)
  12088. comp = replaceStars(comp, options)
  12089. debug('stars', comp)
  12090. return comp
  12091. }
  12092. function isX (id) {
  12093. return !id || id.toLowerCase() === 'x' || id === '*'
  12094. }
  12095. // ~, ~> --> * (any, kinda silly)
  12096. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  12097. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  12098. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  12099. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  12100. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  12101. function replaceTildes (comp, options) {
  12102. return comp.trim().split(/\s+/).map(function (comp) {
  12103. return replaceTilde(comp, options)
  12104. }).join(' ')
  12105. }
  12106. function replaceTilde (comp, options) {
  12107. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  12108. return comp.replace(r, function (_, M, m, p, pr) {
  12109. debug('tilde', comp, _, M, m, p, pr)
  12110. var ret
  12111. if (isX(M)) {
  12112. ret = ''
  12113. } else if (isX(m)) {
  12114. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12115. } else if (isX(p)) {
  12116. // ~1.2 == >=1.2.0 <1.3.0
  12117. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12118. } else if (pr) {
  12119. debug('replaceTilde pr', pr)
  12120. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12121. ' <' + M + '.' + (+m + 1) + '.0'
  12122. } else {
  12123. // ~1.2.3 == >=1.2.3 <1.3.0
  12124. ret = '>=' + M + '.' + m + '.' + p +
  12125. ' <' + M + '.' + (+m + 1) + '.0'
  12126. }
  12127. debug('tilde return', ret)
  12128. return ret
  12129. })
  12130. }
  12131. // ^ --> * (any, kinda silly)
  12132. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  12133. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  12134. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  12135. // ^1.2.3 --> >=1.2.3 <2.0.0
  12136. // ^1.2.0 --> >=1.2.0 <2.0.0
  12137. function replaceCarets (comp, options) {
  12138. return comp.trim().split(/\s+/).map(function (comp) {
  12139. return replaceCaret(comp, options)
  12140. }).join(' ')
  12141. }
  12142. function replaceCaret (comp, options) {
  12143. debug('caret', comp, options)
  12144. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  12145. return comp.replace(r, function (_, M, m, p, pr) {
  12146. debug('caret', comp, _, M, m, p, pr)
  12147. var ret
  12148. if (isX(M)) {
  12149. ret = ''
  12150. } else if (isX(m)) {
  12151. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12152. } else if (isX(p)) {
  12153. if (M === '0') {
  12154. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12155. } else {
  12156. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  12157. }
  12158. } else if (pr) {
  12159. debug('replaceCaret pr', pr)
  12160. if (M === '0') {
  12161. if (m === '0') {
  12162. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12163. ' <' + M + '.' + m + '.' + (+p + 1)
  12164. } else {
  12165. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12166. ' <' + M + '.' + (+m + 1) + '.0'
  12167. }
  12168. } else {
  12169. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12170. ' <' + (+M + 1) + '.0.0'
  12171. }
  12172. } else {
  12173. debug('no pr')
  12174. if (M === '0') {
  12175. if (m === '0') {
  12176. ret = '>=' + M + '.' + m + '.' + p +
  12177. ' <' + M + '.' + m + '.' + (+p + 1)
  12178. } else {
  12179. ret = '>=' + M + '.' + m + '.' + p +
  12180. ' <' + M + '.' + (+m + 1) + '.0'
  12181. }
  12182. } else {
  12183. ret = '>=' + M + '.' + m + '.' + p +
  12184. ' <' + (+M + 1) + '.0.0'
  12185. }
  12186. }
  12187. debug('caret return', ret)
  12188. return ret
  12189. })
  12190. }
  12191. function replaceXRanges (comp, options) {
  12192. debug('replaceXRanges', comp, options)
  12193. return comp.split(/\s+/).map(function (comp) {
  12194. return replaceXRange(comp, options)
  12195. }).join(' ')
  12196. }
  12197. function replaceXRange (comp, options) {
  12198. comp = comp.trim()
  12199. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  12200. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  12201. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  12202. var xM = isX(M)
  12203. var xm = xM || isX(m)
  12204. var xp = xm || isX(p)
  12205. var anyX = xp
  12206. if (gtlt === '=' && anyX) {
  12207. gtlt = ''
  12208. }
  12209. // if we're including prereleases in the match, then we need
  12210. // to fix this to -0, the lowest possible prerelease value
  12211. pr = options.includePrerelease ? '-0' : ''
  12212. if (xM) {
  12213. if (gtlt === '>' || gtlt === '<') {
  12214. // nothing is allowed
  12215. ret = '<0.0.0-0'
  12216. } else {
  12217. // nothing is forbidden
  12218. ret = '*'
  12219. }
  12220. } else if (gtlt && anyX) {
  12221. // we know patch is an x, because we have any x at all.
  12222. // replace X with 0
  12223. if (xm) {
  12224. m = 0
  12225. }
  12226. p = 0
  12227. if (gtlt === '>') {
  12228. // >1 => >=2.0.0
  12229. // >1.2 => >=1.3.0
  12230. // >1.2.3 => >= 1.2.4
  12231. gtlt = '>='
  12232. if (xm) {
  12233. M = +M + 1
  12234. m = 0
  12235. p = 0
  12236. } else {
  12237. m = +m + 1
  12238. p = 0
  12239. }
  12240. } else if (gtlt === '<=') {
  12241. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  12242. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  12243. gtlt = '<'
  12244. if (xm) {
  12245. M = +M + 1
  12246. } else {
  12247. m = +m + 1
  12248. }
  12249. }
  12250. ret = gtlt + M + '.' + m + '.' + p + pr
  12251. } else if (xm) {
  12252. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  12253. } else if (xp) {
  12254. ret = '>=' + M + '.' + m + '.0' + pr +
  12255. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12256. }
  12257. debug('xRange return', ret)
  12258. return ret
  12259. })
  12260. }
  12261. // Because * is AND-ed with everything else in the comparator,
  12262. // and '' means "any version", just remove the *s entirely.
  12263. function replaceStars (comp, options) {
  12264. debug('replaceStars', comp, options)
  12265. // Looseness is ignored here. star is always as loose as it gets!
  12266. return comp.trim().replace(safeRe[t.STAR], '')
  12267. }
  12268. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12269. // M, m, patch, prerelease, build
  12270. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12271. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12272. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12273. function hyphenReplace ($0,
  12274. from, fM, fm, fp, fpr, fb,
  12275. to, tM, tm, tp, tpr, tb) {
  12276. if (isX(fM)) {
  12277. from = ''
  12278. } else if (isX(fm)) {
  12279. from = '>=' + fM + '.0.0'
  12280. } else if (isX(fp)) {
  12281. from = '>=' + fM + '.' + fm + '.0'
  12282. } else {
  12283. from = '>=' + from
  12284. }
  12285. if (isX(tM)) {
  12286. to = ''
  12287. } else if (isX(tm)) {
  12288. to = '<' + (+tM + 1) + '.0.0'
  12289. } else if (isX(tp)) {
  12290. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12291. } else if (tpr) {
  12292. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12293. } else {
  12294. to = '<=' + to
  12295. }
  12296. return (from + ' ' + to).trim()
  12297. }
  12298. // if ANY of the sets match ALL of its comparators, then pass
  12299. Range.prototype.test = function (version) {
  12300. if (!version) {
  12301. return false
  12302. }
  12303. if (typeof version === 'string') {
  12304. try {
  12305. version = new SemVer(version, this.options)
  12306. } catch (er) {
  12307. return false
  12308. }
  12309. }
  12310. for (var i = 0; i < this.set.length; i++) {
  12311. if (testSet(this.set[i], version, this.options)) {
  12312. return true
  12313. }
  12314. }
  12315. return false
  12316. }
  12317. function testSet (set, version, options) {
  12318. for (var i = 0; i < set.length; i++) {
  12319. if (!set[i].test(version)) {
  12320. return false
  12321. }
  12322. }
  12323. if (version.prerelease.length && !options.includePrerelease) {
  12324. // Find the set of versions that are allowed to have prereleases
  12325. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12326. // That should allow `1.2.3-pr.2` to pass.
  12327. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12328. // even though it's within the range set by the comparators.
  12329. for (i = 0; i < set.length; i++) {
  12330. debug(set[i].semver)
  12331. if (set[i].semver === ANY) {
  12332. continue
  12333. }
  12334. if (set[i].semver.prerelease.length > 0) {
  12335. var allowed = set[i].semver
  12336. if (allowed.major === version.major &&
  12337. allowed.minor === version.minor &&
  12338. allowed.patch === version.patch) {
  12339. return true
  12340. }
  12341. }
  12342. }
  12343. // Version has a -pre, but it's not one of the ones we like.
  12344. return false
  12345. }
  12346. return true
  12347. }
  12348. exports.satisfies = satisfies
  12349. function satisfies (version, range, options) {
  12350. try {
  12351. range = new Range(range, options)
  12352. } catch (er) {
  12353. return false
  12354. }
  12355. return range.test(version)
  12356. }
  12357. exports.maxSatisfying = maxSatisfying
  12358. function maxSatisfying (versions, range, options) {
  12359. var max = null
  12360. var maxSV = null
  12361. try {
  12362. var rangeObj = new Range(range, options)
  12363. } catch (er) {
  12364. return null
  12365. }
  12366. versions.forEach(function (v) {
  12367. if (rangeObj.test(v)) {
  12368. // satisfies(v, range, options)
  12369. if (!max || maxSV.compare(v) === -1) {
  12370. // compare(max, v, true)
  12371. max = v
  12372. maxSV = new SemVer(max, options)
  12373. }
  12374. }
  12375. })
  12376. return max
  12377. }
  12378. exports.minSatisfying = minSatisfying
  12379. function minSatisfying (versions, range, options) {
  12380. var min = null
  12381. var minSV = null
  12382. try {
  12383. var rangeObj = new Range(range, options)
  12384. } catch (er) {
  12385. return null
  12386. }
  12387. versions.forEach(function (v) {
  12388. if (rangeObj.test(v)) {
  12389. // satisfies(v, range, options)
  12390. if (!min || minSV.compare(v) === 1) {
  12391. // compare(min, v, true)
  12392. min = v
  12393. minSV = new SemVer(min, options)
  12394. }
  12395. }
  12396. })
  12397. return min
  12398. }
  12399. exports.minVersion = minVersion
  12400. function minVersion (range, loose) {
  12401. range = new Range(range, loose)
  12402. var minver = new SemVer('0.0.0')
  12403. if (range.test(minver)) {
  12404. return minver
  12405. }
  12406. minver = new SemVer('0.0.0-0')
  12407. if (range.test(minver)) {
  12408. return minver
  12409. }
  12410. minver = null
  12411. for (var i = 0; i < range.set.length; ++i) {
  12412. var comparators = range.set[i]
  12413. comparators.forEach(function (comparator) {
  12414. // Clone to avoid manipulating the comparator's semver object.
  12415. var compver = new SemVer(comparator.semver.version)
  12416. switch (comparator.operator) {
  12417. case '>':
  12418. if (compver.prerelease.length === 0) {
  12419. compver.patch++
  12420. } else {
  12421. compver.prerelease.push(0)
  12422. }
  12423. compver.raw = compver.format()
  12424. /* fallthrough */
  12425. case '':
  12426. case '>=':
  12427. if (!minver || gt(minver, compver)) {
  12428. minver = compver
  12429. }
  12430. break
  12431. case '<':
  12432. case '<=':
  12433. /* Ignore maximum versions */
  12434. break
  12435. /* istanbul ignore next */
  12436. default:
  12437. throw new Error('Unexpected operation: ' + comparator.operator)
  12438. }
  12439. })
  12440. }
  12441. if (minver && range.test(minver)) {
  12442. return minver
  12443. }
  12444. return null
  12445. }
  12446. exports.validRange = validRange
  12447. function validRange (range, options) {
  12448. try {
  12449. // Return '*' instead of '' so that truthiness works.
  12450. // This will throw if it's invalid anyway
  12451. return new Range(range, options).range || '*'
  12452. } catch (er) {
  12453. return null
  12454. }
  12455. }
  12456. // Determine if version is less than all the versions possible in the range
  12457. exports.ltr = ltr
  12458. function ltr (version, range, options) {
  12459. return outside(version, range, '<', options)
  12460. }
  12461. // Determine if version is greater than all the versions possible in the range.
  12462. exports.gtr = gtr
  12463. function gtr (version, range, options) {
  12464. return outside(version, range, '>', options)
  12465. }
  12466. exports.outside = outside
  12467. function outside (version, range, hilo, options) {
  12468. version = new SemVer(version, options)
  12469. range = new Range(range, options)
  12470. var gtfn, ltefn, ltfn, comp, ecomp
  12471. switch (hilo) {
  12472. case '>':
  12473. gtfn = gt
  12474. ltefn = lte
  12475. ltfn = lt
  12476. comp = '>'
  12477. ecomp = '>='
  12478. break
  12479. case '<':
  12480. gtfn = lt
  12481. ltefn = gte
  12482. ltfn = gt
  12483. comp = '<'
  12484. ecomp = '<='
  12485. break
  12486. default:
  12487. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12488. }
  12489. // If it satisifes the range it is not outside
  12490. if (satisfies(version, range, options)) {
  12491. return false
  12492. }
  12493. // From now on, variable terms are as if we're in "gtr" mode.
  12494. // but note that everything is flipped for the "ltr" function.
  12495. for (var i = 0; i < range.set.length; ++i) {
  12496. var comparators = range.set[i]
  12497. var high = null
  12498. var low = null
  12499. comparators.forEach(function (comparator) {
  12500. if (comparator.semver === ANY) {
  12501. comparator = new Comparator('>=0.0.0')
  12502. }
  12503. high = high || comparator
  12504. low = low || comparator
  12505. if (gtfn(comparator.semver, high.semver, options)) {
  12506. high = comparator
  12507. } else if (ltfn(comparator.semver, low.semver, options)) {
  12508. low = comparator
  12509. }
  12510. })
  12511. // If the edge version comparator has a operator then our version
  12512. // isn't outside it
  12513. if (high.operator === comp || high.operator === ecomp) {
  12514. return false
  12515. }
  12516. // If the lowest version comparator has an operator and our version
  12517. // is less than it then it isn't higher than the range
  12518. if ((!low.operator || low.operator === comp) &&
  12519. ltefn(version, low.semver)) {
  12520. return false
  12521. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12522. return false
  12523. }
  12524. }
  12525. return true
  12526. }
  12527. exports.prerelease = prerelease
  12528. function prerelease (version, options) {
  12529. var parsed = parse(version, options)
  12530. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12531. }
  12532. exports.intersects = intersects
  12533. function intersects (r1, r2, options) {
  12534. r1 = new Range(r1, options)
  12535. r2 = new Range(r2, options)
  12536. return r1.intersects(r2)
  12537. }
  12538. exports.coerce = coerce
  12539. function coerce (version, options) {
  12540. if (version instanceof SemVer) {
  12541. return version
  12542. }
  12543. if (typeof version === 'number') {
  12544. version = String(version)
  12545. }
  12546. if (typeof version !== 'string') {
  12547. return null
  12548. }
  12549. options = options || {}
  12550. var match = null
  12551. if (!options.rtl) {
  12552. match = version.match(safeRe[t.COERCE])
  12553. } else {
  12554. // Find the right-most coercible string that does not share
  12555. // a terminus with a more left-ward coercible string.
  12556. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12557. //
  12558. // Walk through the string checking with a /g regexp
  12559. // Manually set the index so as to pick up overlapping matches.
  12560. // Stop when we get a match that ends at the string end, since no
  12561. // coercible string can be more right-ward without the same terminus.
  12562. var next
  12563. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12564. (!match || match.index + match[0].length !== version.length)
  12565. ) {
  12566. if (!match ||
  12567. next.index + next[0].length !== match.index + match[0].length) {
  12568. match = next
  12569. }
  12570. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12571. }
  12572. // leave it in a clean state
  12573. safeRe[t.COERCERTL].lastIndex = -1
  12574. }
  12575. if (match === null) {
  12576. return null
  12577. }
  12578. return parse(match[2] +
  12579. '.' + (match[3] || '0') +
  12580. '.' + (match[4] || '0'), options)
  12581. }
  12582. /***/ }),
  12583. /***/ 4294:
  12584. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12585. module.exports = __nccwpck_require__(4219);
  12586. /***/ }),
  12587. /***/ 4219:
  12588. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12589. "use strict";
  12590. var net = __nccwpck_require__(1808);
  12591. var tls = __nccwpck_require__(4404);
  12592. var http = __nccwpck_require__(3685);
  12593. var https = __nccwpck_require__(5687);
  12594. var events = __nccwpck_require__(2361);
  12595. var assert = __nccwpck_require__(9491);
  12596. var util = __nccwpck_require__(3837);
  12597. exports.httpOverHttp = httpOverHttp;
  12598. exports.httpsOverHttp = httpsOverHttp;
  12599. exports.httpOverHttps = httpOverHttps;
  12600. exports.httpsOverHttps = httpsOverHttps;
  12601. function httpOverHttp(options) {
  12602. var agent = new TunnelingAgent(options);
  12603. agent.request = http.request;
  12604. return agent;
  12605. }
  12606. function httpsOverHttp(options) {
  12607. var agent = new TunnelingAgent(options);
  12608. agent.request = http.request;
  12609. agent.createSocket = createSecureSocket;
  12610. agent.defaultPort = 443;
  12611. return agent;
  12612. }
  12613. function httpOverHttps(options) {
  12614. var agent = new TunnelingAgent(options);
  12615. agent.request = https.request;
  12616. return agent;
  12617. }
  12618. function httpsOverHttps(options) {
  12619. var agent = new TunnelingAgent(options);
  12620. agent.request = https.request;
  12621. agent.createSocket = createSecureSocket;
  12622. agent.defaultPort = 443;
  12623. return agent;
  12624. }
  12625. function TunnelingAgent(options) {
  12626. var self = this;
  12627. self.options = options || {};
  12628. self.proxyOptions = self.options.proxy || {};
  12629. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12630. self.requests = [];
  12631. self.sockets = [];
  12632. self.on('free', function onFree(socket, host, port, localAddress) {
  12633. var options = toOptions(host, port, localAddress);
  12634. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12635. var pending = self.requests[i];
  12636. if (pending.host === options.host && pending.port === options.port) {
  12637. // Detect the request to connect same origin server,
  12638. // reuse the connection.
  12639. self.requests.splice(i, 1);
  12640. pending.request.onSocket(socket);
  12641. return;
  12642. }
  12643. }
  12644. socket.destroy();
  12645. self.removeSocket(socket);
  12646. });
  12647. }
  12648. util.inherits(TunnelingAgent, events.EventEmitter);
  12649. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12650. var self = this;
  12651. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12652. if (self.sockets.length >= this.maxSockets) {
  12653. // We are over limit so we'll add it to the queue.
  12654. self.requests.push(options);
  12655. return;
  12656. }
  12657. // If we are under maxSockets create a new one.
  12658. self.createSocket(options, function(socket) {
  12659. socket.on('free', onFree);
  12660. socket.on('close', onCloseOrRemove);
  12661. socket.on('agentRemove', onCloseOrRemove);
  12662. req.onSocket(socket);
  12663. function onFree() {
  12664. self.emit('free', socket, options);
  12665. }
  12666. function onCloseOrRemove(err) {
  12667. self.removeSocket(socket);
  12668. socket.removeListener('free', onFree);
  12669. socket.removeListener('close', onCloseOrRemove);
  12670. socket.removeListener('agentRemove', onCloseOrRemove);
  12671. }
  12672. });
  12673. };
  12674. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12675. var self = this;
  12676. var placeholder = {};
  12677. self.sockets.push(placeholder);
  12678. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12679. method: 'CONNECT',
  12680. path: options.host + ':' + options.port,
  12681. agent: false,
  12682. headers: {
  12683. host: options.host + ':' + options.port
  12684. }
  12685. });
  12686. if (options.localAddress) {
  12687. connectOptions.localAddress = options.localAddress;
  12688. }
  12689. if (connectOptions.proxyAuth) {
  12690. connectOptions.headers = connectOptions.headers || {};
  12691. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12692. new Buffer(connectOptions.proxyAuth).toString('base64');
  12693. }
  12694. debug('making CONNECT request');
  12695. var connectReq = self.request(connectOptions);
  12696. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12697. connectReq.once('response', onResponse); // for v0.6
  12698. connectReq.once('upgrade', onUpgrade); // for v0.6
  12699. connectReq.once('connect', onConnect); // for v0.7 or later
  12700. connectReq.once('error', onError);
  12701. connectReq.end();
  12702. function onResponse(res) {
  12703. // Very hacky. This is necessary to avoid http-parser leaks.
  12704. res.upgrade = true;
  12705. }
  12706. function onUpgrade(res, socket, head) {
  12707. // Hacky.
  12708. process.nextTick(function() {
  12709. onConnect(res, socket, head);
  12710. });
  12711. }
  12712. function onConnect(res, socket, head) {
  12713. connectReq.removeAllListeners();
  12714. socket.removeAllListeners();
  12715. if (res.statusCode !== 200) {
  12716. debug('tunneling socket could not be established, statusCode=%d',
  12717. res.statusCode);
  12718. socket.destroy();
  12719. var error = new Error('tunneling socket could not be established, ' +
  12720. 'statusCode=' + res.statusCode);
  12721. error.code = 'ECONNRESET';
  12722. options.request.emit('error', error);
  12723. self.removeSocket(placeholder);
  12724. return;
  12725. }
  12726. if (head.length > 0) {
  12727. debug('got illegal response body from proxy');
  12728. socket.destroy();
  12729. var error = new Error('got illegal response body from proxy');
  12730. error.code = 'ECONNRESET';
  12731. options.request.emit('error', error);
  12732. self.removeSocket(placeholder);
  12733. return;
  12734. }
  12735. debug('tunneling connection has established');
  12736. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12737. return cb(socket);
  12738. }
  12739. function onError(cause) {
  12740. connectReq.removeAllListeners();
  12741. debug('tunneling socket could not be established, cause=%s\n',
  12742. cause.message, cause.stack);
  12743. var error = new Error('tunneling socket could not be established, ' +
  12744. 'cause=' + cause.message);
  12745. error.code = 'ECONNRESET';
  12746. options.request.emit('error', error);
  12747. self.removeSocket(placeholder);
  12748. }
  12749. };
  12750. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12751. var pos = this.sockets.indexOf(socket)
  12752. if (pos === -1) {
  12753. return;
  12754. }
  12755. this.sockets.splice(pos, 1);
  12756. var pending = this.requests.shift();
  12757. if (pending) {
  12758. // If we have pending requests and a socket gets closed a new one
  12759. // needs to be created to take over in the pool for the one that closed.
  12760. this.createSocket(pending, function(socket) {
  12761. pending.request.onSocket(socket);
  12762. });
  12763. }
  12764. };
  12765. function createSecureSocket(options, cb) {
  12766. var self = this;
  12767. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12768. var hostHeader = options.request.getHeader('host');
  12769. var tlsOptions = mergeOptions({}, self.options, {
  12770. socket: socket,
  12771. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12772. });
  12773. // 0 is dummy port for v0.6
  12774. var secureSocket = tls.connect(0, tlsOptions);
  12775. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12776. cb(secureSocket);
  12777. });
  12778. }
  12779. function toOptions(host, port, localAddress) {
  12780. if (typeof host === 'string') { // since v0.10
  12781. return {
  12782. host: host,
  12783. port: port,
  12784. localAddress: localAddress
  12785. };
  12786. }
  12787. return host; // for v0.11 or later
  12788. }
  12789. function mergeOptions(target) {
  12790. for (var i = 1, len = arguments.length; i < len; ++i) {
  12791. var overrides = arguments[i];
  12792. if (typeof overrides === 'object') {
  12793. var keys = Object.keys(overrides);
  12794. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12795. var k = keys[j];
  12796. if (overrides[k] !== undefined) {
  12797. target[k] = overrides[k];
  12798. }
  12799. }
  12800. }
  12801. }
  12802. return target;
  12803. }
  12804. var debug;
  12805. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12806. debug = function() {
  12807. var args = Array.prototype.slice.call(arguments);
  12808. if (typeof args[0] === 'string') {
  12809. args[0] = 'TUNNEL: ' + args[0];
  12810. } else {
  12811. args.unshift('TUNNEL:');
  12812. }
  12813. console.error.apply(console, args);
  12814. }
  12815. } else {
  12816. debug = function() {};
  12817. }
  12818. exports.debug = debug; // for test
  12819. /***/ }),
  12820. /***/ 1773:
  12821. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12822. "use strict";
  12823. const Client = __nccwpck_require__(3598)
  12824. const Dispatcher = __nccwpck_require__(412)
  12825. const errors = __nccwpck_require__(8045)
  12826. const Pool = __nccwpck_require__(4634)
  12827. const BalancedPool = __nccwpck_require__(7931)
  12828. const Agent = __nccwpck_require__(7890)
  12829. const util = __nccwpck_require__(3983)
  12830. const { InvalidArgumentError } = errors
  12831. const api = __nccwpck_require__(4059)
  12832. const buildConnector = __nccwpck_require__(2067)
  12833. const MockClient = __nccwpck_require__(8687)
  12834. const MockAgent = __nccwpck_require__(6771)
  12835. const MockPool = __nccwpck_require__(6193)
  12836. const mockErrors = __nccwpck_require__(888)
  12837. const ProxyAgent = __nccwpck_require__(7858)
  12838. const RetryHandler = __nccwpck_require__(2286)
  12839. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12840. const DecoratorHandler = __nccwpck_require__(6930)
  12841. const RedirectHandler = __nccwpck_require__(2860)
  12842. const createRedirectInterceptor = __nccwpck_require__(8861)
  12843. let hasCrypto
  12844. try {
  12845. __nccwpck_require__(6113)
  12846. hasCrypto = true
  12847. } catch {
  12848. hasCrypto = false
  12849. }
  12850. Object.assign(Dispatcher.prototype, api)
  12851. module.exports.Dispatcher = Dispatcher
  12852. module.exports.Client = Client
  12853. module.exports.Pool = Pool
  12854. module.exports.BalancedPool = BalancedPool
  12855. module.exports.Agent = Agent
  12856. module.exports.ProxyAgent = ProxyAgent
  12857. module.exports.RetryHandler = RetryHandler
  12858. module.exports.DecoratorHandler = DecoratorHandler
  12859. module.exports.RedirectHandler = RedirectHandler
  12860. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12861. module.exports.buildConnector = buildConnector
  12862. module.exports.errors = errors
  12863. function makeDispatcher (fn) {
  12864. return (url, opts, handler) => {
  12865. if (typeof opts === 'function') {
  12866. handler = opts
  12867. opts = null
  12868. }
  12869. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12870. throw new InvalidArgumentError('invalid url')
  12871. }
  12872. if (opts != null && typeof opts !== 'object') {
  12873. throw new InvalidArgumentError('invalid opts')
  12874. }
  12875. if (opts && opts.path != null) {
  12876. if (typeof opts.path !== 'string') {
  12877. throw new InvalidArgumentError('invalid opts.path')
  12878. }
  12879. let path = opts.path
  12880. if (!opts.path.startsWith('/')) {
  12881. path = `/${path}`
  12882. }
  12883. url = new URL(util.parseOrigin(url).origin + path)
  12884. } else {
  12885. if (!opts) {
  12886. opts = typeof url === 'object' ? url : {}
  12887. }
  12888. url = util.parseURL(url)
  12889. }
  12890. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12891. if (agent) {
  12892. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12893. }
  12894. return fn.call(dispatcher, {
  12895. ...opts,
  12896. origin: url.origin,
  12897. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12898. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12899. }, handler)
  12900. }
  12901. }
  12902. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12903. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12904. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12905. let fetchImpl = null
  12906. module.exports.fetch = async function fetch (resource) {
  12907. if (!fetchImpl) {
  12908. fetchImpl = (__nccwpck_require__(4881).fetch)
  12909. }
  12910. try {
  12911. return await fetchImpl(...arguments)
  12912. } catch (err) {
  12913. if (typeof err === 'object') {
  12914. Error.captureStackTrace(err, this)
  12915. }
  12916. throw err
  12917. }
  12918. }
  12919. module.exports.Headers = __nccwpck_require__(554).Headers
  12920. module.exports.Response = __nccwpck_require__(7823).Response
  12921. module.exports.Request = __nccwpck_require__(8359).Request
  12922. module.exports.FormData = __nccwpck_require__(2015).FormData
  12923. module.exports.File = __nccwpck_require__(8511).File
  12924. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12925. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12926. module.exports.setGlobalOrigin = setGlobalOrigin
  12927. module.exports.getGlobalOrigin = getGlobalOrigin
  12928. const { CacheStorage } = __nccwpck_require__(7907)
  12929. const { kConstruct } = __nccwpck_require__(9174)
  12930. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12931. // in an older version of Node, it doesn't have any use without fetch.
  12932. module.exports.caches = new CacheStorage(kConstruct)
  12933. }
  12934. if (util.nodeMajor >= 16) {
  12935. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12936. module.exports.deleteCookie = deleteCookie
  12937. module.exports.getCookies = getCookies
  12938. module.exports.getSetCookies = getSetCookies
  12939. module.exports.setCookie = setCookie
  12940. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12941. module.exports.parseMIMEType = parseMIMEType
  12942. module.exports.serializeAMimeType = serializeAMimeType
  12943. }
  12944. if (util.nodeMajor >= 18 && hasCrypto) {
  12945. const { WebSocket } = __nccwpck_require__(4284)
  12946. module.exports.WebSocket = WebSocket
  12947. }
  12948. module.exports.request = makeDispatcher(api.request)
  12949. module.exports.stream = makeDispatcher(api.stream)
  12950. module.exports.pipeline = makeDispatcher(api.pipeline)
  12951. module.exports.connect = makeDispatcher(api.connect)
  12952. module.exports.upgrade = makeDispatcher(api.upgrade)
  12953. module.exports.MockClient = MockClient
  12954. module.exports.MockPool = MockPool
  12955. module.exports.MockAgent = MockAgent
  12956. module.exports.mockErrors = mockErrors
  12957. /***/ }),
  12958. /***/ 7890:
  12959. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12960. "use strict";
  12961. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12962. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12963. const DispatcherBase = __nccwpck_require__(4839)
  12964. const Pool = __nccwpck_require__(4634)
  12965. const Client = __nccwpck_require__(3598)
  12966. const util = __nccwpck_require__(3983)
  12967. const createRedirectInterceptor = __nccwpck_require__(8861)
  12968. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12969. const kOnConnect = Symbol('onConnect')
  12970. const kOnDisconnect = Symbol('onDisconnect')
  12971. const kOnConnectionError = Symbol('onConnectionError')
  12972. const kMaxRedirections = Symbol('maxRedirections')
  12973. const kOnDrain = Symbol('onDrain')
  12974. const kFactory = Symbol('factory')
  12975. const kFinalizer = Symbol('finalizer')
  12976. const kOptions = Symbol('options')
  12977. function defaultFactory (origin, opts) {
  12978. return opts && opts.connections === 1
  12979. ? new Client(origin, opts)
  12980. : new Pool(origin, opts)
  12981. }
  12982. class Agent extends DispatcherBase {
  12983. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  12984. super()
  12985. if (typeof factory !== 'function') {
  12986. throw new InvalidArgumentError('factory must be a function.')
  12987. }
  12988. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  12989. throw new InvalidArgumentError('connect must be a function or an object')
  12990. }
  12991. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  12992. throw new InvalidArgumentError('maxRedirections must be a positive number')
  12993. }
  12994. if (connect && typeof connect !== 'function') {
  12995. connect = { ...connect }
  12996. }
  12997. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  12998. ? options.interceptors.Agent
  12999. : [createRedirectInterceptor({ maxRedirections })]
  13000. this[kOptions] = { ...util.deepClone(options), connect }
  13001. this[kOptions].interceptors = options.interceptors
  13002. ? { ...options.interceptors }
  13003. : undefined
  13004. this[kMaxRedirections] = maxRedirections
  13005. this[kFactory] = factory
  13006. this[kClients] = new Map()
  13007. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  13008. const ref = this[kClients].get(key)
  13009. if (ref !== undefined && ref.deref() === undefined) {
  13010. this[kClients].delete(key)
  13011. }
  13012. })
  13013. const agent = this
  13014. this[kOnDrain] = (origin, targets) => {
  13015. agent.emit('drain', origin, [agent, ...targets])
  13016. }
  13017. this[kOnConnect] = (origin, targets) => {
  13018. agent.emit('connect', origin, [agent, ...targets])
  13019. }
  13020. this[kOnDisconnect] = (origin, targets, err) => {
  13021. agent.emit('disconnect', origin, [agent, ...targets], err)
  13022. }
  13023. this[kOnConnectionError] = (origin, targets, err) => {
  13024. agent.emit('connectionError', origin, [agent, ...targets], err)
  13025. }
  13026. }
  13027. get [kRunning] () {
  13028. let ret = 0
  13029. for (const ref of this[kClients].values()) {
  13030. const client = ref.deref()
  13031. /* istanbul ignore next: gc is undeterministic */
  13032. if (client) {
  13033. ret += client[kRunning]
  13034. }
  13035. }
  13036. return ret
  13037. }
  13038. [kDispatch] (opts, handler) {
  13039. let key
  13040. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  13041. key = String(opts.origin)
  13042. } else {
  13043. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  13044. }
  13045. const ref = this[kClients].get(key)
  13046. let dispatcher = ref ? ref.deref() : null
  13047. if (!dispatcher) {
  13048. dispatcher = this[kFactory](opts.origin, this[kOptions])
  13049. .on('drain', this[kOnDrain])
  13050. .on('connect', this[kOnConnect])
  13051. .on('disconnect', this[kOnDisconnect])
  13052. .on('connectionError', this[kOnConnectionError])
  13053. this[kClients].set(key, new WeakRef(dispatcher))
  13054. this[kFinalizer].register(dispatcher, key)
  13055. }
  13056. return dispatcher.dispatch(opts, handler)
  13057. }
  13058. async [kClose] () {
  13059. const closePromises = []
  13060. for (const ref of this[kClients].values()) {
  13061. const client = ref.deref()
  13062. /* istanbul ignore else: gc is undeterministic */
  13063. if (client) {
  13064. closePromises.push(client.close())
  13065. }
  13066. }
  13067. await Promise.all(closePromises)
  13068. }
  13069. async [kDestroy] (err) {
  13070. const destroyPromises = []
  13071. for (const ref of this[kClients].values()) {
  13072. const client = ref.deref()
  13073. /* istanbul ignore else: gc is undeterministic */
  13074. if (client) {
  13075. destroyPromises.push(client.destroy(err))
  13076. }
  13077. }
  13078. await Promise.all(destroyPromises)
  13079. }
  13080. }
  13081. module.exports = Agent
  13082. /***/ }),
  13083. /***/ 7032:
  13084. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13085. const { addAbortListener } = __nccwpck_require__(3983)
  13086. const { RequestAbortedError } = __nccwpck_require__(8045)
  13087. const kListener = Symbol('kListener')
  13088. const kSignal = Symbol('kSignal')
  13089. function abort (self) {
  13090. if (self.abort) {
  13091. self.abort()
  13092. } else {
  13093. self.onError(new RequestAbortedError())
  13094. }
  13095. }
  13096. function addSignal (self, signal) {
  13097. self[kSignal] = null
  13098. self[kListener] = null
  13099. if (!signal) {
  13100. return
  13101. }
  13102. if (signal.aborted) {
  13103. abort(self)
  13104. return
  13105. }
  13106. self[kSignal] = signal
  13107. self[kListener] = () => {
  13108. abort(self)
  13109. }
  13110. addAbortListener(self[kSignal], self[kListener])
  13111. }
  13112. function removeSignal (self) {
  13113. if (!self[kSignal]) {
  13114. return
  13115. }
  13116. if ('removeEventListener' in self[kSignal]) {
  13117. self[kSignal].removeEventListener('abort', self[kListener])
  13118. } else {
  13119. self[kSignal].removeListener('abort', self[kListener])
  13120. }
  13121. self[kSignal] = null
  13122. self[kListener] = null
  13123. }
  13124. module.exports = {
  13125. addSignal,
  13126. removeSignal
  13127. }
  13128. /***/ }),
  13129. /***/ 9744:
  13130. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13131. "use strict";
  13132. const { AsyncResource } = __nccwpck_require__(852)
  13133. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13134. const util = __nccwpck_require__(3983)
  13135. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13136. class ConnectHandler extends AsyncResource {
  13137. constructor (opts, callback) {
  13138. if (!opts || typeof opts !== 'object') {
  13139. throw new InvalidArgumentError('invalid opts')
  13140. }
  13141. if (typeof callback !== 'function') {
  13142. throw new InvalidArgumentError('invalid callback')
  13143. }
  13144. const { signal, opaque, responseHeaders } = opts
  13145. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13146. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13147. }
  13148. super('UNDICI_CONNECT')
  13149. this.opaque = opaque || null
  13150. this.responseHeaders = responseHeaders || null
  13151. this.callback = callback
  13152. this.abort = null
  13153. addSignal(this, signal)
  13154. }
  13155. onConnect (abort, context) {
  13156. if (!this.callback) {
  13157. throw new RequestAbortedError()
  13158. }
  13159. this.abort = abort
  13160. this.context = context
  13161. }
  13162. onHeaders () {
  13163. throw new SocketError('bad connect', null)
  13164. }
  13165. onUpgrade (statusCode, rawHeaders, socket) {
  13166. const { callback, opaque, context } = this
  13167. removeSignal(this)
  13168. this.callback = null
  13169. let headers = rawHeaders
  13170. // Indicates is an HTTP2Session
  13171. if (headers != null) {
  13172. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13173. }
  13174. this.runInAsyncScope(callback, null, null, {
  13175. statusCode,
  13176. headers,
  13177. socket,
  13178. opaque,
  13179. context
  13180. })
  13181. }
  13182. onError (err) {
  13183. const { callback, opaque } = this
  13184. removeSignal(this)
  13185. if (callback) {
  13186. this.callback = null
  13187. queueMicrotask(() => {
  13188. this.runInAsyncScope(callback, null, err, { opaque })
  13189. })
  13190. }
  13191. }
  13192. }
  13193. function connect (opts, callback) {
  13194. if (callback === undefined) {
  13195. return new Promise((resolve, reject) => {
  13196. connect.call(this, opts, (err, data) => {
  13197. return err ? reject(err) : resolve(data)
  13198. })
  13199. })
  13200. }
  13201. try {
  13202. const connectHandler = new ConnectHandler(opts, callback)
  13203. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  13204. } catch (err) {
  13205. if (typeof callback !== 'function') {
  13206. throw err
  13207. }
  13208. const opaque = opts && opts.opaque
  13209. queueMicrotask(() => callback(err, { opaque }))
  13210. }
  13211. }
  13212. module.exports = connect
  13213. /***/ }),
  13214. /***/ 8752:
  13215. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13216. "use strict";
  13217. const {
  13218. Readable,
  13219. Duplex,
  13220. PassThrough
  13221. } = __nccwpck_require__(2781)
  13222. const {
  13223. InvalidArgumentError,
  13224. InvalidReturnValueError,
  13225. RequestAbortedError
  13226. } = __nccwpck_require__(8045)
  13227. const util = __nccwpck_require__(3983)
  13228. const { AsyncResource } = __nccwpck_require__(852)
  13229. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13230. const assert = __nccwpck_require__(9491)
  13231. const kResume = Symbol('resume')
  13232. class PipelineRequest extends Readable {
  13233. constructor () {
  13234. super({ autoDestroy: true })
  13235. this[kResume] = null
  13236. }
  13237. _read () {
  13238. const { [kResume]: resume } = this
  13239. if (resume) {
  13240. this[kResume] = null
  13241. resume()
  13242. }
  13243. }
  13244. _destroy (err, callback) {
  13245. this._read()
  13246. callback(err)
  13247. }
  13248. }
  13249. class PipelineResponse extends Readable {
  13250. constructor (resume) {
  13251. super({ autoDestroy: true })
  13252. this[kResume] = resume
  13253. }
  13254. _read () {
  13255. this[kResume]()
  13256. }
  13257. _destroy (err, callback) {
  13258. if (!err && !this._readableState.endEmitted) {
  13259. err = new RequestAbortedError()
  13260. }
  13261. callback(err)
  13262. }
  13263. }
  13264. class PipelineHandler extends AsyncResource {
  13265. constructor (opts, handler) {
  13266. if (!opts || typeof opts !== 'object') {
  13267. throw new InvalidArgumentError('invalid opts')
  13268. }
  13269. if (typeof handler !== 'function') {
  13270. throw new InvalidArgumentError('invalid handler')
  13271. }
  13272. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13273. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13274. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13275. }
  13276. if (method === 'CONNECT') {
  13277. throw new InvalidArgumentError('invalid method')
  13278. }
  13279. if (onInfo && typeof onInfo !== 'function') {
  13280. throw new InvalidArgumentError('invalid onInfo callback')
  13281. }
  13282. super('UNDICI_PIPELINE')
  13283. this.opaque = opaque || null
  13284. this.responseHeaders = responseHeaders || null
  13285. this.handler = handler
  13286. this.abort = null
  13287. this.context = null
  13288. this.onInfo = onInfo || null
  13289. this.req = new PipelineRequest().on('error', util.nop)
  13290. this.ret = new Duplex({
  13291. readableObjectMode: opts.objectMode,
  13292. autoDestroy: true,
  13293. read: () => {
  13294. const { body } = this
  13295. if (body && body.resume) {
  13296. body.resume()
  13297. }
  13298. },
  13299. write: (chunk, encoding, callback) => {
  13300. const { req } = this
  13301. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13302. callback()
  13303. } else {
  13304. req[kResume] = callback
  13305. }
  13306. },
  13307. destroy: (err, callback) => {
  13308. const { body, req, res, ret, abort } = this
  13309. if (!err && !ret._readableState.endEmitted) {
  13310. err = new RequestAbortedError()
  13311. }
  13312. if (abort && err) {
  13313. abort()
  13314. }
  13315. util.destroy(body, err)
  13316. util.destroy(req, err)
  13317. util.destroy(res, err)
  13318. removeSignal(this)
  13319. callback(err)
  13320. }
  13321. }).on('prefinish', () => {
  13322. const { req } = this
  13323. // Node < 15 does not call _final in same tick.
  13324. req.push(null)
  13325. })
  13326. this.res = null
  13327. addSignal(this, signal)
  13328. }
  13329. onConnect (abort, context) {
  13330. const { ret, res } = this
  13331. assert(!res, 'pipeline cannot be retried')
  13332. if (ret.destroyed) {
  13333. throw new RequestAbortedError()
  13334. }
  13335. this.abort = abort
  13336. this.context = context
  13337. }
  13338. onHeaders (statusCode, rawHeaders, resume) {
  13339. const { opaque, handler, context } = this
  13340. if (statusCode < 200) {
  13341. if (this.onInfo) {
  13342. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13343. this.onInfo({ statusCode, headers })
  13344. }
  13345. return
  13346. }
  13347. this.res = new PipelineResponse(resume)
  13348. let body
  13349. try {
  13350. this.handler = null
  13351. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13352. body = this.runInAsyncScope(handler, null, {
  13353. statusCode,
  13354. headers,
  13355. opaque,
  13356. body: this.res,
  13357. context
  13358. })
  13359. } catch (err) {
  13360. this.res.on('error', util.nop)
  13361. throw err
  13362. }
  13363. if (!body || typeof body.on !== 'function') {
  13364. throw new InvalidReturnValueError('expected Readable')
  13365. }
  13366. body
  13367. .on('data', (chunk) => {
  13368. const { ret, body } = this
  13369. if (!ret.push(chunk) && body.pause) {
  13370. body.pause()
  13371. }
  13372. })
  13373. .on('error', (err) => {
  13374. const { ret } = this
  13375. util.destroy(ret, err)
  13376. })
  13377. .on('end', () => {
  13378. const { ret } = this
  13379. ret.push(null)
  13380. })
  13381. .on('close', () => {
  13382. const { ret } = this
  13383. if (!ret._readableState.ended) {
  13384. util.destroy(ret, new RequestAbortedError())
  13385. }
  13386. })
  13387. this.body = body
  13388. }
  13389. onData (chunk) {
  13390. const { res } = this
  13391. return res.push(chunk)
  13392. }
  13393. onComplete (trailers) {
  13394. const { res } = this
  13395. res.push(null)
  13396. }
  13397. onError (err) {
  13398. const { ret } = this
  13399. this.handler = null
  13400. util.destroy(ret, err)
  13401. }
  13402. }
  13403. function pipeline (opts, handler) {
  13404. try {
  13405. const pipelineHandler = new PipelineHandler(opts, handler)
  13406. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13407. return pipelineHandler.ret
  13408. } catch (err) {
  13409. return new PassThrough().destroy(err)
  13410. }
  13411. }
  13412. module.exports = pipeline
  13413. /***/ }),
  13414. /***/ 5448:
  13415. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13416. "use strict";
  13417. const Readable = __nccwpck_require__(3858)
  13418. const {
  13419. InvalidArgumentError,
  13420. RequestAbortedError
  13421. } = __nccwpck_require__(8045)
  13422. const util = __nccwpck_require__(3983)
  13423. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13424. const { AsyncResource } = __nccwpck_require__(852)
  13425. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13426. class RequestHandler extends AsyncResource {
  13427. constructor (opts, callback) {
  13428. if (!opts || typeof opts !== 'object') {
  13429. throw new InvalidArgumentError('invalid opts')
  13430. }
  13431. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13432. try {
  13433. if (typeof callback !== 'function') {
  13434. throw new InvalidArgumentError('invalid callback')
  13435. }
  13436. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13437. throw new InvalidArgumentError('invalid highWaterMark')
  13438. }
  13439. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13440. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13441. }
  13442. if (method === 'CONNECT') {
  13443. throw new InvalidArgumentError('invalid method')
  13444. }
  13445. if (onInfo && typeof onInfo !== 'function') {
  13446. throw new InvalidArgumentError('invalid onInfo callback')
  13447. }
  13448. super('UNDICI_REQUEST')
  13449. } catch (err) {
  13450. if (util.isStream(body)) {
  13451. util.destroy(body.on('error', util.nop), err)
  13452. }
  13453. throw err
  13454. }
  13455. this.responseHeaders = responseHeaders || null
  13456. this.opaque = opaque || null
  13457. this.callback = callback
  13458. this.res = null
  13459. this.abort = null
  13460. this.body = body
  13461. this.trailers = {}
  13462. this.context = null
  13463. this.onInfo = onInfo || null
  13464. this.throwOnError = throwOnError
  13465. this.highWaterMark = highWaterMark
  13466. if (util.isStream(body)) {
  13467. body.on('error', (err) => {
  13468. this.onError(err)
  13469. })
  13470. }
  13471. addSignal(this, signal)
  13472. }
  13473. onConnect (abort, context) {
  13474. if (!this.callback) {
  13475. throw new RequestAbortedError()
  13476. }
  13477. this.abort = abort
  13478. this.context = context
  13479. }
  13480. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13481. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13482. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13483. if (statusCode < 200) {
  13484. if (this.onInfo) {
  13485. this.onInfo({ statusCode, headers })
  13486. }
  13487. return
  13488. }
  13489. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13490. const contentType = parsedHeaders['content-type']
  13491. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13492. this.callback = null
  13493. this.res = body
  13494. if (callback !== null) {
  13495. if (this.throwOnError && statusCode >= 400) {
  13496. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13497. { callback, body, contentType, statusCode, statusMessage, headers }
  13498. )
  13499. } else {
  13500. this.runInAsyncScope(callback, null, null, {
  13501. statusCode,
  13502. headers,
  13503. trailers: this.trailers,
  13504. opaque,
  13505. body,
  13506. context
  13507. })
  13508. }
  13509. }
  13510. }
  13511. onData (chunk) {
  13512. const { res } = this
  13513. return res.push(chunk)
  13514. }
  13515. onComplete (trailers) {
  13516. const { res } = this
  13517. removeSignal(this)
  13518. util.parseHeaders(trailers, this.trailers)
  13519. res.push(null)
  13520. }
  13521. onError (err) {
  13522. const { res, callback, body, opaque } = this
  13523. removeSignal(this)
  13524. if (callback) {
  13525. // TODO: Does this need queueMicrotask?
  13526. this.callback = null
  13527. queueMicrotask(() => {
  13528. this.runInAsyncScope(callback, null, err, { opaque })
  13529. })
  13530. }
  13531. if (res) {
  13532. this.res = null
  13533. // Ensure all queued handlers are invoked before destroying res.
  13534. queueMicrotask(() => {
  13535. util.destroy(res, err)
  13536. })
  13537. }
  13538. if (body) {
  13539. this.body = null
  13540. util.destroy(body, err)
  13541. }
  13542. }
  13543. }
  13544. function request (opts, callback) {
  13545. if (callback === undefined) {
  13546. return new Promise((resolve, reject) => {
  13547. request.call(this, opts, (err, data) => {
  13548. return err ? reject(err) : resolve(data)
  13549. })
  13550. })
  13551. }
  13552. try {
  13553. this.dispatch(opts, new RequestHandler(opts, callback))
  13554. } catch (err) {
  13555. if (typeof callback !== 'function') {
  13556. throw err
  13557. }
  13558. const opaque = opts && opts.opaque
  13559. queueMicrotask(() => callback(err, { opaque }))
  13560. }
  13561. }
  13562. module.exports = request
  13563. module.exports.RequestHandler = RequestHandler
  13564. /***/ }),
  13565. /***/ 5395:
  13566. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13567. "use strict";
  13568. const { finished, PassThrough } = __nccwpck_require__(2781)
  13569. const {
  13570. InvalidArgumentError,
  13571. InvalidReturnValueError,
  13572. RequestAbortedError
  13573. } = __nccwpck_require__(8045)
  13574. const util = __nccwpck_require__(3983)
  13575. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13576. const { AsyncResource } = __nccwpck_require__(852)
  13577. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13578. class StreamHandler extends AsyncResource {
  13579. constructor (opts, factory, callback) {
  13580. if (!opts || typeof opts !== 'object') {
  13581. throw new InvalidArgumentError('invalid opts')
  13582. }
  13583. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13584. try {
  13585. if (typeof callback !== 'function') {
  13586. throw new InvalidArgumentError('invalid callback')
  13587. }
  13588. if (typeof factory !== 'function') {
  13589. throw new InvalidArgumentError('invalid factory')
  13590. }
  13591. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13592. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13593. }
  13594. if (method === 'CONNECT') {
  13595. throw new InvalidArgumentError('invalid method')
  13596. }
  13597. if (onInfo && typeof onInfo !== 'function') {
  13598. throw new InvalidArgumentError('invalid onInfo callback')
  13599. }
  13600. super('UNDICI_STREAM')
  13601. } catch (err) {
  13602. if (util.isStream(body)) {
  13603. util.destroy(body.on('error', util.nop), err)
  13604. }
  13605. throw err
  13606. }
  13607. this.responseHeaders = responseHeaders || null
  13608. this.opaque = opaque || null
  13609. this.factory = factory
  13610. this.callback = callback
  13611. this.res = null
  13612. this.abort = null
  13613. this.context = null
  13614. this.trailers = null
  13615. this.body = body
  13616. this.onInfo = onInfo || null
  13617. this.throwOnError = throwOnError || false
  13618. if (util.isStream(body)) {
  13619. body.on('error', (err) => {
  13620. this.onError(err)
  13621. })
  13622. }
  13623. addSignal(this, signal)
  13624. }
  13625. onConnect (abort, context) {
  13626. if (!this.callback) {
  13627. throw new RequestAbortedError()
  13628. }
  13629. this.abort = abort
  13630. this.context = context
  13631. }
  13632. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13633. const { factory, opaque, context, callback, responseHeaders } = this
  13634. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13635. if (statusCode < 200) {
  13636. if (this.onInfo) {
  13637. this.onInfo({ statusCode, headers })
  13638. }
  13639. return
  13640. }
  13641. this.factory = null
  13642. let res
  13643. if (this.throwOnError && statusCode >= 400) {
  13644. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13645. const contentType = parsedHeaders['content-type']
  13646. res = new PassThrough()
  13647. this.callback = null
  13648. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13649. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13650. )
  13651. } else {
  13652. if (factory === null) {
  13653. return
  13654. }
  13655. res = this.runInAsyncScope(factory, null, {
  13656. statusCode,
  13657. headers,
  13658. opaque,
  13659. context
  13660. })
  13661. if (
  13662. !res ||
  13663. typeof res.write !== 'function' ||
  13664. typeof res.end !== 'function' ||
  13665. typeof res.on !== 'function'
  13666. ) {
  13667. throw new InvalidReturnValueError('expected Writable')
  13668. }
  13669. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13670. finished(res, { readable: false }, (err) => {
  13671. const { callback, res, opaque, trailers, abort } = this
  13672. this.res = null
  13673. if (err || !res.readable) {
  13674. util.destroy(res, err)
  13675. }
  13676. this.callback = null
  13677. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13678. if (err) {
  13679. abort()
  13680. }
  13681. })
  13682. }
  13683. res.on('drain', resume)
  13684. this.res = res
  13685. const needDrain = res.writableNeedDrain !== undefined
  13686. ? res.writableNeedDrain
  13687. : res._writableState && res._writableState.needDrain
  13688. return needDrain !== true
  13689. }
  13690. onData (chunk) {
  13691. const { res } = this
  13692. return res ? res.write(chunk) : true
  13693. }
  13694. onComplete (trailers) {
  13695. const { res } = this
  13696. removeSignal(this)
  13697. if (!res) {
  13698. return
  13699. }
  13700. this.trailers = util.parseHeaders(trailers)
  13701. res.end()
  13702. }
  13703. onError (err) {
  13704. const { res, callback, opaque, body } = this
  13705. removeSignal(this)
  13706. this.factory = null
  13707. if (res) {
  13708. this.res = null
  13709. util.destroy(res, err)
  13710. } else if (callback) {
  13711. this.callback = null
  13712. queueMicrotask(() => {
  13713. this.runInAsyncScope(callback, null, err, { opaque })
  13714. })
  13715. }
  13716. if (body) {
  13717. this.body = null
  13718. util.destroy(body, err)
  13719. }
  13720. }
  13721. }
  13722. function stream (opts, factory, callback) {
  13723. if (callback === undefined) {
  13724. return new Promise((resolve, reject) => {
  13725. stream.call(this, opts, factory, (err, data) => {
  13726. return err ? reject(err) : resolve(data)
  13727. })
  13728. })
  13729. }
  13730. try {
  13731. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13732. } catch (err) {
  13733. if (typeof callback !== 'function') {
  13734. throw err
  13735. }
  13736. const opaque = opts && opts.opaque
  13737. queueMicrotask(() => callback(err, { opaque }))
  13738. }
  13739. }
  13740. module.exports = stream
  13741. /***/ }),
  13742. /***/ 6923:
  13743. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13744. "use strict";
  13745. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13746. const { AsyncResource } = __nccwpck_require__(852)
  13747. const util = __nccwpck_require__(3983)
  13748. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13749. const assert = __nccwpck_require__(9491)
  13750. class UpgradeHandler extends AsyncResource {
  13751. constructor (opts, callback) {
  13752. if (!opts || typeof opts !== 'object') {
  13753. throw new InvalidArgumentError('invalid opts')
  13754. }
  13755. if (typeof callback !== 'function') {
  13756. throw new InvalidArgumentError('invalid callback')
  13757. }
  13758. const { signal, opaque, responseHeaders } = opts
  13759. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13760. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13761. }
  13762. super('UNDICI_UPGRADE')
  13763. this.responseHeaders = responseHeaders || null
  13764. this.opaque = opaque || null
  13765. this.callback = callback
  13766. this.abort = null
  13767. this.context = null
  13768. addSignal(this, signal)
  13769. }
  13770. onConnect (abort, context) {
  13771. if (!this.callback) {
  13772. throw new RequestAbortedError()
  13773. }
  13774. this.abort = abort
  13775. this.context = null
  13776. }
  13777. onHeaders () {
  13778. throw new SocketError('bad upgrade', null)
  13779. }
  13780. onUpgrade (statusCode, rawHeaders, socket) {
  13781. const { callback, opaque, context } = this
  13782. assert.strictEqual(statusCode, 101)
  13783. removeSignal(this)
  13784. this.callback = null
  13785. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13786. this.runInAsyncScope(callback, null, null, {
  13787. headers,
  13788. socket,
  13789. opaque,
  13790. context
  13791. })
  13792. }
  13793. onError (err) {
  13794. const { callback, opaque } = this
  13795. removeSignal(this)
  13796. if (callback) {
  13797. this.callback = null
  13798. queueMicrotask(() => {
  13799. this.runInAsyncScope(callback, null, err, { opaque })
  13800. })
  13801. }
  13802. }
  13803. }
  13804. function upgrade (opts, callback) {
  13805. if (callback === undefined) {
  13806. return new Promise((resolve, reject) => {
  13807. upgrade.call(this, opts, (err, data) => {
  13808. return err ? reject(err) : resolve(data)
  13809. })
  13810. })
  13811. }
  13812. try {
  13813. const upgradeHandler = new UpgradeHandler(opts, callback)
  13814. this.dispatch({
  13815. ...opts,
  13816. method: opts.method || 'GET',
  13817. upgrade: opts.protocol || 'Websocket'
  13818. }, upgradeHandler)
  13819. } catch (err) {
  13820. if (typeof callback !== 'function') {
  13821. throw err
  13822. }
  13823. const opaque = opts && opts.opaque
  13824. queueMicrotask(() => callback(err, { opaque }))
  13825. }
  13826. }
  13827. module.exports = upgrade
  13828. /***/ }),
  13829. /***/ 4059:
  13830. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13831. "use strict";
  13832. module.exports.request = __nccwpck_require__(5448)
  13833. module.exports.stream = __nccwpck_require__(5395)
  13834. module.exports.pipeline = __nccwpck_require__(8752)
  13835. module.exports.upgrade = __nccwpck_require__(6923)
  13836. module.exports.connect = __nccwpck_require__(9744)
  13837. /***/ }),
  13838. /***/ 3858:
  13839. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13840. "use strict";
  13841. // Ported from https://github.com/nodejs/undici/pull/907
  13842. const assert = __nccwpck_require__(9491)
  13843. const { Readable } = __nccwpck_require__(2781)
  13844. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13845. const util = __nccwpck_require__(3983)
  13846. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13847. let Blob
  13848. const kConsume = Symbol('kConsume')
  13849. const kReading = Symbol('kReading')
  13850. const kBody = Symbol('kBody')
  13851. const kAbort = Symbol('abort')
  13852. const kContentType = Symbol('kContentType')
  13853. const noop = () => {}
  13854. module.exports = class BodyReadable extends Readable {
  13855. constructor ({
  13856. resume,
  13857. abort,
  13858. contentType = '',
  13859. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13860. }) {
  13861. super({
  13862. autoDestroy: true,
  13863. read: resume,
  13864. highWaterMark
  13865. })
  13866. this._readableState.dataEmitted = false
  13867. this[kAbort] = abort
  13868. this[kConsume] = null
  13869. this[kBody] = null
  13870. this[kContentType] = contentType
  13871. // Is stream being consumed through Readable API?
  13872. // This is an optimization so that we avoid checking
  13873. // for 'data' and 'readable' listeners in the hot path
  13874. // inside push().
  13875. this[kReading] = false
  13876. }
  13877. destroy (err) {
  13878. if (this.destroyed) {
  13879. // Node < 16
  13880. return this
  13881. }
  13882. if (!err && !this._readableState.endEmitted) {
  13883. err = new RequestAbortedError()
  13884. }
  13885. if (err) {
  13886. this[kAbort]()
  13887. }
  13888. return super.destroy(err)
  13889. }
  13890. emit (ev, ...args) {
  13891. if (ev === 'data') {
  13892. // Node < 16.7
  13893. this._readableState.dataEmitted = true
  13894. } else if (ev === 'error') {
  13895. // Node < 16
  13896. this._readableState.errorEmitted = true
  13897. }
  13898. return super.emit(ev, ...args)
  13899. }
  13900. on (ev, ...args) {
  13901. if (ev === 'data' || ev === 'readable') {
  13902. this[kReading] = true
  13903. }
  13904. return super.on(ev, ...args)
  13905. }
  13906. addListener (ev, ...args) {
  13907. return this.on(ev, ...args)
  13908. }
  13909. off (ev, ...args) {
  13910. const ret = super.off(ev, ...args)
  13911. if (ev === 'data' || ev === 'readable') {
  13912. this[kReading] = (
  13913. this.listenerCount('data') > 0 ||
  13914. this.listenerCount('readable') > 0
  13915. )
  13916. }
  13917. return ret
  13918. }
  13919. removeListener (ev, ...args) {
  13920. return this.off(ev, ...args)
  13921. }
  13922. push (chunk) {
  13923. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13924. consumePush(this[kConsume], chunk)
  13925. return this[kReading] ? super.push(chunk) : true
  13926. }
  13927. return super.push(chunk)
  13928. }
  13929. // https://fetch.spec.whatwg.org/#dom-body-text
  13930. async text () {
  13931. return consume(this, 'text')
  13932. }
  13933. // https://fetch.spec.whatwg.org/#dom-body-json
  13934. async json () {
  13935. return consume(this, 'json')
  13936. }
  13937. // https://fetch.spec.whatwg.org/#dom-body-blob
  13938. async blob () {
  13939. return consume(this, 'blob')
  13940. }
  13941. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13942. async arrayBuffer () {
  13943. return consume(this, 'arrayBuffer')
  13944. }
  13945. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13946. async formData () {
  13947. // TODO: Implement.
  13948. throw new NotSupportedError()
  13949. }
  13950. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13951. get bodyUsed () {
  13952. return util.isDisturbed(this)
  13953. }
  13954. // https://fetch.spec.whatwg.org/#dom-body-body
  13955. get body () {
  13956. if (!this[kBody]) {
  13957. this[kBody] = ReadableStreamFrom(this)
  13958. if (this[kConsume]) {
  13959. // TODO: Is this the best way to force a lock?
  13960. this[kBody].getReader() // Ensure stream is locked.
  13961. assert(this[kBody].locked)
  13962. }
  13963. }
  13964. return this[kBody]
  13965. }
  13966. dump (opts) {
  13967. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13968. const signal = opts && opts.signal
  13969. if (signal) {
  13970. try {
  13971. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13972. throw new InvalidArgumentError('signal must be an AbortSignal')
  13973. }
  13974. util.throwIfAborted(signal)
  13975. } catch (err) {
  13976. return Promise.reject(err)
  13977. }
  13978. }
  13979. if (this.closed) {
  13980. return Promise.resolve(null)
  13981. }
  13982. return new Promise((resolve, reject) => {
  13983. const signalListenerCleanup = signal
  13984. ? util.addAbortListener(signal, () => {
  13985. this.destroy()
  13986. })
  13987. : noop
  13988. this
  13989. .on('close', function () {
  13990. signalListenerCleanup()
  13991. if (signal && signal.aborted) {
  13992. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  13993. } else {
  13994. resolve(null)
  13995. }
  13996. })
  13997. .on('error', noop)
  13998. .on('data', function (chunk) {
  13999. limit -= chunk.length
  14000. if (limit <= 0) {
  14001. this.destroy()
  14002. }
  14003. })
  14004. .resume()
  14005. })
  14006. }
  14007. }
  14008. // https://streams.spec.whatwg.org/#readablestream-locked
  14009. function isLocked (self) {
  14010. // Consume is an implicit lock.
  14011. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  14012. }
  14013. // https://fetch.spec.whatwg.org/#body-unusable
  14014. function isUnusable (self) {
  14015. return util.isDisturbed(self) || isLocked(self)
  14016. }
  14017. async function consume (stream, type) {
  14018. if (isUnusable(stream)) {
  14019. throw new TypeError('unusable')
  14020. }
  14021. assert(!stream[kConsume])
  14022. return new Promise((resolve, reject) => {
  14023. stream[kConsume] = {
  14024. type,
  14025. stream,
  14026. resolve,
  14027. reject,
  14028. length: 0,
  14029. body: []
  14030. }
  14031. stream
  14032. .on('error', function (err) {
  14033. consumeFinish(this[kConsume], err)
  14034. })
  14035. .on('close', function () {
  14036. if (this[kConsume].body !== null) {
  14037. consumeFinish(this[kConsume], new RequestAbortedError())
  14038. }
  14039. })
  14040. process.nextTick(consumeStart, stream[kConsume])
  14041. })
  14042. }
  14043. function consumeStart (consume) {
  14044. if (consume.body === null) {
  14045. return
  14046. }
  14047. const { _readableState: state } = consume.stream
  14048. for (const chunk of state.buffer) {
  14049. consumePush(consume, chunk)
  14050. }
  14051. if (state.endEmitted) {
  14052. consumeEnd(this[kConsume])
  14053. } else {
  14054. consume.stream.on('end', function () {
  14055. consumeEnd(this[kConsume])
  14056. })
  14057. }
  14058. consume.stream.resume()
  14059. while (consume.stream.read() != null) {
  14060. // Loop
  14061. }
  14062. }
  14063. function consumeEnd (consume) {
  14064. const { type, body, resolve, stream, length } = consume
  14065. try {
  14066. if (type === 'text') {
  14067. resolve(toUSVString(Buffer.concat(body)))
  14068. } else if (type === 'json') {
  14069. resolve(JSON.parse(Buffer.concat(body)))
  14070. } else if (type === 'arrayBuffer') {
  14071. const dst = new Uint8Array(length)
  14072. let pos = 0
  14073. for (const buf of body) {
  14074. dst.set(buf, pos)
  14075. pos += buf.byteLength
  14076. }
  14077. resolve(dst.buffer)
  14078. } else if (type === 'blob') {
  14079. if (!Blob) {
  14080. Blob = (__nccwpck_require__(4300).Blob)
  14081. }
  14082. resolve(new Blob(body, { type: stream[kContentType] }))
  14083. }
  14084. consumeFinish(consume)
  14085. } catch (err) {
  14086. stream.destroy(err)
  14087. }
  14088. }
  14089. function consumePush (consume, chunk) {
  14090. consume.length += chunk.length
  14091. consume.body.push(chunk)
  14092. }
  14093. function consumeFinish (consume, err) {
  14094. if (consume.body === null) {
  14095. return
  14096. }
  14097. if (err) {
  14098. consume.reject(err)
  14099. } else {
  14100. consume.resolve()
  14101. }
  14102. consume.type = null
  14103. consume.stream = null
  14104. consume.resolve = null
  14105. consume.reject = null
  14106. consume.length = 0
  14107. consume.body = null
  14108. }
  14109. /***/ }),
  14110. /***/ 7474:
  14111. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14112. const assert = __nccwpck_require__(9491)
  14113. const {
  14114. ResponseStatusCodeError
  14115. } = __nccwpck_require__(8045)
  14116. const { toUSVString } = __nccwpck_require__(3983)
  14117. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  14118. assert(body)
  14119. let chunks = []
  14120. let limit = 0
  14121. for await (const chunk of body) {
  14122. chunks.push(chunk)
  14123. limit += chunk.length
  14124. if (limit > 128 * 1024) {
  14125. chunks = null
  14126. break
  14127. }
  14128. }
  14129. if (statusCode === 204 || !contentType || !chunks) {
  14130. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14131. return
  14132. }
  14133. try {
  14134. if (contentType.startsWith('application/json')) {
  14135. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  14136. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14137. return
  14138. }
  14139. if (contentType.startsWith('text/')) {
  14140. const payload = toUSVString(Buffer.concat(chunks))
  14141. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14142. return
  14143. }
  14144. } catch (err) {
  14145. // Process in a fallback if error
  14146. }
  14147. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14148. }
  14149. module.exports = { getResolveErrorBodyCallback }
  14150. /***/ }),
  14151. /***/ 7931:
  14152. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14153. "use strict";
  14154. const {
  14155. BalancedPoolMissingUpstreamError,
  14156. InvalidArgumentError
  14157. } = __nccwpck_require__(8045)
  14158. const {
  14159. PoolBase,
  14160. kClients,
  14161. kNeedDrain,
  14162. kAddClient,
  14163. kRemoveClient,
  14164. kGetDispatcher
  14165. } = __nccwpck_require__(3198)
  14166. const Pool = __nccwpck_require__(4634)
  14167. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  14168. const { parseOrigin } = __nccwpck_require__(3983)
  14169. const kFactory = Symbol('factory')
  14170. const kOptions = Symbol('options')
  14171. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  14172. const kCurrentWeight = Symbol('kCurrentWeight')
  14173. const kIndex = Symbol('kIndex')
  14174. const kWeight = Symbol('kWeight')
  14175. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  14176. const kErrorPenalty = Symbol('kErrorPenalty')
  14177. function getGreatestCommonDivisor (a, b) {
  14178. if (b === 0) return a
  14179. return getGreatestCommonDivisor(b, a % b)
  14180. }
  14181. function defaultFactory (origin, opts) {
  14182. return new Pool(origin, opts)
  14183. }
  14184. class BalancedPool extends PoolBase {
  14185. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  14186. super()
  14187. this[kOptions] = opts
  14188. this[kIndex] = -1
  14189. this[kCurrentWeight] = 0
  14190. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  14191. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  14192. if (!Array.isArray(upstreams)) {
  14193. upstreams = [upstreams]
  14194. }
  14195. if (typeof factory !== 'function') {
  14196. throw new InvalidArgumentError('factory must be a function.')
  14197. }
  14198. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  14199. ? opts.interceptors.BalancedPool
  14200. : []
  14201. this[kFactory] = factory
  14202. for (const upstream of upstreams) {
  14203. this.addUpstream(upstream)
  14204. }
  14205. this._updateBalancedPoolStats()
  14206. }
  14207. addUpstream (upstream) {
  14208. const upstreamOrigin = parseOrigin(upstream).origin
  14209. if (this[kClients].find((pool) => (
  14210. pool[kUrl].origin === upstreamOrigin &&
  14211. pool.closed !== true &&
  14212. pool.destroyed !== true
  14213. ))) {
  14214. return this
  14215. }
  14216. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  14217. this[kAddClient](pool)
  14218. pool.on('connect', () => {
  14219. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  14220. })
  14221. pool.on('connectionError', () => {
  14222. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14223. this._updateBalancedPoolStats()
  14224. })
  14225. pool.on('disconnect', (...args) => {
  14226. const err = args[2]
  14227. if (err && err.code === 'UND_ERR_SOCKET') {
  14228. // decrease the weight of the pool.
  14229. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14230. this._updateBalancedPoolStats()
  14231. }
  14232. })
  14233. for (const client of this[kClients]) {
  14234. client[kWeight] = this[kMaxWeightPerServer]
  14235. }
  14236. this._updateBalancedPoolStats()
  14237. return this
  14238. }
  14239. _updateBalancedPoolStats () {
  14240. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  14241. }
  14242. removeUpstream (upstream) {
  14243. const upstreamOrigin = parseOrigin(upstream).origin
  14244. const pool = this[kClients].find((pool) => (
  14245. pool[kUrl].origin === upstreamOrigin &&
  14246. pool.closed !== true &&
  14247. pool.destroyed !== true
  14248. ))
  14249. if (pool) {
  14250. this[kRemoveClient](pool)
  14251. }
  14252. return this
  14253. }
  14254. get upstreams () {
  14255. return this[kClients]
  14256. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14257. .map((p) => p[kUrl].origin)
  14258. }
  14259. [kGetDispatcher] () {
  14260. // We validate that pools is greater than 0,
  14261. // otherwise we would have to wait until an upstream
  14262. // is added, which might never happen.
  14263. if (this[kClients].length === 0) {
  14264. throw new BalancedPoolMissingUpstreamError()
  14265. }
  14266. const dispatcher = this[kClients].find(dispatcher => (
  14267. !dispatcher[kNeedDrain] &&
  14268. dispatcher.closed !== true &&
  14269. dispatcher.destroyed !== true
  14270. ))
  14271. if (!dispatcher) {
  14272. return
  14273. }
  14274. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14275. if (allClientsBusy) {
  14276. return
  14277. }
  14278. let counter = 0
  14279. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14280. while (counter++ < this[kClients].length) {
  14281. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14282. const pool = this[kClients][this[kIndex]]
  14283. // find pool index with the largest weight
  14284. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14285. maxWeightIndex = this[kIndex]
  14286. }
  14287. // decrease the current weight every `this[kClients].length`.
  14288. if (this[kIndex] === 0) {
  14289. // Set the current weight to the next lower weight.
  14290. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14291. if (this[kCurrentWeight] <= 0) {
  14292. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14293. }
  14294. }
  14295. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14296. return pool
  14297. }
  14298. }
  14299. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14300. this[kIndex] = maxWeightIndex
  14301. return this[kClients][maxWeightIndex]
  14302. }
  14303. }
  14304. module.exports = BalancedPool
  14305. /***/ }),
  14306. /***/ 6101:
  14307. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14308. "use strict";
  14309. const { kConstruct } = __nccwpck_require__(9174)
  14310. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14311. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14312. const { kHeadersList } = __nccwpck_require__(2785)
  14313. const { webidl } = __nccwpck_require__(1744)
  14314. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14315. const { Request } = __nccwpck_require__(8359)
  14316. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14317. const { fetching } = __nccwpck_require__(4881)
  14318. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14319. const assert = __nccwpck_require__(9491)
  14320. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14321. /**
  14322. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14323. * @typedef {Object} CacheBatchOperation
  14324. * @property {'delete' | 'put'} type
  14325. * @property {any} request
  14326. * @property {any} response
  14327. * @property {import('../../types/cache').CacheQueryOptions} options
  14328. */
  14329. /**
  14330. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14331. * @typedef {[any, any][]} requestResponseList
  14332. */
  14333. class Cache {
  14334. /**
  14335. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14336. * @type {requestResponseList}
  14337. */
  14338. #relevantRequestResponseList
  14339. constructor () {
  14340. if (arguments[0] !== kConstruct) {
  14341. webidl.illegalConstructor()
  14342. }
  14343. this.#relevantRequestResponseList = arguments[1]
  14344. }
  14345. async match (request, options = {}) {
  14346. webidl.brandCheck(this, Cache)
  14347. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14348. request = webidl.converters.RequestInfo(request)
  14349. options = webidl.converters.CacheQueryOptions(options)
  14350. const p = await this.matchAll(request, options)
  14351. if (p.length === 0) {
  14352. return
  14353. }
  14354. return p[0]
  14355. }
  14356. async matchAll (request = undefined, options = {}) {
  14357. webidl.brandCheck(this, Cache)
  14358. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14359. options = webidl.converters.CacheQueryOptions(options)
  14360. // 1.
  14361. let r = null
  14362. // 2.
  14363. if (request !== undefined) {
  14364. if (request instanceof Request) {
  14365. // 2.1.1
  14366. r = request[kState]
  14367. // 2.1.2
  14368. if (r.method !== 'GET' && !options.ignoreMethod) {
  14369. return []
  14370. }
  14371. } else if (typeof request === 'string') {
  14372. // 2.2.1
  14373. r = new Request(request)[kState]
  14374. }
  14375. }
  14376. // 5.
  14377. // 5.1
  14378. const responses = []
  14379. // 5.2
  14380. if (request === undefined) {
  14381. // 5.2.1
  14382. for (const requestResponse of this.#relevantRequestResponseList) {
  14383. responses.push(requestResponse[1])
  14384. }
  14385. } else { // 5.3
  14386. // 5.3.1
  14387. const requestResponses = this.#queryCache(r, options)
  14388. // 5.3.2
  14389. for (const requestResponse of requestResponses) {
  14390. responses.push(requestResponse[1])
  14391. }
  14392. }
  14393. // 5.4
  14394. // We don't implement CORs so we don't need to loop over the responses, yay!
  14395. // 5.5.1
  14396. const responseList = []
  14397. // 5.5.2
  14398. for (const response of responses) {
  14399. // 5.5.2.1
  14400. const responseObject = new Response(response.body?.source ?? null)
  14401. const body = responseObject[kState].body
  14402. responseObject[kState] = response
  14403. responseObject[kState].body = body
  14404. responseObject[kHeaders][kHeadersList] = response.headersList
  14405. responseObject[kHeaders][kGuard] = 'immutable'
  14406. responseList.push(responseObject)
  14407. }
  14408. // 6.
  14409. return Object.freeze(responseList)
  14410. }
  14411. async add (request) {
  14412. webidl.brandCheck(this, Cache)
  14413. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14414. request = webidl.converters.RequestInfo(request)
  14415. // 1.
  14416. const requests = [request]
  14417. // 2.
  14418. const responseArrayPromise = this.addAll(requests)
  14419. // 3.
  14420. return await responseArrayPromise
  14421. }
  14422. async addAll (requests) {
  14423. webidl.brandCheck(this, Cache)
  14424. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14425. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14426. // 1.
  14427. const responsePromises = []
  14428. // 2.
  14429. const requestList = []
  14430. // 3.
  14431. for (const request of requests) {
  14432. if (typeof request === 'string') {
  14433. continue
  14434. }
  14435. // 3.1
  14436. const r = request[kState]
  14437. // 3.2
  14438. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14439. throw webidl.errors.exception({
  14440. header: 'Cache.addAll',
  14441. message: 'Expected http/s scheme when method is not GET.'
  14442. })
  14443. }
  14444. }
  14445. // 4.
  14446. /** @type {ReturnType<typeof fetching>[]} */
  14447. const fetchControllers = []
  14448. // 5.
  14449. for (const request of requests) {
  14450. // 5.1
  14451. const r = new Request(request)[kState]
  14452. // 5.2
  14453. if (!urlIsHttpHttpsScheme(r.url)) {
  14454. throw webidl.errors.exception({
  14455. header: 'Cache.addAll',
  14456. message: 'Expected http/s scheme.'
  14457. })
  14458. }
  14459. // 5.4
  14460. r.initiator = 'fetch'
  14461. r.destination = 'subresource'
  14462. // 5.5
  14463. requestList.push(r)
  14464. // 5.6
  14465. const responsePromise = createDeferredPromise()
  14466. // 5.7
  14467. fetchControllers.push(fetching({
  14468. request: r,
  14469. dispatcher: getGlobalDispatcher(),
  14470. processResponse (response) {
  14471. // 1.
  14472. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14473. responsePromise.reject(webidl.errors.exception({
  14474. header: 'Cache.addAll',
  14475. message: 'Received an invalid status code or the request failed.'
  14476. }))
  14477. } else if (response.headersList.contains('vary')) { // 2.
  14478. // 2.1
  14479. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14480. // 2.2
  14481. for (const fieldValue of fieldValues) {
  14482. // 2.2.1
  14483. if (fieldValue === '*') {
  14484. responsePromise.reject(webidl.errors.exception({
  14485. header: 'Cache.addAll',
  14486. message: 'invalid vary field value'
  14487. }))
  14488. for (const controller of fetchControllers) {
  14489. controller.abort()
  14490. }
  14491. return
  14492. }
  14493. }
  14494. }
  14495. },
  14496. processResponseEndOfBody (response) {
  14497. // 1.
  14498. if (response.aborted) {
  14499. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14500. return
  14501. }
  14502. // 2.
  14503. responsePromise.resolve(response)
  14504. }
  14505. }))
  14506. // 5.8
  14507. responsePromises.push(responsePromise.promise)
  14508. }
  14509. // 6.
  14510. const p = Promise.all(responsePromises)
  14511. // 7.
  14512. const responses = await p
  14513. // 7.1
  14514. const operations = []
  14515. // 7.2
  14516. let index = 0
  14517. // 7.3
  14518. for (const response of responses) {
  14519. // 7.3.1
  14520. /** @type {CacheBatchOperation} */
  14521. const operation = {
  14522. type: 'put', // 7.3.2
  14523. request: requestList[index], // 7.3.3
  14524. response // 7.3.4
  14525. }
  14526. operations.push(operation) // 7.3.5
  14527. index++ // 7.3.6
  14528. }
  14529. // 7.5
  14530. const cacheJobPromise = createDeferredPromise()
  14531. // 7.6.1
  14532. let errorData = null
  14533. // 7.6.2
  14534. try {
  14535. this.#batchCacheOperations(operations)
  14536. } catch (e) {
  14537. errorData = e
  14538. }
  14539. // 7.6.3
  14540. queueMicrotask(() => {
  14541. // 7.6.3.1
  14542. if (errorData === null) {
  14543. cacheJobPromise.resolve(undefined)
  14544. } else {
  14545. // 7.6.3.2
  14546. cacheJobPromise.reject(errorData)
  14547. }
  14548. })
  14549. // 7.7
  14550. return cacheJobPromise.promise
  14551. }
  14552. async put (request, response) {
  14553. webidl.brandCheck(this, Cache)
  14554. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14555. request = webidl.converters.RequestInfo(request)
  14556. response = webidl.converters.Response(response)
  14557. // 1.
  14558. let innerRequest = null
  14559. // 2.
  14560. if (request instanceof Request) {
  14561. innerRequest = request[kState]
  14562. } else { // 3.
  14563. innerRequest = new Request(request)[kState]
  14564. }
  14565. // 4.
  14566. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14567. throw webidl.errors.exception({
  14568. header: 'Cache.put',
  14569. message: 'Expected an http/s scheme when method is not GET'
  14570. })
  14571. }
  14572. // 5.
  14573. const innerResponse = response[kState]
  14574. // 6.
  14575. if (innerResponse.status === 206) {
  14576. throw webidl.errors.exception({
  14577. header: 'Cache.put',
  14578. message: 'Got 206 status'
  14579. })
  14580. }
  14581. // 7.
  14582. if (innerResponse.headersList.contains('vary')) {
  14583. // 7.1.
  14584. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14585. // 7.2.
  14586. for (const fieldValue of fieldValues) {
  14587. // 7.2.1
  14588. if (fieldValue === '*') {
  14589. throw webidl.errors.exception({
  14590. header: 'Cache.put',
  14591. message: 'Got * vary field value'
  14592. })
  14593. }
  14594. }
  14595. }
  14596. // 8.
  14597. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14598. throw webidl.errors.exception({
  14599. header: 'Cache.put',
  14600. message: 'Response body is locked or disturbed'
  14601. })
  14602. }
  14603. // 9.
  14604. const clonedResponse = cloneResponse(innerResponse)
  14605. // 10.
  14606. const bodyReadPromise = createDeferredPromise()
  14607. // 11.
  14608. if (innerResponse.body != null) {
  14609. // 11.1
  14610. const stream = innerResponse.body.stream
  14611. // 11.2
  14612. const reader = stream.getReader()
  14613. // 11.3
  14614. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14615. } else {
  14616. bodyReadPromise.resolve(undefined)
  14617. }
  14618. // 12.
  14619. /** @type {CacheBatchOperation[]} */
  14620. const operations = []
  14621. // 13.
  14622. /** @type {CacheBatchOperation} */
  14623. const operation = {
  14624. type: 'put', // 14.
  14625. request: innerRequest, // 15.
  14626. response: clonedResponse // 16.
  14627. }
  14628. // 17.
  14629. operations.push(operation)
  14630. // 19.
  14631. const bytes = await bodyReadPromise.promise
  14632. if (clonedResponse.body != null) {
  14633. clonedResponse.body.source = bytes
  14634. }
  14635. // 19.1
  14636. const cacheJobPromise = createDeferredPromise()
  14637. // 19.2.1
  14638. let errorData = null
  14639. // 19.2.2
  14640. try {
  14641. this.#batchCacheOperations(operations)
  14642. } catch (e) {
  14643. errorData = e
  14644. }
  14645. // 19.2.3
  14646. queueMicrotask(() => {
  14647. // 19.2.3.1
  14648. if (errorData === null) {
  14649. cacheJobPromise.resolve()
  14650. } else { // 19.2.3.2
  14651. cacheJobPromise.reject(errorData)
  14652. }
  14653. })
  14654. return cacheJobPromise.promise
  14655. }
  14656. async delete (request, options = {}) {
  14657. webidl.brandCheck(this, Cache)
  14658. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14659. request = webidl.converters.RequestInfo(request)
  14660. options = webidl.converters.CacheQueryOptions(options)
  14661. /**
  14662. * @type {Request}
  14663. */
  14664. let r = null
  14665. if (request instanceof Request) {
  14666. r = request[kState]
  14667. if (r.method !== 'GET' && !options.ignoreMethod) {
  14668. return false
  14669. }
  14670. } else {
  14671. assert(typeof request === 'string')
  14672. r = new Request(request)[kState]
  14673. }
  14674. /** @type {CacheBatchOperation[]} */
  14675. const operations = []
  14676. /** @type {CacheBatchOperation} */
  14677. const operation = {
  14678. type: 'delete',
  14679. request: r,
  14680. options
  14681. }
  14682. operations.push(operation)
  14683. const cacheJobPromise = createDeferredPromise()
  14684. let errorData = null
  14685. let requestResponses
  14686. try {
  14687. requestResponses = this.#batchCacheOperations(operations)
  14688. } catch (e) {
  14689. errorData = e
  14690. }
  14691. queueMicrotask(() => {
  14692. if (errorData === null) {
  14693. cacheJobPromise.resolve(!!requestResponses?.length)
  14694. } else {
  14695. cacheJobPromise.reject(errorData)
  14696. }
  14697. })
  14698. return cacheJobPromise.promise
  14699. }
  14700. /**
  14701. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14702. * @param {any} request
  14703. * @param {import('../../types/cache').CacheQueryOptions} options
  14704. * @returns {readonly Request[]}
  14705. */
  14706. async keys (request = undefined, options = {}) {
  14707. webidl.brandCheck(this, Cache)
  14708. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14709. options = webidl.converters.CacheQueryOptions(options)
  14710. // 1.
  14711. let r = null
  14712. // 2.
  14713. if (request !== undefined) {
  14714. // 2.1
  14715. if (request instanceof Request) {
  14716. // 2.1.1
  14717. r = request[kState]
  14718. // 2.1.2
  14719. if (r.method !== 'GET' && !options.ignoreMethod) {
  14720. return []
  14721. }
  14722. } else if (typeof request === 'string') { // 2.2
  14723. r = new Request(request)[kState]
  14724. }
  14725. }
  14726. // 4.
  14727. const promise = createDeferredPromise()
  14728. // 5.
  14729. // 5.1
  14730. const requests = []
  14731. // 5.2
  14732. if (request === undefined) {
  14733. // 5.2.1
  14734. for (const requestResponse of this.#relevantRequestResponseList) {
  14735. // 5.2.1.1
  14736. requests.push(requestResponse[0])
  14737. }
  14738. } else { // 5.3
  14739. // 5.3.1
  14740. const requestResponses = this.#queryCache(r, options)
  14741. // 5.3.2
  14742. for (const requestResponse of requestResponses) {
  14743. // 5.3.2.1
  14744. requests.push(requestResponse[0])
  14745. }
  14746. }
  14747. // 5.4
  14748. queueMicrotask(() => {
  14749. // 5.4.1
  14750. const requestList = []
  14751. // 5.4.2
  14752. for (const request of requests) {
  14753. const requestObject = new Request('https://a')
  14754. requestObject[kState] = request
  14755. requestObject[kHeaders][kHeadersList] = request.headersList
  14756. requestObject[kHeaders][kGuard] = 'immutable'
  14757. requestObject[kRealm] = request.client
  14758. // 5.4.2.1
  14759. requestList.push(requestObject)
  14760. }
  14761. // 5.4.3
  14762. promise.resolve(Object.freeze(requestList))
  14763. })
  14764. return promise.promise
  14765. }
  14766. /**
  14767. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14768. * @param {CacheBatchOperation[]} operations
  14769. * @returns {requestResponseList}
  14770. */
  14771. #batchCacheOperations (operations) {
  14772. // 1.
  14773. const cache = this.#relevantRequestResponseList
  14774. // 2.
  14775. const backupCache = [...cache]
  14776. // 3.
  14777. const addedItems = []
  14778. // 4.1
  14779. const resultList = []
  14780. try {
  14781. // 4.2
  14782. for (const operation of operations) {
  14783. // 4.2.1
  14784. if (operation.type !== 'delete' && operation.type !== 'put') {
  14785. throw webidl.errors.exception({
  14786. header: 'Cache.#batchCacheOperations',
  14787. message: 'operation type does not match "delete" or "put"'
  14788. })
  14789. }
  14790. // 4.2.2
  14791. if (operation.type === 'delete' && operation.response != null) {
  14792. throw webidl.errors.exception({
  14793. header: 'Cache.#batchCacheOperations',
  14794. message: 'delete operation should not have an associated response'
  14795. })
  14796. }
  14797. // 4.2.3
  14798. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14799. throw new DOMException('???', 'InvalidStateError')
  14800. }
  14801. // 4.2.4
  14802. let requestResponses
  14803. // 4.2.5
  14804. if (operation.type === 'delete') {
  14805. // 4.2.5.1
  14806. requestResponses = this.#queryCache(operation.request, operation.options)
  14807. // TODO: the spec is wrong, this is needed to pass WPTs
  14808. if (requestResponses.length === 0) {
  14809. return []
  14810. }
  14811. // 4.2.5.2
  14812. for (const requestResponse of requestResponses) {
  14813. const idx = cache.indexOf(requestResponse)
  14814. assert(idx !== -1)
  14815. // 4.2.5.2.1
  14816. cache.splice(idx, 1)
  14817. }
  14818. } else if (operation.type === 'put') { // 4.2.6
  14819. // 4.2.6.1
  14820. if (operation.response == null) {
  14821. throw webidl.errors.exception({
  14822. header: 'Cache.#batchCacheOperations',
  14823. message: 'put operation should have an associated response'
  14824. })
  14825. }
  14826. // 4.2.6.2
  14827. const r = operation.request
  14828. // 4.2.6.3
  14829. if (!urlIsHttpHttpsScheme(r.url)) {
  14830. throw webidl.errors.exception({
  14831. header: 'Cache.#batchCacheOperations',
  14832. message: 'expected http or https scheme'
  14833. })
  14834. }
  14835. // 4.2.6.4
  14836. if (r.method !== 'GET') {
  14837. throw webidl.errors.exception({
  14838. header: 'Cache.#batchCacheOperations',
  14839. message: 'not get method'
  14840. })
  14841. }
  14842. // 4.2.6.5
  14843. if (operation.options != null) {
  14844. throw webidl.errors.exception({
  14845. header: 'Cache.#batchCacheOperations',
  14846. message: 'options must not be defined'
  14847. })
  14848. }
  14849. // 4.2.6.6
  14850. requestResponses = this.#queryCache(operation.request)
  14851. // 4.2.6.7
  14852. for (const requestResponse of requestResponses) {
  14853. const idx = cache.indexOf(requestResponse)
  14854. assert(idx !== -1)
  14855. // 4.2.6.7.1
  14856. cache.splice(idx, 1)
  14857. }
  14858. // 4.2.6.8
  14859. cache.push([operation.request, operation.response])
  14860. // 4.2.6.10
  14861. addedItems.push([operation.request, operation.response])
  14862. }
  14863. // 4.2.7
  14864. resultList.push([operation.request, operation.response])
  14865. }
  14866. // 4.3
  14867. return resultList
  14868. } catch (e) { // 5.
  14869. // 5.1
  14870. this.#relevantRequestResponseList.length = 0
  14871. // 5.2
  14872. this.#relevantRequestResponseList = backupCache
  14873. // 5.3
  14874. throw e
  14875. }
  14876. }
  14877. /**
  14878. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14879. * @param {any} requestQuery
  14880. * @param {import('../../types/cache').CacheQueryOptions} options
  14881. * @param {requestResponseList} targetStorage
  14882. * @returns {requestResponseList}
  14883. */
  14884. #queryCache (requestQuery, options, targetStorage) {
  14885. /** @type {requestResponseList} */
  14886. const resultList = []
  14887. const storage = targetStorage ?? this.#relevantRequestResponseList
  14888. for (const requestResponse of storage) {
  14889. const [cachedRequest, cachedResponse] = requestResponse
  14890. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14891. resultList.push(requestResponse)
  14892. }
  14893. }
  14894. return resultList
  14895. }
  14896. /**
  14897. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14898. * @param {any} requestQuery
  14899. * @param {any} request
  14900. * @param {any | null} response
  14901. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14902. * @returns {boolean}
  14903. */
  14904. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14905. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14906. // return false
  14907. // }
  14908. const queryURL = new URL(requestQuery.url)
  14909. const cachedURL = new URL(request.url)
  14910. if (options?.ignoreSearch) {
  14911. cachedURL.search = ''
  14912. queryURL.search = ''
  14913. }
  14914. if (!urlEquals(queryURL, cachedURL, true)) {
  14915. return false
  14916. }
  14917. if (
  14918. response == null ||
  14919. options?.ignoreVary ||
  14920. !response.headersList.contains('vary')
  14921. ) {
  14922. return true
  14923. }
  14924. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14925. for (const fieldValue of fieldValues) {
  14926. if (fieldValue === '*') {
  14927. return false
  14928. }
  14929. const requestValue = request.headersList.get(fieldValue)
  14930. const queryValue = requestQuery.headersList.get(fieldValue)
  14931. // If one has the header and the other doesn't, or one has
  14932. // a different value than the other, return false
  14933. if (requestValue !== queryValue) {
  14934. return false
  14935. }
  14936. }
  14937. return true
  14938. }
  14939. }
  14940. Object.defineProperties(Cache.prototype, {
  14941. [Symbol.toStringTag]: {
  14942. value: 'Cache',
  14943. configurable: true
  14944. },
  14945. match: kEnumerableProperty,
  14946. matchAll: kEnumerableProperty,
  14947. add: kEnumerableProperty,
  14948. addAll: kEnumerableProperty,
  14949. put: kEnumerableProperty,
  14950. delete: kEnumerableProperty,
  14951. keys: kEnumerableProperty
  14952. })
  14953. const cacheQueryOptionConverters = [
  14954. {
  14955. key: 'ignoreSearch',
  14956. converter: webidl.converters.boolean,
  14957. defaultValue: false
  14958. },
  14959. {
  14960. key: 'ignoreMethod',
  14961. converter: webidl.converters.boolean,
  14962. defaultValue: false
  14963. },
  14964. {
  14965. key: 'ignoreVary',
  14966. converter: webidl.converters.boolean,
  14967. defaultValue: false
  14968. }
  14969. ]
  14970. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14971. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14972. ...cacheQueryOptionConverters,
  14973. {
  14974. key: 'cacheName',
  14975. converter: webidl.converters.DOMString
  14976. }
  14977. ])
  14978. webidl.converters.Response = webidl.interfaceConverter(Response)
  14979. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14980. webidl.converters.RequestInfo
  14981. )
  14982. module.exports = {
  14983. Cache
  14984. }
  14985. /***/ }),
  14986. /***/ 7907:
  14987. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14988. "use strict";
  14989. const { kConstruct } = __nccwpck_require__(9174)
  14990. const { Cache } = __nccwpck_require__(6101)
  14991. const { webidl } = __nccwpck_require__(1744)
  14992. const { kEnumerableProperty } = __nccwpck_require__(3983)
  14993. class CacheStorage {
  14994. /**
  14995. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  14996. * @type {Map<string, import('./cache').requestResponseList}
  14997. */
  14998. #caches = new Map()
  14999. constructor () {
  15000. if (arguments[0] !== kConstruct) {
  15001. webidl.illegalConstructor()
  15002. }
  15003. }
  15004. async match (request, options = {}) {
  15005. webidl.brandCheck(this, CacheStorage)
  15006. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  15007. request = webidl.converters.RequestInfo(request)
  15008. options = webidl.converters.MultiCacheQueryOptions(options)
  15009. // 1.
  15010. if (options.cacheName != null) {
  15011. // 1.1.1.1
  15012. if (this.#caches.has(options.cacheName)) {
  15013. // 1.1.1.1.1
  15014. const cacheList = this.#caches.get(options.cacheName)
  15015. const cache = new Cache(kConstruct, cacheList)
  15016. return await cache.match(request, options)
  15017. }
  15018. } else { // 2.
  15019. // 2.2
  15020. for (const cacheList of this.#caches.values()) {
  15021. const cache = new Cache(kConstruct, cacheList)
  15022. // 2.2.1.2
  15023. const response = await cache.match(request, options)
  15024. if (response !== undefined) {
  15025. return response
  15026. }
  15027. }
  15028. }
  15029. }
  15030. /**
  15031. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  15032. * @param {string} cacheName
  15033. * @returns {Promise<boolean>}
  15034. */
  15035. async has (cacheName) {
  15036. webidl.brandCheck(this, CacheStorage)
  15037. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  15038. cacheName = webidl.converters.DOMString(cacheName)
  15039. // 2.1.1
  15040. // 2.2
  15041. return this.#caches.has(cacheName)
  15042. }
  15043. /**
  15044. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  15045. * @param {string} cacheName
  15046. * @returns {Promise<Cache>}
  15047. */
  15048. async open (cacheName) {
  15049. webidl.brandCheck(this, CacheStorage)
  15050. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  15051. cacheName = webidl.converters.DOMString(cacheName)
  15052. // 2.1
  15053. if (this.#caches.has(cacheName)) {
  15054. // await caches.open('v1') !== await caches.open('v1')
  15055. // 2.1.1
  15056. const cache = this.#caches.get(cacheName)
  15057. // 2.1.1.1
  15058. return new Cache(kConstruct, cache)
  15059. }
  15060. // 2.2
  15061. const cache = []
  15062. // 2.3
  15063. this.#caches.set(cacheName, cache)
  15064. // 2.4
  15065. return new Cache(kConstruct, cache)
  15066. }
  15067. /**
  15068. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  15069. * @param {string} cacheName
  15070. * @returns {Promise<boolean>}
  15071. */
  15072. async delete (cacheName) {
  15073. webidl.brandCheck(this, CacheStorage)
  15074. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  15075. cacheName = webidl.converters.DOMString(cacheName)
  15076. return this.#caches.delete(cacheName)
  15077. }
  15078. /**
  15079. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  15080. * @returns {string[]}
  15081. */
  15082. async keys () {
  15083. webidl.brandCheck(this, CacheStorage)
  15084. // 2.1
  15085. const keys = this.#caches.keys()
  15086. // 2.2
  15087. return [...keys]
  15088. }
  15089. }
  15090. Object.defineProperties(CacheStorage.prototype, {
  15091. [Symbol.toStringTag]: {
  15092. value: 'CacheStorage',
  15093. configurable: true
  15094. },
  15095. match: kEnumerableProperty,
  15096. has: kEnumerableProperty,
  15097. open: kEnumerableProperty,
  15098. delete: kEnumerableProperty,
  15099. keys: kEnumerableProperty
  15100. })
  15101. module.exports = {
  15102. CacheStorage
  15103. }
  15104. /***/ }),
  15105. /***/ 9174:
  15106. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15107. "use strict";
  15108. module.exports = {
  15109. kConstruct: (__nccwpck_require__(2785).kConstruct)
  15110. }
  15111. /***/ }),
  15112. /***/ 2396:
  15113. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15114. "use strict";
  15115. const assert = __nccwpck_require__(9491)
  15116. const { URLSerializer } = __nccwpck_require__(685)
  15117. const { isValidHeaderName } = __nccwpck_require__(2538)
  15118. /**
  15119. * @see https://url.spec.whatwg.org/#concept-url-equals
  15120. * @param {URL} A
  15121. * @param {URL} B
  15122. * @param {boolean | undefined} excludeFragment
  15123. * @returns {boolean}
  15124. */
  15125. function urlEquals (A, B, excludeFragment = false) {
  15126. const serializedA = URLSerializer(A, excludeFragment)
  15127. const serializedB = URLSerializer(B, excludeFragment)
  15128. return serializedA === serializedB
  15129. }
  15130. /**
  15131. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  15132. * @param {string} header
  15133. */
  15134. function fieldValues (header) {
  15135. assert(header !== null)
  15136. const values = []
  15137. for (let value of header.split(',')) {
  15138. value = value.trim()
  15139. if (!value.length) {
  15140. continue
  15141. } else if (!isValidHeaderName(value)) {
  15142. continue
  15143. }
  15144. values.push(value)
  15145. }
  15146. return values
  15147. }
  15148. module.exports = {
  15149. urlEquals,
  15150. fieldValues
  15151. }
  15152. /***/ }),
  15153. /***/ 3598:
  15154. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15155. "use strict";
  15156. // @ts-check
  15157. /* global WebAssembly */
  15158. const assert = __nccwpck_require__(9491)
  15159. const net = __nccwpck_require__(1808)
  15160. const http = __nccwpck_require__(3685)
  15161. const { pipeline } = __nccwpck_require__(2781)
  15162. const util = __nccwpck_require__(3983)
  15163. const timers = __nccwpck_require__(9459)
  15164. const Request = __nccwpck_require__(2905)
  15165. const DispatcherBase = __nccwpck_require__(4839)
  15166. const {
  15167. RequestContentLengthMismatchError,
  15168. ResponseContentLengthMismatchError,
  15169. InvalidArgumentError,
  15170. RequestAbortedError,
  15171. HeadersTimeoutError,
  15172. HeadersOverflowError,
  15173. SocketError,
  15174. InformationalError,
  15175. BodyTimeoutError,
  15176. HTTPParserError,
  15177. ResponseExceededMaxSizeError,
  15178. ClientDestroyedError
  15179. } = __nccwpck_require__(8045)
  15180. const buildConnector = __nccwpck_require__(2067)
  15181. const {
  15182. kUrl,
  15183. kReset,
  15184. kServerName,
  15185. kClient,
  15186. kBusy,
  15187. kParser,
  15188. kConnect,
  15189. kBlocking,
  15190. kResuming,
  15191. kRunning,
  15192. kPending,
  15193. kSize,
  15194. kWriting,
  15195. kQueue,
  15196. kConnected,
  15197. kConnecting,
  15198. kNeedDrain,
  15199. kNoRef,
  15200. kKeepAliveDefaultTimeout,
  15201. kHostHeader,
  15202. kPendingIdx,
  15203. kRunningIdx,
  15204. kError,
  15205. kPipelining,
  15206. kSocket,
  15207. kKeepAliveTimeoutValue,
  15208. kMaxHeadersSize,
  15209. kKeepAliveMaxTimeout,
  15210. kKeepAliveTimeoutThreshold,
  15211. kHeadersTimeout,
  15212. kBodyTimeout,
  15213. kStrictContentLength,
  15214. kConnector,
  15215. kMaxRedirections,
  15216. kMaxRequests,
  15217. kCounter,
  15218. kClose,
  15219. kDestroy,
  15220. kDispatch,
  15221. kInterceptors,
  15222. kLocalAddress,
  15223. kMaxResponseSize,
  15224. kHTTPConnVersion,
  15225. // HTTP2
  15226. kHost,
  15227. kHTTP2Session,
  15228. kHTTP2SessionState,
  15229. kHTTP2BuildRequest,
  15230. kHTTP2CopyHeaders,
  15231. kHTTP1BuildRequest
  15232. } = __nccwpck_require__(2785)
  15233. /** @type {import('http2')} */
  15234. let http2
  15235. try {
  15236. http2 = __nccwpck_require__(5158)
  15237. } catch {
  15238. // @ts-ignore
  15239. http2 = { constants: {} }
  15240. }
  15241. const {
  15242. constants: {
  15243. HTTP2_HEADER_AUTHORITY,
  15244. HTTP2_HEADER_METHOD,
  15245. HTTP2_HEADER_PATH,
  15246. HTTP2_HEADER_SCHEME,
  15247. HTTP2_HEADER_CONTENT_LENGTH,
  15248. HTTP2_HEADER_EXPECT,
  15249. HTTP2_HEADER_STATUS
  15250. }
  15251. } = http2
  15252. // Experimental
  15253. let h2ExperimentalWarned = false
  15254. const FastBuffer = Buffer[Symbol.species]
  15255. const kClosedResolve = Symbol('kClosedResolve')
  15256. const channels = {}
  15257. try {
  15258. const diagnosticsChannel = __nccwpck_require__(7643)
  15259. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15260. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15261. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15262. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15263. } catch {
  15264. channels.sendHeaders = { hasSubscribers: false }
  15265. channels.beforeConnect = { hasSubscribers: false }
  15266. channels.connectError = { hasSubscribers: false }
  15267. channels.connected = { hasSubscribers: false }
  15268. }
  15269. /**
  15270. * @type {import('../types/client').default}
  15271. */
  15272. class Client extends DispatcherBase {
  15273. /**
  15274. *
  15275. * @param {string|URL} url
  15276. * @param {import('../types/client').Client.Options} options
  15277. */
  15278. constructor (url, {
  15279. interceptors,
  15280. maxHeaderSize,
  15281. headersTimeout,
  15282. socketTimeout,
  15283. requestTimeout,
  15284. connectTimeout,
  15285. bodyTimeout,
  15286. idleTimeout,
  15287. keepAlive,
  15288. keepAliveTimeout,
  15289. maxKeepAliveTimeout,
  15290. keepAliveMaxTimeout,
  15291. keepAliveTimeoutThreshold,
  15292. socketPath,
  15293. pipelining,
  15294. tls,
  15295. strictContentLength,
  15296. maxCachedSessions,
  15297. maxRedirections,
  15298. connect,
  15299. maxRequestsPerClient,
  15300. localAddress,
  15301. maxResponseSize,
  15302. autoSelectFamily,
  15303. autoSelectFamilyAttemptTimeout,
  15304. // h2
  15305. allowH2,
  15306. maxConcurrentStreams
  15307. } = {}) {
  15308. super()
  15309. if (keepAlive !== undefined) {
  15310. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15311. }
  15312. if (socketTimeout !== undefined) {
  15313. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15314. }
  15315. if (requestTimeout !== undefined) {
  15316. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15317. }
  15318. if (idleTimeout !== undefined) {
  15319. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15320. }
  15321. if (maxKeepAliveTimeout !== undefined) {
  15322. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15323. }
  15324. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15325. throw new InvalidArgumentError('invalid maxHeaderSize')
  15326. }
  15327. if (socketPath != null && typeof socketPath !== 'string') {
  15328. throw new InvalidArgumentError('invalid socketPath')
  15329. }
  15330. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15331. throw new InvalidArgumentError('invalid connectTimeout')
  15332. }
  15333. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15334. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15335. }
  15336. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15337. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15338. }
  15339. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15340. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15341. }
  15342. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15343. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15344. }
  15345. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15346. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15347. }
  15348. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15349. throw new InvalidArgumentError('connect must be a function or an object')
  15350. }
  15351. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15352. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15353. }
  15354. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15355. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15356. }
  15357. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15358. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15359. }
  15360. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15361. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15362. }
  15363. if (
  15364. autoSelectFamilyAttemptTimeout != null &&
  15365. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15366. ) {
  15367. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15368. }
  15369. // h2
  15370. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15371. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15372. }
  15373. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15374. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15375. }
  15376. if (typeof connect !== 'function') {
  15377. connect = buildConnector({
  15378. ...tls,
  15379. maxCachedSessions,
  15380. allowH2,
  15381. socketPath,
  15382. timeout: connectTimeout,
  15383. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15384. ...connect
  15385. })
  15386. }
  15387. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15388. ? interceptors.Client
  15389. : [createRedirectInterceptor({ maxRedirections })]
  15390. this[kUrl] = util.parseOrigin(url)
  15391. this[kConnector] = connect
  15392. this[kSocket] = null
  15393. this[kPipelining] = pipelining != null ? pipelining : 1
  15394. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15395. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15396. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15397. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15398. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15399. this[kServerName] = null
  15400. this[kLocalAddress] = localAddress != null ? localAddress : null
  15401. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15402. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15403. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15404. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15405. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15406. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15407. this[kMaxRedirections] = maxRedirections
  15408. this[kMaxRequests] = maxRequestsPerClient
  15409. this[kClosedResolve] = null
  15410. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15411. this[kHTTPConnVersion] = 'h1'
  15412. // HTTP/2
  15413. this[kHTTP2Session] = null
  15414. this[kHTTP2SessionState] = !allowH2
  15415. ? null
  15416. : {
  15417. // streams: null, // Fixed queue of streams - For future support of `push`
  15418. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15419. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15420. }
  15421. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15422. // kQueue is built up of 3 sections separated by
  15423. // the kRunningIdx and kPendingIdx indices.
  15424. // | complete | running | pending |
  15425. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15426. // kRunningIdx points to the first running element.
  15427. // kPendingIdx points to the first pending element.
  15428. // This implements a fast queue with an amortized
  15429. // time of O(1).
  15430. this[kQueue] = []
  15431. this[kRunningIdx] = 0
  15432. this[kPendingIdx] = 0
  15433. }
  15434. get pipelining () {
  15435. return this[kPipelining]
  15436. }
  15437. set pipelining (value) {
  15438. this[kPipelining] = value
  15439. resume(this, true)
  15440. }
  15441. get [kPending] () {
  15442. return this[kQueue].length - this[kPendingIdx]
  15443. }
  15444. get [kRunning] () {
  15445. return this[kPendingIdx] - this[kRunningIdx]
  15446. }
  15447. get [kSize] () {
  15448. return this[kQueue].length - this[kRunningIdx]
  15449. }
  15450. get [kConnected] () {
  15451. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15452. }
  15453. get [kBusy] () {
  15454. const socket = this[kSocket]
  15455. return (
  15456. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15457. (this[kSize] >= (this[kPipelining] || 1)) ||
  15458. this[kPending] > 0
  15459. )
  15460. }
  15461. /* istanbul ignore: only used for test */
  15462. [kConnect] (cb) {
  15463. connect(this)
  15464. this.once('connect', cb)
  15465. }
  15466. [kDispatch] (opts, handler) {
  15467. const origin = opts.origin || this[kUrl].origin
  15468. const request = this[kHTTPConnVersion] === 'h2'
  15469. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15470. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15471. this[kQueue].push(request)
  15472. if (this[kResuming]) {
  15473. // Do nothing.
  15474. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15475. // Wait a tick in case stream/iterator is ended in the same tick.
  15476. this[kResuming] = 1
  15477. process.nextTick(resume, this)
  15478. } else {
  15479. resume(this, true)
  15480. }
  15481. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15482. this[kNeedDrain] = 2
  15483. }
  15484. return this[kNeedDrain] < 2
  15485. }
  15486. async [kClose] () {
  15487. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15488. // request and close each stream.
  15489. return new Promise((resolve) => {
  15490. if (!this[kSize]) {
  15491. resolve(null)
  15492. } else {
  15493. this[kClosedResolve] = resolve
  15494. }
  15495. })
  15496. }
  15497. async [kDestroy] (err) {
  15498. return new Promise((resolve) => {
  15499. const requests = this[kQueue].splice(this[kPendingIdx])
  15500. for (let i = 0; i < requests.length; i++) {
  15501. const request = requests[i]
  15502. errorRequest(this, request, err)
  15503. }
  15504. const callback = () => {
  15505. if (this[kClosedResolve]) {
  15506. // TODO (fix): Should we error here with ClientDestroyedError?
  15507. this[kClosedResolve]()
  15508. this[kClosedResolve] = null
  15509. }
  15510. resolve()
  15511. }
  15512. if (this[kHTTP2Session] != null) {
  15513. util.destroy(this[kHTTP2Session], err)
  15514. this[kHTTP2Session] = null
  15515. this[kHTTP2SessionState] = null
  15516. }
  15517. if (!this[kSocket]) {
  15518. queueMicrotask(callback)
  15519. } else {
  15520. util.destroy(this[kSocket].on('close', callback), err)
  15521. }
  15522. resume(this)
  15523. })
  15524. }
  15525. }
  15526. function onHttp2SessionError (err) {
  15527. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15528. this[kSocket][kError] = err
  15529. onError(this[kClient], err)
  15530. }
  15531. function onHttp2FrameError (type, code, id) {
  15532. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15533. if (id === 0) {
  15534. this[kSocket][kError] = err
  15535. onError(this[kClient], err)
  15536. }
  15537. }
  15538. function onHttp2SessionEnd () {
  15539. util.destroy(this, new SocketError('other side closed'))
  15540. util.destroy(this[kSocket], new SocketError('other side closed'))
  15541. }
  15542. function onHTTP2GoAway (code) {
  15543. const client = this[kClient]
  15544. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15545. client[kSocket] = null
  15546. client[kHTTP2Session] = null
  15547. if (client.destroyed) {
  15548. assert(this[kPending] === 0)
  15549. // Fail entire queue.
  15550. const requests = client[kQueue].splice(client[kRunningIdx])
  15551. for (let i = 0; i < requests.length; i++) {
  15552. const request = requests[i]
  15553. errorRequest(this, request, err)
  15554. }
  15555. } else if (client[kRunning] > 0) {
  15556. // Fail head of pipeline.
  15557. const request = client[kQueue][client[kRunningIdx]]
  15558. client[kQueue][client[kRunningIdx]++] = null
  15559. errorRequest(client, request, err)
  15560. }
  15561. client[kPendingIdx] = client[kRunningIdx]
  15562. assert(client[kRunning] === 0)
  15563. client.emit('disconnect',
  15564. client[kUrl],
  15565. [client],
  15566. err
  15567. )
  15568. resume(client)
  15569. }
  15570. const constants = __nccwpck_require__(953)
  15571. const createRedirectInterceptor = __nccwpck_require__(8861)
  15572. const EMPTY_BUF = Buffer.alloc(0)
  15573. async function lazyllhttp () {
  15574. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15575. let mod
  15576. try {
  15577. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15578. } catch (e) {
  15579. /* istanbul ignore next */
  15580. // We could check if the error was caused by the simd option not
  15581. // being enabled, but the occurring of this other error
  15582. // * https://github.com/emscripten-core/emscripten/issues/11495
  15583. // got me to remove that check to avoid breaking Node 12.
  15584. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15585. }
  15586. return await WebAssembly.instantiate(mod, {
  15587. env: {
  15588. /* eslint-disable camelcase */
  15589. wasm_on_url: (p, at, len) => {
  15590. /* istanbul ignore next */
  15591. return 0
  15592. },
  15593. wasm_on_status: (p, at, len) => {
  15594. assert.strictEqual(currentParser.ptr, p)
  15595. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15596. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15597. },
  15598. wasm_on_message_begin: (p) => {
  15599. assert.strictEqual(currentParser.ptr, p)
  15600. return currentParser.onMessageBegin() || 0
  15601. },
  15602. wasm_on_header_field: (p, at, len) => {
  15603. assert.strictEqual(currentParser.ptr, p)
  15604. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15605. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15606. },
  15607. wasm_on_header_value: (p, at, len) => {
  15608. assert.strictEqual(currentParser.ptr, p)
  15609. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15610. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15611. },
  15612. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15613. assert.strictEqual(currentParser.ptr, p)
  15614. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15615. },
  15616. wasm_on_body: (p, at, len) => {
  15617. assert.strictEqual(currentParser.ptr, p)
  15618. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15619. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15620. },
  15621. wasm_on_message_complete: (p) => {
  15622. assert.strictEqual(currentParser.ptr, p)
  15623. return currentParser.onMessageComplete() || 0
  15624. }
  15625. /* eslint-enable camelcase */
  15626. }
  15627. })
  15628. }
  15629. let llhttpInstance = null
  15630. let llhttpPromise = lazyllhttp()
  15631. llhttpPromise.catch()
  15632. let currentParser = null
  15633. let currentBufferRef = null
  15634. let currentBufferSize = 0
  15635. let currentBufferPtr = null
  15636. const TIMEOUT_HEADERS = 1
  15637. const TIMEOUT_BODY = 2
  15638. const TIMEOUT_IDLE = 3
  15639. class Parser {
  15640. constructor (client, socket, { exports }) {
  15641. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15642. this.llhttp = exports
  15643. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15644. this.client = client
  15645. this.socket = socket
  15646. this.timeout = null
  15647. this.timeoutValue = null
  15648. this.timeoutType = null
  15649. this.statusCode = null
  15650. this.statusText = ''
  15651. this.upgrade = false
  15652. this.headers = []
  15653. this.headersSize = 0
  15654. this.headersMaxSize = client[kMaxHeadersSize]
  15655. this.shouldKeepAlive = false
  15656. this.paused = false
  15657. this.resume = this.resume.bind(this)
  15658. this.bytesRead = 0
  15659. this.keepAlive = ''
  15660. this.contentLength = ''
  15661. this.connection = ''
  15662. this.maxResponseSize = client[kMaxResponseSize]
  15663. }
  15664. setTimeout (value, type) {
  15665. this.timeoutType = type
  15666. if (value !== this.timeoutValue) {
  15667. timers.clearTimeout(this.timeout)
  15668. if (value) {
  15669. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15670. // istanbul ignore else: only for jest
  15671. if (this.timeout.unref) {
  15672. this.timeout.unref()
  15673. }
  15674. } else {
  15675. this.timeout = null
  15676. }
  15677. this.timeoutValue = value
  15678. } else if (this.timeout) {
  15679. // istanbul ignore else: only for jest
  15680. if (this.timeout.refresh) {
  15681. this.timeout.refresh()
  15682. }
  15683. }
  15684. }
  15685. resume () {
  15686. if (this.socket.destroyed || !this.paused) {
  15687. return
  15688. }
  15689. assert(this.ptr != null)
  15690. assert(currentParser == null)
  15691. this.llhttp.llhttp_resume(this.ptr)
  15692. assert(this.timeoutType === TIMEOUT_BODY)
  15693. if (this.timeout) {
  15694. // istanbul ignore else: only for jest
  15695. if (this.timeout.refresh) {
  15696. this.timeout.refresh()
  15697. }
  15698. }
  15699. this.paused = false
  15700. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15701. this.readMore()
  15702. }
  15703. readMore () {
  15704. while (!this.paused && this.ptr) {
  15705. const chunk = this.socket.read()
  15706. if (chunk === null) {
  15707. break
  15708. }
  15709. this.execute(chunk)
  15710. }
  15711. }
  15712. execute (data) {
  15713. assert(this.ptr != null)
  15714. assert(currentParser == null)
  15715. assert(!this.paused)
  15716. const { socket, llhttp } = this
  15717. if (data.length > currentBufferSize) {
  15718. if (currentBufferPtr) {
  15719. llhttp.free(currentBufferPtr)
  15720. }
  15721. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15722. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15723. }
  15724. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15725. // Call `execute` on the wasm parser.
  15726. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15727. // and finally the length of bytes to parse.
  15728. // The return value is an error code or `constants.ERROR.OK`.
  15729. try {
  15730. let ret
  15731. try {
  15732. currentBufferRef = data
  15733. currentParser = this
  15734. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15735. /* eslint-disable-next-line no-useless-catch */
  15736. } catch (err) {
  15737. /* istanbul ignore next: difficult to make a test case for */
  15738. throw err
  15739. } finally {
  15740. currentParser = null
  15741. currentBufferRef = null
  15742. }
  15743. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15744. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15745. this.onUpgrade(data.slice(offset))
  15746. } else if (ret === constants.ERROR.PAUSED) {
  15747. this.paused = true
  15748. socket.unshift(data.slice(offset))
  15749. } else if (ret !== constants.ERROR.OK) {
  15750. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15751. let message = ''
  15752. /* istanbul ignore else: difficult to make a test case for */
  15753. if (ptr) {
  15754. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15755. message =
  15756. 'Response does not match the HTTP/1.1 protocol (' +
  15757. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15758. ')'
  15759. }
  15760. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15761. }
  15762. } catch (err) {
  15763. util.destroy(socket, err)
  15764. }
  15765. }
  15766. destroy () {
  15767. assert(this.ptr != null)
  15768. assert(currentParser == null)
  15769. this.llhttp.llhttp_free(this.ptr)
  15770. this.ptr = null
  15771. timers.clearTimeout(this.timeout)
  15772. this.timeout = null
  15773. this.timeoutValue = null
  15774. this.timeoutType = null
  15775. this.paused = false
  15776. }
  15777. onStatus (buf) {
  15778. this.statusText = buf.toString()
  15779. }
  15780. onMessageBegin () {
  15781. const { socket, client } = this
  15782. /* istanbul ignore next: difficult to make a test case for */
  15783. if (socket.destroyed) {
  15784. return -1
  15785. }
  15786. const request = client[kQueue][client[kRunningIdx]]
  15787. if (!request) {
  15788. return -1
  15789. }
  15790. }
  15791. onHeaderField (buf) {
  15792. const len = this.headers.length
  15793. if ((len & 1) === 0) {
  15794. this.headers.push(buf)
  15795. } else {
  15796. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15797. }
  15798. this.trackHeader(buf.length)
  15799. }
  15800. onHeaderValue (buf) {
  15801. let len = this.headers.length
  15802. if ((len & 1) === 1) {
  15803. this.headers.push(buf)
  15804. len += 1
  15805. } else {
  15806. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15807. }
  15808. const key = this.headers[len - 2]
  15809. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15810. this.keepAlive += buf.toString()
  15811. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15812. this.connection += buf.toString()
  15813. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15814. this.contentLength += buf.toString()
  15815. }
  15816. this.trackHeader(buf.length)
  15817. }
  15818. trackHeader (len) {
  15819. this.headersSize += len
  15820. if (this.headersSize >= this.headersMaxSize) {
  15821. util.destroy(this.socket, new HeadersOverflowError())
  15822. }
  15823. }
  15824. onUpgrade (head) {
  15825. const { upgrade, client, socket, headers, statusCode } = this
  15826. assert(upgrade)
  15827. const request = client[kQueue][client[kRunningIdx]]
  15828. assert(request)
  15829. assert(!socket.destroyed)
  15830. assert(socket === client[kSocket])
  15831. assert(!this.paused)
  15832. assert(request.upgrade || request.method === 'CONNECT')
  15833. this.statusCode = null
  15834. this.statusText = ''
  15835. this.shouldKeepAlive = null
  15836. assert(this.headers.length % 2 === 0)
  15837. this.headers = []
  15838. this.headersSize = 0
  15839. socket.unshift(head)
  15840. socket[kParser].destroy()
  15841. socket[kParser] = null
  15842. socket[kClient] = null
  15843. socket[kError] = null
  15844. socket
  15845. .removeListener('error', onSocketError)
  15846. .removeListener('readable', onSocketReadable)
  15847. .removeListener('end', onSocketEnd)
  15848. .removeListener('close', onSocketClose)
  15849. client[kSocket] = null
  15850. client[kQueue][client[kRunningIdx]++] = null
  15851. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15852. try {
  15853. request.onUpgrade(statusCode, headers, socket)
  15854. } catch (err) {
  15855. util.destroy(socket, err)
  15856. }
  15857. resume(client)
  15858. }
  15859. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15860. const { client, socket, headers, statusText } = this
  15861. /* istanbul ignore next: difficult to make a test case for */
  15862. if (socket.destroyed) {
  15863. return -1
  15864. }
  15865. const request = client[kQueue][client[kRunningIdx]]
  15866. /* istanbul ignore next: difficult to make a test case for */
  15867. if (!request) {
  15868. return -1
  15869. }
  15870. assert(!this.upgrade)
  15871. assert(this.statusCode < 200)
  15872. if (statusCode === 100) {
  15873. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15874. return -1
  15875. }
  15876. /* this can only happen if server is misbehaving */
  15877. if (upgrade && !request.upgrade) {
  15878. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15879. return -1
  15880. }
  15881. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15882. this.statusCode = statusCode
  15883. this.shouldKeepAlive = (
  15884. shouldKeepAlive ||
  15885. // Override llhttp value which does not allow keepAlive for HEAD.
  15886. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15887. )
  15888. if (this.statusCode >= 200) {
  15889. const bodyTimeout = request.bodyTimeout != null
  15890. ? request.bodyTimeout
  15891. : client[kBodyTimeout]
  15892. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15893. } else if (this.timeout) {
  15894. // istanbul ignore else: only for jest
  15895. if (this.timeout.refresh) {
  15896. this.timeout.refresh()
  15897. }
  15898. }
  15899. if (request.method === 'CONNECT') {
  15900. assert(client[kRunning] === 1)
  15901. this.upgrade = true
  15902. return 2
  15903. }
  15904. if (upgrade) {
  15905. assert(client[kRunning] === 1)
  15906. this.upgrade = true
  15907. return 2
  15908. }
  15909. assert(this.headers.length % 2 === 0)
  15910. this.headers = []
  15911. this.headersSize = 0
  15912. if (this.shouldKeepAlive && client[kPipelining]) {
  15913. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15914. if (keepAliveTimeout != null) {
  15915. const timeout = Math.min(
  15916. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15917. client[kKeepAliveMaxTimeout]
  15918. )
  15919. if (timeout <= 0) {
  15920. socket[kReset] = true
  15921. } else {
  15922. client[kKeepAliveTimeoutValue] = timeout
  15923. }
  15924. } else {
  15925. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15926. }
  15927. } else {
  15928. // Stop more requests from being dispatched.
  15929. socket[kReset] = true
  15930. }
  15931. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15932. if (request.aborted) {
  15933. return -1
  15934. }
  15935. if (request.method === 'HEAD') {
  15936. return 1
  15937. }
  15938. if (statusCode < 200) {
  15939. return 1
  15940. }
  15941. if (socket[kBlocking]) {
  15942. socket[kBlocking] = false
  15943. resume(client)
  15944. }
  15945. return pause ? constants.ERROR.PAUSED : 0
  15946. }
  15947. onBody (buf) {
  15948. const { client, socket, statusCode, maxResponseSize } = this
  15949. if (socket.destroyed) {
  15950. return -1
  15951. }
  15952. const request = client[kQueue][client[kRunningIdx]]
  15953. assert(request)
  15954. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15955. if (this.timeout) {
  15956. // istanbul ignore else: only for jest
  15957. if (this.timeout.refresh) {
  15958. this.timeout.refresh()
  15959. }
  15960. }
  15961. assert(statusCode >= 200)
  15962. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15963. util.destroy(socket, new ResponseExceededMaxSizeError())
  15964. return -1
  15965. }
  15966. this.bytesRead += buf.length
  15967. if (request.onData(buf) === false) {
  15968. return constants.ERROR.PAUSED
  15969. }
  15970. }
  15971. onMessageComplete () {
  15972. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15973. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15974. return -1
  15975. }
  15976. if (upgrade) {
  15977. return
  15978. }
  15979. const request = client[kQueue][client[kRunningIdx]]
  15980. assert(request)
  15981. assert(statusCode >= 100)
  15982. this.statusCode = null
  15983. this.statusText = ''
  15984. this.bytesRead = 0
  15985. this.contentLength = ''
  15986. this.keepAlive = ''
  15987. this.connection = ''
  15988. assert(this.headers.length % 2 === 0)
  15989. this.headers = []
  15990. this.headersSize = 0
  15991. if (statusCode < 200) {
  15992. return
  15993. }
  15994. /* istanbul ignore next: should be handled by llhttp? */
  15995. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  15996. util.destroy(socket, new ResponseContentLengthMismatchError())
  15997. return -1
  15998. }
  15999. request.onComplete(headers)
  16000. client[kQueue][client[kRunningIdx]++] = null
  16001. if (socket[kWriting]) {
  16002. assert.strictEqual(client[kRunning], 0)
  16003. // Response completed before request.
  16004. util.destroy(socket, new InformationalError('reset'))
  16005. return constants.ERROR.PAUSED
  16006. } else if (!shouldKeepAlive) {
  16007. util.destroy(socket, new InformationalError('reset'))
  16008. return constants.ERROR.PAUSED
  16009. } else if (socket[kReset] && client[kRunning] === 0) {
  16010. // Destroy socket once all requests have completed.
  16011. // The request at the tail of the pipeline is the one
  16012. // that requested reset and no further requests should
  16013. // have been queued since then.
  16014. util.destroy(socket, new InformationalError('reset'))
  16015. return constants.ERROR.PAUSED
  16016. } else if (client[kPipelining] === 1) {
  16017. // We must wait a full event loop cycle to reuse this socket to make sure
  16018. // that non-spec compliant servers are not closing the connection even if they
  16019. // said they won't.
  16020. setImmediate(resume, client)
  16021. } else {
  16022. resume(client)
  16023. }
  16024. }
  16025. }
  16026. function onParserTimeout (parser) {
  16027. const { socket, timeoutType, client } = parser
  16028. /* istanbul ignore else */
  16029. if (timeoutType === TIMEOUT_HEADERS) {
  16030. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  16031. assert(!parser.paused, 'cannot be paused while waiting for headers')
  16032. util.destroy(socket, new HeadersTimeoutError())
  16033. }
  16034. } else if (timeoutType === TIMEOUT_BODY) {
  16035. if (!parser.paused) {
  16036. util.destroy(socket, new BodyTimeoutError())
  16037. }
  16038. } else if (timeoutType === TIMEOUT_IDLE) {
  16039. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  16040. util.destroy(socket, new InformationalError('socket idle timeout'))
  16041. }
  16042. }
  16043. function onSocketReadable () {
  16044. const { [kParser]: parser } = this
  16045. if (parser) {
  16046. parser.readMore()
  16047. }
  16048. }
  16049. function onSocketError (err) {
  16050. const { [kClient]: client, [kParser]: parser } = this
  16051. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  16052. if (client[kHTTPConnVersion] !== 'h2') {
  16053. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  16054. // to the user.
  16055. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  16056. // We treat all incoming data so for as a valid response.
  16057. parser.onMessageComplete()
  16058. return
  16059. }
  16060. }
  16061. this[kError] = err
  16062. onError(this[kClient], err)
  16063. }
  16064. function onError (client, err) {
  16065. if (
  16066. client[kRunning] === 0 &&
  16067. err.code !== 'UND_ERR_INFO' &&
  16068. err.code !== 'UND_ERR_SOCKET'
  16069. ) {
  16070. // Error is not caused by running request and not a recoverable
  16071. // socket error.
  16072. assert(client[kPendingIdx] === client[kRunningIdx])
  16073. const requests = client[kQueue].splice(client[kRunningIdx])
  16074. for (let i = 0; i < requests.length; i++) {
  16075. const request = requests[i]
  16076. errorRequest(client, request, err)
  16077. }
  16078. assert(client[kSize] === 0)
  16079. }
  16080. }
  16081. function onSocketEnd () {
  16082. const { [kParser]: parser, [kClient]: client } = this
  16083. if (client[kHTTPConnVersion] !== 'h2') {
  16084. if (parser.statusCode && !parser.shouldKeepAlive) {
  16085. // We treat all incoming data so far as a valid response.
  16086. parser.onMessageComplete()
  16087. return
  16088. }
  16089. }
  16090. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  16091. }
  16092. function onSocketClose () {
  16093. const { [kClient]: client, [kParser]: parser } = this
  16094. if (client[kHTTPConnVersion] === 'h1' && parser) {
  16095. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  16096. // We treat all incoming data so far as a valid response.
  16097. parser.onMessageComplete()
  16098. }
  16099. this[kParser].destroy()
  16100. this[kParser] = null
  16101. }
  16102. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  16103. client[kSocket] = null
  16104. if (client.destroyed) {
  16105. assert(client[kPending] === 0)
  16106. // Fail entire queue.
  16107. const requests = client[kQueue].splice(client[kRunningIdx])
  16108. for (let i = 0; i < requests.length; i++) {
  16109. const request = requests[i]
  16110. errorRequest(client, request, err)
  16111. }
  16112. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  16113. // Fail head of pipeline.
  16114. const request = client[kQueue][client[kRunningIdx]]
  16115. client[kQueue][client[kRunningIdx]++] = null
  16116. errorRequest(client, request, err)
  16117. }
  16118. client[kPendingIdx] = client[kRunningIdx]
  16119. assert(client[kRunning] === 0)
  16120. client.emit('disconnect', client[kUrl], [client], err)
  16121. resume(client)
  16122. }
  16123. async function connect (client) {
  16124. assert(!client[kConnecting])
  16125. assert(!client[kSocket])
  16126. let { host, hostname, protocol, port } = client[kUrl]
  16127. // Resolve ipv6
  16128. if (hostname[0] === '[') {
  16129. const idx = hostname.indexOf(']')
  16130. assert(idx !== -1)
  16131. const ip = hostname.substring(1, idx)
  16132. assert(net.isIP(ip))
  16133. hostname = ip
  16134. }
  16135. client[kConnecting] = true
  16136. if (channels.beforeConnect.hasSubscribers) {
  16137. channels.beforeConnect.publish({
  16138. connectParams: {
  16139. host,
  16140. hostname,
  16141. protocol,
  16142. port,
  16143. servername: client[kServerName],
  16144. localAddress: client[kLocalAddress]
  16145. },
  16146. connector: client[kConnector]
  16147. })
  16148. }
  16149. try {
  16150. const socket = await new Promise((resolve, reject) => {
  16151. client[kConnector]({
  16152. host,
  16153. hostname,
  16154. protocol,
  16155. port,
  16156. servername: client[kServerName],
  16157. localAddress: client[kLocalAddress]
  16158. }, (err, socket) => {
  16159. if (err) {
  16160. reject(err)
  16161. } else {
  16162. resolve(socket)
  16163. }
  16164. })
  16165. })
  16166. if (client.destroyed) {
  16167. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  16168. return
  16169. }
  16170. client[kConnecting] = false
  16171. assert(socket)
  16172. const isH2 = socket.alpnProtocol === 'h2'
  16173. if (isH2) {
  16174. if (!h2ExperimentalWarned) {
  16175. h2ExperimentalWarned = true
  16176. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  16177. code: 'UNDICI-H2'
  16178. })
  16179. }
  16180. const session = http2.connect(client[kUrl], {
  16181. createConnection: () => socket,
  16182. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  16183. })
  16184. client[kHTTPConnVersion] = 'h2'
  16185. session[kClient] = client
  16186. session[kSocket] = socket
  16187. session.on('error', onHttp2SessionError)
  16188. session.on('frameError', onHttp2FrameError)
  16189. session.on('end', onHttp2SessionEnd)
  16190. session.on('goaway', onHTTP2GoAway)
  16191. session.on('close', onSocketClose)
  16192. session.unref()
  16193. client[kHTTP2Session] = session
  16194. socket[kHTTP2Session] = session
  16195. } else {
  16196. if (!llhttpInstance) {
  16197. llhttpInstance = await llhttpPromise
  16198. llhttpPromise = null
  16199. }
  16200. socket[kNoRef] = false
  16201. socket[kWriting] = false
  16202. socket[kReset] = false
  16203. socket[kBlocking] = false
  16204. socket[kParser] = new Parser(client, socket, llhttpInstance)
  16205. }
  16206. socket[kCounter] = 0
  16207. socket[kMaxRequests] = client[kMaxRequests]
  16208. socket[kClient] = client
  16209. socket[kError] = null
  16210. socket
  16211. .on('error', onSocketError)
  16212. .on('readable', onSocketReadable)
  16213. .on('end', onSocketEnd)
  16214. .on('close', onSocketClose)
  16215. client[kSocket] = socket
  16216. if (channels.connected.hasSubscribers) {
  16217. channels.connected.publish({
  16218. connectParams: {
  16219. host,
  16220. hostname,
  16221. protocol,
  16222. port,
  16223. servername: client[kServerName],
  16224. localAddress: client[kLocalAddress]
  16225. },
  16226. connector: client[kConnector],
  16227. socket
  16228. })
  16229. }
  16230. client.emit('connect', client[kUrl], [client])
  16231. } catch (err) {
  16232. if (client.destroyed) {
  16233. return
  16234. }
  16235. client[kConnecting] = false
  16236. if (channels.connectError.hasSubscribers) {
  16237. channels.connectError.publish({
  16238. connectParams: {
  16239. host,
  16240. hostname,
  16241. protocol,
  16242. port,
  16243. servername: client[kServerName],
  16244. localAddress: client[kLocalAddress]
  16245. },
  16246. connector: client[kConnector],
  16247. error: err
  16248. })
  16249. }
  16250. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  16251. assert(client[kRunning] === 0)
  16252. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  16253. const request = client[kQueue][client[kPendingIdx]++]
  16254. errorRequest(client, request, err)
  16255. }
  16256. } else {
  16257. onError(client, err)
  16258. }
  16259. client.emit('connectionError', client[kUrl], [client], err)
  16260. }
  16261. resume(client)
  16262. }
  16263. function emitDrain (client) {
  16264. client[kNeedDrain] = 0
  16265. client.emit('drain', client[kUrl], [client])
  16266. }
  16267. function resume (client, sync) {
  16268. if (client[kResuming] === 2) {
  16269. return
  16270. }
  16271. client[kResuming] = 2
  16272. _resume(client, sync)
  16273. client[kResuming] = 0
  16274. if (client[kRunningIdx] > 256) {
  16275. client[kQueue].splice(0, client[kRunningIdx])
  16276. client[kPendingIdx] -= client[kRunningIdx]
  16277. client[kRunningIdx] = 0
  16278. }
  16279. }
  16280. function _resume (client, sync) {
  16281. while (true) {
  16282. if (client.destroyed) {
  16283. assert(client[kPending] === 0)
  16284. return
  16285. }
  16286. if (client[kClosedResolve] && !client[kSize]) {
  16287. client[kClosedResolve]()
  16288. client[kClosedResolve] = null
  16289. return
  16290. }
  16291. const socket = client[kSocket]
  16292. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16293. if (client[kSize] === 0) {
  16294. if (!socket[kNoRef] && socket.unref) {
  16295. socket.unref()
  16296. socket[kNoRef] = true
  16297. }
  16298. } else if (socket[kNoRef] && socket.ref) {
  16299. socket.ref()
  16300. socket[kNoRef] = false
  16301. }
  16302. if (client[kSize] === 0) {
  16303. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16304. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16305. }
  16306. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16307. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16308. const request = client[kQueue][client[kRunningIdx]]
  16309. const headersTimeout = request.headersTimeout != null
  16310. ? request.headersTimeout
  16311. : client[kHeadersTimeout]
  16312. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16313. }
  16314. }
  16315. }
  16316. if (client[kBusy]) {
  16317. client[kNeedDrain] = 2
  16318. } else if (client[kNeedDrain] === 2) {
  16319. if (sync) {
  16320. client[kNeedDrain] = 1
  16321. process.nextTick(emitDrain, client)
  16322. } else {
  16323. emitDrain(client)
  16324. }
  16325. continue
  16326. }
  16327. if (client[kPending] === 0) {
  16328. return
  16329. }
  16330. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16331. return
  16332. }
  16333. const request = client[kQueue][client[kPendingIdx]]
  16334. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16335. if (client[kRunning] > 0) {
  16336. return
  16337. }
  16338. client[kServerName] = request.servername
  16339. if (socket && socket.servername !== request.servername) {
  16340. util.destroy(socket, new InformationalError('servername changed'))
  16341. return
  16342. }
  16343. }
  16344. if (client[kConnecting]) {
  16345. return
  16346. }
  16347. if (!socket && !client[kHTTP2Session]) {
  16348. connect(client)
  16349. return
  16350. }
  16351. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16352. return
  16353. }
  16354. if (client[kRunning] > 0 && !request.idempotent) {
  16355. // Non-idempotent request cannot be retried.
  16356. // Ensure that no other requests are inflight and
  16357. // could cause failure.
  16358. return
  16359. }
  16360. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16361. // Don't dispatch an upgrade until all preceding requests have completed.
  16362. // A misbehaving server might upgrade the connection before all pipelined
  16363. // request has completed.
  16364. return
  16365. }
  16366. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16367. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16368. // Request with stream or iterator body can error while other requests
  16369. // are inflight and indirectly error those as well.
  16370. // Ensure this doesn't happen by waiting for inflight
  16371. // to complete before dispatching.
  16372. // Request with stream or iterator body cannot be retried.
  16373. // Ensure that no other requests are inflight and
  16374. // could cause failure.
  16375. return
  16376. }
  16377. if (!request.aborted && write(client, request)) {
  16378. client[kPendingIdx]++
  16379. } else {
  16380. client[kQueue].splice(client[kPendingIdx], 1)
  16381. }
  16382. }
  16383. }
  16384. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16385. function shouldSendContentLength (method) {
  16386. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16387. }
  16388. function write (client, request) {
  16389. if (client[kHTTPConnVersion] === 'h2') {
  16390. writeH2(client, client[kHTTP2Session], request)
  16391. return
  16392. }
  16393. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16394. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16395. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16396. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16397. // Sending a payload body on a request that does not
  16398. // expect it can cause undefined behavior on some
  16399. // servers and corrupt connection state. Do not
  16400. // re-use the connection for further requests.
  16401. const expectsPayload = (
  16402. method === 'PUT' ||
  16403. method === 'POST' ||
  16404. method === 'PATCH'
  16405. )
  16406. if (body && typeof body.read === 'function') {
  16407. // Try to read EOF in order to get length.
  16408. body.read(0)
  16409. }
  16410. const bodyLength = util.bodyLength(body)
  16411. let contentLength = bodyLength
  16412. if (contentLength === null) {
  16413. contentLength = request.contentLength
  16414. }
  16415. if (contentLength === 0 && !expectsPayload) {
  16416. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16417. // A user agent SHOULD NOT send a Content-Length header field when
  16418. // the request message does not contain a payload body and the method
  16419. // semantics do not anticipate such a body.
  16420. contentLength = null
  16421. }
  16422. // https://github.com/nodejs/undici/issues/2046
  16423. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16424. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16425. if (client[kStrictContentLength]) {
  16426. errorRequest(client, request, new RequestContentLengthMismatchError())
  16427. return false
  16428. }
  16429. process.emitWarning(new RequestContentLengthMismatchError())
  16430. }
  16431. const socket = client[kSocket]
  16432. try {
  16433. request.onConnect((err) => {
  16434. if (request.aborted || request.completed) {
  16435. return
  16436. }
  16437. errorRequest(client, request, err || new RequestAbortedError())
  16438. util.destroy(socket, new InformationalError('aborted'))
  16439. })
  16440. } catch (err) {
  16441. errorRequest(client, request, err)
  16442. }
  16443. if (request.aborted) {
  16444. return false
  16445. }
  16446. if (method === 'HEAD') {
  16447. // https://github.com/mcollina/undici/issues/258
  16448. // Close after a HEAD request to interop with misbehaving servers
  16449. // that may send a body in the response.
  16450. socket[kReset] = true
  16451. }
  16452. if (upgrade || method === 'CONNECT') {
  16453. // On CONNECT or upgrade, block pipeline from dispatching further
  16454. // requests on this connection.
  16455. socket[kReset] = true
  16456. }
  16457. if (reset != null) {
  16458. socket[kReset] = reset
  16459. }
  16460. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16461. socket[kReset] = true
  16462. }
  16463. if (blocking) {
  16464. socket[kBlocking] = true
  16465. }
  16466. let header = `${method} ${path} HTTP/1.1\r\n`
  16467. if (typeof host === 'string') {
  16468. header += `host: ${host}\r\n`
  16469. } else {
  16470. header += client[kHostHeader]
  16471. }
  16472. if (upgrade) {
  16473. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16474. } else if (client[kPipelining] && !socket[kReset]) {
  16475. header += 'connection: keep-alive\r\n'
  16476. } else {
  16477. header += 'connection: close\r\n'
  16478. }
  16479. if (headers) {
  16480. header += headers
  16481. }
  16482. if (channels.sendHeaders.hasSubscribers) {
  16483. channels.sendHeaders.publish({ request, headers: header, socket })
  16484. }
  16485. /* istanbul ignore else: assertion */
  16486. if (!body || bodyLength === 0) {
  16487. if (contentLength === 0) {
  16488. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16489. } else {
  16490. assert(contentLength === null, 'no body must not have content length')
  16491. socket.write(`${header}\r\n`, 'latin1')
  16492. }
  16493. request.onRequestSent()
  16494. } else if (util.isBuffer(body)) {
  16495. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16496. socket.cork()
  16497. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16498. socket.write(body)
  16499. socket.uncork()
  16500. request.onBodySent(body)
  16501. request.onRequestSent()
  16502. if (!expectsPayload) {
  16503. socket[kReset] = true
  16504. }
  16505. } else if (util.isBlobLike(body)) {
  16506. if (typeof body.stream === 'function') {
  16507. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16508. } else {
  16509. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16510. }
  16511. } else if (util.isStream(body)) {
  16512. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16513. } else if (util.isIterable(body)) {
  16514. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16515. } else {
  16516. assert(false)
  16517. }
  16518. return true
  16519. }
  16520. function writeH2 (client, session, request) {
  16521. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16522. let headers
  16523. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16524. else headers = reqHeaders
  16525. if (upgrade) {
  16526. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16527. return false
  16528. }
  16529. try {
  16530. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16531. request.onConnect((err) => {
  16532. if (request.aborted || request.completed) {
  16533. return
  16534. }
  16535. errorRequest(client, request, err || new RequestAbortedError())
  16536. })
  16537. } catch (err) {
  16538. errorRequest(client, request, err)
  16539. }
  16540. if (request.aborted) {
  16541. return false
  16542. }
  16543. /** @type {import('node:http2').ClientHttp2Stream} */
  16544. let stream
  16545. const h2State = client[kHTTP2SessionState]
  16546. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16547. headers[HTTP2_HEADER_METHOD] = method
  16548. if (method === 'CONNECT') {
  16549. session.ref()
  16550. // we are already connected, streams are pending, first request
  16551. // will create a new stream. We trigger a request to create the stream and wait until
  16552. // `ready` event is triggered
  16553. // We disabled endStream to allow the user to write to the stream
  16554. stream = session.request(headers, { endStream: false, signal })
  16555. if (stream.id && !stream.pending) {
  16556. request.onUpgrade(null, null, stream)
  16557. ++h2State.openStreams
  16558. } else {
  16559. stream.once('ready', () => {
  16560. request.onUpgrade(null, null, stream)
  16561. ++h2State.openStreams
  16562. })
  16563. }
  16564. stream.once('close', () => {
  16565. h2State.openStreams -= 1
  16566. // TODO(HTTP/2): unref only if current streams count is 0
  16567. if (h2State.openStreams === 0) session.unref()
  16568. })
  16569. return true
  16570. }
  16571. // https://tools.ietf.org/html/rfc7540#section-8.3
  16572. // :path and :scheme headers must be omited when sending CONNECT
  16573. headers[HTTP2_HEADER_PATH] = path
  16574. headers[HTTP2_HEADER_SCHEME] = 'https'
  16575. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16576. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16577. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16578. // Sending a payload body on a request that does not
  16579. // expect it can cause undefined behavior on some
  16580. // servers and corrupt connection state. Do not
  16581. // re-use the connection for further requests.
  16582. const expectsPayload = (
  16583. method === 'PUT' ||
  16584. method === 'POST' ||
  16585. method === 'PATCH'
  16586. )
  16587. if (body && typeof body.read === 'function') {
  16588. // Try to read EOF in order to get length.
  16589. body.read(0)
  16590. }
  16591. let contentLength = util.bodyLength(body)
  16592. if (contentLength == null) {
  16593. contentLength = request.contentLength
  16594. }
  16595. if (contentLength === 0 || !expectsPayload) {
  16596. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16597. // A user agent SHOULD NOT send a Content-Length header field when
  16598. // the request message does not contain a payload body and the method
  16599. // semantics do not anticipate such a body.
  16600. contentLength = null
  16601. }
  16602. // https://github.com/nodejs/undici/issues/2046
  16603. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16604. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16605. if (client[kStrictContentLength]) {
  16606. errorRequest(client, request, new RequestContentLengthMismatchError())
  16607. return false
  16608. }
  16609. process.emitWarning(new RequestContentLengthMismatchError())
  16610. }
  16611. if (contentLength != null) {
  16612. assert(body, 'no body must not have content length')
  16613. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16614. }
  16615. session.ref()
  16616. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16617. if (expectContinue) {
  16618. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16619. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16620. stream.once('continue', writeBodyH2)
  16621. } else {
  16622. stream = session.request(headers, {
  16623. endStream: shouldEndStream,
  16624. signal
  16625. })
  16626. writeBodyH2()
  16627. }
  16628. // Increment counter as we have new several streams open
  16629. ++h2State.openStreams
  16630. stream.once('response', headers => {
  16631. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16632. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16633. stream.pause()
  16634. }
  16635. })
  16636. stream.once('end', () => {
  16637. request.onComplete([])
  16638. })
  16639. stream.on('data', (chunk) => {
  16640. if (request.onData(chunk) === false) {
  16641. stream.pause()
  16642. }
  16643. })
  16644. stream.once('close', () => {
  16645. h2State.openStreams -= 1
  16646. // TODO(HTTP/2): unref only if current streams count is 0
  16647. if (h2State.openStreams === 0) {
  16648. session.unref()
  16649. }
  16650. })
  16651. stream.once('error', function (err) {
  16652. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16653. h2State.streams -= 1
  16654. util.destroy(stream, err)
  16655. }
  16656. })
  16657. stream.once('frameError', (type, code) => {
  16658. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16659. errorRequest(client, request, err)
  16660. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16661. h2State.streams -= 1
  16662. util.destroy(stream, err)
  16663. }
  16664. })
  16665. // stream.on('aborted', () => {
  16666. // // TODO(HTTP/2): Support aborted
  16667. // })
  16668. // stream.on('timeout', () => {
  16669. // // TODO(HTTP/2): Support timeout
  16670. // })
  16671. // stream.on('push', headers => {
  16672. // // TODO(HTTP/2): Suppor push
  16673. // })
  16674. // stream.on('trailers', headers => {
  16675. // // TODO(HTTP/2): Support trailers
  16676. // })
  16677. return true
  16678. function writeBodyH2 () {
  16679. /* istanbul ignore else: assertion */
  16680. if (!body) {
  16681. request.onRequestSent()
  16682. } else if (util.isBuffer(body)) {
  16683. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16684. stream.cork()
  16685. stream.write(body)
  16686. stream.uncork()
  16687. stream.end()
  16688. request.onBodySent(body)
  16689. request.onRequestSent()
  16690. } else if (util.isBlobLike(body)) {
  16691. if (typeof body.stream === 'function') {
  16692. writeIterable({
  16693. client,
  16694. request,
  16695. contentLength,
  16696. h2stream: stream,
  16697. expectsPayload,
  16698. body: body.stream(),
  16699. socket: client[kSocket],
  16700. header: ''
  16701. })
  16702. } else {
  16703. writeBlob({
  16704. body,
  16705. client,
  16706. request,
  16707. contentLength,
  16708. expectsPayload,
  16709. h2stream: stream,
  16710. header: '',
  16711. socket: client[kSocket]
  16712. })
  16713. }
  16714. } else if (util.isStream(body)) {
  16715. writeStream({
  16716. body,
  16717. client,
  16718. request,
  16719. contentLength,
  16720. expectsPayload,
  16721. socket: client[kSocket],
  16722. h2stream: stream,
  16723. header: ''
  16724. })
  16725. } else if (util.isIterable(body)) {
  16726. writeIterable({
  16727. body,
  16728. client,
  16729. request,
  16730. contentLength,
  16731. expectsPayload,
  16732. header: '',
  16733. h2stream: stream,
  16734. socket: client[kSocket]
  16735. })
  16736. } else {
  16737. assert(false)
  16738. }
  16739. }
  16740. }
  16741. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16742. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16743. if (client[kHTTPConnVersion] === 'h2') {
  16744. // For HTTP/2, is enough to pipe the stream
  16745. const pipe = pipeline(
  16746. body,
  16747. h2stream,
  16748. (err) => {
  16749. if (err) {
  16750. util.destroy(body, err)
  16751. util.destroy(h2stream, err)
  16752. } else {
  16753. request.onRequestSent()
  16754. }
  16755. }
  16756. )
  16757. pipe.on('data', onPipeData)
  16758. pipe.once('end', () => {
  16759. pipe.removeListener('data', onPipeData)
  16760. util.destroy(pipe)
  16761. })
  16762. function onPipeData (chunk) {
  16763. request.onBodySent(chunk)
  16764. }
  16765. return
  16766. }
  16767. let finished = false
  16768. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16769. const onData = function (chunk) {
  16770. if (finished) {
  16771. return
  16772. }
  16773. try {
  16774. if (!writer.write(chunk) && this.pause) {
  16775. this.pause()
  16776. }
  16777. } catch (err) {
  16778. util.destroy(this, err)
  16779. }
  16780. }
  16781. const onDrain = function () {
  16782. if (finished) {
  16783. return
  16784. }
  16785. if (body.resume) {
  16786. body.resume()
  16787. }
  16788. }
  16789. const onAbort = function () {
  16790. if (finished) {
  16791. return
  16792. }
  16793. const err = new RequestAbortedError()
  16794. queueMicrotask(() => onFinished(err))
  16795. }
  16796. const onFinished = function (err) {
  16797. if (finished) {
  16798. return
  16799. }
  16800. finished = true
  16801. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16802. socket
  16803. .off('drain', onDrain)
  16804. .off('error', onFinished)
  16805. body
  16806. .removeListener('data', onData)
  16807. .removeListener('end', onFinished)
  16808. .removeListener('error', onFinished)
  16809. .removeListener('close', onAbort)
  16810. if (!err) {
  16811. try {
  16812. writer.end()
  16813. } catch (er) {
  16814. err = er
  16815. }
  16816. }
  16817. writer.destroy(err)
  16818. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16819. util.destroy(body, err)
  16820. } else {
  16821. util.destroy(body)
  16822. }
  16823. }
  16824. body
  16825. .on('data', onData)
  16826. .on('end', onFinished)
  16827. .on('error', onFinished)
  16828. .on('close', onAbort)
  16829. if (body.resume) {
  16830. body.resume()
  16831. }
  16832. socket
  16833. .on('drain', onDrain)
  16834. .on('error', onFinished)
  16835. }
  16836. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16837. assert(contentLength === body.size, 'blob body must have content length')
  16838. const isH2 = client[kHTTPConnVersion] === 'h2'
  16839. try {
  16840. if (contentLength != null && contentLength !== body.size) {
  16841. throw new RequestContentLengthMismatchError()
  16842. }
  16843. const buffer = Buffer.from(await body.arrayBuffer())
  16844. if (isH2) {
  16845. h2stream.cork()
  16846. h2stream.write(buffer)
  16847. h2stream.uncork()
  16848. } else {
  16849. socket.cork()
  16850. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16851. socket.write(buffer)
  16852. socket.uncork()
  16853. }
  16854. request.onBodySent(buffer)
  16855. request.onRequestSent()
  16856. if (!expectsPayload) {
  16857. socket[kReset] = true
  16858. }
  16859. resume(client)
  16860. } catch (err) {
  16861. util.destroy(isH2 ? h2stream : socket, err)
  16862. }
  16863. }
  16864. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16865. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16866. let callback = null
  16867. function onDrain () {
  16868. if (callback) {
  16869. const cb = callback
  16870. callback = null
  16871. cb()
  16872. }
  16873. }
  16874. const waitForDrain = () => new Promise((resolve, reject) => {
  16875. assert(callback === null)
  16876. if (socket[kError]) {
  16877. reject(socket[kError])
  16878. } else {
  16879. callback = resolve
  16880. }
  16881. })
  16882. if (client[kHTTPConnVersion] === 'h2') {
  16883. h2stream
  16884. .on('close', onDrain)
  16885. .on('drain', onDrain)
  16886. try {
  16887. // It's up to the user to somehow abort the async iterable.
  16888. for await (const chunk of body) {
  16889. if (socket[kError]) {
  16890. throw socket[kError]
  16891. }
  16892. const res = h2stream.write(chunk)
  16893. request.onBodySent(chunk)
  16894. if (!res) {
  16895. await waitForDrain()
  16896. }
  16897. }
  16898. } catch (err) {
  16899. h2stream.destroy(err)
  16900. } finally {
  16901. request.onRequestSent()
  16902. h2stream.end()
  16903. h2stream
  16904. .off('close', onDrain)
  16905. .off('drain', onDrain)
  16906. }
  16907. return
  16908. }
  16909. socket
  16910. .on('close', onDrain)
  16911. .on('drain', onDrain)
  16912. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16913. try {
  16914. // It's up to the user to somehow abort the async iterable.
  16915. for await (const chunk of body) {
  16916. if (socket[kError]) {
  16917. throw socket[kError]
  16918. }
  16919. if (!writer.write(chunk)) {
  16920. await waitForDrain()
  16921. }
  16922. }
  16923. writer.end()
  16924. } catch (err) {
  16925. writer.destroy(err)
  16926. } finally {
  16927. socket
  16928. .off('close', onDrain)
  16929. .off('drain', onDrain)
  16930. }
  16931. }
  16932. class AsyncWriter {
  16933. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16934. this.socket = socket
  16935. this.request = request
  16936. this.contentLength = contentLength
  16937. this.client = client
  16938. this.bytesWritten = 0
  16939. this.expectsPayload = expectsPayload
  16940. this.header = header
  16941. socket[kWriting] = true
  16942. }
  16943. write (chunk) {
  16944. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16945. if (socket[kError]) {
  16946. throw socket[kError]
  16947. }
  16948. if (socket.destroyed) {
  16949. return false
  16950. }
  16951. const len = Buffer.byteLength(chunk)
  16952. if (!len) {
  16953. return true
  16954. }
  16955. // We should defer writing chunks.
  16956. if (contentLength !== null && bytesWritten + len > contentLength) {
  16957. if (client[kStrictContentLength]) {
  16958. throw new RequestContentLengthMismatchError()
  16959. }
  16960. process.emitWarning(new RequestContentLengthMismatchError())
  16961. }
  16962. socket.cork()
  16963. if (bytesWritten === 0) {
  16964. if (!expectsPayload) {
  16965. socket[kReset] = true
  16966. }
  16967. if (contentLength === null) {
  16968. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16969. } else {
  16970. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16971. }
  16972. }
  16973. if (contentLength === null) {
  16974. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16975. }
  16976. this.bytesWritten += len
  16977. const ret = socket.write(chunk)
  16978. socket.uncork()
  16979. request.onBodySent(chunk)
  16980. if (!ret) {
  16981. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16982. // istanbul ignore else: only for jest
  16983. if (socket[kParser].timeout.refresh) {
  16984. socket[kParser].timeout.refresh()
  16985. }
  16986. }
  16987. }
  16988. return ret
  16989. }
  16990. end () {
  16991. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  16992. request.onRequestSent()
  16993. socket[kWriting] = false
  16994. if (socket[kError]) {
  16995. throw socket[kError]
  16996. }
  16997. if (socket.destroyed) {
  16998. return
  16999. }
  17000. if (bytesWritten === 0) {
  17001. if (expectsPayload) {
  17002. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  17003. // A user agent SHOULD send a Content-Length in a request message when
  17004. // no Transfer-Encoding is sent and the request method defines a meaning
  17005. // for an enclosed payload body.
  17006. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  17007. } else {
  17008. socket.write(`${header}\r\n`, 'latin1')
  17009. }
  17010. } else if (contentLength === null) {
  17011. socket.write('\r\n0\r\n\r\n', 'latin1')
  17012. }
  17013. if (contentLength !== null && bytesWritten !== contentLength) {
  17014. if (client[kStrictContentLength]) {
  17015. throw new RequestContentLengthMismatchError()
  17016. } else {
  17017. process.emitWarning(new RequestContentLengthMismatchError())
  17018. }
  17019. }
  17020. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17021. // istanbul ignore else: only for jest
  17022. if (socket[kParser].timeout.refresh) {
  17023. socket[kParser].timeout.refresh()
  17024. }
  17025. }
  17026. resume(client)
  17027. }
  17028. destroy (err) {
  17029. const { socket, client } = this
  17030. socket[kWriting] = false
  17031. if (err) {
  17032. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  17033. util.destroy(socket, err)
  17034. }
  17035. }
  17036. }
  17037. function errorRequest (client, request, err) {
  17038. try {
  17039. request.onError(err)
  17040. assert(request.aborted)
  17041. } catch (err) {
  17042. client.emit('error', err)
  17043. }
  17044. }
  17045. module.exports = Client
  17046. /***/ }),
  17047. /***/ 6436:
  17048. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17049. "use strict";
  17050. /* istanbul ignore file: only for Node 12 */
  17051. const { kConnected, kSize } = __nccwpck_require__(2785)
  17052. class CompatWeakRef {
  17053. constructor (value) {
  17054. this.value = value
  17055. }
  17056. deref () {
  17057. return this.value[kConnected] === 0 && this.value[kSize] === 0
  17058. ? undefined
  17059. : this.value
  17060. }
  17061. }
  17062. class CompatFinalizer {
  17063. constructor (finalizer) {
  17064. this.finalizer = finalizer
  17065. }
  17066. register (dispatcher, key) {
  17067. if (dispatcher.on) {
  17068. dispatcher.on('disconnect', () => {
  17069. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  17070. this.finalizer(key)
  17071. }
  17072. })
  17073. }
  17074. }
  17075. }
  17076. module.exports = function () {
  17077. // FIXME: remove workaround when the Node bug is fixed
  17078. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17079. if (process.env.NODE_V8_COVERAGE) {
  17080. return {
  17081. WeakRef: CompatWeakRef,
  17082. FinalizationRegistry: CompatFinalizer
  17083. }
  17084. }
  17085. return {
  17086. WeakRef: global.WeakRef || CompatWeakRef,
  17087. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  17088. }
  17089. }
  17090. /***/ }),
  17091. /***/ 663:
  17092. /***/ ((module) => {
  17093. "use strict";
  17094. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  17095. const maxAttributeValueSize = 1024
  17096. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  17097. const maxNameValuePairSize = 4096
  17098. module.exports = {
  17099. maxAttributeValueSize,
  17100. maxNameValuePairSize
  17101. }
  17102. /***/ }),
  17103. /***/ 1724:
  17104. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17105. "use strict";
  17106. const { parseSetCookie } = __nccwpck_require__(4408)
  17107. const { stringify } = __nccwpck_require__(3121)
  17108. const { webidl } = __nccwpck_require__(1744)
  17109. const { Headers } = __nccwpck_require__(554)
  17110. /**
  17111. * @typedef {Object} Cookie
  17112. * @property {string} name
  17113. * @property {string} value
  17114. * @property {Date|number|undefined} expires
  17115. * @property {number|undefined} maxAge
  17116. * @property {string|undefined} domain
  17117. * @property {string|undefined} path
  17118. * @property {boolean|undefined} secure
  17119. * @property {boolean|undefined} httpOnly
  17120. * @property {'Strict'|'Lax'|'None'} sameSite
  17121. * @property {string[]} unparsed
  17122. */
  17123. /**
  17124. * @param {Headers} headers
  17125. * @returns {Record<string, string>}
  17126. */
  17127. function getCookies (headers) {
  17128. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  17129. webidl.brandCheck(headers, Headers, { strict: false })
  17130. const cookie = headers.get('cookie')
  17131. const out = {}
  17132. if (!cookie) {
  17133. return out
  17134. }
  17135. for (const piece of cookie.split(';')) {
  17136. const [name, ...value] = piece.split('=')
  17137. out[name.trim()] = value.join('=')
  17138. }
  17139. return out
  17140. }
  17141. /**
  17142. * @param {Headers} headers
  17143. * @param {string} name
  17144. * @param {{ path?: string, domain?: string }|undefined} attributes
  17145. * @returns {void}
  17146. */
  17147. function deleteCookie (headers, name, attributes) {
  17148. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  17149. webidl.brandCheck(headers, Headers, { strict: false })
  17150. name = webidl.converters.DOMString(name)
  17151. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  17152. // Matches behavior of
  17153. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  17154. setCookie(headers, {
  17155. name,
  17156. value: '',
  17157. expires: new Date(0),
  17158. ...attributes
  17159. })
  17160. }
  17161. /**
  17162. * @param {Headers} headers
  17163. * @returns {Cookie[]}
  17164. */
  17165. function getSetCookies (headers) {
  17166. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  17167. webidl.brandCheck(headers, Headers, { strict: false })
  17168. const cookies = headers.getSetCookie()
  17169. if (!cookies) {
  17170. return []
  17171. }
  17172. return cookies.map((pair) => parseSetCookie(pair))
  17173. }
  17174. /**
  17175. * @param {Headers} headers
  17176. * @param {Cookie} cookie
  17177. * @returns {void}
  17178. */
  17179. function setCookie (headers, cookie) {
  17180. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  17181. webidl.brandCheck(headers, Headers, { strict: false })
  17182. cookie = webidl.converters.Cookie(cookie)
  17183. const str = stringify(cookie)
  17184. if (str) {
  17185. headers.append('Set-Cookie', stringify(cookie))
  17186. }
  17187. }
  17188. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  17189. {
  17190. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17191. key: 'path',
  17192. defaultValue: null
  17193. },
  17194. {
  17195. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17196. key: 'domain',
  17197. defaultValue: null
  17198. }
  17199. ])
  17200. webidl.converters.Cookie = webidl.dictionaryConverter([
  17201. {
  17202. converter: webidl.converters.DOMString,
  17203. key: 'name'
  17204. },
  17205. {
  17206. converter: webidl.converters.DOMString,
  17207. key: 'value'
  17208. },
  17209. {
  17210. converter: webidl.nullableConverter((value) => {
  17211. if (typeof value === 'number') {
  17212. return webidl.converters['unsigned long long'](value)
  17213. }
  17214. return new Date(value)
  17215. }),
  17216. key: 'expires',
  17217. defaultValue: null
  17218. },
  17219. {
  17220. converter: webidl.nullableConverter(webidl.converters['long long']),
  17221. key: 'maxAge',
  17222. defaultValue: null
  17223. },
  17224. {
  17225. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17226. key: 'domain',
  17227. defaultValue: null
  17228. },
  17229. {
  17230. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17231. key: 'path',
  17232. defaultValue: null
  17233. },
  17234. {
  17235. converter: webidl.nullableConverter(webidl.converters.boolean),
  17236. key: 'secure',
  17237. defaultValue: null
  17238. },
  17239. {
  17240. converter: webidl.nullableConverter(webidl.converters.boolean),
  17241. key: 'httpOnly',
  17242. defaultValue: null
  17243. },
  17244. {
  17245. converter: webidl.converters.USVString,
  17246. key: 'sameSite',
  17247. allowedValues: ['Strict', 'Lax', 'None']
  17248. },
  17249. {
  17250. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  17251. key: 'unparsed',
  17252. defaultValue: []
  17253. }
  17254. ])
  17255. module.exports = {
  17256. getCookies,
  17257. deleteCookie,
  17258. getSetCookies,
  17259. setCookie
  17260. }
  17261. /***/ }),
  17262. /***/ 4408:
  17263. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17264. "use strict";
  17265. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17266. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17267. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17268. const assert = __nccwpck_require__(9491)
  17269. /**
  17270. * @description Parses the field-value attributes of a set-cookie header string.
  17271. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17272. * @param {string} header
  17273. * @returns if the header is invalid, null will be returned
  17274. */
  17275. function parseSetCookie (header) {
  17276. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17277. // character (CTL characters excluding HTAB): Abort these steps and
  17278. // ignore the set-cookie-string entirely.
  17279. if (isCTLExcludingHtab(header)) {
  17280. return null
  17281. }
  17282. let nameValuePair = ''
  17283. let unparsedAttributes = ''
  17284. let name = ''
  17285. let value = ''
  17286. // 2. If the set-cookie-string contains a %x3B (";") character:
  17287. if (header.includes(';')) {
  17288. // 1. The name-value-pair string consists of the characters up to,
  17289. // but not including, the first %x3B (";"), and the unparsed-
  17290. // attributes consist of the remainder of the set-cookie-string
  17291. // (including the %x3B (";") in question).
  17292. const position = { position: 0 }
  17293. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17294. unparsedAttributes = header.slice(position.position)
  17295. } else {
  17296. // Otherwise:
  17297. // 1. The name-value-pair string consists of all the characters
  17298. // contained in the set-cookie-string, and the unparsed-
  17299. // attributes is the empty string.
  17300. nameValuePair = header
  17301. }
  17302. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17303. // the name string is empty, and the value string is the value of
  17304. // name-value-pair.
  17305. if (!nameValuePair.includes('=')) {
  17306. value = nameValuePair
  17307. } else {
  17308. // Otherwise, the name string consists of the characters up to, but
  17309. // not including, the first %x3D ("=") character, and the (possibly
  17310. // empty) value string consists of the characters after the first
  17311. // %x3D ("=") character.
  17312. const position = { position: 0 }
  17313. name = collectASequenceOfCodePointsFast(
  17314. '=',
  17315. nameValuePair,
  17316. position
  17317. )
  17318. value = nameValuePair.slice(position.position + 1)
  17319. }
  17320. // 4. Remove any leading or trailing WSP characters from the name
  17321. // string and the value string.
  17322. name = name.trim()
  17323. value = value.trim()
  17324. // 5. If the sum of the lengths of the name string and the value string
  17325. // is more than 4096 octets, abort these steps and ignore the set-
  17326. // cookie-string entirely.
  17327. if (name.length + value.length > maxNameValuePairSize) {
  17328. return null
  17329. }
  17330. // 6. The cookie-name is the name string, and the cookie-value is the
  17331. // value string.
  17332. return {
  17333. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17334. }
  17335. }
  17336. /**
  17337. * Parses the remaining attributes of a set-cookie header
  17338. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17339. * @param {string} unparsedAttributes
  17340. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17341. */
  17342. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17343. // 1. If the unparsed-attributes string is empty, skip the rest of
  17344. // these steps.
  17345. if (unparsedAttributes.length === 0) {
  17346. return cookieAttributeList
  17347. }
  17348. // 2. Discard the first character of the unparsed-attributes (which
  17349. // will be a %x3B (";") character).
  17350. assert(unparsedAttributes[0] === ';')
  17351. unparsedAttributes = unparsedAttributes.slice(1)
  17352. let cookieAv = ''
  17353. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17354. // character:
  17355. if (unparsedAttributes.includes(';')) {
  17356. // 1. Consume the characters of the unparsed-attributes up to, but
  17357. // not including, the first %x3B (";") character.
  17358. cookieAv = collectASequenceOfCodePointsFast(
  17359. ';',
  17360. unparsedAttributes,
  17361. { position: 0 }
  17362. )
  17363. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17364. } else {
  17365. // Otherwise:
  17366. // 1. Consume the remainder of the unparsed-attributes.
  17367. cookieAv = unparsedAttributes
  17368. unparsedAttributes = ''
  17369. }
  17370. // Let the cookie-av string be the characters consumed in this step.
  17371. let attributeName = ''
  17372. let attributeValue = ''
  17373. // 4. If the cookie-av string contains a %x3D ("=") character:
  17374. if (cookieAv.includes('=')) {
  17375. // 1. The (possibly empty) attribute-name string consists of the
  17376. // characters up to, but not including, the first %x3D ("=")
  17377. // character, and the (possibly empty) attribute-value string
  17378. // consists of the characters after the first %x3D ("=")
  17379. // character.
  17380. const position = { position: 0 }
  17381. attributeName = collectASequenceOfCodePointsFast(
  17382. '=',
  17383. cookieAv,
  17384. position
  17385. )
  17386. attributeValue = cookieAv.slice(position.position + 1)
  17387. } else {
  17388. // Otherwise:
  17389. // 1. The attribute-name string consists of the entire cookie-av
  17390. // string, and the attribute-value string is empty.
  17391. attributeName = cookieAv
  17392. }
  17393. // 5. Remove any leading or trailing WSP characters from the attribute-
  17394. // name string and the attribute-value string.
  17395. attributeName = attributeName.trim()
  17396. attributeValue = attributeValue.trim()
  17397. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17398. // cookie-av string and return to Step 1 of this algorithm.
  17399. if (attributeValue.length > maxAttributeValueSize) {
  17400. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17401. }
  17402. // 7. Process the attribute-name and attribute-value according to the
  17403. // requirements in the following subsections. (Notice that
  17404. // attributes with unrecognized attribute-names are ignored.)
  17405. const attributeNameLowercase = attributeName.toLowerCase()
  17406. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17407. // If the attribute-name case-insensitively matches the string
  17408. // "Expires", the user agent MUST process the cookie-av as follows.
  17409. if (attributeNameLowercase === 'expires') {
  17410. // 1. Let the expiry-time be the result of parsing the attribute-value
  17411. // as cookie-date (see Section 5.1.1).
  17412. const expiryTime = new Date(attributeValue)
  17413. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17414. // the cookie-av.
  17415. cookieAttributeList.expires = expiryTime
  17416. } else if (attributeNameLowercase === 'max-age') {
  17417. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17418. // If the attribute-name case-insensitively matches the string "Max-
  17419. // Age", the user agent MUST process the cookie-av as follows.
  17420. // 1. If the first character of the attribute-value is not a DIGIT or a
  17421. // "-" character, ignore the cookie-av.
  17422. const charCode = attributeValue.charCodeAt(0)
  17423. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17424. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17425. }
  17426. // 2. If the remainder of attribute-value contains a non-DIGIT
  17427. // character, ignore the cookie-av.
  17428. if (!/^\d+$/.test(attributeValue)) {
  17429. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17430. }
  17431. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17432. const deltaSeconds = Number(attributeValue)
  17433. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17434. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17435. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17436. // age-limit.
  17437. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17438. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17439. // time be the earliest representable date and time. Otherwise, let
  17440. // the expiry-time be the current date and time plus delta-seconds
  17441. // seconds.
  17442. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17443. // 7. Append an attribute to the cookie-attribute-list with an
  17444. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17445. cookieAttributeList.maxAge = deltaSeconds
  17446. } else if (attributeNameLowercase === 'domain') {
  17447. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17448. // If the attribute-name case-insensitively matches the string "Domain",
  17449. // the user agent MUST process the cookie-av as follows.
  17450. // 1. Let cookie-domain be the attribute-value.
  17451. let cookieDomain = attributeValue
  17452. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17453. // cookie-domain without its leading %x2E (".").
  17454. if (cookieDomain[0] === '.') {
  17455. cookieDomain = cookieDomain.slice(1)
  17456. }
  17457. // 3. Convert the cookie-domain to lower case.
  17458. cookieDomain = cookieDomain.toLowerCase()
  17459. // 4. Append an attribute to the cookie-attribute-list with an
  17460. // attribute-name of Domain and an attribute-value of cookie-domain.
  17461. cookieAttributeList.domain = cookieDomain
  17462. } else if (attributeNameLowercase === 'path') {
  17463. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17464. // If the attribute-name case-insensitively matches the string "Path",
  17465. // the user agent MUST process the cookie-av as follows.
  17466. // 1. If the attribute-value is empty or if the first character of the
  17467. // attribute-value is not %x2F ("/"):
  17468. let cookiePath = ''
  17469. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17470. // 1. Let cookie-path be the default-path.
  17471. cookiePath = '/'
  17472. } else {
  17473. // Otherwise:
  17474. // 1. Let cookie-path be the attribute-value.
  17475. cookiePath = attributeValue
  17476. }
  17477. // 2. Append an attribute to the cookie-attribute-list with an
  17478. // attribute-name of Path and an attribute-value of cookie-path.
  17479. cookieAttributeList.path = cookiePath
  17480. } else if (attributeNameLowercase === 'secure') {
  17481. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17482. // If the attribute-name case-insensitively matches the string "Secure",
  17483. // the user agent MUST append an attribute to the cookie-attribute-list
  17484. // with an attribute-name of Secure and an empty attribute-value.
  17485. cookieAttributeList.secure = true
  17486. } else if (attributeNameLowercase === 'httponly') {
  17487. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17488. // If the attribute-name case-insensitively matches the string
  17489. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17490. // attribute-list with an attribute-name of HttpOnly and an empty
  17491. // attribute-value.
  17492. cookieAttributeList.httpOnly = true
  17493. } else if (attributeNameLowercase === 'samesite') {
  17494. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17495. // If the attribute-name case-insensitively matches the string
  17496. // "SameSite", the user agent MUST process the cookie-av as follows:
  17497. // 1. Let enforcement be "Default".
  17498. let enforcement = 'Default'
  17499. const attributeValueLowercase = attributeValue.toLowerCase()
  17500. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17501. // "None", set enforcement to "None".
  17502. if (attributeValueLowercase.includes('none')) {
  17503. enforcement = 'None'
  17504. }
  17505. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17506. // "Strict", set enforcement to "Strict".
  17507. if (attributeValueLowercase.includes('strict')) {
  17508. enforcement = 'Strict'
  17509. }
  17510. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17511. // "Lax", set enforcement to "Lax".
  17512. if (attributeValueLowercase.includes('lax')) {
  17513. enforcement = 'Lax'
  17514. }
  17515. // 5. Append an attribute to the cookie-attribute-list with an
  17516. // attribute-name of "SameSite" and an attribute-value of
  17517. // enforcement.
  17518. cookieAttributeList.sameSite = enforcement
  17519. } else {
  17520. cookieAttributeList.unparsed ??= []
  17521. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17522. }
  17523. // 8. Return to Step 1 of this algorithm.
  17524. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17525. }
  17526. module.exports = {
  17527. parseSetCookie,
  17528. parseUnparsedAttributes
  17529. }
  17530. /***/ }),
  17531. /***/ 3121:
  17532. /***/ ((module) => {
  17533. "use strict";
  17534. /**
  17535. * @param {string} value
  17536. * @returns {boolean}
  17537. */
  17538. function isCTLExcludingHtab (value) {
  17539. if (value.length === 0) {
  17540. return false
  17541. }
  17542. for (const char of value) {
  17543. const code = char.charCodeAt(0)
  17544. if (
  17545. (code >= 0x00 || code <= 0x08) ||
  17546. (code >= 0x0A || code <= 0x1F) ||
  17547. code === 0x7F
  17548. ) {
  17549. return false
  17550. }
  17551. }
  17552. }
  17553. /**
  17554. CHAR = <any US-ASCII character (octets 0 - 127)>
  17555. token = 1*<any CHAR except CTLs or separators>
  17556. separators = "(" | ")" | "<" | ">" | "@"
  17557. | "," | ";" | ":" | "\" | <">
  17558. | "/" | "[" | "]" | "?" | "="
  17559. | "{" | "}" | SP | HT
  17560. * @param {string} name
  17561. */
  17562. function validateCookieName (name) {
  17563. for (const char of name) {
  17564. const code = char.charCodeAt(0)
  17565. if (
  17566. (code <= 0x20 || code > 0x7F) ||
  17567. char === '(' ||
  17568. char === ')' ||
  17569. char === '>' ||
  17570. char === '<' ||
  17571. char === '@' ||
  17572. char === ',' ||
  17573. char === ';' ||
  17574. char === ':' ||
  17575. char === '\\' ||
  17576. char === '"' ||
  17577. char === '/' ||
  17578. char === '[' ||
  17579. char === ']' ||
  17580. char === '?' ||
  17581. char === '=' ||
  17582. char === '{' ||
  17583. char === '}'
  17584. ) {
  17585. throw new Error('Invalid cookie name')
  17586. }
  17587. }
  17588. }
  17589. /**
  17590. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17591. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17592. ; US-ASCII characters excluding CTLs,
  17593. ; whitespace DQUOTE, comma, semicolon,
  17594. ; and backslash
  17595. * @param {string} value
  17596. */
  17597. function validateCookieValue (value) {
  17598. for (const char of value) {
  17599. const code = char.charCodeAt(0)
  17600. if (
  17601. code < 0x21 || // exclude CTLs (0-31)
  17602. code === 0x22 ||
  17603. code === 0x2C ||
  17604. code === 0x3B ||
  17605. code === 0x5C ||
  17606. code > 0x7E // non-ascii
  17607. ) {
  17608. throw new Error('Invalid header value')
  17609. }
  17610. }
  17611. }
  17612. /**
  17613. * path-value = <any CHAR except CTLs or ";">
  17614. * @param {string} path
  17615. */
  17616. function validateCookiePath (path) {
  17617. for (const char of path) {
  17618. const code = char.charCodeAt(0)
  17619. if (code < 0x21 || char === ';') {
  17620. throw new Error('Invalid cookie path')
  17621. }
  17622. }
  17623. }
  17624. /**
  17625. * I have no idea why these values aren't allowed to be honest,
  17626. * but Deno tests these. - Khafra
  17627. * @param {string} domain
  17628. */
  17629. function validateCookieDomain (domain) {
  17630. if (
  17631. domain.startsWith('-') ||
  17632. domain.endsWith('.') ||
  17633. domain.endsWith('-')
  17634. ) {
  17635. throw new Error('Invalid cookie domain')
  17636. }
  17637. }
  17638. /**
  17639. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17640. * @param {number|Date} date
  17641. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17642. ; fixed length/zone/capitalization subset of the format
  17643. ; see Section 3.3 of [RFC5322]
  17644. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17645. / %x54.75.65 ; "Tue", case-sensitive
  17646. / %x57.65.64 ; "Wed", case-sensitive
  17647. / %x54.68.75 ; "Thu", case-sensitive
  17648. / %x46.72.69 ; "Fri", case-sensitive
  17649. / %x53.61.74 ; "Sat", case-sensitive
  17650. / %x53.75.6E ; "Sun", case-sensitive
  17651. date1 = day SP month SP year
  17652. ; e.g., 02 Jun 1982
  17653. day = 2DIGIT
  17654. month = %x4A.61.6E ; "Jan", case-sensitive
  17655. / %x46.65.62 ; "Feb", case-sensitive
  17656. / %x4D.61.72 ; "Mar", case-sensitive
  17657. / %x41.70.72 ; "Apr", case-sensitive
  17658. / %x4D.61.79 ; "May", case-sensitive
  17659. / %x4A.75.6E ; "Jun", case-sensitive
  17660. / %x4A.75.6C ; "Jul", case-sensitive
  17661. / %x41.75.67 ; "Aug", case-sensitive
  17662. / %x53.65.70 ; "Sep", case-sensitive
  17663. / %x4F.63.74 ; "Oct", case-sensitive
  17664. / %x4E.6F.76 ; "Nov", case-sensitive
  17665. / %x44.65.63 ; "Dec", case-sensitive
  17666. year = 4DIGIT
  17667. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17668. time-of-day = hour ":" minute ":" second
  17669. ; 00:00:00 - 23:59:60 (leap second)
  17670. hour = 2DIGIT
  17671. minute = 2DIGIT
  17672. second = 2DIGIT
  17673. */
  17674. function toIMFDate (date) {
  17675. if (typeof date === 'number') {
  17676. date = new Date(date)
  17677. }
  17678. const days = [
  17679. 'Sun', 'Mon', 'Tue', 'Wed',
  17680. 'Thu', 'Fri', 'Sat'
  17681. ]
  17682. const months = [
  17683. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17684. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17685. ]
  17686. const dayName = days[date.getUTCDay()]
  17687. const day = date.getUTCDate().toString().padStart(2, '0')
  17688. const month = months[date.getUTCMonth()]
  17689. const year = date.getUTCFullYear()
  17690. const hour = date.getUTCHours().toString().padStart(2, '0')
  17691. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17692. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17693. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17694. }
  17695. /**
  17696. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17697. ; In practice, both expires-av and max-age-av
  17698. ; are limited to dates representable by the
  17699. ; user agent.
  17700. * @param {number} maxAge
  17701. */
  17702. function validateCookieMaxAge (maxAge) {
  17703. if (maxAge < 0) {
  17704. throw new Error('Invalid cookie max-age')
  17705. }
  17706. }
  17707. /**
  17708. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17709. * @param {import('./index').Cookie} cookie
  17710. */
  17711. function stringify (cookie) {
  17712. if (cookie.name.length === 0) {
  17713. return null
  17714. }
  17715. validateCookieName(cookie.name)
  17716. validateCookieValue(cookie.value)
  17717. const out = [`${cookie.name}=${cookie.value}`]
  17718. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17719. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17720. if (cookie.name.startsWith('__Secure-')) {
  17721. cookie.secure = true
  17722. }
  17723. if (cookie.name.startsWith('__Host-')) {
  17724. cookie.secure = true
  17725. cookie.domain = null
  17726. cookie.path = '/'
  17727. }
  17728. if (cookie.secure) {
  17729. out.push('Secure')
  17730. }
  17731. if (cookie.httpOnly) {
  17732. out.push('HttpOnly')
  17733. }
  17734. if (typeof cookie.maxAge === 'number') {
  17735. validateCookieMaxAge(cookie.maxAge)
  17736. out.push(`Max-Age=${cookie.maxAge}`)
  17737. }
  17738. if (cookie.domain) {
  17739. validateCookieDomain(cookie.domain)
  17740. out.push(`Domain=${cookie.domain}`)
  17741. }
  17742. if (cookie.path) {
  17743. validateCookiePath(cookie.path)
  17744. out.push(`Path=${cookie.path}`)
  17745. }
  17746. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17747. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17748. }
  17749. if (cookie.sameSite) {
  17750. out.push(`SameSite=${cookie.sameSite}`)
  17751. }
  17752. for (const part of cookie.unparsed) {
  17753. if (!part.includes('=')) {
  17754. throw new Error('Invalid unparsed')
  17755. }
  17756. const [key, ...value] = part.split('=')
  17757. out.push(`${key.trim()}=${value.join('=')}`)
  17758. }
  17759. return out.join('; ')
  17760. }
  17761. module.exports = {
  17762. isCTLExcludingHtab,
  17763. validateCookieName,
  17764. validateCookiePath,
  17765. validateCookieValue,
  17766. toIMFDate,
  17767. stringify
  17768. }
  17769. /***/ }),
  17770. /***/ 2067:
  17771. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17772. "use strict";
  17773. const net = __nccwpck_require__(1808)
  17774. const assert = __nccwpck_require__(9491)
  17775. const util = __nccwpck_require__(3983)
  17776. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17777. let tls // include tls conditionally since it is not always available
  17778. // TODO: session re-use does not wait for the first
  17779. // connection to resolve the session and might therefore
  17780. // resolve the same servername multiple times even when
  17781. // re-use is enabled.
  17782. let SessionCache
  17783. // FIXME: remove workaround when the Node bug is fixed
  17784. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17785. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17786. SessionCache = class WeakSessionCache {
  17787. constructor (maxCachedSessions) {
  17788. this._maxCachedSessions = maxCachedSessions
  17789. this._sessionCache = new Map()
  17790. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17791. if (this._sessionCache.size < this._maxCachedSessions) {
  17792. return
  17793. }
  17794. const ref = this._sessionCache.get(key)
  17795. if (ref !== undefined && ref.deref() === undefined) {
  17796. this._sessionCache.delete(key)
  17797. }
  17798. })
  17799. }
  17800. get (sessionKey) {
  17801. const ref = this._sessionCache.get(sessionKey)
  17802. return ref ? ref.deref() : null
  17803. }
  17804. set (sessionKey, session) {
  17805. if (this._maxCachedSessions === 0) {
  17806. return
  17807. }
  17808. this._sessionCache.set(sessionKey, new WeakRef(session))
  17809. this._sessionRegistry.register(session, sessionKey)
  17810. }
  17811. }
  17812. } else {
  17813. SessionCache = class SimpleSessionCache {
  17814. constructor (maxCachedSessions) {
  17815. this._maxCachedSessions = maxCachedSessions
  17816. this._sessionCache = new Map()
  17817. }
  17818. get (sessionKey) {
  17819. return this._sessionCache.get(sessionKey)
  17820. }
  17821. set (sessionKey, session) {
  17822. if (this._maxCachedSessions === 0) {
  17823. return
  17824. }
  17825. if (this._sessionCache.size >= this._maxCachedSessions) {
  17826. // remove the oldest session
  17827. const { value: oldestKey } = this._sessionCache.keys().next()
  17828. this._sessionCache.delete(oldestKey)
  17829. }
  17830. this._sessionCache.set(sessionKey, session)
  17831. }
  17832. }
  17833. }
  17834. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17835. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17836. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17837. }
  17838. const options = { path: socketPath, ...opts }
  17839. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17840. timeout = timeout == null ? 10e3 : timeout
  17841. allowH2 = allowH2 != null ? allowH2 : false
  17842. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17843. let socket
  17844. if (protocol === 'https:') {
  17845. if (!tls) {
  17846. tls = __nccwpck_require__(4404)
  17847. }
  17848. servername = servername || options.servername || util.getServerName(host) || null
  17849. const sessionKey = servername || hostname
  17850. const session = sessionCache.get(sessionKey) || null
  17851. assert(sessionKey)
  17852. socket = tls.connect({
  17853. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17854. ...options,
  17855. servername,
  17856. session,
  17857. localAddress,
  17858. // TODO(HTTP/2): Add support for h2c
  17859. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17860. socket: httpSocket, // upgrade socket connection
  17861. port: port || 443,
  17862. host: hostname
  17863. })
  17864. socket
  17865. .on('session', function (session) {
  17866. // TODO (fix): Can a session become invalid once established? Don't think so?
  17867. sessionCache.set(sessionKey, session)
  17868. })
  17869. } else {
  17870. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17871. socket = net.connect({
  17872. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17873. ...options,
  17874. localAddress,
  17875. port: port || 80,
  17876. host: hostname
  17877. })
  17878. }
  17879. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17880. if (options.keepAlive == null || options.keepAlive) {
  17881. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17882. socket.setKeepAlive(true, keepAliveInitialDelay)
  17883. }
  17884. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17885. socket
  17886. .setNoDelay(true)
  17887. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17888. cancelTimeout()
  17889. if (callback) {
  17890. const cb = callback
  17891. callback = null
  17892. cb(null, this)
  17893. }
  17894. })
  17895. .on('error', function (err) {
  17896. cancelTimeout()
  17897. if (callback) {
  17898. const cb = callback
  17899. callback = null
  17900. cb(err)
  17901. }
  17902. })
  17903. return socket
  17904. }
  17905. }
  17906. function setupTimeout (onConnectTimeout, timeout) {
  17907. if (!timeout) {
  17908. return () => {}
  17909. }
  17910. let s1 = null
  17911. let s2 = null
  17912. const timeoutId = setTimeout(() => {
  17913. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17914. s1 = setImmediate(() => {
  17915. if (process.platform === 'win32') {
  17916. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17917. s2 = setImmediate(() => onConnectTimeout())
  17918. } else {
  17919. onConnectTimeout()
  17920. }
  17921. })
  17922. }, timeout)
  17923. return () => {
  17924. clearTimeout(timeoutId)
  17925. clearImmediate(s1)
  17926. clearImmediate(s2)
  17927. }
  17928. }
  17929. function onConnectTimeout (socket) {
  17930. util.destroy(socket, new ConnectTimeoutError())
  17931. }
  17932. module.exports = buildConnector
  17933. /***/ }),
  17934. /***/ 4462:
  17935. /***/ ((module) => {
  17936. "use strict";
  17937. /** @type {Record<string, string | undefined>} */
  17938. const headerNameLowerCasedRecord = {}
  17939. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17940. const wellknownHeaderNames = [
  17941. 'Accept',
  17942. 'Accept-Encoding',
  17943. 'Accept-Language',
  17944. 'Accept-Ranges',
  17945. 'Access-Control-Allow-Credentials',
  17946. 'Access-Control-Allow-Headers',
  17947. 'Access-Control-Allow-Methods',
  17948. 'Access-Control-Allow-Origin',
  17949. 'Access-Control-Expose-Headers',
  17950. 'Access-Control-Max-Age',
  17951. 'Access-Control-Request-Headers',
  17952. 'Access-Control-Request-Method',
  17953. 'Age',
  17954. 'Allow',
  17955. 'Alt-Svc',
  17956. 'Alt-Used',
  17957. 'Authorization',
  17958. 'Cache-Control',
  17959. 'Clear-Site-Data',
  17960. 'Connection',
  17961. 'Content-Disposition',
  17962. 'Content-Encoding',
  17963. 'Content-Language',
  17964. 'Content-Length',
  17965. 'Content-Location',
  17966. 'Content-Range',
  17967. 'Content-Security-Policy',
  17968. 'Content-Security-Policy-Report-Only',
  17969. 'Content-Type',
  17970. 'Cookie',
  17971. 'Cross-Origin-Embedder-Policy',
  17972. 'Cross-Origin-Opener-Policy',
  17973. 'Cross-Origin-Resource-Policy',
  17974. 'Date',
  17975. 'Device-Memory',
  17976. 'Downlink',
  17977. 'ECT',
  17978. 'ETag',
  17979. 'Expect',
  17980. 'Expect-CT',
  17981. 'Expires',
  17982. 'Forwarded',
  17983. 'From',
  17984. 'Host',
  17985. 'If-Match',
  17986. 'If-Modified-Since',
  17987. 'If-None-Match',
  17988. 'If-Range',
  17989. 'If-Unmodified-Since',
  17990. 'Keep-Alive',
  17991. 'Last-Modified',
  17992. 'Link',
  17993. 'Location',
  17994. 'Max-Forwards',
  17995. 'Origin',
  17996. 'Permissions-Policy',
  17997. 'Pragma',
  17998. 'Proxy-Authenticate',
  17999. 'Proxy-Authorization',
  18000. 'RTT',
  18001. 'Range',
  18002. 'Referer',
  18003. 'Referrer-Policy',
  18004. 'Refresh',
  18005. 'Retry-After',
  18006. 'Sec-WebSocket-Accept',
  18007. 'Sec-WebSocket-Extensions',
  18008. 'Sec-WebSocket-Key',
  18009. 'Sec-WebSocket-Protocol',
  18010. 'Sec-WebSocket-Version',
  18011. 'Server',
  18012. 'Server-Timing',
  18013. 'Service-Worker-Allowed',
  18014. 'Service-Worker-Navigation-Preload',
  18015. 'Set-Cookie',
  18016. 'SourceMap',
  18017. 'Strict-Transport-Security',
  18018. 'Supports-Loading-Mode',
  18019. 'TE',
  18020. 'Timing-Allow-Origin',
  18021. 'Trailer',
  18022. 'Transfer-Encoding',
  18023. 'Upgrade',
  18024. 'Upgrade-Insecure-Requests',
  18025. 'User-Agent',
  18026. 'Vary',
  18027. 'Via',
  18028. 'WWW-Authenticate',
  18029. 'X-Content-Type-Options',
  18030. 'X-DNS-Prefetch-Control',
  18031. 'X-Frame-Options',
  18032. 'X-Permitted-Cross-Domain-Policies',
  18033. 'X-Powered-By',
  18034. 'X-Requested-With',
  18035. 'X-XSS-Protection'
  18036. ]
  18037. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  18038. const key = wellknownHeaderNames[i]
  18039. const lowerCasedKey = key.toLowerCase()
  18040. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  18041. lowerCasedKey
  18042. }
  18043. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  18044. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  18045. module.exports = {
  18046. wellknownHeaderNames,
  18047. headerNameLowerCasedRecord
  18048. }
  18049. /***/ }),
  18050. /***/ 8045:
  18051. /***/ ((module) => {
  18052. "use strict";
  18053. class UndiciError extends Error {
  18054. constructor (message) {
  18055. super(message)
  18056. this.name = 'UndiciError'
  18057. this.code = 'UND_ERR'
  18058. }
  18059. }
  18060. class ConnectTimeoutError extends UndiciError {
  18061. constructor (message) {
  18062. super(message)
  18063. Error.captureStackTrace(this, ConnectTimeoutError)
  18064. this.name = 'ConnectTimeoutError'
  18065. this.message = message || 'Connect Timeout Error'
  18066. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  18067. }
  18068. }
  18069. class HeadersTimeoutError extends UndiciError {
  18070. constructor (message) {
  18071. super(message)
  18072. Error.captureStackTrace(this, HeadersTimeoutError)
  18073. this.name = 'HeadersTimeoutError'
  18074. this.message = message || 'Headers Timeout Error'
  18075. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  18076. }
  18077. }
  18078. class HeadersOverflowError extends UndiciError {
  18079. constructor (message) {
  18080. super(message)
  18081. Error.captureStackTrace(this, HeadersOverflowError)
  18082. this.name = 'HeadersOverflowError'
  18083. this.message = message || 'Headers Overflow Error'
  18084. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  18085. }
  18086. }
  18087. class BodyTimeoutError extends UndiciError {
  18088. constructor (message) {
  18089. super(message)
  18090. Error.captureStackTrace(this, BodyTimeoutError)
  18091. this.name = 'BodyTimeoutError'
  18092. this.message = message || 'Body Timeout Error'
  18093. this.code = 'UND_ERR_BODY_TIMEOUT'
  18094. }
  18095. }
  18096. class ResponseStatusCodeError extends UndiciError {
  18097. constructor (message, statusCode, headers, body) {
  18098. super(message)
  18099. Error.captureStackTrace(this, ResponseStatusCodeError)
  18100. this.name = 'ResponseStatusCodeError'
  18101. this.message = message || 'Response Status Code Error'
  18102. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  18103. this.body = body
  18104. this.status = statusCode
  18105. this.statusCode = statusCode
  18106. this.headers = headers
  18107. }
  18108. }
  18109. class InvalidArgumentError extends UndiciError {
  18110. constructor (message) {
  18111. super(message)
  18112. Error.captureStackTrace(this, InvalidArgumentError)
  18113. this.name = 'InvalidArgumentError'
  18114. this.message = message || 'Invalid Argument Error'
  18115. this.code = 'UND_ERR_INVALID_ARG'
  18116. }
  18117. }
  18118. class InvalidReturnValueError extends UndiciError {
  18119. constructor (message) {
  18120. super(message)
  18121. Error.captureStackTrace(this, InvalidReturnValueError)
  18122. this.name = 'InvalidReturnValueError'
  18123. this.message = message || 'Invalid Return Value Error'
  18124. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  18125. }
  18126. }
  18127. class RequestAbortedError extends UndiciError {
  18128. constructor (message) {
  18129. super(message)
  18130. Error.captureStackTrace(this, RequestAbortedError)
  18131. this.name = 'AbortError'
  18132. this.message = message || 'Request aborted'
  18133. this.code = 'UND_ERR_ABORTED'
  18134. }
  18135. }
  18136. class InformationalError extends UndiciError {
  18137. constructor (message) {
  18138. super(message)
  18139. Error.captureStackTrace(this, InformationalError)
  18140. this.name = 'InformationalError'
  18141. this.message = message || 'Request information'
  18142. this.code = 'UND_ERR_INFO'
  18143. }
  18144. }
  18145. class RequestContentLengthMismatchError extends UndiciError {
  18146. constructor (message) {
  18147. super(message)
  18148. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  18149. this.name = 'RequestContentLengthMismatchError'
  18150. this.message = message || 'Request body length does not match content-length header'
  18151. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  18152. }
  18153. }
  18154. class ResponseContentLengthMismatchError extends UndiciError {
  18155. constructor (message) {
  18156. super(message)
  18157. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  18158. this.name = 'ResponseContentLengthMismatchError'
  18159. this.message = message || 'Response body length does not match content-length header'
  18160. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  18161. }
  18162. }
  18163. class ClientDestroyedError extends UndiciError {
  18164. constructor (message) {
  18165. super(message)
  18166. Error.captureStackTrace(this, ClientDestroyedError)
  18167. this.name = 'ClientDestroyedError'
  18168. this.message = message || 'The client is destroyed'
  18169. this.code = 'UND_ERR_DESTROYED'
  18170. }
  18171. }
  18172. class ClientClosedError extends UndiciError {
  18173. constructor (message) {
  18174. super(message)
  18175. Error.captureStackTrace(this, ClientClosedError)
  18176. this.name = 'ClientClosedError'
  18177. this.message = message || 'The client is closed'
  18178. this.code = 'UND_ERR_CLOSED'
  18179. }
  18180. }
  18181. class SocketError extends UndiciError {
  18182. constructor (message, socket) {
  18183. super(message)
  18184. Error.captureStackTrace(this, SocketError)
  18185. this.name = 'SocketError'
  18186. this.message = message || 'Socket error'
  18187. this.code = 'UND_ERR_SOCKET'
  18188. this.socket = socket
  18189. }
  18190. }
  18191. class NotSupportedError extends UndiciError {
  18192. constructor (message) {
  18193. super(message)
  18194. Error.captureStackTrace(this, NotSupportedError)
  18195. this.name = 'NotSupportedError'
  18196. this.message = message || 'Not supported error'
  18197. this.code = 'UND_ERR_NOT_SUPPORTED'
  18198. }
  18199. }
  18200. class BalancedPoolMissingUpstreamError extends UndiciError {
  18201. constructor (message) {
  18202. super(message)
  18203. Error.captureStackTrace(this, NotSupportedError)
  18204. this.name = 'MissingUpstreamError'
  18205. this.message = message || 'No upstream has been added to the BalancedPool'
  18206. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  18207. }
  18208. }
  18209. class HTTPParserError extends Error {
  18210. constructor (message, code, data) {
  18211. super(message)
  18212. Error.captureStackTrace(this, HTTPParserError)
  18213. this.name = 'HTTPParserError'
  18214. this.code = code ? `HPE_${code}` : undefined
  18215. this.data = data ? data.toString() : undefined
  18216. }
  18217. }
  18218. class ResponseExceededMaxSizeError extends UndiciError {
  18219. constructor (message) {
  18220. super(message)
  18221. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  18222. this.name = 'ResponseExceededMaxSizeError'
  18223. this.message = message || 'Response content exceeded max size'
  18224. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  18225. }
  18226. }
  18227. class RequestRetryError extends UndiciError {
  18228. constructor (message, code, { headers, data }) {
  18229. super(message)
  18230. Error.captureStackTrace(this, RequestRetryError)
  18231. this.name = 'RequestRetryError'
  18232. this.message = message || 'Request retry error'
  18233. this.code = 'UND_ERR_REQ_RETRY'
  18234. this.statusCode = code
  18235. this.data = data
  18236. this.headers = headers
  18237. }
  18238. }
  18239. module.exports = {
  18240. HTTPParserError,
  18241. UndiciError,
  18242. HeadersTimeoutError,
  18243. HeadersOverflowError,
  18244. BodyTimeoutError,
  18245. RequestContentLengthMismatchError,
  18246. ConnectTimeoutError,
  18247. ResponseStatusCodeError,
  18248. InvalidArgumentError,
  18249. InvalidReturnValueError,
  18250. RequestAbortedError,
  18251. ClientDestroyedError,
  18252. ClientClosedError,
  18253. InformationalError,
  18254. SocketError,
  18255. NotSupportedError,
  18256. ResponseContentLengthMismatchError,
  18257. BalancedPoolMissingUpstreamError,
  18258. ResponseExceededMaxSizeError,
  18259. RequestRetryError
  18260. }
  18261. /***/ }),
  18262. /***/ 2905:
  18263. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18264. "use strict";
  18265. const {
  18266. InvalidArgumentError,
  18267. NotSupportedError
  18268. } = __nccwpck_require__(8045)
  18269. const assert = __nccwpck_require__(9491)
  18270. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18271. const util = __nccwpck_require__(3983)
  18272. // tokenRegExp and headerCharRegex have been lifted from
  18273. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18274. /**
  18275. * Verifies that the given val is a valid HTTP token
  18276. * per the rules defined in RFC 7230
  18277. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18278. */
  18279. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18280. /**
  18281. * Matches if val contains an invalid field-vchar
  18282. * field-value = *( field-content / obs-fold )
  18283. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18284. * field-vchar = VCHAR / obs-text
  18285. */
  18286. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18287. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18288. const invalidPathRegex = /[^\u0021-\u00ff]/
  18289. const kHandler = Symbol('handler')
  18290. const channels = {}
  18291. let extractBody
  18292. try {
  18293. const diagnosticsChannel = __nccwpck_require__(7643)
  18294. channels.create = diagnosticsChannel.channel('undici:request:create')
  18295. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18296. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18297. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18298. channels.error = diagnosticsChannel.channel('undici:request:error')
  18299. } catch {
  18300. channels.create = { hasSubscribers: false }
  18301. channels.bodySent = { hasSubscribers: false }
  18302. channels.headers = { hasSubscribers: false }
  18303. channels.trailers = { hasSubscribers: false }
  18304. channels.error = { hasSubscribers: false }
  18305. }
  18306. class Request {
  18307. constructor (origin, {
  18308. path,
  18309. method,
  18310. body,
  18311. headers,
  18312. query,
  18313. idempotent,
  18314. blocking,
  18315. upgrade,
  18316. headersTimeout,
  18317. bodyTimeout,
  18318. reset,
  18319. throwOnError,
  18320. expectContinue
  18321. }, handler) {
  18322. if (typeof path !== 'string') {
  18323. throw new InvalidArgumentError('path must be a string')
  18324. } else if (
  18325. path[0] !== '/' &&
  18326. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18327. method !== 'CONNECT'
  18328. ) {
  18329. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18330. } else if (invalidPathRegex.exec(path) !== null) {
  18331. throw new InvalidArgumentError('invalid request path')
  18332. }
  18333. if (typeof method !== 'string') {
  18334. throw new InvalidArgumentError('method must be a string')
  18335. } else if (tokenRegExp.exec(method) === null) {
  18336. throw new InvalidArgumentError('invalid request method')
  18337. }
  18338. if (upgrade && typeof upgrade !== 'string') {
  18339. throw new InvalidArgumentError('upgrade must be a string')
  18340. }
  18341. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18342. throw new InvalidArgumentError('invalid headersTimeout')
  18343. }
  18344. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18345. throw new InvalidArgumentError('invalid bodyTimeout')
  18346. }
  18347. if (reset != null && typeof reset !== 'boolean') {
  18348. throw new InvalidArgumentError('invalid reset')
  18349. }
  18350. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18351. throw new InvalidArgumentError('invalid expectContinue')
  18352. }
  18353. this.headersTimeout = headersTimeout
  18354. this.bodyTimeout = bodyTimeout
  18355. this.throwOnError = throwOnError === true
  18356. this.method = method
  18357. this.abort = null
  18358. if (body == null) {
  18359. this.body = null
  18360. } else if (util.isStream(body)) {
  18361. this.body = body
  18362. const rState = this.body._readableState
  18363. if (!rState || !rState.autoDestroy) {
  18364. this.endHandler = function autoDestroy () {
  18365. util.destroy(this)
  18366. }
  18367. this.body.on('end', this.endHandler)
  18368. }
  18369. this.errorHandler = err => {
  18370. if (this.abort) {
  18371. this.abort(err)
  18372. } else {
  18373. this.error = err
  18374. }
  18375. }
  18376. this.body.on('error', this.errorHandler)
  18377. } else if (util.isBuffer(body)) {
  18378. this.body = body.byteLength ? body : null
  18379. } else if (ArrayBuffer.isView(body)) {
  18380. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18381. } else if (body instanceof ArrayBuffer) {
  18382. this.body = body.byteLength ? Buffer.from(body) : null
  18383. } else if (typeof body === 'string') {
  18384. this.body = body.length ? Buffer.from(body) : null
  18385. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18386. this.body = body
  18387. } else {
  18388. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18389. }
  18390. this.completed = false
  18391. this.aborted = false
  18392. this.upgrade = upgrade || null
  18393. this.path = query ? util.buildURL(path, query) : path
  18394. this.origin = origin
  18395. this.idempotent = idempotent == null
  18396. ? method === 'HEAD' || method === 'GET'
  18397. : idempotent
  18398. this.blocking = blocking == null ? false : blocking
  18399. this.reset = reset == null ? null : reset
  18400. this.host = null
  18401. this.contentLength = null
  18402. this.contentType = null
  18403. this.headers = ''
  18404. // Only for H2
  18405. this.expectContinue = expectContinue != null ? expectContinue : false
  18406. if (Array.isArray(headers)) {
  18407. if (headers.length % 2 !== 0) {
  18408. throw new InvalidArgumentError('headers array must be even')
  18409. }
  18410. for (let i = 0; i < headers.length; i += 2) {
  18411. processHeader(this, headers[i], headers[i + 1])
  18412. }
  18413. } else if (headers && typeof headers === 'object') {
  18414. const keys = Object.keys(headers)
  18415. for (let i = 0; i < keys.length; i++) {
  18416. const key = keys[i]
  18417. processHeader(this, key, headers[key])
  18418. }
  18419. } else if (headers != null) {
  18420. throw new InvalidArgumentError('headers must be an object or an array')
  18421. }
  18422. if (util.isFormDataLike(this.body)) {
  18423. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18424. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18425. }
  18426. if (!extractBody) {
  18427. extractBody = (__nccwpck_require__(9990).extractBody)
  18428. }
  18429. const [bodyStream, contentType] = extractBody(body)
  18430. if (this.contentType == null) {
  18431. this.contentType = contentType
  18432. this.headers += `content-type: ${contentType}\r\n`
  18433. }
  18434. this.body = bodyStream.stream
  18435. this.contentLength = bodyStream.length
  18436. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18437. this.contentType = body.type
  18438. this.headers += `content-type: ${body.type}\r\n`
  18439. }
  18440. util.validateHandler(handler, method, upgrade)
  18441. this.servername = util.getServerName(this.host)
  18442. this[kHandler] = handler
  18443. if (channels.create.hasSubscribers) {
  18444. channels.create.publish({ request: this })
  18445. }
  18446. }
  18447. onBodySent (chunk) {
  18448. if (this[kHandler].onBodySent) {
  18449. try {
  18450. return this[kHandler].onBodySent(chunk)
  18451. } catch (err) {
  18452. this.abort(err)
  18453. }
  18454. }
  18455. }
  18456. onRequestSent () {
  18457. if (channels.bodySent.hasSubscribers) {
  18458. channels.bodySent.publish({ request: this })
  18459. }
  18460. if (this[kHandler].onRequestSent) {
  18461. try {
  18462. return this[kHandler].onRequestSent()
  18463. } catch (err) {
  18464. this.abort(err)
  18465. }
  18466. }
  18467. }
  18468. onConnect (abort) {
  18469. assert(!this.aborted)
  18470. assert(!this.completed)
  18471. if (this.error) {
  18472. abort(this.error)
  18473. } else {
  18474. this.abort = abort
  18475. return this[kHandler].onConnect(abort)
  18476. }
  18477. }
  18478. onHeaders (statusCode, headers, resume, statusText) {
  18479. assert(!this.aborted)
  18480. assert(!this.completed)
  18481. if (channels.headers.hasSubscribers) {
  18482. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18483. }
  18484. try {
  18485. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18486. } catch (err) {
  18487. this.abort(err)
  18488. }
  18489. }
  18490. onData (chunk) {
  18491. assert(!this.aborted)
  18492. assert(!this.completed)
  18493. try {
  18494. return this[kHandler].onData(chunk)
  18495. } catch (err) {
  18496. this.abort(err)
  18497. return false
  18498. }
  18499. }
  18500. onUpgrade (statusCode, headers, socket) {
  18501. assert(!this.aborted)
  18502. assert(!this.completed)
  18503. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18504. }
  18505. onComplete (trailers) {
  18506. this.onFinally()
  18507. assert(!this.aborted)
  18508. this.completed = true
  18509. if (channels.trailers.hasSubscribers) {
  18510. channels.trailers.publish({ request: this, trailers })
  18511. }
  18512. try {
  18513. return this[kHandler].onComplete(trailers)
  18514. } catch (err) {
  18515. // TODO (fix): This might be a bad idea?
  18516. this.onError(err)
  18517. }
  18518. }
  18519. onError (error) {
  18520. this.onFinally()
  18521. if (channels.error.hasSubscribers) {
  18522. channels.error.publish({ request: this, error })
  18523. }
  18524. if (this.aborted) {
  18525. return
  18526. }
  18527. this.aborted = true
  18528. return this[kHandler].onError(error)
  18529. }
  18530. onFinally () {
  18531. if (this.errorHandler) {
  18532. this.body.off('error', this.errorHandler)
  18533. this.errorHandler = null
  18534. }
  18535. if (this.endHandler) {
  18536. this.body.off('end', this.endHandler)
  18537. this.endHandler = null
  18538. }
  18539. }
  18540. // TODO: adjust to support H2
  18541. addHeader (key, value) {
  18542. processHeader(this, key, value)
  18543. return this
  18544. }
  18545. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18546. // TODO: Migrate header parsing here, to make Requests
  18547. // HTTP agnostic
  18548. return new Request(origin, opts, handler)
  18549. }
  18550. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18551. const headers = opts.headers
  18552. opts = { ...opts, headers: null }
  18553. const request = new Request(origin, opts, handler)
  18554. request.headers = {}
  18555. if (Array.isArray(headers)) {
  18556. if (headers.length % 2 !== 0) {
  18557. throw new InvalidArgumentError('headers array must be even')
  18558. }
  18559. for (let i = 0; i < headers.length; i += 2) {
  18560. processHeader(request, headers[i], headers[i + 1], true)
  18561. }
  18562. } else if (headers && typeof headers === 'object') {
  18563. const keys = Object.keys(headers)
  18564. for (let i = 0; i < keys.length; i++) {
  18565. const key = keys[i]
  18566. processHeader(request, key, headers[key], true)
  18567. }
  18568. } else if (headers != null) {
  18569. throw new InvalidArgumentError('headers must be an object or an array')
  18570. }
  18571. return request
  18572. }
  18573. static [kHTTP2CopyHeaders] (raw) {
  18574. const rawHeaders = raw.split('\r\n')
  18575. const headers = {}
  18576. for (const header of rawHeaders) {
  18577. const [key, value] = header.split(': ')
  18578. if (value == null || value.length === 0) continue
  18579. if (headers[key]) headers[key] += `,${value}`
  18580. else headers[key] = value
  18581. }
  18582. return headers
  18583. }
  18584. }
  18585. function processHeaderValue (key, val, skipAppend) {
  18586. if (val && typeof val === 'object') {
  18587. throw new InvalidArgumentError(`invalid ${key} header`)
  18588. }
  18589. val = val != null ? `${val}` : ''
  18590. if (headerCharRegex.exec(val) !== null) {
  18591. throw new InvalidArgumentError(`invalid ${key} header`)
  18592. }
  18593. return skipAppend ? val : `${key}: ${val}\r\n`
  18594. }
  18595. function processHeader (request, key, val, skipAppend = false) {
  18596. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18597. throw new InvalidArgumentError(`invalid ${key} header`)
  18598. } else if (val === undefined) {
  18599. return
  18600. }
  18601. if (
  18602. request.host === null &&
  18603. key.length === 4 &&
  18604. key.toLowerCase() === 'host'
  18605. ) {
  18606. if (headerCharRegex.exec(val) !== null) {
  18607. throw new InvalidArgumentError(`invalid ${key} header`)
  18608. }
  18609. // Consumed by Client
  18610. request.host = val
  18611. } else if (
  18612. request.contentLength === null &&
  18613. key.length === 14 &&
  18614. key.toLowerCase() === 'content-length'
  18615. ) {
  18616. request.contentLength = parseInt(val, 10)
  18617. if (!Number.isFinite(request.contentLength)) {
  18618. throw new InvalidArgumentError('invalid content-length header')
  18619. }
  18620. } else if (
  18621. request.contentType === null &&
  18622. key.length === 12 &&
  18623. key.toLowerCase() === 'content-type'
  18624. ) {
  18625. request.contentType = val
  18626. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18627. else request.headers += processHeaderValue(key, val)
  18628. } else if (
  18629. key.length === 17 &&
  18630. key.toLowerCase() === 'transfer-encoding'
  18631. ) {
  18632. throw new InvalidArgumentError('invalid transfer-encoding header')
  18633. } else if (
  18634. key.length === 10 &&
  18635. key.toLowerCase() === 'connection'
  18636. ) {
  18637. const value = typeof val === 'string' ? val.toLowerCase() : null
  18638. if (value !== 'close' && value !== 'keep-alive') {
  18639. throw new InvalidArgumentError('invalid connection header')
  18640. } else if (value === 'close') {
  18641. request.reset = true
  18642. }
  18643. } else if (
  18644. key.length === 10 &&
  18645. key.toLowerCase() === 'keep-alive'
  18646. ) {
  18647. throw new InvalidArgumentError('invalid keep-alive header')
  18648. } else if (
  18649. key.length === 7 &&
  18650. key.toLowerCase() === 'upgrade'
  18651. ) {
  18652. throw new InvalidArgumentError('invalid upgrade header')
  18653. } else if (
  18654. key.length === 6 &&
  18655. key.toLowerCase() === 'expect'
  18656. ) {
  18657. throw new NotSupportedError('expect header not supported')
  18658. } else if (tokenRegExp.exec(key) === null) {
  18659. throw new InvalidArgumentError('invalid header key')
  18660. } else {
  18661. if (Array.isArray(val)) {
  18662. for (let i = 0; i < val.length; i++) {
  18663. if (skipAppend) {
  18664. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18665. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18666. } else {
  18667. request.headers += processHeaderValue(key, val[i])
  18668. }
  18669. }
  18670. } else {
  18671. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18672. else request.headers += processHeaderValue(key, val)
  18673. }
  18674. }
  18675. }
  18676. module.exports = Request
  18677. /***/ }),
  18678. /***/ 2785:
  18679. /***/ ((module) => {
  18680. module.exports = {
  18681. kClose: Symbol('close'),
  18682. kDestroy: Symbol('destroy'),
  18683. kDispatch: Symbol('dispatch'),
  18684. kUrl: Symbol('url'),
  18685. kWriting: Symbol('writing'),
  18686. kResuming: Symbol('resuming'),
  18687. kQueue: Symbol('queue'),
  18688. kConnect: Symbol('connect'),
  18689. kConnecting: Symbol('connecting'),
  18690. kHeadersList: Symbol('headers list'),
  18691. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18692. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18693. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18694. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18695. kKeepAlive: Symbol('keep alive'),
  18696. kHeadersTimeout: Symbol('headers timeout'),
  18697. kBodyTimeout: Symbol('body timeout'),
  18698. kServerName: Symbol('server name'),
  18699. kLocalAddress: Symbol('local address'),
  18700. kHost: Symbol('host'),
  18701. kNoRef: Symbol('no ref'),
  18702. kBodyUsed: Symbol('used'),
  18703. kRunning: Symbol('running'),
  18704. kBlocking: Symbol('blocking'),
  18705. kPending: Symbol('pending'),
  18706. kSize: Symbol('size'),
  18707. kBusy: Symbol('busy'),
  18708. kQueued: Symbol('queued'),
  18709. kFree: Symbol('free'),
  18710. kConnected: Symbol('connected'),
  18711. kClosed: Symbol('closed'),
  18712. kNeedDrain: Symbol('need drain'),
  18713. kReset: Symbol('reset'),
  18714. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18715. kMaxHeadersSize: Symbol('max headers size'),
  18716. kRunningIdx: Symbol('running index'),
  18717. kPendingIdx: Symbol('pending index'),
  18718. kError: Symbol('error'),
  18719. kClients: Symbol('clients'),
  18720. kClient: Symbol('client'),
  18721. kParser: Symbol('parser'),
  18722. kOnDestroyed: Symbol('destroy callbacks'),
  18723. kPipelining: Symbol('pipelining'),
  18724. kSocket: Symbol('socket'),
  18725. kHostHeader: Symbol('host header'),
  18726. kConnector: Symbol('connector'),
  18727. kStrictContentLength: Symbol('strict content length'),
  18728. kMaxRedirections: Symbol('maxRedirections'),
  18729. kMaxRequests: Symbol('maxRequestsPerClient'),
  18730. kProxy: Symbol('proxy agent options'),
  18731. kCounter: Symbol('socket request counter'),
  18732. kInterceptors: Symbol('dispatch interceptors'),
  18733. kMaxResponseSize: Symbol('max response size'),
  18734. kHTTP2Session: Symbol('http2Session'),
  18735. kHTTP2SessionState: Symbol('http2Session state'),
  18736. kHTTP2BuildRequest: Symbol('http2 build request'),
  18737. kHTTP1BuildRequest: Symbol('http1 build request'),
  18738. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18739. kHTTPConnVersion: Symbol('http connection version'),
  18740. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18741. kConstruct: Symbol('constructable')
  18742. }
  18743. /***/ }),
  18744. /***/ 3983:
  18745. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18746. "use strict";
  18747. const assert = __nccwpck_require__(9491)
  18748. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18749. const { IncomingMessage } = __nccwpck_require__(3685)
  18750. const stream = __nccwpck_require__(2781)
  18751. const net = __nccwpck_require__(1808)
  18752. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18753. const { Blob } = __nccwpck_require__(4300)
  18754. const nodeUtil = __nccwpck_require__(3837)
  18755. const { stringify } = __nccwpck_require__(3477)
  18756. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18757. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18758. function nop () {}
  18759. function isStream (obj) {
  18760. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18761. }
  18762. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18763. function isBlobLike (object) {
  18764. return (Blob && object instanceof Blob) || (
  18765. object &&
  18766. typeof object === 'object' &&
  18767. (typeof object.stream === 'function' ||
  18768. typeof object.arrayBuffer === 'function') &&
  18769. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18770. )
  18771. }
  18772. function buildURL (url, queryParams) {
  18773. if (url.includes('?') || url.includes('#')) {
  18774. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18775. }
  18776. const stringified = stringify(queryParams)
  18777. if (stringified) {
  18778. url += '?' + stringified
  18779. }
  18780. return url
  18781. }
  18782. function parseURL (url) {
  18783. if (typeof url === 'string') {
  18784. url = new URL(url)
  18785. if (!/^https?:/.test(url.origin || url.protocol)) {
  18786. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18787. }
  18788. return url
  18789. }
  18790. if (!url || typeof url !== 'object') {
  18791. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18792. }
  18793. if (!/^https?:/.test(url.origin || url.protocol)) {
  18794. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18795. }
  18796. if (!(url instanceof URL)) {
  18797. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18798. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18799. }
  18800. if (url.path != null && typeof url.path !== 'string') {
  18801. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18802. }
  18803. if (url.pathname != null && typeof url.pathname !== 'string') {
  18804. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18805. }
  18806. if (url.hostname != null && typeof url.hostname !== 'string') {
  18807. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18808. }
  18809. if (url.origin != null && typeof url.origin !== 'string') {
  18810. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18811. }
  18812. const port = url.port != null
  18813. ? url.port
  18814. : (url.protocol === 'https:' ? 443 : 80)
  18815. let origin = url.origin != null
  18816. ? url.origin
  18817. : `${url.protocol}//${url.hostname}:${port}`
  18818. let path = url.path != null
  18819. ? url.path
  18820. : `${url.pathname || ''}${url.search || ''}`
  18821. if (origin.endsWith('/')) {
  18822. origin = origin.substring(0, origin.length - 1)
  18823. }
  18824. if (path && !path.startsWith('/')) {
  18825. path = `/${path}`
  18826. }
  18827. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18828. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18829. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18830. // If first parameter is an absolute URL, a given second param will be ignored.
  18831. url = new URL(origin + path)
  18832. }
  18833. return url
  18834. }
  18835. function parseOrigin (url) {
  18836. url = parseURL(url)
  18837. if (url.pathname !== '/' || url.search || url.hash) {
  18838. throw new InvalidArgumentError('invalid url')
  18839. }
  18840. return url
  18841. }
  18842. function getHostname (host) {
  18843. if (host[0] === '[') {
  18844. const idx = host.indexOf(']')
  18845. assert(idx !== -1)
  18846. return host.substring(1, idx)
  18847. }
  18848. const idx = host.indexOf(':')
  18849. if (idx === -1) return host
  18850. return host.substring(0, idx)
  18851. }
  18852. // IP addresses are not valid server names per RFC6066
  18853. // > Currently, the only server names supported are DNS hostnames
  18854. function getServerName (host) {
  18855. if (!host) {
  18856. return null
  18857. }
  18858. assert.strictEqual(typeof host, 'string')
  18859. const servername = getHostname(host)
  18860. if (net.isIP(servername)) {
  18861. return ''
  18862. }
  18863. return servername
  18864. }
  18865. function deepClone (obj) {
  18866. return JSON.parse(JSON.stringify(obj))
  18867. }
  18868. function isAsyncIterable (obj) {
  18869. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18870. }
  18871. function isIterable (obj) {
  18872. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18873. }
  18874. function bodyLength (body) {
  18875. if (body == null) {
  18876. return 0
  18877. } else if (isStream(body)) {
  18878. const state = body._readableState
  18879. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18880. ? state.length
  18881. : null
  18882. } else if (isBlobLike(body)) {
  18883. return body.size != null ? body.size : null
  18884. } else if (isBuffer(body)) {
  18885. return body.byteLength
  18886. }
  18887. return null
  18888. }
  18889. function isDestroyed (stream) {
  18890. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18891. }
  18892. function isReadableAborted (stream) {
  18893. const state = stream && stream._readableState
  18894. return isDestroyed(stream) && state && !state.endEmitted
  18895. }
  18896. function destroy (stream, err) {
  18897. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18898. return
  18899. }
  18900. if (typeof stream.destroy === 'function') {
  18901. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18902. // See: https://github.com/nodejs/node/pull/38505/files
  18903. stream.socket = null
  18904. }
  18905. stream.destroy(err)
  18906. } else if (err) {
  18907. process.nextTick((stream, err) => {
  18908. stream.emit('error', err)
  18909. }, stream, err)
  18910. }
  18911. if (stream.destroyed !== true) {
  18912. stream[kDestroyed] = true
  18913. }
  18914. }
  18915. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18916. function parseKeepAliveTimeout (val) {
  18917. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18918. return m ? parseInt(m[1], 10) * 1000 : null
  18919. }
  18920. /**
  18921. * Retrieves a header name and returns its lowercase value.
  18922. * @param {string | Buffer} value Header name
  18923. * @returns {string}
  18924. */
  18925. function headerNameToString (value) {
  18926. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18927. }
  18928. function parseHeaders (headers, obj = {}) {
  18929. // For H2 support
  18930. if (!Array.isArray(headers)) return headers
  18931. for (let i = 0; i < headers.length; i += 2) {
  18932. const key = headers[i].toString().toLowerCase()
  18933. let val = obj[key]
  18934. if (!val) {
  18935. if (Array.isArray(headers[i + 1])) {
  18936. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18937. } else {
  18938. obj[key] = headers[i + 1].toString('utf8')
  18939. }
  18940. } else {
  18941. if (!Array.isArray(val)) {
  18942. val = [val]
  18943. obj[key] = val
  18944. }
  18945. val.push(headers[i + 1].toString('utf8'))
  18946. }
  18947. }
  18948. // See https://github.com/nodejs/node/pull/46528
  18949. if ('content-length' in obj && 'content-disposition' in obj) {
  18950. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18951. }
  18952. return obj
  18953. }
  18954. function parseRawHeaders (headers) {
  18955. const ret = []
  18956. let hasContentLength = false
  18957. let contentDispositionIdx = -1
  18958. for (let n = 0; n < headers.length; n += 2) {
  18959. const key = headers[n + 0].toString()
  18960. const val = headers[n + 1].toString('utf8')
  18961. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18962. ret.push(key, val)
  18963. hasContentLength = true
  18964. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18965. contentDispositionIdx = ret.push(key, val) - 1
  18966. } else {
  18967. ret.push(key, val)
  18968. }
  18969. }
  18970. // See https://github.com/nodejs/node/pull/46528
  18971. if (hasContentLength && contentDispositionIdx !== -1) {
  18972. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18973. }
  18974. return ret
  18975. }
  18976. function isBuffer (buffer) {
  18977. // See, https://github.com/mcollina/undici/pull/319
  18978. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18979. }
  18980. function validateHandler (handler, method, upgrade) {
  18981. if (!handler || typeof handler !== 'object') {
  18982. throw new InvalidArgumentError('handler must be an object')
  18983. }
  18984. if (typeof handler.onConnect !== 'function') {
  18985. throw new InvalidArgumentError('invalid onConnect method')
  18986. }
  18987. if (typeof handler.onError !== 'function') {
  18988. throw new InvalidArgumentError('invalid onError method')
  18989. }
  18990. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  18991. throw new InvalidArgumentError('invalid onBodySent method')
  18992. }
  18993. if (upgrade || method === 'CONNECT') {
  18994. if (typeof handler.onUpgrade !== 'function') {
  18995. throw new InvalidArgumentError('invalid onUpgrade method')
  18996. }
  18997. } else {
  18998. if (typeof handler.onHeaders !== 'function') {
  18999. throw new InvalidArgumentError('invalid onHeaders method')
  19000. }
  19001. if (typeof handler.onData !== 'function') {
  19002. throw new InvalidArgumentError('invalid onData method')
  19003. }
  19004. if (typeof handler.onComplete !== 'function') {
  19005. throw new InvalidArgumentError('invalid onComplete method')
  19006. }
  19007. }
  19008. }
  19009. // A body is disturbed if it has been read from and it cannot
  19010. // be re-used without losing state or data.
  19011. function isDisturbed (body) {
  19012. return !!(body && (
  19013. stream.isDisturbed
  19014. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  19015. : body[kBodyUsed] ||
  19016. body.readableDidRead ||
  19017. (body._readableState && body._readableState.dataEmitted) ||
  19018. isReadableAborted(body)
  19019. ))
  19020. }
  19021. function isErrored (body) {
  19022. return !!(body && (
  19023. stream.isErrored
  19024. ? stream.isErrored(body)
  19025. : /state: 'errored'/.test(nodeUtil.inspect(body)
  19026. )))
  19027. }
  19028. function isReadable (body) {
  19029. return !!(body && (
  19030. stream.isReadable
  19031. ? stream.isReadable(body)
  19032. : /state: 'readable'/.test(nodeUtil.inspect(body)
  19033. )))
  19034. }
  19035. function getSocketInfo (socket) {
  19036. return {
  19037. localAddress: socket.localAddress,
  19038. localPort: socket.localPort,
  19039. remoteAddress: socket.remoteAddress,
  19040. remotePort: socket.remotePort,
  19041. remoteFamily: socket.remoteFamily,
  19042. timeout: socket.timeout,
  19043. bytesWritten: socket.bytesWritten,
  19044. bytesRead: socket.bytesRead
  19045. }
  19046. }
  19047. async function * convertIterableToBuffer (iterable) {
  19048. for await (const chunk of iterable) {
  19049. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  19050. }
  19051. }
  19052. let ReadableStream
  19053. function ReadableStreamFrom (iterable) {
  19054. if (!ReadableStream) {
  19055. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19056. }
  19057. if (ReadableStream.from) {
  19058. return ReadableStream.from(convertIterableToBuffer(iterable))
  19059. }
  19060. let iterator
  19061. return new ReadableStream(
  19062. {
  19063. async start () {
  19064. iterator = iterable[Symbol.asyncIterator]()
  19065. },
  19066. async pull (controller) {
  19067. const { done, value } = await iterator.next()
  19068. if (done) {
  19069. queueMicrotask(() => {
  19070. controller.close()
  19071. })
  19072. } else {
  19073. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  19074. controller.enqueue(new Uint8Array(buf))
  19075. }
  19076. return controller.desiredSize > 0
  19077. },
  19078. async cancel (reason) {
  19079. await iterator.return()
  19080. }
  19081. },
  19082. 0
  19083. )
  19084. }
  19085. // The chunk should be a FormData instance and contains
  19086. // all the required methods.
  19087. function isFormDataLike (object) {
  19088. return (
  19089. object &&
  19090. typeof object === 'object' &&
  19091. typeof object.append === 'function' &&
  19092. typeof object.delete === 'function' &&
  19093. typeof object.get === 'function' &&
  19094. typeof object.getAll === 'function' &&
  19095. typeof object.has === 'function' &&
  19096. typeof object.set === 'function' &&
  19097. object[Symbol.toStringTag] === 'FormData'
  19098. )
  19099. }
  19100. function throwIfAborted (signal) {
  19101. if (!signal) { return }
  19102. if (typeof signal.throwIfAborted === 'function') {
  19103. signal.throwIfAborted()
  19104. } else {
  19105. if (signal.aborted) {
  19106. // DOMException not available < v17.0.0
  19107. const err = new Error('The operation was aborted')
  19108. err.name = 'AbortError'
  19109. throw err
  19110. }
  19111. }
  19112. }
  19113. function addAbortListener (signal, listener) {
  19114. if ('addEventListener' in signal) {
  19115. signal.addEventListener('abort', listener, { once: true })
  19116. return () => signal.removeEventListener('abort', listener)
  19117. }
  19118. signal.addListener('abort', listener)
  19119. return () => signal.removeListener('abort', listener)
  19120. }
  19121. const hasToWellFormed = !!String.prototype.toWellFormed
  19122. /**
  19123. * @param {string} val
  19124. */
  19125. function toUSVString (val) {
  19126. if (hasToWellFormed) {
  19127. return `${val}`.toWellFormed()
  19128. } else if (nodeUtil.toUSVString) {
  19129. return nodeUtil.toUSVString(val)
  19130. }
  19131. return `${val}`
  19132. }
  19133. // Parsed accordingly to RFC 9110
  19134. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  19135. function parseRangeHeader (range) {
  19136. if (range == null || range === '') return { start: 0, end: null, size: null }
  19137. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  19138. return m
  19139. ? {
  19140. start: parseInt(m[1]),
  19141. end: m[2] ? parseInt(m[2]) : null,
  19142. size: m[3] ? parseInt(m[3]) : null
  19143. }
  19144. : null
  19145. }
  19146. const kEnumerableProperty = Object.create(null)
  19147. kEnumerableProperty.enumerable = true
  19148. module.exports = {
  19149. kEnumerableProperty,
  19150. nop,
  19151. isDisturbed,
  19152. isErrored,
  19153. isReadable,
  19154. toUSVString,
  19155. isReadableAborted,
  19156. isBlobLike,
  19157. parseOrigin,
  19158. parseURL,
  19159. getServerName,
  19160. isStream,
  19161. isIterable,
  19162. isAsyncIterable,
  19163. isDestroyed,
  19164. headerNameToString,
  19165. parseRawHeaders,
  19166. parseHeaders,
  19167. parseKeepAliveTimeout,
  19168. destroy,
  19169. bodyLength,
  19170. deepClone,
  19171. ReadableStreamFrom,
  19172. isBuffer,
  19173. validateHandler,
  19174. getSocketInfo,
  19175. isFormDataLike,
  19176. buildURL,
  19177. throwIfAborted,
  19178. addAbortListener,
  19179. parseRangeHeader,
  19180. nodeMajor,
  19181. nodeMinor,
  19182. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  19183. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19184. }
  19185. /***/ }),
  19186. /***/ 4839:
  19187. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19188. "use strict";
  19189. const Dispatcher = __nccwpck_require__(412)
  19190. const {
  19191. ClientDestroyedError,
  19192. ClientClosedError,
  19193. InvalidArgumentError
  19194. } = __nccwpck_require__(8045)
  19195. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  19196. const kDestroyed = Symbol('destroyed')
  19197. const kClosed = Symbol('closed')
  19198. const kOnDestroyed = Symbol('onDestroyed')
  19199. const kOnClosed = Symbol('onClosed')
  19200. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  19201. class DispatcherBase extends Dispatcher {
  19202. constructor () {
  19203. super()
  19204. this[kDestroyed] = false
  19205. this[kOnDestroyed] = null
  19206. this[kClosed] = false
  19207. this[kOnClosed] = []
  19208. }
  19209. get destroyed () {
  19210. return this[kDestroyed]
  19211. }
  19212. get closed () {
  19213. return this[kClosed]
  19214. }
  19215. get interceptors () {
  19216. return this[kInterceptors]
  19217. }
  19218. set interceptors (newInterceptors) {
  19219. if (newInterceptors) {
  19220. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  19221. const interceptor = this[kInterceptors][i]
  19222. if (typeof interceptor !== 'function') {
  19223. throw new InvalidArgumentError('interceptor must be an function')
  19224. }
  19225. }
  19226. }
  19227. this[kInterceptors] = newInterceptors
  19228. }
  19229. close (callback) {
  19230. if (callback === undefined) {
  19231. return new Promise((resolve, reject) => {
  19232. this.close((err, data) => {
  19233. return err ? reject(err) : resolve(data)
  19234. })
  19235. })
  19236. }
  19237. if (typeof callback !== 'function') {
  19238. throw new InvalidArgumentError('invalid callback')
  19239. }
  19240. if (this[kDestroyed]) {
  19241. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  19242. return
  19243. }
  19244. if (this[kClosed]) {
  19245. if (this[kOnClosed]) {
  19246. this[kOnClosed].push(callback)
  19247. } else {
  19248. queueMicrotask(() => callback(null, null))
  19249. }
  19250. return
  19251. }
  19252. this[kClosed] = true
  19253. this[kOnClosed].push(callback)
  19254. const onClosed = () => {
  19255. const callbacks = this[kOnClosed]
  19256. this[kOnClosed] = null
  19257. for (let i = 0; i < callbacks.length; i++) {
  19258. callbacks[i](null, null)
  19259. }
  19260. }
  19261. // Should not error.
  19262. this[kClose]()
  19263. .then(() => this.destroy())
  19264. .then(() => {
  19265. queueMicrotask(onClosed)
  19266. })
  19267. }
  19268. destroy (err, callback) {
  19269. if (typeof err === 'function') {
  19270. callback = err
  19271. err = null
  19272. }
  19273. if (callback === undefined) {
  19274. return new Promise((resolve, reject) => {
  19275. this.destroy(err, (err, data) => {
  19276. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19277. })
  19278. })
  19279. }
  19280. if (typeof callback !== 'function') {
  19281. throw new InvalidArgumentError('invalid callback')
  19282. }
  19283. if (this[kDestroyed]) {
  19284. if (this[kOnDestroyed]) {
  19285. this[kOnDestroyed].push(callback)
  19286. } else {
  19287. queueMicrotask(() => callback(null, null))
  19288. }
  19289. return
  19290. }
  19291. if (!err) {
  19292. err = new ClientDestroyedError()
  19293. }
  19294. this[kDestroyed] = true
  19295. this[kOnDestroyed] = this[kOnDestroyed] || []
  19296. this[kOnDestroyed].push(callback)
  19297. const onDestroyed = () => {
  19298. const callbacks = this[kOnDestroyed]
  19299. this[kOnDestroyed] = null
  19300. for (let i = 0; i < callbacks.length; i++) {
  19301. callbacks[i](null, null)
  19302. }
  19303. }
  19304. // Should not error.
  19305. this[kDestroy](err).then(() => {
  19306. queueMicrotask(onDestroyed)
  19307. })
  19308. }
  19309. [kInterceptedDispatch] (opts, handler) {
  19310. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19311. this[kInterceptedDispatch] = this[kDispatch]
  19312. return this[kDispatch](opts, handler)
  19313. }
  19314. let dispatch = this[kDispatch].bind(this)
  19315. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19316. dispatch = this[kInterceptors][i](dispatch)
  19317. }
  19318. this[kInterceptedDispatch] = dispatch
  19319. return dispatch(opts, handler)
  19320. }
  19321. dispatch (opts, handler) {
  19322. if (!handler || typeof handler !== 'object') {
  19323. throw new InvalidArgumentError('handler must be an object')
  19324. }
  19325. try {
  19326. if (!opts || typeof opts !== 'object') {
  19327. throw new InvalidArgumentError('opts must be an object.')
  19328. }
  19329. if (this[kDestroyed] || this[kOnDestroyed]) {
  19330. throw new ClientDestroyedError()
  19331. }
  19332. if (this[kClosed]) {
  19333. throw new ClientClosedError()
  19334. }
  19335. return this[kInterceptedDispatch](opts, handler)
  19336. } catch (err) {
  19337. if (typeof handler.onError !== 'function') {
  19338. throw new InvalidArgumentError('invalid onError method')
  19339. }
  19340. handler.onError(err)
  19341. return false
  19342. }
  19343. }
  19344. }
  19345. module.exports = DispatcherBase
  19346. /***/ }),
  19347. /***/ 412:
  19348. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19349. "use strict";
  19350. const EventEmitter = __nccwpck_require__(2361)
  19351. class Dispatcher extends EventEmitter {
  19352. dispatch () {
  19353. throw new Error('not implemented')
  19354. }
  19355. close () {
  19356. throw new Error('not implemented')
  19357. }
  19358. destroy () {
  19359. throw new Error('not implemented')
  19360. }
  19361. }
  19362. module.exports = Dispatcher
  19363. /***/ }),
  19364. /***/ 9990:
  19365. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19366. "use strict";
  19367. const Busboy = __nccwpck_require__(727)
  19368. const util = __nccwpck_require__(3983)
  19369. const {
  19370. ReadableStreamFrom,
  19371. isBlobLike,
  19372. isReadableStreamLike,
  19373. readableStreamClose,
  19374. createDeferredPromise,
  19375. fullyReadBody
  19376. } = __nccwpck_require__(2538)
  19377. const { FormData } = __nccwpck_require__(2015)
  19378. const { kState } = __nccwpck_require__(5861)
  19379. const { webidl } = __nccwpck_require__(1744)
  19380. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19381. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19382. const { kBodyUsed } = __nccwpck_require__(2785)
  19383. const assert = __nccwpck_require__(9491)
  19384. const { isErrored } = __nccwpck_require__(3983)
  19385. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19386. const { File: UndiciFile } = __nccwpck_require__(8511)
  19387. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19388. let random
  19389. try {
  19390. const crypto = __nccwpck_require__(6005)
  19391. random = (max) => crypto.randomInt(0, max)
  19392. } catch {
  19393. random = (max) => Math.floor(Math.random(max))
  19394. }
  19395. let ReadableStream = globalThis.ReadableStream
  19396. /** @type {globalThis['File']} */
  19397. const File = NativeFile ?? UndiciFile
  19398. const textEncoder = new TextEncoder()
  19399. const textDecoder = new TextDecoder()
  19400. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19401. function extractBody (object, keepalive = false) {
  19402. if (!ReadableStream) {
  19403. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19404. }
  19405. // 1. Let stream be null.
  19406. let stream = null
  19407. // 2. If object is a ReadableStream object, then set stream to object.
  19408. if (object instanceof ReadableStream) {
  19409. stream = object
  19410. } else if (isBlobLike(object)) {
  19411. // 3. Otherwise, if object is a Blob object, set stream to the
  19412. // result of running object’s get stream.
  19413. stream = object.stream()
  19414. } else {
  19415. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19416. // up stream.
  19417. stream = new ReadableStream({
  19418. async pull (controller) {
  19419. controller.enqueue(
  19420. typeof source === 'string' ? textEncoder.encode(source) : source
  19421. )
  19422. queueMicrotask(() => readableStreamClose(controller))
  19423. },
  19424. start () {},
  19425. type: undefined
  19426. })
  19427. }
  19428. // 5. Assert: stream is a ReadableStream object.
  19429. assert(isReadableStreamLike(stream))
  19430. // 6. Let action be null.
  19431. let action = null
  19432. // 7. Let source be null.
  19433. let source = null
  19434. // 8. Let length be null.
  19435. let length = null
  19436. // 9. Let type be null.
  19437. let type = null
  19438. // 10. Switch on object:
  19439. if (typeof object === 'string') {
  19440. // Set source to the UTF-8 encoding of object.
  19441. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19442. source = object
  19443. // Set type to `text/plain;charset=UTF-8`.
  19444. type = 'text/plain;charset=UTF-8'
  19445. } else if (object instanceof URLSearchParams) {
  19446. // URLSearchParams
  19447. // spec says to run application/x-www-form-urlencoded on body.list
  19448. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19449. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19450. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19451. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19452. source = object.toString()
  19453. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19454. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19455. } else if (isArrayBuffer(object)) {
  19456. // BufferSource/ArrayBuffer
  19457. // Set source to a copy of the bytes held by object.
  19458. source = new Uint8Array(object.slice())
  19459. } else if (ArrayBuffer.isView(object)) {
  19460. // BufferSource/ArrayBufferView
  19461. // Set source to a copy of the bytes held by object.
  19462. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19463. } else if (util.isFormDataLike(object)) {
  19464. const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
  19465. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19466. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19467. const escape = (str) =>
  19468. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19469. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19470. // Set action to this step: run the multipart/form-data
  19471. // encoding algorithm, with object’s entry list and UTF-8.
  19472. // - This ensures that the body is immutable and can't be changed afterwords
  19473. // - That the content-length is calculated in advance.
  19474. // - And that all parts are pre-encoded and ready to be sent.
  19475. const blobParts = []
  19476. const rn = new Uint8Array([13, 10]) // '\r\n'
  19477. length = 0
  19478. let hasUnknownSizeValue = false
  19479. for (const [name, value] of object) {
  19480. if (typeof value === 'string') {
  19481. const chunk = textEncoder.encode(prefix +
  19482. `; name="${escape(normalizeLinefeeds(name))}"` +
  19483. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19484. blobParts.push(chunk)
  19485. length += chunk.byteLength
  19486. } else {
  19487. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19488. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19489. `Content-Type: ${
  19490. value.type || 'application/octet-stream'
  19491. }\r\n\r\n`)
  19492. blobParts.push(chunk, value, rn)
  19493. if (typeof value.size === 'number') {
  19494. length += chunk.byteLength + value.size + rn.byteLength
  19495. } else {
  19496. hasUnknownSizeValue = true
  19497. }
  19498. }
  19499. }
  19500. const chunk = textEncoder.encode(`--${boundary}--`)
  19501. blobParts.push(chunk)
  19502. length += chunk.byteLength
  19503. if (hasUnknownSizeValue) {
  19504. length = null
  19505. }
  19506. // Set source to object.
  19507. source = object
  19508. action = async function * () {
  19509. for (const part of blobParts) {
  19510. if (part.stream) {
  19511. yield * part.stream()
  19512. } else {
  19513. yield part
  19514. }
  19515. }
  19516. }
  19517. // Set type to `multipart/form-data; boundary=`,
  19518. // followed by the multipart/form-data boundary string generated
  19519. // by the multipart/form-data encoding algorithm.
  19520. type = 'multipart/form-data; boundary=' + boundary
  19521. } else if (isBlobLike(object)) {
  19522. // Blob
  19523. // Set source to object.
  19524. source = object
  19525. // Set length to object’s size.
  19526. length = object.size
  19527. // If object’s type attribute is not the empty byte sequence, set
  19528. // type to its value.
  19529. if (object.type) {
  19530. type = object.type
  19531. }
  19532. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19533. // If keepalive is true, then throw a TypeError.
  19534. if (keepalive) {
  19535. throw new TypeError('keepalive')
  19536. }
  19537. // If object is disturbed or locked, then throw a TypeError.
  19538. if (util.isDisturbed(object) || object.locked) {
  19539. throw new TypeError(
  19540. 'Response body object should not be disturbed or locked'
  19541. )
  19542. }
  19543. stream =
  19544. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19545. }
  19546. // 11. If source is a byte sequence, then set action to a
  19547. // step that returns source and length to source’s length.
  19548. if (typeof source === 'string' || util.isBuffer(source)) {
  19549. length = Buffer.byteLength(source)
  19550. }
  19551. // 12. If action is non-null, then run these steps in in parallel:
  19552. if (action != null) {
  19553. // Run action.
  19554. let iterator
  19555. stream = new ReadableStream({
  19556. async start () {
  19557. iterator = action(object)[Symbol.asyncIterator]()
  19558. },
  19559. async pull (controller) {
  19560. const { value, done } = await iterator.next()
  19561. if (done) {
  19562. // When running action is done, close stream.
  19563. queueMicrotask(() => {
  19564. controller.close()
  19565. })
  19566. } else {
  19567. // Whenever one or more bytes are available and stream is not errored,
  19568. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19569. // bytes into stream.
  19570. if (!isErrored(stream)) {
  19571. controller.enqueue(new Uint8Array(value))
  19572. }
  19573. }
  19574. return controller.desiredSize > 0
  19575. },
  19576. async cancel (reason) {
  19577. await iterator.return()
  19578. },
  19579. type: undefined
  19580. })
  19581. }
  19582. // 13. Let body be a body whose stream is stream, source is source,
  19583. // and length is length.
  19584. const body = { stream, source, length }
  19585. // 14. Return (body, type).
  19586. return [body, type]
  19587. }
  19588. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19589. function safelyExtractBody (object, keepalive = false) {
  19590. if (!ReadableStream) {
  19591. // istanbul ignore next
  19592. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19593. }
  19594. // To safely extract a body and a `Content-Type` value from
  19595. // a byte sequence or BodyInit object object, run these steps:
  19596. // 1. If object is a ReadableStream object, then:
  19597. if (object instanceof ReadableStream) {
  19598. // Assert: object is neither disturbed nor locked.
  19599. // istanbul ignore next
  19600. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19601. // istanbul ignore next
  19602. assert(!object.locked, 'The stream is locked.')
  19603. }
  19604. // 2. Return the results of extracting object.
  19605. return extractBody(object, keepalive)
  19606. }
  19607. function cloneBody (body) {
  19608. // To clone a body body, run these steps:
  19609. // https://fetch.spec.whatwg.org/#concept-body-clone
  19610. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19611. const [out1, out2] = body.stream.tee()
  19612. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19613. // This, for whatever reasons, unrefs out2Clone which allows
  19614. // the process to exit by itself.
  19615. const [, finalClone] = out2Clone.tee()
  19616. // 2. Set body’s stream to out1.
  19617. body.stream = out1
  19618. // 3. Return a body whose stream is out2 and other members are copied from body.
  19619. return {
  19620. stream: finalClone,
  19621. length: body.length,
  19622. source: body.source
  19623. }
  19624. }
  19625. async function * consumeBody (body) {
  19626. if (body) {
  19627. if (isUint8Array(body)) {
  19628. yield body
  19629. } else {
  19630. const stream = body.stream
  19631. if (util.isDisturbed(stream)) {
  19632. throw new TypeError('The body has already been consumed.')
  19633. }
  19634. if (stream.locked) {
  19635. throw new TypeError('The stream is locked.')
  19636. }
  19637. // Compat.
  19638. stream[kBodyUsed] = true
  19639. yield * stream
  19640. }
  19641. }
  19642. }
  19643. function throwIfAborted (state) {
  19644. if (state.aborted) {
  19645. throw new DOMException('The operation was aborted.', 'AbortError')
  19646. }
  19647. }
  19648. function bodyMixinMethods (instance) {
  19649. const methods = {
  19650. blob () {
  19651. // The blob() method steps are to return the result of
  19652. // running consume body with this and the following step
  19653. // given a byte sequence bytes: return a Blob whose
  19654. // contents are bytes and whose type attribute is this’s
  19655. // MIME type.
  19656. return specConsumeBody(this, (bytes) => {
  19657. let mimeType = bodyMimeType(this)
  19658. if (mimeType === 'failure') {
  19659. mimeType = ''
  19660. } else if (mimeType) {
  19661. mimeType = serializeAMimeType(mimeType)
  19662. }
  19663. // Return a Blob whose contents are bytes and type attribute
  19664. // is mimeType.
  19665. return new Blob([bytes], { type: mimeType })
  19666. }, instance)
  19667. },
  19668. arrayBuffer () {
  19669. // The arrayBuffer() method steps are to return the result
  19670. // of running consume body with this and the following step
  19671. // given a byte sequence bytes: return a new ArrayBuffer
  19672. // whose contents are bytes.
  19673. return specConsumeBody(this, (bytes) => {
  19674. return new Uint8Array(bytes).buffer
  19675. }, instance)
  19676. },
  19677. text () {
  19678. // The text() method steps are to return the result of running
  19679. // consume body with this and UTF-8 decode.
  19680. return specConsumeBody(this, utf8DecodeBytes, instance)
  19681. },
  19682. json () {
  19683. // The json() method steps are to return the result of running
  19684. // consume body with this and parse JSON from bytes.
  19685. return specConsumeBody(this, parseJSONFromBytes, instance)
  19686. },
  19687. async formData () {
  19688. webidl.brandCheck(this, instance)
  19689. throwIfAborted(this[kState])
  19690. const contentType = this.headers.get('Content-Type')
  19691. // If mimeType’s essence is "multipart/form-data", then:
  19692. if (/multipart\/form-data/.test(contentType)) {
  19693. const headers = {}
  19694. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19695. const responseFormData = new FormData()
  19696. let busboy
  19697. try {
  19698. busboy = new Busboy({
  19699. headers,
  19700. preservePath: true
  19701. })
  19702. } catch (err) {
  19703. throw new DOMException(`${err}`, 'AbortError')
  19704. }
  19705. busboy.on('field', (name, value) => {
  19706. responseFormData.append(name, value)
  19707. })
  19708. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19709. const chunks = []
  19710. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19711. let base64chunk = ''
  19712. value.on('data', (chunk) => {
  19713. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19714. const end = base64chunk.length - base64chunk.length % 4
  19715. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19716. base64chunk = base64chunk.slice(end)
  19717. })
  19718. value.on('end', () => {
  19719. chunks.push(Buffer.from(base64chunk, 'base64'))
  19720. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19721. })
  19722. } else {
  19723. value.on('data', (chunk) => {
  19724. chunks.push(chunk)
  19725. })
  19726. value.on('end', () => {
  19727. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19728. })
  19729. }
  19730. })
  19731. const busboyResolve = new Promise((resolve, reject) => {
  19732. busboy.on('finish', resolve)
  19733. busboy.on('error', (err) => reject(new TypeError(err)))
  19734. })
  19735. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19736. busboy.end()
  19737. await busboyResolve
  19738. return responseFormData
  19739. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19740. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19741. // 1. Let entries be the result of parsing bytes.
  19742. let entries
  19743. try {
  19744. let text = ''
  19745. // application/x-www-form-urlencoded parser will keep the BOM.
  19746. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19747. // Note that streaming decoder is stateful and cannot be reused
  19748. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19749. for await (const chunk of consumeBody(this[kState].body)) {
  19750. if (!isUint8Array(chunk)) {
  19751. throw new TypeError('Expected Uint8Array chunk')
  19752. }
  19753. text += streamingDecoder.decode(chunk, { stream: true })
  19754. }
  19755. text += streamingDecoder.decode()
  19756. entries = new URLSearchParams(text)
  19757. } catch (err) {
  19758. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19759. // 2. If entries is failure, then throw a TypeError.
  19760. throw Object.assign(new TypeError(), { cause: err })
  19761. }
  19762. // 3. Return a new FormData object whose entries are entries.
  19763. const formData = new FormData()
  19764. for (const [name, value] of entries) {
  19765. formData.append(name, value)
  19766. }
  19767. return formData
  19768. } else {
  19769. // Wait a tick before checking if the request has been aborted.
  19770. // Otherwise, a TypeError can be thrown when an AbortError should.
  19771. await Promise.resolve()
  19772. throwIfAborted(this[kState])
  19773. // Otherwise, throw a TypeError.
  19774. throw webidl.errors.exception({
  19775. header: `${instance.name}.formData`,
  19776. message: 'Could not parse content as FormData.'
  19777. })
  19778. }
  19779. }
  19780. }
  19781. return methods
  19782. }
  19783. function mixinBody (prototype) {
  19784. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19785. }
  19786. /**
  19787. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19788. * @param {Response|Request} object
  19789. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19790. * @param {Response|Request} instance
  19791. */
  19792. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19793. webidl.brandCheck(object, instance)
  19794. throwIfAborted(object[kState])
  19795. // 1. If object is unusable, then return a promise rejected
  19796. // with a TypeError.
  19797. if (bodyUnusable(object[kState].body)) {
  19798. throw new TypeError('Body is unusable')
  19799. }
  19800. // 2. Let promise be a new promise.
  19801. const promise = createDeferredPromise()
  19802. // 3. Let errorSteps given error be to reject promise with error.
  19803. const errorSteps = (error) => promise.reject(error)
  19804. // 4. Let successSteps given a byte sequence data be to resolve
  19805. // promise with the result of running convertBytesToJSValue
  19806. // with data. If that threw an exception, then run errorSteps
  19807. // with that exception.
  19808. const successSteps = (data) => {
  19809. try {
  19810. promise.resolve(convertBytesToJSValue(data))
  19811. } catch (e) {
  19812. errorSteps(e)
  19813. }
  19814. }
  19815. // 5. If object’s body is null, then run successSteps with an
  19816. // empty byte sequence.
  19817. if (object[kState].body == null) {
  19818. successSteps(new Uint8Array())
  19819. return promise.promise
  19820. }
  19821. // 6. Otherwise, fully read object’s body given successSteps,
  19822. // errorSteps, and object’s relevant global object.
  19823. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19824. // 7. Return promise.
  19825. return promise.promise
  19826. }
  19827. // https://fetch.spec.whatwg.org/#body-unusable
  19828. function bodyUnusable (body) {
  19829. // An object including the Body interface mixin is
  19830. // said to be unusable if its body is non-null and
  19831. // its body’s stream is disturbed or locked.
  19832. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19833. }
  19834. /**
  19835. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19836. * @param {Buffer} buffer
  19837. */
  19838. function utf8DecodeBytes (buffer) {
  19839. if (buffer.length === 0) {
  19840. return ''
  19841. }
  19842. // 1. Let buffer be the result of peeking three bytes from
  19843. // ioQueue, converted to a byte sequence.
  19844. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19845. // bytes from ioQueue. (Do nothing with those bytes.)
  19846. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19847. buffer = buffer.subarray(3)
  19848. }
  19849. // 3. Process a queue with an instance of UTF-8’s
  19850. // decoder, ioQueue, output, and "replacement".
  19851. const output = textDecoder.decode(buffer)
  19852. // 4. Return output.
  19853. return output
  19854. }
  19855. /**
  19856. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19857. * @param {Uint8Array} bytes
  19858. */
  19859. function parseJSONFromBytes (bytes) {
  19860. return JSON.parse(utf8DecodeBytes(bytes))
  19861. }
  19862. /**
  19863. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19864. * @param {import('./response').Response|import('./request').Request} object
  19865. */
  19866. function bodyMimeType (object) {
  19867. const { headersList } = object[kState]
  19868. const contentType = headersList.get('content-type')
  19869. if (contentType === null) {
  19870. return 'failure'
  19871. }
  19872. return parseMIMEType(contentType)
  19873. }
  19874. module.exports = {
  19875. extractBody,
  19876. safelyExtractBody,
  19877. cloneBody,
  19878. mixinBody
  19879. }
  19880. /***/ }),
  19881. /***/ 1037:
  19882. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19883. "use strict";
  19884. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19885. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19886. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19887. const nullBodyStatus = [101, 204, 205, 304]
  19888. const redirectStatus = [301, 302, 303, 307, 308]
  19889. const redirectStatusSet = new Set(redirectStatus)
  19890. // https://fetch.spec.whatwg.org/#block-bad-port
  19891. const badPorts = [
  19892. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19893. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19894. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19895. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19896. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19897. '10080'
  19898. ]
  19899. const badPortsSet = new Set(badPorts)
  19900. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19901. const referrerPolicy = [
  19902. '',
  19903. 'no-referrer',
  19904. 'no-referrer-when-downgrade',
  19905. 'same-origin',
  19906. 'origin',
  19907. 'strict-origin',
  19908. 'origin-when-cross-origin',
  19909. 'strict-origin-when-cross-origin',
  19910. 'unsafe-url'
  19911. ]
  19912. const referrerPolicySet = new Set(referrerPolicy)
  19913. const requestRedirect = ['follow', 'manual', 'error']
  19914. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19915. const safeMethodsSet = new Set(safeMethods)
  19916. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19917. const requestCredentials = ['omit', 'same-origin', 'include']
  19918. const requestCache = [
  19919. 'default',
  19920. 'no-store',
  19921. 'reload',
  19922. 'no-cache',
  19923. 'force-cache',
  19924. 'only-if-cached'
  19925. ]
  19926. // https://fetch.spec.whatwg.org/#request-body-header-name
  19927. const requestBodyHeader = [
  19928. 'content-encoding',
  19929. 'content-language',
  19930. 'content-location',
  19931. 'content-type',
  19932. // See https://github.com/nodejs/undici/issues/2021
  19933. // 'Content-Length' is a forbidden header name, which is typically
  19934. // removed in the Headers implementation. However, undici doesn't
  19935. // filter out headers, so we add it here.
  19936. 'content-length'
  19937. ]
  19938. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19939. const requestDuplex = [
  19940. 'half'
  19941. ]
  19942. // http://fetch.spec.whatwg.org/#forbidden-method
  19943. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19944. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19945. const subresource = [
  19946. 'audio',
  19947. 'audioworklet',
  19948. 'font',
  19949. 'image',
  19950. 'manifest',
  19951. 'paintworklet',
  19952. 'script',
  19953. 'style',
  19954. 'track',
  19955. 'video',
  19956. 'xslt',
  19957. ''
  19958. ]
  19959. const subresourceSet = new Set(subresource)
  19960. /** @type {globalThis['DOMException']} */
  19961. const DOMException = globalThis.DOMException ?? (() => {
  19962. // DOMException was only made a global in Node v17.0.0,
  19963. // but fetch supports >= v16.8.
  19964. try {
  19965. atob('~')
  19966. } catch (err) {
  19967. return Object.getPrototypeOf(err).constructor
  19968. }
  19969. })()
  19970. let channel
  19971. /** @type {globalThis['structuredClone']} */
  19972. const structuredClone =
  19973. globalThis.structuredClone ??
  19974. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19975. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19976. function structuredClone (value, options = undefined) {
  19977. if (arguments.length === 0) {
  19978. throw new TypeError('missing argument')
  19979. }
  19980. if (!channel) {
  19981. channel = new MessageChannel()
  19982. }
  19983. channel.port1.unref()
  19984. channel.port2.unref()
  19985. channel.port1.postMessage(value, options?.transfer)
  19986. return receiveMessageOnPort(channel.port2).message
  19987. }
  19988. module.exports = {
  19989. DOMException,
  19990. structuredClone,
  19991. subresource,
  19992. forbiddenMethods,
  19993. requestBodyHeader,
  19994. referrerPolicy,
  19995. requestRedirect,
  19996. requestMode,
  19997. requestCredentials,
  19998. requestCache,
  19999. redirectStatus,
  20000. corsSafeListedMethods,
  20001. nullBodyStatus,
  20002. safeMethods,
  20003. badPorts,
  20004. requestDuplex,
  20005. subresourceSet,
  20006. badPortsSet,
  20007. redirectStatusSet,
  20008. corsSafeListedMethodsSet,
  20009. safeMethodsSet,
  20010. forbiddenMethodsSet,
  20011. referrerPolicySet
  20012. }
  20013. /***/ }),
  20014. /***/ 685:
  20015. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20016. const assert = __nccwpck_require__(9491)
  20017. const { atob } = __nccwpck_require__(4300)
  20018. const { isomorphicDecode } = __nccwpck_require__(2538)
  20019. const encoder = new TextEncoder()
  20020. /**
  20021. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  20022. */
  20023. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  20024. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  20025. /**
  20026. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  20027. */
  20028. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  20029. // https://fetch.spec.whatwg.org/#data-url-processor
  20030. /** @param {URL} dataURL */
  20031. function dataURLProcessor (dataURL) {
  20032. // 1. Assert: dataURL’s scheme is "data".
  20033. assert(dataURL.protocol === 'data:')
  20034. // 2. Let input be the result of running the URL
  20035. // serializer on dataURL with exclude fragment
  20036. // set to true.
  20037. let input = URLSerializer(dataURL, true)
  20038. // 3. Remove the leading "data:" string from input.
  20039. input = input.slice(5)
  20040. // 4. Let position point at the start of input.
  20041. const position = { position: 0 }
  20042. // 5. Let mimeType be the result of collecting a
  20043. // sequence of code points that are not equal
  20044. // to U+002C (,), given position.
  20045. let mimeType = collectASequenceOfCodePointsFast(
  20046. ',',
  20047. input,
  20048. position
  20049. )
  20050. // 6. Strip leading and trailing ASCII whitespace
  20051. // from mimeType.
  20052. // Undici implementation note: we need to store the
  20053. // length because if the mimetype has spaces removed,
  20054. // the wrong amount will be sliced from the input in
  20055. // step #9
  20056. const mimeTypeLength = mimeType.length
  20057. mimeType = removeASCIIWhitespace(mimeType, true, true)
  20058. // 7. If position is past the end of input, then
  20059. // return failure
  20060. if (position.position >= input.length) {
  20061. return 'failure'
  20062. }
  20063. // 8. Advance position by 1.
  20064. position.position++
  20065. // 9. Let encodedBody be the remainder of input.
  20066. const encodedBody = input.slice(mimeTypeLength + 1)
  20067. // 10. Let body be the percent-decoding of encodedBody.
  20068. let body = stringPercentDecode(encodedBody)
  20069. // 11. If mimeType ends with U+003B (;), followed by
  20070. // zero or more U+0020 SPACE, followed by an ASCII
  20071. // case-insensitive match for "base64", then:
  20072. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  20073. // 1. Let stringBody be the isomorphic decode of body.
  20074. const stringBody = isomorphicDecode(body)
  20075. // 2. Set body to the forgiving-base64 decode of
  20076. // stringBody.
  20077. body = forgivingBase64(stringBody)
  20078. // 3. If body is failure, then return failure.
  20079. if (body === 'failure') {
  20080. return 'failure'
  20081. }
  20082. // 4. Remove the last 6 code points from mimeType.
  20083. mimeType = mimeType.slice(0, -6)
  20084. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  20085. // if any.
  20086. mimeType = mimeType.replace(/(\u0020)+$/, '')
  20087. // 6. Remove the last U+003B (;) code point from mimeType.
  20088. mimeType = mimeType.slice(0, -1)
  20089. }
  20090. // 12. If mimeType starts with U+003B (;), then prepend
  20091. // "text/plain" to mimeType.
  20092. if (mimeType.startsWith(';')) {
  20093. mimeType = 'text/plain' + mimeType
  20094. }
  20095. // 13. Let mimeTypeRecord be the result of parsing
  20096. // mimeType.
  20097. let mimeTypeRecord = parseMIMEType(mimeType)
  20098. // 14. If mimeTypeRecord is failure, then set
  20099. // mimeTypeRecord to text/plain;charset=US-ASCII.
  20100. if (mimeTypeRecord === 'failure') {
  20101. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  20102. }
  20103. // 15. Return a new data: URL struct whose MIME
  20104. // type is mimeTypeRecord and body is body.
  20105. // https://fetch.spec.whatwg.org/#data-url-struct
  20106. return { mimeType: mimeTypeRecord, body }
  20107. }
  20108. // https://url.spec.whatwg.org/#concept-url-serializer
  20109. /**
  20110. * @param {URL} url
  20111. * @param {boolean} excludeFragment
  20112. */
  20113. function URLSerializer (url, excludeFragment = false) {
  20114. if (!excludeFragment) {
  20115. return url.href
  20116. }
  20117. const href = url.href
  20118. const hashLength = url.hash.length
  20119. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  20120. }
  20121. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  20122. /**
  20123. * @param {(char: string) => boolean} condition
  20124. * @param {string} input
  20125. * @param {{ position: number }} position
  20126. */
  20127. function collectASequenceOfCodePoints (condition, input, position) {
  20128. // 1. Let result be the empty string.
  20129. let result = ''
  20130. // 2. While position doesn’t point past the end of input and the
  20131. // code point at position within input meets the condition condition:
  20132. while (position.position < input.length && condition(input[position.position])) {
  20133. // 1. Append that code point to the end of result.
  20134. result += input[position.position]
  20135. // 2. Advance position by 1.
  20136. position.position++
  20137. }
  20138. // 3. Return result.
  20139. return result
  20140. }
  20141. /**
  20142. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  20143. * @param {string} char
  20144. * @param {string} input
  20145. * @param {{ position: number }} position
  20146. */
  20147. function collectASequenceOfCodePointsFast (char, input, position) {
  20148. const idx = input.indexOf(char, position.position)
  20149. const start = position.position
  20150. if (idx === -1) {
  20151. position.position = input.length
  20152. return input.slice(start)
  20153. }
  20154. position.position = idx
  20155. return input.slice(start, position.position)
  20156. }
  20157. // https://url.spec.whatwg.org/#string-percent-decode
  20158. /** @param {string} input */
  20159. function stringPercentDecode (input) {
  20160. // 1. Let bytes be the UTF-8 encoding of input.
  20161. const bytes = encoder.encode(input)
  20162. // 2. Return the percent-decoding of bytes.
  20163. return percentDecode(bytes)
  20164. }
  20165. // https://url.spec.whatwg.org/#percent-decode
  20166. /** @param {Uint8Array} input */
  20167. function percentDecode (input) {
  20168. // 1. Let output be an empty byte sequence.
  20169. /** @type {number[]} */
  20170. const output = []
  20171. // 2. For each byte byte in input:
  20172. for (let i = 0; i < input.length; i++) {
  20173. const byte = input[i]
  20174. // 1. If byte is not 0x25 (%), then append byte to output.
  20175. if (byte !== 0x25) {
  20176. output.push(byte)
  20177. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  20178. // after byte in input are not in the ranges
  20179. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  20180. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  20181. // to output.
  20182. } else if (
  20183. byte === 0x25 &&
  20184. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  20185. ) {
  20186. output.push(0x25)
  20187. // 3. Otherwise:
  20188. } else {
  20189. // 1. Let bytePoint be the two bytes after byte in input,
  20190. // decoded, and then interpreted as hexadecimal number.
  20191. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  20192. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  20193. // 2. Append a byte whose value is bytePoint to output.
  20194. output.push(bytePoint)
  20195. // 3. Skip the next two bytes in input.
  20196. i += 2
  20197. }
  20198. }
  20199. // 3. Return output.
  20200. return Uint8Array.from(output)
  20201. }
  20202. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  20203. /** @param {string} input */
  20204. function parseMIMEType (input) {
  20205. // 1. Remove any leading and trailing HTTP whitespace
  20206. // from input.
  20207. input = removeHTTPWhitespace(input, true, true)
  20208. // 2. Let position be a position variable for input,
  20209. // initially pointing at the start of input.
  20210. const position = { position: 0 }
  20211. // 3. Let type be the result of collecting a sequence
  20212. // of code points that are not U+002F (/) from
  20213. // input, given position.
  20214. const type = collectASequenceOfCodePointsFast(
  20215. '/',
  20216. input,
  20217. position
  20218. )
  20219. // 4. If type is the empty string or does not solely
  20220. // contain HTTP token code points, then return failure.
  20221. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  20222. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  20223. return 'failure'
  20224. }
  20225. // 5. If position is past the end of input, then return
  20226. // failure
  20227. if (position.position > input.length) {
  20228. return 'failure'
  20229. }
  20230. // 6. Advance position by 1. (This skips past U+002F (/).)
  20231. position.position++
  20232. // 7. Let subtype be the result of collecting a sequence of
  20233. // code points that are not U+003B (;) from input, given
  20234. // position.
  20235. let subtype = collectASequenceOfCodePointsFast(
  20236. ';',
  20237. input,
  20238. position
  20239. )
  20240. // 8. Remove any trailing HTTP whitespace from subtype.
  20241. subtype = removeHTTPWhitespace(subtype, false, true)
  20242. // 9. If subtype is the empty string or does not solely
  20243. // contain HTTP token code points, then return failure.
  20244. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  20245. return 'failure'
  20246. }
  20247. const typeLowercase = type.toLowerCase()
  20248. const subtypeLowercase = subtype.toLowerCase()
  20249. // 10. Let mimeType be a new MIME type record whose type
  20250. // is type, in ASCII lowercase, and subtype is subtype,
  20251. // in ASCII lowercase.
  20252. // https://mimesniff.spec.whatwg.org/#mime-type
  20253. const mimeType = {
  20254. type: typeLowercase,
  20255. subtype: subtypeLowercase,
  20256. /** @type {Map<string, string>} */
  20257. parameters: new Map(),
  20258. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20259. essence: `${typeLowercase}/${subtypeLowercase}`
  20260. }
  20261. // 11. While position is not past the end of input:
  20262. while (position.position < input.length) {
  20263. // 1. Advance position by 1. (This skips past U+003B (;).)
  20264. position.position++
  20265. // 2. Collect a sequence of code points that are HTTP
  20266. // whitespace from input given position.
  20267. collectASequenceOfCodePoints(
  20268. // https://fetch.spec.whatwg.org/#http-whitespace
  20269. char => HTTP_WHITESPACE_REGEX.test(char),
  20270. input,
  20271. position
  20272. )
  20273. // 3. Let parameterName be the result of collecting a
  20274. // sequence of code points that are not U+003B (;)
  20275. // or U+003D (=) from input, given position.
  20276. let parameterName = collectASequenceOfCodePoints(
  20277. (char) => char !== ';' && char !== '=',
  20278. input,
  20279. position
  20280. )
  20281. // 4. Set parameterName to parameterName, in ASCII
  20282. // lowercase.
  20283. parameterName = parameterName.toLowerCase()
  20284. // 5. If position is not past the end of input, then:
  20285. if (position.position < input.length) {
  20286. // 1. If the code point at position within input is
  20287. // U+003B (;), then continue.
  20288. if (input[position.position] === ';') {
  20289. continue
  20290. }
  20291. // 2. Advance position by 1. (This skips past U+003D (=).)
  20292. position.position++
  20293. }
  20294. // 6. If position is past the end of input, then break.
  20295. if (position.position > input.length) {
  20296. break
  20297. }
  20298. // 7. Let parameterValue be null.
  20299. let parameterValue = null
  20300. // 8. If the code point at position within input is
  20301. // U+0022 ("), then:
  20302. if (input[position.position] === '"') {
  20303. // 1. Set parameterValue to the result of collecting
  20304. // an HTTP quoted string from input, given position
  20305. // and the extract-value flag.
  20306. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20307. // 2. Collect a sequence of code points that are not
  20308. // U+003B (;) from input, given position.
  20309. collectASequenceOfCodePointsFast(
  20310. ';',
  20311. input,
  20312. position
  20313. )
  20314. // 9. Otherwise:
  20315. } else {
  20316. // 1. Set parameterValue to the result of collecting
  20317. // a sequence of code points that are not U+003B (;)
  20318. // from input, given position.
  20319. parameterValue = collectASequenceOfCodePointsFast(
  20320. ';',
  20321. input,
  20322. position
  20323. )
  20324. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20325. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20326. // 3. If parameterValue is the empty string, then continue.
  20327. if (parameterValue.length === 0) {
  20328. continue
  20329. }
  20330. }
  20331. // 10. If all of the following are true
  20332. // - parameterName is not the empty string
  20333. // - parameterName solely contains HTTP token code points
  20334. // - parameterValue solely contains HTTP quoted-string token code points
  20335. // - mimeType’s parameters[parameterName] does not exist
  20336. // then set mimeType’s parameters[parameterName] to parameterValue.
  20337. if (
  20338. parameterName.length !== 0 &&
  20339. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20340. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20341. !mimeType.parameters.has(parameterName)
  20342. ) {
  20343. mimeType.parameters.set(parameterName, parameterValue)
  20344. }
  20345. }
  20346. // 12. Return mimeType.
  20347. return mimeType
  20348. }
  20349. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20350. /** @param {string} data */
  20351. function forgivingBase64 (data) {
  20352. // 1. Remove all ASCII whitespace from data.
  20353. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20354. // 2. If data’s code point length divides by 4 leaving
  20355. // no remainder, then:
  20356. if (data.length % 4 === 0) {
  20357. // 1. If data ends with one or two U+003D (=) code points,
  20358. // then remove them from data.
  20359. data = data.replace(/=?=$/, '')
  20360. }
  20361. // 3. If data’s code point length divides by 4 leaving
  20362. // a remainder of 1, then return failure.
  20363. if (data.length % 4 === 1) {
  20364. return 'failure'
  20365. }
  20366. // 4. If data contains a code point that is not one of
  20367. // U+002B (+)
  20368. // U+002F (/)
  20369. // ASCII alphanumeric
  20370. // then return failure.
  20371. if (/[^+/0-9A-Za-z]/.test(data)) {
  20372. return 'failure'
  20373. }
  20374. const binary = atob(data)
  20375. const bytes = new Uint8Array(binary.length)
  20376. for (let byte = 0; byte < binary.length; byte++) {
  20377. bytes[byte] = binary.charCodeAt(byte)
  20378. }
  20379. return bytes
  20380. }
  20381. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20382. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20383. /**
  20384. * @param {string} input
  20385. * @param {{ position: number }} position
  20386. * @param {boolean?} extractValue
  20387. */
  20388. function collectAnHTTPQuotedString (input, position, extractValue) {
  20389. // 1. Let positionStart be position.
  20390. const positionStart = position.position
  20391. // 2. Let value be the empty string.
  20392. let value = ''
  20393. // 3. Assert: the code point at position within input
  20394. // is U+0022 (").
  20395. assert(input[position.position] === '"')
  20396. // 4. Advance position by 1.
  20397. position.position++
  20398. // 5. While true:
  20399. while (true) {
  20400. // 1. Append the result of collecting a sequence of code points
  20401. // that are not U+0022 (") or U+005C (\) from input, given
  20402. // position, to value.
  20403. value += collectASequenceOfCodePoints(
  20404. (char) => char !== '"' && char !== '\\',
  20405. input,
  20406. position
  20407. )
  20408. // 2. If position is past the end of input, then break.
  20409. if (position.position >= input.length) {
  20410. break
  20411. }
  20412. // 3. Let quoteOrBackslash be the code point at position within
  20413. // input.
  20414. const quoteOrBackslash = input[position.position]
  20415. // 4. Advance position by 1.
  20416. position.position++
  20417. // 5. If quoteOrBackslash is U+005C (\), then:
  20418. if (quoteOrBackslash === '\\') {
  20419. // 1. If position is past the end of input, then append
  20420. // U+005C (\) to value and break.
  20421. if (position.position >= input.length) {
  20422. value += '\\'
  20423. break
  20424. }
  20425. // 2. Append the code point at position within input to value.
  20426. value += input[position.position]
  20427. // 3. Advance position by 1.
  20428. position.position++
  20429. // 6. Otherwise:
  20430. } else {
  20431. // 1. Assert: quoteOrBackslash is U+0022 (").
  20432. assert(quoteOrBackslash === '"')
  20433. // 2. Break.
  20434. break
  20435. }
  20436. }
  20437. // 6. If the extract-value flag is set, then return value.
  20438. if (extractValue) {
  20439. return value
  20440. }
  20441. // 7. Return the code points from positionStart to position,
  20442. // inclusive, within input.
  20443. return input.slice(positionStart, position.position)
  20444. }
  20445. /**
  20446. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20447. */
  20448. function serializeAMimeType (mimeType) {
  20449. assert(mimeType !== 'failure')
  20450. const { parameters, essence } = mimeType
  20451. // 1. Let serialization be the concatenation of mimeType’s
  20452. // type, U+002F (/), and mimeType’s subtype.
  20453. let serialization = essence
  20454. // 2. For each name → value of mimeType’s parameters:
  20455. for (let [name, value] of parameters.entries()) {
  20456. // 1. Append U+003B (;) to serialization.
  20457. serialization += ';'
  20458. // 2. Append name to serialization.
  20459. serialization += name
  20460. // 3. Append U+003D (=) to serialization.
  20461. serialization += '='
  20462. // 4. If value does not solely contain HTTP token code
  20463. // points or value is the empty string, then:
  20464. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20465. // 1. Precede each occurence of U+0022 (") or
  20466. // U+005C (\) in value with U+005C (\).
  20467. value = value.replace(/(\\|")/g, '\\$1')
  20468. // 2. Prepend U+0022 (") to value.
  20469. value = '"' + value
  20470. // 3. Append U+0022 (") to value.
  20471. value += '"'
  20472. }
  20473. // 5. Append value to serialization.
  20474. serialization += value
  20475. }
  20476. // 3. Return serialization.
  20477. return serialization
  20478. }
  20479. /**
  20480. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20481. * @param {string} char
  20482. */
  20483. function isHTTPWhiteSpace (char) {
  20484. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20485. }
  20486. /**
  20487. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20488. * @param {string} str
  20489. */
  20490. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20491. let lead = 0
  20492. let trail = str.length - 1
  20493. if (leading) {
  20494. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20495. }
  20496. if (trailing) {
  20497. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20498. }
  20499. return str.slice(lead, trail + 1)
  20500. }
  20501. /**
  20502. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20503. * @param {string} char
  20504. */
  20505. function isASCIIWhitespace (char) {
  20506. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20507. }
  20508. /**
  20509. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20510. */
  20511. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20512. let lead = 0
  20513. let trail = str.length - 1
  20514. if (leading) {
  20515. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20516. }
  20517. if (trailing) {
  20518. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20519. }
  20520. return str.slice(lead, trail + 1)
  20521. }
  20522. module.exports = {
  20523. dataURLProcessor,
  20524. URLSerializer,
  20525. collectASequenceOfCodePoints,
  20526. collectASequenceOfCodePointsFast,
  20527. stringPercentDecode,
  20528. parseMIMEType,
  20529. collectAnHTTPQuotedString,
  20530. serializeAMimeType
  20531. }
  20532. /***/ }),
  20533. /***/ 8511:
  20534. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20535. "use strict";
  20536. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20537. const { types } = __nccwpck_require__(3837)
  20538. const { kState } = __nccwpck_require__(5861)
  20539. const { isBlobLike } = __nccwpck_require__(2538)
  20540. const { webidl } = __nccwpck_require__(1744)
  20541. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20542. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20543. const encoder = new TextEncoder()
  20544. class File extends Blob {
  20545. constructor (fileBits, fileName, options = {}) {
  20546. // The File constructor is invoked with two or three parameters, depending
  20547. // on whether the optional dictionary parameter is used. When the File()
  20548. // constructor is invoked, user agents must run the following steps:
  20549. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20550. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20551. fileName = webidl.converters.USVString(fileName)
  20552. options = webidl.converters.FilePropertyBag(options)
  20553. // 1. Let bytes be the result of processing blob parts given fileBits and
  20554. // options.
  20555. // Note: Blob handles this for us
  20556. // 2. Let n be the fileName argument to the constructor.
  20557. const n = fileName
  20558. // 3. Process FilePropertyBag dictionary argument by running the following
  20559. // substeps:
  20560. // 1. If the type member is provided and is not the empty string, let t
  20561. // be set to the type dictionary member. If t contains any characters
  20562. // outside the range U+0020 to U+007E, then set t to the empty string
  20563. // and return from these substeps.
  20564. // 2. Convert every character in t to ASCII lowercase.
  20565. let t = options.type
  20566. let d
  20567. // eslint-disable-next-line no-labels
  20568. substep: {
  20569. if (t) {
  20570. t = parseMIMEType(t)
  20571. if (t === 'failure') {
  20572. t = ''
  20573. // eslint-disable-next-line no-labels
  20574. break substep
  20575. }
  20576. t = serializeAMimeType(t).toLowerCase()
  20577. }
  20578. // 3. If the lastModified member is provided, let d be set to the
  20579. // lastModified dictionary member. If it is not provided, set d to the
  20580. // current date and time represented as the number of milliseconds since
  20581. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20582. d = options.lastModified
  20583. }
  20584. // 4. Return a new File object F such that:
  20585. // F refers to the bytes byte sequence.
  20586. // F.size is set to the number of total bytes in bytes.
  20587. // F.name is set to n.
  20588. // F.type is set to t.
  20589. // F.lastModified is set to d.
  20590. super(processBlobParts(fileBits, options), { type: t })
  20591. this[kState] = {
  20592. name: n,
  20593. lastModified: d,
  20594. type: t
  20595. }
  20596. }
  20597. get name () {
  20598. webidl.brandCheck(this, File)
  20599. return this[kState].name
  20600. }
  20601. get lastModified () {
  20602. webidl.brandCheck(this, File)
  20603. return this[kState].lastModified
  20604. }
  20605. get type () {
  20606. webidl.brandCheck(this, File)
  20607. return this[kState].type
  20608. }
  20609. }
  20610. class FileLike {
  20611. constructor (blobLike, fileName, options = {}) {
  20612. // TODO: argument idl type check
  20613. // The File constructor is invoked with two or three parameters, depending
  20614. // on whether the optional dictionary parameter is used. When the File()
  20615. // constructor is invoked, user agents must run the following steps:
  20616. // 1. Let bytes be the result of processing blob parts given fileBits and
  20617. // options.
  20618. // 2. Let n be the fileName argument to the constructor.
  20619. const n = fileName
  20620. // 3. Process FilePropertyBag dictionary argument by running the following
  20621. // substeps:
  20622. // 1. If the type member is provided and is not the empty string, let t
  20623. // be set to the type dictionary member. If t contains any characters
  20624. // outside the range U+0020 to U+007E, then set t to the empty string
  20625. // and return from these substeps.
  20626. // TODO
  20627. const t = options.type
  20628. // 2. Convert every character in t to ASCII lowercase.
  20629. // TODO
  20630. // 3. If the lastModified member is provided, let d be set to the
  20631. // lastModified dictionary member. If it is not provided, set d to the
  20632. // current date and time represented as the number of milliseconds since
  20633. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20634. const d = options.lastModified ?? Date.now()
  20635. // 4. Return a new File object F such that:
  20636. // F refers to the bytes byte sequence.
  20637. // F.size is set to the number of total bytes in bytes.
  20638. // F.name is set to n.
  20639. // F.type is set to t.
  20640. // F.lastModified is set to d.
  20641. this[kState] = {
  20642. blobLike,
  20643. name: n,
  20644. type: t,
  20645. lastModified: d
  20646. }
  20647. }
  20648. stream (...args) {
  20649. webidl.brandCheck(this, FileLike)
  20650. return this[kState].blobLike.stream(...args)
  20651. }
  20652. arrayBuffer (...args) {
  20653. webidl.brandCheck(this, FileLike)
  20654. return this[kState].blobLike.arrayBuffer(...args)
  20655. }
  20656. slice (...args) {
  20657. webidl.brandCheck(this, FileLike)
  20658. return this[kState].blobLike.slice(...args)
  20659. }
  20660. text (...args) {
  20661. webidl.brandCheck(this, FileLike)
  20662. return this[kState].blobLike.text(...args)
  20663. }
  20664. get size () {
  20665. webidl.brandCheck(this, FileLike)
  20666. return this[kState].blobLike.size
  20667. }
  20668. get type () {
  20669. webidl.brandCheck(this, FileLike)
  20670. return this[kState].blobLike.type
  20671. }
  20672. get name () {
  20673. webidl.brandCheck(this, FileLike)
  20674. return this[kState].name
  20675. }
  20676. get lastModified () {
  20677. webidl.brandCheck(this, FileLike)
  20678. return this[kState].lastModified
  20679. }
  20680. get [Symbol.toStringTag] () {
  20681. return 'File'
  20682. }
  20683. }
  20684. Object.defineProperties(File.prototype, {
  20685. [Symbol.toStringTag]: {
  20686. value: 'File',
  20687. configurable: true
  20688. },
  20689. name: kEnumerableProperty,
  20690. lastModified: kEnumerableProperty
  20691. })
  20692. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20693. webidl.converters.BlobPart = function (V, opts) {
  20694. if (webidl.util.Type(V) === 'Object') {
  20695. if (isBlobLike(V)) {
  20696. return webidl.converters.Blob(V, { strict: false })
  20697. }
  20698. if (
  20699. ArrayBuffer.isView(V) ||
  20700. types.isAnyArrayBuffer(V)
  20701. ) {
  20702. return webidl.converters.BufferSource(V, opts)
  20703. }
  20704. }
  20705. return webidl.converters.USVString(V, opts)
  20706. }
  20707. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20708. webidl.converters.BlobPart
  20709. )
  20710. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20711. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20712. {
  20713. key: 'lastModified',
  20714. converter: webidl.converters['long long'],
  20715. get defaultValue () {
  20716. return Date.now()
  20717. }
  20718. },
  20719. {
  20720. key: 'type',
  20721. converter: webidl.converters.DOMString,
  20722. defaultValue: ''
  20723. },
  20724. {
  20725. key: 'endings',
  20726. converter: (value) => {
  20727. value = webidl.converters.DOMString(value)
  20728. value = value.toLowerCase()
  20729. if (value !== 'native') {
  20730. value = 'transparent'
  20731. }
  20732. return value
  20733. },
  20734. defaultValue: 'transparent'
  20735. }
  20736. ])
  20737. /**
  20738. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20739. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20740. * @param {{ type: string, endings: string }} options
  20741. */
  20742. function processBlobParts (parts, options) {
  20743. // 1. Let bytes be an empty sequence of bytes.
  20744. /** @type {NodeJS.TypedArray[]} */
  20745. const bytes = []
  20746. // 2. For each element in parts:
  20747. for (const element of parts) {
  20748. // 1. If element is a USVString, run the following substeps:
  20749. if (typeof element === 'string') {
  20750. // 1. Let s be element.
  20751. let s = element
  20752. // 2. If the endings member of options is "native", set s
  20753. // to the result of converting line endings to native
  20754. // of element.
  20755. if (options.endings === 'native') {
  20756. s = convertLineEndingsNative(s)
  20757. }
  20758. // 3. Append the result of UTF-8 encoding s to bytes.
  20759. bytes.push(encoder.encode(s))
  20760. } else if (
  20761. types.isAnyArrayBuffer(element) ||
  20762. types.isTypedArray(element)
  20763. ) {
  20764. // 2. If element is a BufferSource, get a copy of the
  20765. // bytes held by the buffer source, and append those
  20766. // bytes to bytes.
  20767. if (!element.buffer) { // ArrayBuffer
  20768. bytes.push(new Uint8Array(element))
  20769. } else {
  20770. bytes.push(
  20771. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20772. )
  20773. }
  20774. } else if (isBlobLike(element)) {
  20775. // 3. If element is a Blob, append the bytes it represents
  20776. // to bytes.
  20777. bytes.push(element)
  20778. }
  20779. }
  20780. // 3. Return bytes.
  20781. return bytes
  20782. }
  20783. /**
  20784. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20785. * @param {string} s
  20786. */
  20787. function convertLineEndingsNative (s) {
  20788. // 1. Let native line ending be be the code point U+000A LF.
  20789. let nativeLineEnding = '\n'
  20790. // 2. If the underlying platform’s conventions are to
  20791. // represent newlines as a carriage return and line feed
  20792. // sequence, set native line ending to the code point
  20793. // U+000D CR followed by the code point U+000A LF.
  20794. if (process.platform === 'win32') {
  20795. nativeLineEnding = '\r\n'
  20796. }
  20797. return s.replace(/\r?\n/g, nativeLineEnding)
  20798. }
  20799. // If this function is moved to ./util.js, some tools (such as
  20800. // rollup) will warn about circular dependencies. See:
  20801. // https://github.com/nodejs/undici/issues/1629
  20802. function isFileLike (object) {
  20803. return (
  20804. (NativeFile && object instanceof NativeFile) ||
  20805. object instanceof File || (
  20806. object &&
  20807. (typeof object.stream === 'function' ||
  20808. typeof object.arrayBuffer === 'function') &&
  20809. object[Symbol.toStringTag] === 'File'
  20810. )
  20811. )
  20812. }
  20813. module.exports = { File, FileLike, isFileLike }
  20814. /***/ }),
  20815. /***/ 2015:
  20816. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20817. "use strict";
  20818. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20819. const { kState } = __nccwpck_require__(5861)
  20820. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20821. const { webidl } = __nccwpck_require__(1744)
  20822. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20823. /** @type {globalThis['File']} */
  20824. const File = NativeFile ?? UndiciFile
  20825. // https://xhr.spec.whatwg.org/#formdata
  20826. class FormData {
  20827. constructor (form) {
  20828. if (form !== undefined) {
  20829. throw webidl.errors.conversionFailed({
  20830. prefix: 'FormData constructor',
  20831. argument: 'Argument 1',
  20832. types: ['undefined']
  20833. })
  20834. }
  20835. this[kState] = []
  20836. }
  20837. append (name, value, filename = undefined) {
  20838. webidl.brandCheck(this, FormData)
  20839. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20840. if (arguments.length === 3 && !isBlobLike(value)) {
  20841. throw new TypeError(
  20842. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20843. )
  20844. }
  20845. // 1. Let value be value if given; otherwise blobValue.
  20846. name = webidl.converters.USVString(name)
  20847. value = isBlobLike(value)
  20848. ? webidl.converters.Blob(value, { strict: false })
  20849. : webidl.converters.USVString(value)
  20850. filename = arguments.length === 3
  20851. ? webidl.converters.USVString(filename)
  20852. : undefined
  20853. // 2. Let entry be the result of creating an entry with
  20854. // name, value, and filename if given.
  20855. const entry = makeEntry(name, value, filename)
  20856. // 3. Append entry to this’s entry list.
  20857. this[kState].push(entry)
  20858. }
  20859. delete (name) {
  20860. webidl.brandCheck(this, FormData)
  20861. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20862. name = webidl.converters.USVString(name)
  20863. // The delete(name) method steps are to remove all entries whose name
  20864. // is name from this’s entry list.
  20865. this[kState] = this[kState].filter(entry => entry.name !== name)
  20866. }
  20867. get (name) {
  20868. webidl.brandCheck(this, FormData)
  20869. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20870. name = webidl.converters.USVString(name)
  20871. // 1. If there is no entry whose name is name in this’s entry list,
  20872. // then return null.
  20873. const idx = this[kState].findIndex((entry) => entry.name === name)
  20874. if (idx === -1) {
  20875. return null
  20876. }
  20877. // 2. Return the value of the first entry whose name is name from
  20878. // this’s entry list.
  20879. return this[kState][idx].value
  20880. }
  20881. getAll (name) {
  20882. webidl.brandCheck(this, FormData)
  20883. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20884. name = webidl.converters.USVString(name)
  20885. // 1. If there is no entry whose name is name in this’s entry list,
  20886. // then return the empty list.
  20887. // 2. Return the values of all entries whose name is name, in order,
  20888. // from this’s entry list.
  20889. return this[kState]
  20890. .filter((entry) => entry.name === name)
  20891. .map((entry) => entry.value)
  20892. }
  20893. has (name) {
  20894. webidl.brandCheck(this, FormData)
  20895. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20896. name = webidl.converters.USVString(name)
  20897. // The has(name) method steps are to return true if there is an entry
  20898. // whose name is name in this’s entry list; otherwise false.
  20899. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20900. }
  20901. set (name, value, filename = undefined) {
  20902. webidl.brandCheck(this, FormData)
  20903. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20904. if (arguments.length === 3 && !isBlobLike(value)) {
  20905. throw new TypeError(
  20906. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20907. )
  20908. }
  20909. // The set(name, value) and set(name, blobValue, filename) method steps
  20910. // are:
  20911. // 1. Let value be value if given; otherwise blobValue.
  20912. name = webidl.converters.USVString(name)
  20913. value = isBlobLike(value)
  20914. ? webidl.converters.Blob(value, { strict: false })
  20915. : webidl.converters.USVString(value)
  20916. filename = arguments.length === 3
  20917. ? toUSVString(filename)
  20918. : undefined
  20919. // 2. Let entry be the result of creating an entry with name, value, and
  20920. // filename if given.
  20921. const entry = makeEntry(name, value, filename)
  20922. // 3. If there are entries in this’s entry list whose name is name, then
  20923. // replace the first such entry with entry and remove the others.
  20924. const idx = this[kState].findIndex((entry) => entry.name === name)
  20925. if (idx !== -1) {
  20926. this[kState] = [
  20927. ...this[kState].slice(0, idx),
  20928. entry,
  20929. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20930. ]
  20931. } else {
  20932. // 4. Otherwise, append entry to this’s entry list.
  20933. this[kState].push(entry)
  20934. }
  20935. }
  20936. entries () {
  20937. webidl.brandCheck(this, FormData)
  20938. return makeIterator(
  20939. () => this[kState].map(pair => [pair.name, pair.value]),
  20940. 'FormData',
  20941. 'key+value'
  20942. )
  20943. }
  20944. keys () {
  20945. webidl.brandCheck(this, FormData)
  20946. return makeIterator(
  20947. () => this[kState].map(pair => [pair.name, pair.value]),
  20948. 'FormData',
  20949. 'key'
  20950. )
  20951. }
  20952. values () {
  20953. webidl.brandCheck(this, FormData)
  20954. return makeIterator(
  20955. () => this[kState].map(pair => [pair.name, pair.value]),
  20956. 'FormData',
  20957. 'value'
  20958. )
  20959. }
  20960. /**
  20961. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20962. * @param {unknown} thisArg
  20963. */
  20964. forEach (callbackFn, thisArg = globalThis) {
  20965. webidl.brandCheck(this, FormData)
  20966. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20967. if (typeof callbackFn !== 'function') {
  20968. throw new TypeError(
  20969. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20970. )
  20971. }
  20972. for (const [key, value] of this) {
  20973. callbackFn.apply(thisArg, [value, key, this])
  20974. }
  20975. }
  20976. }
  20977. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20978. Object.defineProperties(FormData.prototype, {
  20979. [Symbol.toStringTag]: {
  20980. value: 'FormData',
  20981. configurable: true
  20982. }
  20983. })
  20984. /**
  20985. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  20986. * @param {string} name
  20987. * @param {string|Blob} value
  20988. * @param {?string} filename
  20989. * @returns
  20990. */
  20991. function makeEntry (name, value, filename) {
  20992. // 1. Set name to the result of converting name into a scalar value string.
  20993. // "To convert a string into a scalar value string, replace any surrogates
  20994. // with U+FFFD."
  20995. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  20996. name = Buffer.from(name).toString('utf8')
  20997. // 2. If value is a string, then set value to the result of converting
  20998. // value into a scalar value string.
  20999. if (typeof value === 'string') {
  21000. value = Buffer.from(value).toString('utf8')
  21001. } else {
  21002. // 3. Otherwise:
  21003. // 1. If value is not a File object, then set value to a new File object,
  21004. // representing the same bytes, whose name attribute value is "blob"
  21005. if (!isFileLike(value)) {
  21006. value = value instanceof Blob
  21007. ? new File([value], 'blob', { type: value.type })
  21008. : new FileLike(value, 'blob', { type: value.type })
  21009. }
  21010. // 2. If filename is given, then set value to a new File object,
  21011. // representing the same bytes, whose name attribute is filename.
  21012. if (filename !== undefined) {
  21013. /** @type {FilePropertyBag} */
  21014. const options = {
  21015. type: value.type,
  21016. lastModified: value.lastModified
  21017. }
  21018. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  21019. ? new File([value], filename, options)
  21020. : new FileLike(value, filename, options)
  21021. }
  21022. }
  21023. // 4. Return an entry whose name is name and whose value is value.
  21024. return { name, value }
  21025. }
  21026. module.exports = { FormData }
  21027. /***/ }),
  21028. /***/ 1246:
  21029. /***/ ((module) => {
  21030. "use strict";
  21031. // In case of breaking changes, increase the version
  21032. // number to avoid conflicts.
  21033. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  21034. function getGlobalOrigin () {
  21035. return globalThis[globalOrigin]
  21036. }
  21037. function setGlobalOrigin (newOrigin) {
  21038. if (newOrigin === undefined) {
  21039. Object.defineProperty(globalThis, globalOrigin, {
  21040. value: undefined,
  21041. writable: true,
  21042. enumerable: false,
  21043. configurable: false
  21044. })
  21045. return
  21046. }
  21047. const parsedURL = new URL(newOrigin)
  21048. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  21049. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  21050. }
  21051. Object.defineProperty(globalThis, globalOrigin, {
  21052. value: parsedURL,
  21053. writable: true,
  21054. enumerable: false,
  21055. configurable: false
  21056. })
  21057. }
  21058. module.exports = {
  21059. getGlobalOrigin,
  21060. setGlobalOrigin
  21061. }
  21062. /***/ }),
  21063. /***/ 554:
  21064. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21065. "use strict";
  21066. // https://github.com/Ethan-Arrowood/undici-fetch
  21067. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  21068. const { kGuard } = __nccwpck_require__(5861)
  21069. const { kEnumerableProperty } = __nccwpck_require__(3983)
  21070. const {
  21071. makeIterator,
  21072. isValidHeaderName,
  21073. isValidHeaderValue
  21074. } = __nccwpck_require__(2538)
  21075. const util = __nccwpck_require__(3837)
  21076. const { webidl } = __nccwpck_require__(1744)
  21077. const assert = __nccwpck_require__(9491)
  21078. const kHeadersMap = Symbol('headers map')
  21079. const kHeadersSortedMap = Symbol('headers map sorted')
  21080. /**
  21081. * @param {number} code
  21082. */
  21083. function isHTTPWhiteSpaceCharCode (code) {
  21084. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  21085. }
  21086. /**
  21087. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  21088. * @param {string} potentialValue
  21089. */
  21090. function headerValueNormalize (potentialValue) {
  21091. // To normalize a byte sequence potentialValue, remove
  21092. // any leading and trailing HTTP whitespace bytes from
  21093. // potentialValue.
  21094. let i = 0; let j = potentialValue.length
  21095. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  21096. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  21097. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  21098. }
  21099. function fill (headers, object) {
  21100. // To fill a Headers object headers with a given object object, run these steps:
  21101. // 1. If object is a sequence, then for each header in object:
  21102. // Note: webidl conversion to array has already been done.
  21103. if (Array.isArray(object)) {
  21104. for (let i = 0; i < object.length; ++i) {
  21105. const header = object[i]
  21106. // 1. If header does not contain exactly two items, then throw a TypeError.
  21107. if (header.length !== 2) {
  21108. throw webidl.errors.exception({
  21109. header: 'Headers constructor',
  21110. message: `expected name/value pair to be length 2, found ${header.length}.`
  21111. })
  21112. }
  21113. // 2. Append (header’s first item, header’s second item) to headers.
  21114. appendHeader(headers, header[0], header[1])
  21115. }
  21116. } else if (typeof object === 'object' && object !== null) {
  21117. // Note: null should throw
  21118. // 2. Otherwise, object is a record, then for each key → value in object,
  21119. // append (key, value) to headers
  21120. const keys = Object.keys(object)
  21121. for (let i = 0; i < keys.length; ++i) {
  21122. appendHeader(headers, keys[i], object[keys[i]])
  21123. }
  21124. } else {
  21125. throw webidl.errors.conversionFailed({
  21126. prefix: 'Headers constructor',
  21127. argument: 'Argument 1',
  21128. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21129. })
  21130. }
  21131. }
  21132. /**
  21133. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  21134. */
  21135. function appendHeader (headers, name, value) {
  21136. // 1. Normalize value.
  21137. value = headerValueNormalize(value)
  21138. // 2. If name is not a header name or value is not a
  21139. // header value, then throw a TypeError.
  21140. if (!isValidHeaderName(name)) {
  21141. throw webidl.errors.invalidArgument({
  21142. prefix: 'Headers.append',
  21143. value: name,
  21144. type: 'header name'
  21145. })
  21146. } else if (!isValidHeaderValue(value)) {
  21147. throw webidl.errors.invalidArgument({
  21148. prefix: 'Headers.append',
  21149. value,
  21150. type: 'header value'
  21151. })
  21152. }
  21153. // 3. If headers’s guard is "immutable", then throw a TypeError.
  21154. // 4. Otherwise, if headers’s guard is "request" and name is a
  21155. // forbidden header name, return.
  21156. // Note: undici does not implement forbidden header names
  21157. if (headers[kGuard] === 'immutable') {
  21158. throw new TypeError('immutable')
  21159. } else if (headers[kGuard] === 'request-no-cors') {
  21160. // 5. Otherwise, if headers’s guard is "request-no-cors":
  21161. // TODO
  21162. }
  21163. // 6. Otherwise, if headers’s guard is "response" and name is a
  21164. // forbidden response-header name, return.
  21165. // 7. Append (name, value) to headers’s header list.
  21166. return headers[kHeadersList].append(name, value)
  21167. // 8. If headers’s guard is "request-no-cors", then remove
  21168. // privileged no-CORS request headers from headers
  21169. }
  21170. class HeadersList {
  21171. /** @type {[string, string][]|null} */
  21172. cookies = null
  21173. constructor (init) {
  21174. if (init instanceof HeadersList) {
  21175. this[kHeadersMap] = new Map(init[kHeadersMap])
  21176. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  21177. this.cookies = init.cookies === null ? null : [...init.cookies]
  21178. } else {
  21179. this[kHeadersMap] = new Map(init)
  21180. this[kHeadersSortedMap] = null
  21181. }
  21182. }
  21183. // https://fetch.spec.whatwg.org/#header-list-contains
  21184. contains (name) {
  21185. // A header list list contains a header name name if list
  21186. // contains a header whose name is a byte-case-insensitive
  21187. // match for name.
  21188. name = name.toLowerCase()
  21189. return this[kHeadersMap].has(name)
  21190. }
  21191. clear () {
  21192. this[kHeadersMap].clear()
  21193. this[kHeadersSortedMap] = null
  21194. this.cookies = null
  21195. }
  21196. // https://fetch.spec.whatwg.org/#concept-header-list-append
  21197. append (name, value) {
  21198. this[kHeadersSortedMap] = null
  21199. // 1. If list contains name, then set name to the first such
  21200. // header’s name.
  21201. const lowercaseName = name.toLowerCase()
  21202. const exists = this[kHeadersMap].get(lowercaseName)
  21203. // 2. Append (name, value) to list.
  21204. if (exists) {
  21205. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  21206. this[kHeadersMap].set(lowercaseName, {
  21207. name: exists.name,
  21208. value: `${exists.value}${delimiter}${value}`
  21209. })
  21210. } else {
  21211. this[kHeadersMap].set(lowercaseName, { name, value })
  21212. }
  21213. if (lowercaseName === 'set-cookie') {
  21214. this.cookies ??= []
  21215. this.cookies.push(value)
  21216. }
  21217. }
  21218. // https://fetch.spec.whatwg.org/#concept-header-list-set
  21219. set (name, value) {
  21220. this[kHeadersSortedMap] = null
  21221. const lowercaseName = name.toLowerCase()
  21222. if (lowercaseName === 'set-cookie') {
  21223. this.cookies = [value]
  21224. }
  21225. // 1. If list contains name, then set the value of
  21226. // the first such header to value and remove the
  21227. // others.
  21228. // 2. Otherwise, append header (name, value) to list.
  21229. this[kHeadersMap].set(lowercaseName, { name, value })
  21230. }
  21231. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  21232. delete (name) {
  21233. this[kHeadersSortedMap] = null
  21234. name = name.toLowerCase()
  21235. if (name === 'set-cookie') {
  21236. this.cookies = null
  21237. }
  21238. this[kHeadersMap].delete(name)
  21239. }
  21240. // https://fetch.spec.whatwg.org/#concept-header-list-get
  21241. get (name) {
  21242. const value = this[kHeadersMap].get(name.toLowerCase())
  21243. // 1. If list does not contain name, then return null.
  21244. // 2. Return the values of all headers in list whose name
  21245. // is a byte-case-insensitive match for name,
  21246. // separated from each other by 0x2C 0x20, in order.
  21247. return value === undefined ? null : value.value
  21248. }
  21249. * [Symbol.iterator] () {
  21250. // use the lowercased name
  21251. for (const [name, { value }] of this[kHeadersMap]) {
  21252. yield [name, value]
  21253. }
  21254. }
  21255. get entries () {
  21256. const headers = {}
  21257. if (this[kHeadersMap].size) {
  21258. for (const { name, value } of this[kHeadersMap].values()) {
  21259. headers[name] = value
  21260. }
  21261. }
  21262. return headers
  21263. }
  21264. }
  21265. // https://fetch.spec.whatwg.org/#headers-class
  21266. class Headers {
  21267. constructor (init = undefined) {
  21268. if (init === kConstruct) {
  21269. return
  21270. }
  21271. this[kHeadersList] = new HeadersList()
  21272. // The new Headers(init) constructor steps are:
  21273. // 1. Set this’s guard to "none".
  21274. this[kGuard] = 'none'
  21275. // 2. If init is given, then fill this with init.
  21276. if (init !== undefined) {
  21277. init = webidl.converters.HeadersInit(init)
  21278. fill(this, init)
  21279. }
  21280. }
  21281. // https://fetch.spec.whatwg.org/#dom-headers-append
  21282. append (name, value) {
  21283. webidl.brandCheck(this, Headers)
  21284. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21285. name = webidl.converters.ByteString(name)
  21286. value = webidl.converters.ByteString(value)
  21287. return appendHeader(this, name, value)
  21288. }
  21289. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21290. delete (name) {
  21291. webidl.brandCheck(this, Headers)
  21292. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21293. name = webidl.converters.ByteString(name)
  21294. // 1. If name is not a header name, then throw a TypeError.
  21295. if (!isValidHeaderName(name)) {
  21296. throw webidl.errors.invalidArgument({
  21297. prefix: 'Headers.delete',
  21298. value: name,
  21299. type: 'header name'
  21300. })
  21301. }
  21302. // 2. If this’s guard is "immutable", then throw a TypeError.
  21303. // 3. Otherwise, if this’s guard is "request" and name is a
  21304. // forbidden header name, return.
  21305. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21306. // is not a no-CORS-safelisted request-header name, and
  21307. // name is not a privileged no-CORS request-header name,
  21308. // return.
  21309. // 5. Otherwise, if this’s guard is "response" and name is
  21310. // a forbidden response-header name, return.
  21311. // Note: undici does not implement forbidden header names
  21312. if (this[kGuard] === 'immutable') {
  21313. throw new TypeError('immutable')
  21314. } else if (this[kGuard] === 'request-no-cors') {
  21315. // TODO
  21316. }
  21317. // 6. If this’s header list does not contain name, then
  21318. // return.
  21319. if (!this[kHeadersList].contains(name)) {
  21320. return
  21321. }
  21322. // 7. Delete name from this’s header list.
  21323. // 8. If this’s guard is "request-no-cors", then remove
  21324. // privileged no-CORS request headers from this.
  21325. this[kHeadersList].delete(name)
  21326. }
  21327. // https://fetch.spec.whatwg.org/#dom-headers-get
  21328. get (name) {
  21329. webidl.brandCheck(this, Headers)
  21330. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21331. name = webidl.converters.ByteString(name)
  21332. // 1. If name is not a header name, then throw a TypeError.
  21333. if (!isValidHeaderName(name)) {
  21334. throw webidl.errors.invalidArgument({
  21335. prefix: 'Headers.get',
  21336. value: name,
  21337. type: 'header name'
  21338. })
  21339. }
  21340. // 2. Return the result of getting name from this’s header
  21341. // list.
  21342. return this[kHeadersList].get(name)
  21343. }
  21344. // https://fetch.spec.whatwg.org/#dom-headers-has
  21345. has (name) {
  21346. webidl.brandCheck(this, Headers)
  21347. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21348. name = webidl.converters.ByteString(name)
  21349. // 1. If name is not a header name, then throw a TypeError.
  21350. if (!isValidHeaderName(name)) {
  21351. throw webidl.errors.invalidArgument({
  21352. prefix: 'Headers.has',
  21353. value: name,
  21354. type: 'header name'
  21355. })
  21356. }
  21357. // 2. Return true if this’s header list contains name;
  21358. // otherwise false.
  21359. return this[kHeadersList].contains(name)
  21360. }
  21361. // https://fetch.spec.whatwg.org/#dom-headers-set
  21362. set (name, value) {
  21363. webidl.brandCheck(this, Headers)
  21364. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21365. name = webidl.converters.ByteString(name)
  21366. value = webidl.converters.ByteString(value)
  21367. // 1. Normalize value.
  21368. value = headerValueNormalize(value)
  21369. // 2. If name is not a header name or value is not a
  21370. // header value, then throw a TypeError.
  21371. if (!isValidHeaderName(name)) {
  21372. throw webidl.errors.invalidArgument({
  21373. prefix: 'Headers.set',
  21374. value: name,
  21375. type: 'header name'
  21376. })
  21377. } else if (!isValidHeaderValue(value)) {
  21378. throw webidl.errors.invalidArgument({
  21379. prefix: 'Headers.set',
  21380. value,
  21381. type: 'header value'
  21382. })
  21383. }
  21384. // 3. If this’s guard is "immutable", then throw a TypeError.
  21385. // 4. Otherwise, if this’s guard is "request" and name is a
  21386. // forbidden header name, return.
  21387. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21388. // name/value is not a no-CORS-safelisted request-header,
  21389. // return.
  21390. // 6. Otherwise, if this’s guard is "response" and name is a
  21391. // forbidden response-header name, return.
  21392. // Note: undici does not implement forbidden header names
  21393. if (this[kGuard] === 'immutable') {
  21394. throw new TypeError('immutable')
  21395. } else if (this[kGuard] === 'request-no-cors') {
  21396. // TODO
  21397. }
  21398. // 7. Set (name, value) in this’s header list.
  21399. // 8. If this’s guard is "request-no-cors", then remove
  21400. // privileged no-CORS request headers from this
  21401. this[kHeadersList].set(name, value)
  21402. }
  21403. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21404. getSetCookie () {
  21405. webidl.brandCheck(this, Headers)
  21406. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21407. // 2. Return the values of all headers in this’s header list whose name is
  21408. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21409. const list = this[kHeadersList].cookies
  21410. if (list) {
  21411. return [...list]
  21412. }
  21413. return []
  21414. }
  21415. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21416. get [kHeadersSortedMap] () {
  21417. if (this[kHeadersList][kHeadersSortedMap]) {
  21418. return this[kHeadersList][kHeadersSortedMap]
  21419. }
  21420. // 1. Let headers be an empty list of headers with the key being the name
  21421. // and value the value.
  21422. const headers = []
  21423. // 2. Let names be the result of convert header names to a sorted-lowercase
  21424. // set with all the names of the headers in list.
  21425. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21426. const cookies = this[kHeadersList].cookies
  21427. // 3. For each name of names:
  21428. for (let i = 0; i < names.length; ++i) {
  21429. const [name, value] = names[i]
  21430. // 1. If name is `set-cookie`, then:
  21431. if (name === 'set-cookie') {
  21432. // 1. Let values be a list of all values of headers in list whose name
  21433. // is a byte-case-insensitive match for name, in order.
  21434. // 2. For each value of values:
  21435. // 1. Append (name, value) to headers.
  21436. for (let j = 0; j < cookies.length; ++j) {
  21437. headers.push([name, cookies[j]])
  21438. }
  21439. } else {
  21440. // 2. Otherwise:
  21441. // 1. Let value be the result of getting name from list.
  21442. // 2. Assert: value is non-null.
  21443. assert(value !== null)
  21444. // 3. Append (name, value) to headers.
  21445. headers.push([name, value])
  21446. }
  21447. }
  21448. this[kHeadersList][kHeadersSortedMap] = headers
  21449. // 4. Return headers.
  21450. return headers
  21451. }
  21452. keys () {
  21453. webidl.brandCheck(this, Headers)
  21454. if (this[kGuard] === 'immutable') {
  21455. const value = this[kHeadersSortedMap]
  21456. return makeIterator(() => value, 'Headers',
  21457. 'key')
  21458. }
  21459. return makeIterator(
  21460. () => [...this[kHeadersSortedMap].values()],
  21461. 'Headers',
  21462. 'key'
  21463. )
  21464. }
  21465. values () {
  21466. webidl.brandCheck(this, Headers)
  21467. if (this[kGuard] === 'immutable') {
  21468. const value = this[kHeadersSortedMap]
  21469. return makeIterator(() => value, 'Headers',
  21470. 'value')
  21471. }
  21472. return makeIterator(
  21473. () => [...this[kHeadersSortedMap].values()],
  21474. 'Headers',
  21475. 'value'
  21476. )
  21477. }
  21478. entries () {
  21479. webidl.brandCheck(this, Headers)
  21480. if (this[kGuard] === 'immutable') {
  21481. const value = this[kHeadersSortedMap]
  21482. return makeIterator(() => value, 'Headers',
  21483. 'key+value')
  21484. }
  21485. return makeIterator(
  21486. () => [...this[kHeadersSortedMap].values()],
  21487. 'Headers',
  21488. 'key+value'
  21489. )
  21490. }
  21491. /**
  21492. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21493. * @param {unknown} thisArg
  21494. */
  21495. forEach (callbackFn, thisArg = globalThis) {
  21496. webidl.brandCheck(this, Headers)
  21497. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21498. if (typeof callbackFn !== 'function') {
  21499. throw new TypeError(
  21500. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21501. )
  21502. }
  21503. for (const [key, value] of this) {
  21504. callbackFn.apply(thisArg, [value, key, this])
  21505. }
  21506. }
  21507. [Symbol.for('nodejs.util.inspect.custom')] () {
  21508. webidl.brandCheck(this, Headers)
  21509. return this[kHeadersList]
  21510. }
  21511. }
  21512. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21513. Object.defineProperties(Headers.prototype, {
  21514. append: kEnumerableProperty,
  21515. delete: kEnumerableProperty,
  21516. get: kEnumerableProperty,
  21517. has: kEnumerableProperty,
  21518. set: kEnumerableProperty,
  21519. getSetCookie: kEnumerableProperty,
  21520. keys: kEnumerableProperty,
  21521. values: kEnumerableProperty,
  21522. entries: kEnumerableProperty,
  21523. forEach: kEnumerableProperty,
  21524. [Symbol.iterator]: { enumerable: false },
  21525. [Symbol.toStringTag]: {
  21526. value: 'Headers',
  21527. configurable: true
  21528. },
  21529. [util.inspect.custom]: {
  21530. enumerable: false
  21531. }
  21532. })
  21533. webidl.converters.HeadersInit = function (V) {
  21534. if (webidl.util.Type(V) === 'Object') {
  21535. if (V[Symbol.iterator]) {
  21536. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21537. }
  21538. return webidl.converters['record<ByteString, ByteString>'](V)
  21539. }
  21540. throw webidl.errors.conversionFailed({
  21541. prefix: 'Headers constructor',
  21542. argument: 'Argument 1',
  21543. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21544. })
  21545. }
  21546. module.exports = {
  21547. fill,
  21548. Headers,
  21549. HeadersList
  21550. }
  21551. /***/ }),
  21552. /***/ 4881:
  21553. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21554. "use strict";
  21555. // https://github.com/Ethan-Arrowood/undici-fetch
  21556. const {
  21557. Response,
  21558. makeNetworkError,
  21559. makeAppropriateNetworkError,
  21560. filterResponse,
  21561. makeResponse
  21562. } = __nccwpck_require__(7823)
  21563. const { Headers } = __nccwpck_require__(554)
  21564. const { Request, makeRequest } = __nccwpck_require__(8359)
  21565. const zlib = __nccwpck_require__(9796)
  21566. const {
  21567. bytesMatch,
  21568. makePolicyContainer,
  21569. clonePolicyContainer,
  21570. requestBadPort,
  21571. TAOCheck,
  21572. appendRequestOriginHeader,
  21573. responseLocationURL,
  21574. requestCurrentURL,
  21575. setRequestReferrerPolicyOnRedirect,
  21576. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21577. createOpaqueTimingInfo,
  21578. appendFetchMetadata,
  21579. corsCheck,
  21580. crossOriginResourcePolicyCheck,
  21581. determineRequestsReferrer,
  21582. coarsenedSharedCurrentTime,
  21583. createDeferredPromise,
  21584. isBlobLike,
  21585. sameOrigin,
  21586. isCancelled,
  21587. isAborted,
  21588. isErrorLike,
  21589. fullyReadBody,
  21590. readableStreamClose,
  21591. isomorphicEncode,
  21592. urlIsLocal,
  21593. urlIsHttpHttpsScheme,
  21594. urlHasHttpsScheme
  21595. } = __nccwpck_require__(2538)
  21596. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21597. const assert = __nccwpck_require__(9491)
  21598. const { safelyExtractBody } = __nccwpck_require__(9990)
  21599. const {
  21600. redirectStatusSet,
  21601. nullBodyStatus,
  21602. safeMethodsSet,
  21603. requestBodyHeader,
  21604. subresourceSet,
  21605. DOMException
  21606. } = __nccwpck_require__(1037)
  21607. const { kHeadersList } = __nccwpck_require__(2785)
  21608. const EE = __nccwpck_require__(2361)
  21609. const { Readable, pipeline } = __nccwpck_require__(2781)
  21610. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21611. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21612. const { TransformStream } = __nccwpck_require__(5356)
  21613. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21614. const { webidl } = __nccwpck_require__(1744)
  21615. const { STATUS_CODES } = __nccwpck_require__(3685)
  21616. const GET_OR_HEAD = ['GET', 'HEAD']
  21617. /** @type {import('buffer').resolveObjectURL} */
  21618. let resolveObjectURL
  21619. let ReadableStream = globalThis.ReadableStream
  21620. class Fetch extends EE {
  21621. constructor (dispatcher) {
  21622. super()
  21623. this.dispatcher = dispatcher
  21624. this.connection = null
  21625. this.dump = false
  21626. this.state = 'ongoing'
  21627. // 2 terminated listeners get added per request,
  21628. // but only 1 gets removed. If there are 20 redirects,
  21629. // 21 listeners will be added.
  21630. // See https://github.com/nodejs/undici/issues/1711
  21631. // TODO (fix): Find and fix root cause for leaked listener.
  21632. this.setMaxListeners(21)
  21633. }
  21634. terminate (reason) {
  21635. if (this.state !== 'ongoing') {
  21636. return
  21637. }
  21638. this.state = 'terminated'
  21639. this.connection?.destroy(reason)
  21640. this.emit('terminated', reason)
  21641. }
  21642. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21643. abort (error) {
  21644. if (this.state !== 'ongoing') {
  21645. return
  21646. }
  21647. // 1. Set controller’s state to "aborted".
  21648. this.state = 'aborted'
  21649. // 2. Let fallbackError be an "AbortError" DOMException.
  21650. // 3. Set error to fallbackError if it is not given.
  21651. if (!error) {
  21652. error = new DOMException('The operation was aborted.', 'AbortError')
  21653. }
  21654. // 4. Let serializedError be StructuredSerialize(error).
  21655. // If that threw an exception, catch it, and let
  21656. // serializedError be StructuredSerialize(fallbackError).
  21657. // 5. Set controller’s serialized abort reason to serializedError.
  21658. this.serializedAbortReason = error
  21659. this.connection?.destroy(error)
  21660. this.emit('terminated', error)
  21661. }
  21662. }
  21663. // https://fetch.spec.whatwg.org/#fetch-method
  21664. function fetch (input, init = {}) {
  21665. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21666. // 1. Let p be a new promise.
  21667. const p = createDeferredPromise()
  21668. // 2. Let requestObject be the result of invoking the initial value of
  21669. // Request as constructor with input and init as arguments. If this throws
  21670. // an exception, reject p with it and return p.
  21671. let requestObject
  21672. try {
  21673. requestObject = new Request(input, init)
  21674. } catch (e) {
  21675. p.reject(e)
  21676. return p.promise
  21677. }
  21678. // 3. Let request be requestObject’s request.
  21679. const request = requestObject[kState]
  21680. // 4. If requestObject’s signal’s aborted flag is set, then:
  21681. if (requestObject.signal.aborted) {
  21682. // 1. Abort the fetch() call with p, request, null, and
  21683. // requestObject’s signal’s abort reason.
  21684. abortFetch(p, request, null, requestObject.signal.reason)
  21685. // 2. Return p.
  21686. return p.promise
  21687. }
  21688. // 5. Let globalObject be request’s client’s global object.
  21689. const globalObject = request.client.globalObject
  21690. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21691. // request’s service-workers mode to "none".
  21692. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21693. request.serviceWorkers = 'none'
  21694. }
  21695. // 7. Let responseObject be null.
  21696. let responseObject = null
  21697. // 8. Let relevantRealm be this’s relevant Realm.
  21698. const relevantRealm = null
  21699. // 9. Let locallyAborted be false.
  21700. let locallyAborted = false
  21701. // 10. Let controller be null.
  21702. let controller = null
  21703. // 11. Add the following abort steps to requestObject’s signal:
  21704. addAbortListener(
  21705. requestObject.signal,
  21706. () => {
  21707. // 1. Set locallyAborted to true.
  21708. locallyAborted = true
  21709. // 2. Assert: controller is non-null.
  21710. assert(controller != null)
  21711. // 3. Abort controller with requestObject’s signal’s abort reason.
  21712. controller.abort(requestObject.signal.reason)
  21713. // 4. Abort the fetch() call with p, request, responseObject,
  21714. // and requestObject’s signal’s abort reason.
  21715. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21716. }
  21717. )
  21718. // 12. Let handleFetchDone given response response be to finalize and
  21719. // report timing with response, globalObject, and "fetch".
  21720. const handleFetchDone = (response) =>
  21721. finalizeAndReportTiming(response, 'fetch')
  21722. // 13. Set controller to the result of calling fetch given request,
  21723. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21724. // given response being these substeps:
  21725. const processResponse = (response) => {
  21726. // 1. If locallyAborted is true, terminate these substeps.
  21727. if (locallyAborted) {
  21728. return Promise.resolve()
  21729. }
  21730. // 2. If response’s aborted flag is set, then:
  21731. if (response.aborted) {
  21732. // 1. Let deserializedError be the result of deserialize a serialized
  21733. // abort reason given controller’s serialized abort reason and
  21734. // relevantRealm.
  21735. // 2. Abort the fetch() call with p, request, responseObject, and
  21736. // deserializedError.
  21737. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21738. return Promise.resolve()
  21739. }
  21740. // 3. If response is a network error, then reject p with a TypeError
  21741. // and terminate these substeps.
  21742. if (response.type === 'error') {
  21743. p.reject(
  21744. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21745. )
  21746. return Promise.resolve()
  21747. }
  21748. // 4. Set responseObject to the result of creating a Response object,
  21749. // given response, "immutable", and relevantRealm.
  21750. responseObject = new Response()
  21751. responseObject[kState] = response
  21752. responseObject[kRealm] = relevantRealm
  21753. responseObject[kHeaders][kHeadersList] = response.headersList
  21754. responseObject[kHeaders][kGuard] = 'immutable'
  21755. responseObject[kHeaders][kRealm] = relevantRealm
  21756. // 5. Resolve p with responseObject.
  21757. p.resolve(responseObject)
  21758. }
  21759. controller = fetching({
  21760. request,
  21761. processResponseEndOfBody: handleFetchDone,
  21762. processResponse,
  21763. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21764. })
  21765. // 14. Return p.
  21766. return p.promise
  21767. }
  21768. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21769. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21770. // 1. If response is an aborted network error, then return.
  21771. if (response.type === 'error' && response.aborted) {
  21772. return
  21773. }
  21774. // 2. If response’s URL list is null or empty, then return.
  21775. if (!response.urlList?.length) {
  21776. return
  21777. }
  21778. // 3. Let originalURL be response’s URL list[0].
  21779. const originalURL = response.urlList[0]
  21780. // 4. Let timingInfo be response’s timing info.
  21781. let timingInfo = response.timingInfo
  21782. // 5. Let cacheState be response’s cache state.
  21783. let cacheState = response.cacheState
  21784. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21785. if (!urlIsHttpHttpsScheme(originalURL)) {
  21786. return
  21787. }
  21788. // 7. If timingInfo is null, then return.
  21789. if (timingInfo === null) {
  21790. return
  21791. }
  21792. // 8. If response’s timing allow passed flag is not set, then:
  21793. if (!response.timingAllowPassed) {
  21794. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21795. timingInfo = createOpaqueTimingInfo({
  21796. startTime: timingInfo.startTime
  21797. })
  21798. // 2. Set cacheState to the empty string.
  21799. cacheState = ''
  21800. }
  21801. // 9. Set timingInfo’s end time to the coarsened shared current time
  21802. // given global’s relevant settings object’s cross-origin isolated
  21803. // capability.
  21804. // TODO: given global’s relevant settings object’s cross-origin isolated
  21805. // capability?
  21806. timingInfo.endTime = coarsenedSharedCurrentTime()
  21807. // 10. Set response’s timing info to timingInfo.
  21808. response.timingInfo = timingInfo
  21809. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21810. // global, and cacheState.
  21811. markResourceTiming(
  21812. timingInfo,
  21813. originalURL,
  21814. initiatorType,
  21815. globalThis,
  21816. cacheState
  21817. )
  21818. }
  21819. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21820. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21821. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21822. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21823. }
  21824. }
  21825. // https://fetch.spec.whatwg.org/#abort-fetch
  21826. function abortFetch (p, request, responseObject, error) {
  21827. // Note: AbortSignal.reason was added in node v17.2.0
  21828. // which would give us an undefined error to reject with.
  21829. // Remove this once node v16 is no longer supported.
  21830. if (!error) {
  21831. error = new DOMException('The operation was aborted.', 'AbortError')
  21832. }
  21833. // 1. Reject promise with error.
  21834. p.reject(error)
  21835. // 2. If request’s body is not null and is readable, then cancel request’s
  21836. // body with error.
  21837. if (request.body != null && isReadable(request.body?.stream)) {
  21838. request.body.stream.cancel(error).catch((err) => {
  21839. if (err.code === 'ERR_INVALID_STATE') {
  21840. // Node bug?
  21841. return
  21842. }
  21843. throw err
  21844. })
  21845. }
  21846. // 3. If responseObject is null, then return.
  21847. if (responseObject == null) {
  21848. return
  21849. }
  21850. // 4. Let response be responseObject’s response.
  21851. const response = responseObject[kState]
  21852. // 5. If response’s body is not null and is readable, then error response’s
  21853. // body with error.
  21854. if (response.body != null && isReadable(response.body?.stream)) {
  21855. response.body.stream.cancel(error).catch((err) => {
  21856. if (err.code === 'ERR_INVALID_STATE') {
  21857. // Node bug?
  21858. return
  21859. }
  21860. throw err
  21861. })
  21862. }
  21863. }
  21864. // https://fetch.spec.whatwg.org/#fetching
  21865. function fetching ({
  21866. request,
  21867. processRequestBodyChunkLength,
  21868. processRequestEndOfBody,
  21869. processResponse,
  21870. processResponseEndOfBody,
  21871. processResponseConsumeBody,
  21872. useParallelQueue = false,
  21873. dispatcher // undici
  21874. }) {
  21875. // 1. Let taskDestination be null.
  21876. let taskDestination = null
  21877. // 2. Let crossOriginIsolatedCapability be false.
  21878. let crossOriginIsolatedCapability = false
  21879. // 3. If request’s client is non-null, then:
  21880. if (request.client != null) {
  21881. // 1. Set taskDestination to request’s client’s global object.
  21882. taskDestination = request.client.globalObject
  21883. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21884. // isolated capability.
  21885. crossOriginIsolatedCapability =
  21886. request.client.crossOriginIsolatedCapability
  21887. }
  21888. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21889. // starting a new parallel queue.
  21890. // TODO
  21891. // 5. Let timingInfo be a new fetch timing info whose start time and
  21892. // post-redirect start time are the coarsened shared current time given
  21893. // crossOriginIsolatedCapability.
  21894. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21895. const timingInfo = createOpaqueTimingInfo({
  21896. startTime: currenTime
  21897. })
  21898. // 6. Let fetchParams be a new fetch params whose
  21899. // request is request,
  21900. // timing info is timingInfo,
  21901. // process request body chunk length is processRequestBodyChunkLength,
  21902. // process request end-of-body is processRequestEndOfBody,
  21903. // process response is processResponse,
  21904. // process response consume body is processResponseConsumeBody,
  21905. // process response end-of-body is processResponseEndOfBody,
  21906. // task destination is taskDestination,
  21907. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21908. const fetchParams = {
  21909. controller: new Fetch(dispatcher),
  21910. request,
  21911. timingInfo,
  21912. processRequestBodyChunkLength,
  21913. processRequestEndOfBody,
  21914. processResponse,
  21915. processResponseConsumeBody,
  21916. processResponseEndOfBody,
  21917. taskDestination,
  21918. crossOriginIsolatedCapability
  21919. }
  21920. // 7. If request’s body is a byte sequence, then set request’s body to
  21921. // request’s body as a body.
  21922. // NOTE: Since fetching is only called from fetch, body should already be
  21923. // extracted.
  21924. assert(!request.body || request.body.stream)
  21925. // 8. If request’s window is "client", then set request’s window to request’s
  21926. // client, if request’s client’s global object is a Window object; otherwise
  21927. // "no-window".
  21928. if (request.window === 'client') {
  21929. // TODO: What if request.client is null?
  21930. request.window =
  21931. request.client?.globalObject?.constructor?.name === 'Window'
  21932. ? request.client
  21933. : 'no-window'
  21934. }
  21935. // 9. If request’s origin is "client", then set request’s origin to request’s
  21936. // client’s origin.
  21937. if (request.origin === 'client') {
  21938. // TODO: What if request.client is null?
  21939. request.origin = request.client?.origin
  21940. }
  21941. // 10. If all of the following conditions are true:
  21942. // TODO
  21943. // 11. If request’s policy container is "client", then:
  21944. if (request.policyContainer === 'client') {
  21945. // 1. If request’s client is non-null, then set request’s policy
  21946. // container to a clone of request’s client’s policy container. [HTML]
  21947. if (request.client != null) {
  21948. request.policyContainer = clonePolicyContainer(
  21949. request.client.policyContainer
  21950. )
  21951. } else {
  21952. // 2. Otherwise, set request’s policy container to a new policy
  21953. // container.
  21954. request.policyContainer = makePolicyContainer()
  21955. }
  21956. }
  21957. // 12. If request’s header list does not contain `Accept`, then:
  21958. if (!request.headersList.contains('accept')) {
  21959. // 1. Let value be `*/*`.
  21960. const value = '*/*'
  21961. // 2. A user agent should set value to the first matching statement, if
  21962. // any, switching on request’s destination:
  21963. // "document"
  21964. // "frame"
  21965. // "iframe"
  21966. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21967. // "image"
  21968. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21969. // "style"
  21970. // `text/css,*/*;q=0.1`
  21971. // TODO
  21972. // 3. Append `Accept`/value to request’s header list.
  21973. request.headersList.append('accept', value)
  21974. }
  21975. // 13. If request’s header list does not contain `Accept-Language`, then
  21976. // user agents should append `Accept-Language`/an appropriate value to
  21977. // request’s header list.
  21978. if (!request.headersList.contains('accept-language')) {
  21979. request.headersList.append('accept-language', '*')
  21980. }
  21981. // 14. If request’s priority is null, then use request’s initiator and
  21982. // destination appropriately in setting request’s priority to a
  21983. // user-agent-defined object.
  21984. if (request.priority === null) {
  21985. // TODO
  21986. }
  21987. // 15. If request is a subresource request, then:
  21988. if (subresourceSet.has(request.destination)) {
  21989. // TODO
  21990. }
  21991. // 16. Run main fetch given fetchParams.
  21992. mainFetch(fetchParams)
  21993. .catch(err => {
  21994. fetchParams.controller.terminate(err)
  21995. })
  21996. // 17. Return fetchParam's controller
  21997. return fetchParams.controller
  21998. }
  21999. // https://fetch.spec.whatwg.org/#concept-main-fetch
  22000. async function mainFetch (fetchParams, recursive = false) {
  22001. // 1. Let request be fetchParams’s request.
  22002. const request = fetchParams.request
  22003. // 2. Let response be null.
  22004. let response = null
  22005. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  22006. // not local, then set response to a network error.
  22007. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  22008. response = makeNetworkError('local URLs only')
  22009. }
  22010. // 4. Run report Content Security Policy violations for request.
  22011. // TODO
  22012. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  22013. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  22014. // 6. If should request be blocked due to a bad port, should fetching request
  22015. // be blocked as mixed content, or should request be blocked by Content
  22016. // Security Policy returns blocked, then set response to a network error.
  22017. if (requestBadPort(request) === 'blocked') {
  22018. response = makeNetworkError('bad port')
  22019. }
  22020. // TODO: should fetching request be blocked as mixed content?
  22021. // TODO: should request be blocked by Content Security Policy?
  22022. // 7. If request’s referrer policy is the empty string, then set request’s
  22023. // referrer policy to request’s policy container’s referrer policy.
  22024. if (request.referrerPolicy === '') {
  22025. request.referrerPolicy = request.policyContainer.referrerPolicy
  22026. }
  22027. // 8. If request’s referrer is not "no-referrer", then set request’s
  22028. // referrer to the result of invoking determine request’s referrer.
  22029. if (request.referrer !== 'no-referrer') {
  22030. request.referrer = determineRequestsReferrer(request)
  22031. }
  22032. // 9. Set request’s current URL’s scheme to "https" if all of the following
  22033. // conditions are true:
  22034. // - request’s current URL’s scheme is "http"
  22035. // - request’s current URL’s host is a domain
  22036. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  22037. // Matching results in either a superdomain match with an asserted
  22038. // includeSubDomains directive or a congruent match (with or without an
  22039. // asserted includeSubDomains directive). [HSTS]
  22040. // TODO
  22041. // 10. If recursive is false, then run the remaining steps in parallel.
  22042. // TODO
  22043. // 11. If response is null, then set response to the result of running
  22044. // the steps corresponding to the first matching statement:
  22045. if (response === null) {
  22046. response = await (async () => {
  22047. const currentURL = requestCurrentURL(request)
  22048. if (
  22049. // - request’s current URL’s origin is same origin with request’s origin,
  22050. // and request’s response tainting is "basic"
  22051. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  22052. // request’s current URL’s scheme is "data"
  22053. (currentURL.protocol === 'data:') ||
  22054. // - request’s mode is "navigate" or "websocket"
  22055. (request.mode === 'navigate' || request.mode === 'websocket')
  22056. ) {
  22057. // 1. Set request’s response tainting to "basic".
  22058. request.responseTainting = 'basic'
  22059. // 2. Return the result of running scheme fetch given fetchParams.
  22060. return await schemeFetch(fetchParams)
  22061. }
  22062. // request’s mode is "same-origin"
  22063. if (request.mode === 'same-origin') {
  22064. // 1. Return a network error.
  22065. return makeNetworkError('request mode cannot be "same-origin"')
  22066. }
  22067. // request’s mode is "no-cors"
  22068. if (request.mode === 'no-cors') {
  22069. // 1. If request’s redirect mode is not "follow", then return a network
  22070. // error.
  22071. if (request.redirect !== 'follow') {
  22072. return makeNetworkError(
  22073. 'redirect mode cannot be "follow" for "no-cors" request'
  22074. )
  22075. }
  22076. // 2. Set request’s response tainting to "opaque".
  22077. request.responseTainting = 'opaque'
  22078. // 3. Return the result of running scheme fetch given fetchParams.
  22079. return await schemeFetch(fetchParams)
  22080. }
  22081. // request’s current URL’s scheme is not an HTTP(S) scheme
  22082. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  22083. // Return a network error.
  22084. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  22085. }
  22086. // - request’s use-CORS-preflight flag is set
  22087. // - request’s unsafe-request flag is set and either request’s method is
  22088. // not a CORS-safelisted method or CORS-unsafe request-header names with
  22089. // request’s header list is not empty
  22090. // 1. Set request’s response tainting to "cors".
  22091. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  22092. // given fetchParams and true.
  22093. // 3. If corsWithPreflightResponse is a network error, then clear cache
  22094. // entries using request.
  22095. // 4. Return corsWithPreflightResponse.
  22096. // TODO
  22097. // Otherwise
  22098. // 1. Set request’s response tainting to "cors".
  22099. request.responseTainting = 'cors'
  22100. // 2. Return the result of running HTTP fetch given fetchParams.
  22101. return await httpFetch(fetchParams)
  22102. })()
  22103. }
  22104. // 12. If recursive is true, then return response.
  22105. if (recursive) {
  22106. return response
  22107. }
  22108. // 13. If response is not a network error and response is not a filtered
  22109. // response, then:
  22110. if (response.status !== 0 && !response.internalResponse) {
  22111. // If request’s response tainting is "cors", then:
  22112. if (request.responseTainting === 'cors') {
  22113. // 1. Let headerNames be the result of extracting header list values
  22114. // given `Access-Control-Expose-Headers` and response’s header list.
  22115. // TODO
  22116. // 2. If request’s credentials mode is not "include" and headerNames
  22117. // contains `*`, then set response’s CORS-exposed header-name list to
  22118. // all unique header names in response’s header list.
  22119. // TODO
  22120. // 3. Otherwise, if headerNames is not null or failure, then set
  22121. // response’s CORS-exposed header-name list to headerNames.
  22122. // TODO
  22123. }
  22124. // Set response to the following filtered response with response as its
  22125. // internal response, depending on request’s response tainting:
  22126. if (request.responseTainting === 'basic') {
  22127. response = filterResponse(response, 'basic')
  22128. } else if (request.responseTainting === 'cors') {
  22129. response = filterResponse(response, 'cors')
  22130. } else if (request.responseTainting === 'opaque') {
  22131. response = filterResponse(response, 'opaque')
  22132. } else {
  22133. assert(false)
  22134. }
  22135. }
  22136. // 14. Let internalResponse be response, if response is a network error,
  22137. // and response’s internal response otherwise.
  22138. let internalResponse =
  22139. response.status === 0 ? response : response.internalResponse
  22140. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  22141. // request’s URL list.
  22142. if (internalResponse.urlList.length === 0) {
  22143. internalResponse.urlList.push(...request.urlList)
  22144. }
  22145. // 16. If request’s timing allow failed flag is unset, then set
  22146. // internalResponse’s timing allow passed flag.
  22147. if (!request.timingAllowFailed) {
  22148. response.timingAllowPassed = true
  22149. }
  22150. // 17. If response is not a network error and any of the following returns
  22151. // blocked
  22152. // - should internalResponse to request be blocked as mixed content
  22153. // - should internalResponse to request be blocked by Content Security Policy
  22154. // - should internalResponse to request be blocked due to its MIME type
  22155. // - should internalResponse to request be blocked due to nosniff
  22156. // TODO
  22157. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  22158. // internalResponse’s range-requested flag is set, and request’s header
  22159. // list does not contain `Range`, then set response and internalResponse
  22160. // to a network error.
  22161. if (
  22162. response.type === 'opaque' &&
  22163. internalResponse.status === 206 &&
  22164. internalResponse.rangeRequested &&
  22165. !request.headers.contains('range')
  22166. ) {
  22167. response = internalResponse = makeNetworkError()
  22168. }
  22169. // 19. If response is not a network error and either request’s method is
  22170. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  22171. // set internalResponse’s body to null and disregard any enqueuing toward
  22172. // it (if any).
  22173. if (
  22174. response.status !== 0 &&
  22175. (request.method === 'HEAD' ||
  22176. request.method === 'CONNECT' ||
  22177. nullBodyStatus.includes(internalResponse.status))
  22178. ) {
  22179. internalResponse.body = null
  22180. fetchParams.controller.dump = true
  22181. }
  22182. // 20. If request’s integrity metadata is not the empty string, then:
  22183. if (request.integrity) {
  22184. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  22185. // and a network error.
  22186. const processBodyError = (reason) =>
  22187. fetchFinale(fetchParams, makeNetworkError(reason))
  22188. // 2. If request’s response tainting is "opaque", or response’s body is null,
  22189. // then run processBodyError and abort these steps.
  22190. if (request.responseTainting === 'opaque' || response.body == null) {
  22191. processBodyError(response.error)
  22192. return
  22193. }
  22194. // 3. Let processBody given bytes be these steps:
  22195. const processBody = (bytes) => {
  22196. // 1. If bytes do not match request’s integrity metadata,
  22197. // then run processBodyError and abort these steps. [SRI]
  22198. if (!bytesMatch(bytes, request.integrity)) {
  22199. processBodyError('integrity mismatch')
  22200. return
  22201. }
  22202. // 2. Set response’s body to bytes as a body.
  22203. response.body = safelyExtractBody(bytes)[0]
  22204. // 3. Run fetch finale given fetchParams and response.
  22205. fetchFinale(fetchParams, response)
  22206. }
  22207. // 4. Fully read response’s body given processBody and processBodyError.
  22208. await fullyReadBody(response.body, processBody, processBodyError)
  22209. } else {
  22210. // 21. Otherwise, run fetch finale given fetchParams and response.
  22211. fetchFinale(fetchParams, response)
  22212. }
  22213. }
  22214. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  22215. // given a fetch params fetchParams
  22216. function schemeFetch (fetchParams) {
  22217. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  22218. // cancelled state, we do not want this condition to trigger *unless* there have been
  22219. // no redirects. See https://github.com/nodejs/undici/issues/1776
  22220. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22221. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  22222. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  22223. }
  22224. // 2. Let request be fetchParams’s request.
  22225. const { request } = fetchParams
  22226. const { protocol: scheme } = requestCurrentURL(request)
  22227. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  22228. switch (scheme) {
  22229. case 'about:': {
  22230. // If request’s current URL’s path is the string "blank", then return a new response
  22231. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  22232. // and body is the empty byte sequence as a body.
  22233. // Otherwise, return a network error.
  22234. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  22235. }
  22236. case 'blob:': {
  22237. if (!resolveObjectURL) {
  22238. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  22239. }
  22240. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  22241. const blobURLEntry = requestCurrentURL(request)
  22242. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  22243. // Buffer.resolveObjectURL does not ignore URL queries.
  22244. if (blobURLEntry.search.length !== 0) {
  22245. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  22246. }
  22247. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  22248. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  22249. // object is not a Blob object, then return a network error.
  22250. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  22251. return Promise.resolve(makeNetworkError('invalid method'))
  22252. }
  22253. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  22254. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22255. // 4. Let body be bodyWithType’s body.
  22256. const body = bodyWithType[0]
  22257. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22258. const length = isomorphicEncode(`${body.length}`)
  22259. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22260. const type = bodyWithType[1] ?? ''
  22261. // 7. Return a new response whose status message is `OK`, header list is
  22262. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22263. const response = makeResponse({
  22264. statusText: 'OK',
  22265. headersList: [
  22266. ['content-length', { name: 'Content-Length', value: length }],
  22267. ['content-type', { name: 'Content-Type', value: type }]
  22268. ]
  22269. })
  22270. response.body = body
  22271. return Promise.resolve(response)
  22272. }
  22273. case 'data:': {
  22274. // 1. Let dataURLStruct be the result of running the
  22275. // data: URL processor on request’s current URL.
  22276. const currentURL = requestCurrentURL(request)
  22277. const dataURLStruct = dataURLProcessor(currentURL)
  22278. // 2. If dataURLStruct is failure, then return a
  22279. // network error.
  22280. if (dataURLStruct === 'failure') {
  22281. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22282. }
  22283. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22284. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22285. // 4. Return a response whose status message is `OK`,
  22286. // header list is « (`Content-Type`, mimeType) »,
  22287. // and body is dataURLStruct’s body as a body.
  22288. return Promise.resolve(makeResponse({
  22289. statusText: 'OK',
  22290. headersList: [
  22291. ['content-type', { name: 'Content-Type', value: mimeType }]
  22292. ],
  22293. body: safelyExtractBody(dataURLStruct.body)[0]
  22294. }))
  22295. }
  22296. case 'file:': {
  22297. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22298. // When in doubt, return a network error.
  22299. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22300. }
  22301. case 'http:':
  22302. case 'https:': {
  22303. // Return the result of running HTTP fetch given fetchParams.
  22304. return httpFetch(fetchParams)
  22305. .catch((err) => makeNetworkError(err))
  22306. }
  22307. default: {
  22308. return Promise.resolve(makeNetworkError('unknown scheme'))
  22309. }
  22310. }
  22311. }
  22312. // https://fetch.spec.whatwg.org/#finalize-response
  22313. function finalizeResponse (fetchParams, response) {
  22314. // 1. Set fetchParams’s request’s done flag.
  22315. fetchParams.request.done = true
  22316. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22317. // task to run fetchParams’s process response done given response, with
  22318. // fetchParams’s task destination.
  22319. if (fetchParams.processResponseDone != null) {
  22320. queueMicrotask(() => fetchParams.processResponseDone(response))
  22321. }
  22322. }
  22323. // https://fetch.spec.whatwg.org/#fetch-finale
  22324. function fetchFinale (fetchParams, response) {
  22325. // 1. If response is a network error, then:
  22326. if (response.type === 'error') {
  22327. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22328. response.urlList = [fetchParams.request.urlList[0]]
  22329. // 2. Set response’s timing info to the result of creating an opaque timing
  22330. // info for fetchParams’s timing info.
  22331. response.timingInfo = createOpaqueTimingInfo({
  22332. startTime: fetchParams.timingInfo.startTime
  22333. })
  22334. }
  22335. // 2. Let processResponseEndOfBody be the following steps:
  22336. const processResponseEndOfBody = () => {
  22337. // 1. Set fetchParams’s request’s done flag.
  22338. fetchParams.request.done = true
  22339. // If fetchParams’s process response end-of-body is not null,
  22340. // then queue a fetch task to run fetchParams’s process response
  22341. // end-of-body given response with fetchParams’s task destination.
  22342. if (fetchParams.processResponseEndOfBody != null) {
  22343. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22344. }
  22345. }
  22346. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22347. // to run fetchParams’s process response given response, with fetchParams’s
  22348. // task destination.
  22349. if (fetchParams.processResponse != null) {
  22350. queueMicrotask(() => fetchParams.processResponse(response))
  22351. }
  22352. // 4. If response’s body is null, then run processResponseEndOfBody.
  22353. if (response.body == null) {
  22354. processResponseEndOfBody()
  22355. } else {
  22356. // 5. Otherwise:
  22357. // 1. Let transformStream be a new a TransformStream.
  22358. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22359. // enqueues chunk in transformStream.
  22360. const identityTransformAlgorithm = (chunk, controller) => {
  22361. controller.enqueue(chunk)
  22362. }
  22363. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22364. // and flushAlgorithm set to processResponseEndOfBody.
  22365. const transformStream = new TransformStream({
  22366. start () {},
  22367. transform: identityTransformAlgorithm,
  22368. flush: processResponseEndOfBody
  22369. }, {
  22370. size () {
  22371. return 1
  22372. }
  22373. }, {
  22374. size () {
  22375. return 1
  22376. }
  22377. })
  22378. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22379. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22380. }
  22381. // 6. If fetchParams’s process response consume body is non-null, then:
  22382. if (fetchParams.processResponseConsumeBody != null) {
  22383. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22384. // process response consume body given response and nullOrBytes.
  22385. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22386. // 2. Let processBodyError be this step: run fetchParams’s process
  22387. // response consume body given response and failure.
  22388. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22389. // 3. If response’s body is null, then queue a fetch task to run processBody
  22390. // given null, with fetchParams’s task destination.
  22391. if (response.body == null) {
  22392. queueMicrotask(() => processBody(null))
  22393. } else {
  22394. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22395. // and fetchParams’s task destination.
  22396. return fullyReadBody(response.body, processBody, processBodyError)
  22397. }
  22398. return Promise.resolve()
  22399. }
  22400. }
  22401. // https://fetch.spec.whatwg.org/#http-fetch
  22402. async function httpFetch (fetchParams) {
  22403. // 1. Let request be fetchParams’s request.
  22404. const request = fetchParams.request
  22405. // 2. Let response be null.
  22406. let response = null
  22407. // 3. Let actualResponse be null.
  22408. let actualResponse = null
  22409. // 4. Let timingInfo be fetchParams’s timing info.
  22410. const timingInfo = fetchParams.timingInfo
  22411. // 5. If request’s service-workers mode is "all", then:
  22412. if (request.serviceWorkers === 'all') {
  22413. // TODO
  22414. }
  22415. // 6. If response is null, then:
  22416. if (response === null) {
  22417. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22418. // TODO
  22419. // 2. If request’s redirect mode is "follow", then set request’s
  22420. // service-workers mode to "none".
  22421. if (request.redirect === 'follow') {
  22422. request.serviceWorkers = 'none'
  22423. }
  22424. // 3. Set response and actualResponse to the result of running
  22425. // HTTP-network-or-cache fetch given fetchParams.
  22426. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22427. // 4. If request’s response tainting is "cors" and a CORS check
  22428. // for request and response returns failure, then return a network error.
  22429. if (
  22430. request.responseTainting === 'cors' &&
  22431. corsCheck(request, response) === 'failure'
  22432. ) {
  22433. return makeNetworkError('cors failure')
  22434. }
  22435. // 5. If the TAO check for request and response returns failure, then set
  22436. // request’s timing allow failed flag.
  22437. if (TAOCheck(request, response) === 'failure') {
  22438. request.timingAllowFailed = true
  22439. }
  22440. }
  22441. // 7. If either request’s response tainting or response’s type
  22442. // is "opaque", and the cross-origin resource policy check with
  22443. // request’s origin, request’s client, request’s destination,
  22444. // and actualResponse returns blocked, then return a network error.
  22445. if (
  22446. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22447. crossOriginResourcePolicyCheck(
  22448. request.origin,
  22449. request.client,
  22450. request.destination,
  22451. actualResponse
  22452. ) === 'blocked'
  22453. ) {
  22454. return makeNetworkError('blocked')
  22455. }
  22456. // 8. If actualResponse’s status is a redirect status, then:
  22457. if (redirectStatusSet.has(actualResponse.status)) {
  22458. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22459. // and the connection uses HTTP/2, then user agents may, and are even
  22460. // encouraged to, transmit an RST_STREAM frame.
  22461. // See, https://github.com/whatwg/fetch/issues/1288
  22462. if (request.redirect !== 'manual') {
  22463. fetchParams.controller.connection.destroy()
  22464. }
  22465. // 2. Switch on request’s redirect mode:
  22466. if (request.redirect === 'error') {
  22467. // Set response to a network error.
  22468. response = makeNetworkError('unexpected redirect')
  22469. } else if (request.redirect === 'manual') {
  22470. // Set response to an opaque-redirect filtered response whose internal
  22471. // response is actualResponse.
  22472. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22473. // but that doesn't make sense server side.
  22474. // See https://github.com/nodejs/undici/issues/1193.
  22475. response = actualResponse
  22476. } else if (request.redirect === 'follow') {
  22477. // Set response to the result of running HTTP-redirect fetch given
  22478. // fetchParams and response.
  22479. response = await httpRedirectFetch(fetchParams, response)
  22480. } else {
  22481. assert(false)
  22482. }
  22483. }
  22484. // 9. Set response’s timing info to timingInfo.
  22485. response.timingInfo = timingInfo
  22486. // 10. Return response.
  22487. return response
  22488. }
  22489. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22490. function httpRedirectFetch (fetchParams, response) {
  22491. // 1. Let request be fetchParams’s request.
  22492. const request = fetchParams.request
  22493. // 2. Let actualResponse be response, if response is not a filtered response,
  22494. // and response’s internal response otherwise.
  22495. const actualResponse = response.internalResponse
  22496. ? response.internalResponse
  22497. : response
  22498. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22499. // URL’s fragment.
  22500. let locationURL
  22501. try {
  22502. locationURL = responseLocationURL(
  22503. actualResponse,
  22504. requestCurrentURL(request).hash
  22505. )
  22506. // 4. If locationURL is null, then return response.
  22507. if (locationURL == null) {
  22508. return response
  22509. }
  22510. } catch (err) {
  22511. // 5. If locationURL is failure, then return a network error.
  22512. return Promise.resolve(makeNetworkError(err))
  22513. }
  22514. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22515. // error.
  22516. if (!urlIsHttpHttpsScheme(locationURL)) {
  22517. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22518. }
  22519. // 7. If request’s redirect count is 20, then return a network error.
  22520. if (request.redirectCount === 20) {
  22521. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22522. }
  22523. // 8. Increase request’s redirect count by 1.
  22524. request.redirectCount += 1
  22525. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22526. // request’s origin is not same origin with locationURL’s origin, then return
  22527. // a network error.
  22528. if (
  22529. request.mode === 'cors' &&
  22530. (locationURL.username || locationURL.password) &&
  22531. !sameOrigin(request, locationURL)
  22532. ) {
  22533. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22534. }
  22535. // 10. If request’s response tainting is "cors" and locationURL includes
  22536. // credentials, then return a network error.
  22537. if (
  22538. request.responseTainting === 'cors' &&
  22539. (locationURL.username || locationURL.password)
  22540. ) {
  22541. return Promise.resolve(makeNetworkError(
  22542. 'URL cannot contain credentials for request mode "cors"'
  22543. ))
  22544. }
  22545. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22546. // and request’s body’s source is null, then return a network error.
  22547. if (
  22548. actualResponse.status !== 303 &&
  22549. request.body != null &&
  22550. request.body.source == null
  22551. ) {
  22552. return Promise.resolve(makeNetworkError())
  22553. }
  22554. // 12. If one of the following is true
  22555. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22556. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22557. if (
  22558. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22559. (actualResponse.status === 303 &&
  22560. !GET_OR_HEAD.includes(request.method))
  22561. ) {
  22562. // then:
  22563. // 1. Set request’s method to `GET` and request’s body to null.
  22564. request.method = 'GET'
  22565. request.body = null
  22566. // 2. For each headerName of request-body-header name, delete headerName from
  22567. // request’s header list.
  22568. for (const headerName of requestBodyHeader) {
  22569. request.headersList.delete(headerName)
  22570. }
  22571. }
  22572. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22573. // origin, then for each headerName of CORS non-wildcard request-header name,
  22574. // delete headerName from request’s header list.
  22575. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22576. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22577. request.headersList.delete('authorization')
  22578. // https://fetch.spec.whatwg.org/#authentication-entries
  22579. request.headersList.delete('proxy-authorization', true)
  22580. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22581. request.headersList.delete('cookie')
  22582. request.headersList.delete('host')
  22583. }
  22584. // 14. If request’s body is non-null, then set request’s body to the first return
  22585. // value of safely extracting request’s body’s source.
  22586. if (request.body != null) {
  22587. assert(request.body.source != null)
  22588. request.body = safelyExtractBody(request.body.source)[0]
  22589. }
  22590. // 15. Let timingInfo be fetchParams’s timing info.
  22591. const timingInfo = fetchParams.timingInfo
  22592. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22593. // coarsened shared current time given fetchParams’s cross-origin isolated
  22594. // capability.
  22595. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22596. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22597. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22598. // redirect start time to timingInfo’s start time.
  22599. if (timingInfo.redirectStartTime === 0) {
  22600. timingInfo.redirectStartTime = timingInfo.startTime
  22601. }
  22602. // 18. Append locationURL to request’s URL list.
  22603. request.urlList.push(locationURL)
  22604. // 19. Invoke set request’s referrer policy on redirect on request and
  22605. // actualResponse.
  22606. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22607. // 20. Return the result of running main fetch given fetchParams and true.
  22608. return mainFetch(fetchParams, true)
  22609. }
  22610. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22611. async function httpNetworkOrCacheFetch (
  22612. fetchParams,
  22613. isAuthenticationFetch = false,
  22614. isNewConnectionFetch = false
  22615. ) {
  22616. // 1. Let request be fetchParams’s request.
  22617. const request = fetchParams.request
  22618. // 2. Let httpFetchParams be null.
  22619. let httpFetchParams = null
  22620. // 3. Let httpRequest be null.
  22621. let httpRequest = null
  22622. // 4. Let response be null.
  22623. let response = null
  22624. // 5. Let storedResponse be null.
  22625. // TODO: cache
  22626. // 6. Let httpCache be null.
  22627. const httpCache = null
  22628. // 7. Let the revalidatingFlag be unset.
  22629. const revalidatingFlag = false
  22630. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22631. // 1. If request’s window is "no-window" and request’s redirect mode is
  22632. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22633. // request.
  22634. if (request.window === 'no-window' && request.redirect === 'error') {
  22635. httpFetchParams = fetchParams
  22636. httpRequest = request
  22637. } else {
  22638. // Otherwise:
  22639. // 1. Set httpRequest to a clone of request.
  22640. httpRequest = makeRequest(request)
  22641. // 2. Set httpFetchParams to a copy of fetchParams.
  22642. httpFetchParams = { ...fetchParams }
  22643. // 3. Set httpFetchParams’s request to httpRequest.
  22644. httpFetchParams.request = httpRequest
  22645. }
  22646. // 3. Let includeCredentials be true if one of
  22647. const includeCredentials =
  22648. request.credentials === 'include' ||
  22649. (request.credentials === 'same-origin' &&
  22650. request.responseTainting === 'basic')
  22651. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22652. // body is non-null; otherwise null.
  22653. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22654. // 5. Let contentLengthHeaderValue be null.
  22655. let contentLengthHeaderValue = null
  22656. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22657. // `PUT`, then set contentLengthHeaderValue to `0`.
  22658. if (
  22659. httpRequest.body == null &&
  22660. ['POST', 'PUT'].includes(httpRequest.method)
  22661. ) {
  22662. contentLengthHeaderValue = '0'
  22663. }
  22664. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22665. // contentLength, serialized and isomorphic encoded.
  22666. if (contentLength != null) {
  22667. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22668. }
  22669. // 8. If contentLengthHeaderValue is non-null, then append
  22670. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22671. // list.
  22672. if (contentLengthHeaderValue != null) {
  22673. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22674. }
  22675. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22676. // contentLengthHeaderValue) to httpRequest’s header list.
  22677. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22678. // then:
  22679. if (contentLength != null && httpRequest.keepalive) {
  22680. // NOTE: keepalive is a noop outside of browser context.
  22681. }
  22682. // 11. If httpRequest’s referrer is a URL, then append
  22683. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22684. // to httpRequest’s header list.
  22685. if (httpRequest.referrer instanceof URL) {
  22686. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22687. }
  22688. // 12. Append a request `Origin` header for httpRequest.
  22689. appendRequestOriginHeader(httpRequest)
  22690. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22691. appendFetchMetadata(httpRequest)
  22692. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22693. // user agents should append `User-Agent`/default `User-Agent` value to
  22694. // httpRequest’s header list.
  22695. if (!httpRequest.headersList.contains('user-agent')) {
  22696. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22697. }
  22698. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22699. // list contains `If-Modified-Since`, `If-None-Match`,
  22700. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22701. // httpRequest’s cache mode to "no-store".
  22702. if (
  22703. httpRequest.cache === 'default' &&
  22704. (httpRequest.headersList.contains('if-modified-since') ||
  22705. httpRequest.headersList.contains('if-none-match') ||
  22706. httpRequest.headersList.contains('if-unmodified-since') ||
  22707. httpRequest.headersList.contains('if-match') ||
  22708. httpRequest.headersList.contains('if-range'))
  22709. ) {
  22710. httpRequest.cache = 'no-store'
  22711. }
  22712. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22713. // no-cache cache-control header modification flag is unset, and
  22714. // httpRequest’s header list does not contain `Cache-Control`, then append
  22715. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22716. if (
  22717. httpRequest.cache === 'no-cache' &&
  22718. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22719. !httpRequest.headersList.contains('cache-control')
  22720. ) {
  22721. httpRequest.headersList.append('cache-control', 'max-age=0')
  22722. }
  22723. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22724. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22725. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22726. // `Pragma`/`no-cache` to httpRequest’s header list.
  22727. if (!httpRequest.headersList.contains('pragma')) {
  22728. httpRequest.headersList.append('pragma', 'no-cache')
  22729. }
  22730. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22731. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22732. if (!httpRequest.headersList.contains('cache-control')) {
  22733. httpRequest.headersList.append('cache-control', 'no-cache')
  22734. }
  22735. }
  22736. // 18. If httpRequest’s header list contains `Range`, then append
  22737. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22738. if (httpRequest.headersList.contains('range')) {
  22739. httpRequest.headersList.append('accept-encoding', 'identity')
  22740. }
  22741. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22742. // header if httpRequest’s header list contains that header’s name.
  22743. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22744. if (!httpRequest.headersList.contains('accept-encoding')) {
  22745. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22746. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22747. } else {
  22748. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22749. }
  22750. }
  22751. httpRequest.headersList.delete('host')
  22752. // 20. If includeCredentials is true, then:
  22753. if (includeCredentials) {
  22754. // 1. If the user agent is not configured to block cookies for httpRequest
  22755. // (see section 7 of [COOKIES]), then:
  22756. // TODO: credentials
  22757. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22758. // TODO: credentials
  22759. }
  22760. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22761. // TODO: proxy-authentication
  22762. // 22. Set httpCache to the result of determining the HTTP cache
  22763. // partition, given httpRequest.
  22764. // TODO: cache
  22765. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22766. // "no-store".
  22767. if (httpCache == null) {
  22768. httpRequest.cache = 'no-store'
  22769. }
  22770. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22771. // then:
  22772. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22773. // TODO: cache
  22774. }
  22775. // 9. If aborted, then return the appropriate network error for fetchParams.
  22776. // TODO
  22777. // 10. If response is null, then:
  22778. if (response == null) {
  22779. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22780. // network error.
  22781. if (httpRequest.mode === 'only-if-cached') {
  22782. return makeNetworkError('only if cached')
  22783. }
  22784. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22785. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22786. const forwardResponse = await httpNetworkFetch(
  22787. httpFetchParams,
  22788. includeCredentials,
  22789. isNewConnectionFetch
  22790. )
  22791. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22792. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22793. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22794. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22795. if (
  22796. !safeMethodsSet.has(httpRequest.method) &&
  22797. forwardResponse.status >= 200 &&
  22798. forwardResponse.status <= 399
  22799. ) {
  22800. // TODO: cache
  22801. }
  22802. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22803. // then:
  22804. if (revalidatingFlag && forwardResponse.status === 304) {
  22805. // TODO: cache
  22806. }
  22807. // 5. If response is null, then:
  22808. if (response == null) {
  22809. // 1. Set response to forwardResponse.
  22810. response = forwardResponse
  22811. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22812. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22813. // TODO: cache
  22814. }
  22815. }
  22816. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22817. response.urlList = [...httpRequest.urlList]
  22818. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22819. // range-requested flag.
  22820. if (httpRequest.headersList.contains('range')) {
  22821. response.rangeRequested = true
  22822. }
  22823. // 13. Set response’s request-includes-credentials to includeCredentials.
  22824. response.requestIncludesCredentials = includeCredentials
  22825. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22826. // "cors", includeCredentials is true, and request’s window is an environment
  22827. // settings object, then:
  22828. // TODO
  22829. // 15. If response’s status is 407, then:
  22830. if (response.status === 407) {
  22831. // 1. If request’s window is "no-window", then return a network error.
  22832. if (request.window === 'no-window') {
  22833. return makeNetworkError()
  22834. }
  22835. // 2. ???
  22836. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22837. if (isCancelled(fetchParams)) {
  22838. return makeAppropriateNetworkError(fetchParams)
  22839. }
  22840. // 4. Prompt the end user as appropriate in request’s window and store
  22841. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22842. // TODO: Invoke some kind of callback?
  22843. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22844. // fetchParams.
  22845. // TODO
  22846. return makeNetworkError('proxy authentication required')
  22847. }
  22848. // 16. If all of the following are true
  22849. if (
  22850. // response’s status is 421
  22851. response.status === 421 &&
  22852. // isNewConnectionFetch is false
  22853. !isNewConnectionFetch &&
  22854. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22855. (request.body == null || request.body.source != null)
  22856. ) {
  22857. // then:
  22858. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22859. if (isCancelled(fetchParams)) {
  22860. return makeAppropriateNetworkError(fetchParams)
  22861. }
  22862. // 2. Set response to the result of running HTTP-network-or-cache
  22863. // fetch given fetchParams, isAuthenticationFetch, and true.
  22864. // TODO (spec): The spec doesn't specify this but we need to cancel
  22865. // the active response before we can start a new one.
  22866. // https://github.com/whatwg/fetch/issues/1293
  22867. fetchParams.controller.connection.destroy()
  22868. response = await httpNetworkOrCacheFetch(
  22869. fetchParams,
  22870. isAuthenticationFetch,
  22871. true
  22872. )
  22873. }
  22874. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22875. if (isAuthenticationFetch) {
  22876. // TODO
  22877. }
  22878. // 18. Return response.
  22879. return response
  22880. }
  22881. // https://fetch.spec.whatwg.org/#http-network-fetch
  22882. async function httpNetworkFetch (
  22883. fetchParams,
  22884. includeCredentials = false,
  22885. forceNewConnection = false
  22886. ) {
  22887. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22888. fetchParams.controller.connection = {
  22889. abort: null,
  22890. destroyed: false,
  22891. destroy (err) {
  22892. if (!this.destroyed) {
  22893. this.destroyed = true
  22894. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22895. }
  22896. }
  22897. }
  22898. // 1. Let request be fetchParams’s request.
  22899. const request = fetchParams.request
  22900. // 2. Let response be null.
  22901. let response = null
  22902. // 3. Let timingInfo be fetchParams’s timing info.
  22903. const timingInfo = fetchParams.timingInfo
  22904. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22905. // given request.
  22906. // TODO: cache
  22907. const httpCache = null
  22908. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22909. if (httpCache == null) {
  22910. request.cache = 'no-store'
  22911. }
  22912. // 6. Let networkPartitionKey be the result of determining the network
  22913. // partition key given request.
  22914. // TODO
  22915. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22916. // "no".
  22917. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22918. // 8. Switch on request’s mode:
  22919. if (request.mode === 'websocket') {
  22920. // Let connection be the result of obtaining a WebSocket connection,
  22921. // given request’s current URL.
  22922. // TODO
  22923. } else {
  22924. // Let connection be the result of obtaining a connection, given
  22925. // networkPartitionKey, request’s current URL’s origin,
  22926. // includeCredentials, and forceNewConnection.
  22927. // TODO
  22928. }
  22929. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22930. // 1. If connection is failure, then return a network error.
  22931. // 2. Set timingInfo’s final connection timing info to the result of
  22932. // calling clamp and coarsen connection timing info with connection’s
  22933. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22934. // cross-origin isolated capability.
  22935. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22936. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22937. // `chunked`) to request’s header list.
  22938. // 4. Set timingInfo’s final network-request start time to the coarsened
  22939. // shared current time given fetchParams’s cross-origin isolated
  22940. // capability.
  22941. // 5. Set response to the result of making an HTTP request over connection
  22942. // using request with the following caveats:
  22943. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22944. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22945. // - If request’s body is non-null, and request’s body’s source is null,
  22946. // then the user agent may have a buffer of up to 64 kibibytes and store
  22947. // a part of request’s body in that buffer. If the user agent reads from
  22948. // request’s body beyond that buffer’s size and the user agent needs to
  22949. // resend request, then instead return a network error.
  22950. // - Set timingInfo’s final network-response start time to the coarsened
  22951. // shared current time given fetchParams’s cross-origin isolated capability,
  22952. // immediately after the user agent’s HTTP parser receives the first byte
  22953. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22954. // line for HTTP/1.x).
  22955. // - Wait until all the headers are transmitted.
  22956. // - Any responses whose status is in the range 100 to 199, inclusive,
  22957. // and is not 101, are to be ignored, except for the purposes of setting
  22958. // timingInfo’s final network-response start time above.
  22959. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22960. // response is transferred via HTTP/1.0 or older, then return a network
  22961. // error.
  22962. // - If the HTTP request results in a TLS client certificate dialog, then:
  22963. // 1. If request’s window is an environment settings object, make the
  22964. // dialog available in request’s window.
  22965. // 2. Otherwise, return a network error.
  22966. // To transmit request’s body body, run these steps:
  22967. let requestBody = null
  22968. // 1. If body is null and fetchParams’s process request end-of-body is
  22969. // non-null, then queue a fetch task given fetchParams’s process request
  22970. // end-of-body and fetchParams’s task destination.
  22971. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22972. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22973. } else if (request.body != null) {
  22974. // 2. Otherwise, if body is non-null:
  22975. // 1. Let processBodyChunk given bytes be these steps:
  22976. const processBodyChunk = async function * (bytes) {
  22977. // 1. If the ongoing fetch is terminated, then abort these steps.
  22978. if (isCancelled(fetchParams)) {
  22979. return
  22980. }
  22981. // 2. Run this step in parallel: transmit bytes.
  22982. yield bytes
  22983. // 3. If fetchParams’s process request body is non-null, then run
  22984. // fetchParams’s process request body given bytes’s length.
  22985. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  22986. }
  22987. // 2. Let processEndOfBody be these steps:
  22988. const processEndOfBody = () => {
  22989. // 1. If fetchParams is canceled, then abort these steps.
  22990. if (isCancelled(fetchParams)) {
  22991. return
  22992. }
  22993. // 2. If fetchParams’s process request end-of-body is non-null,
  22994. // then run fetchParams’s process request end-of-body.
  22995. if (fetchParams.processRequestEndOfBody) {
  22996. fetchParams.processRequestEndOfBody()
  22997. }
  22998. }
  22999. // 3. Let processBodyError given e be these steps:
  23000. const processBodyError = (e) => {
  23001. // 1. If fetchParams is canceled, then abort these steps.
  23002. if (isCancelled(fetchParams)) {
  23003. return
  23004. }
  23005. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  23006. if (e.name === 'AbortError') {
  23007. fetchParams.controller.abort()
  23008. } else {
  23009. fetchParams.controller.terminate(e)
  23010. }
  23011. }
  23012. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  23013. // processBodyError, and fetchParams’s task destination.
  23014. requestBody = (async function * () {
  23015. try {
  23016. for await (const bytes of request.body.stream) {
  23017. yield * processBodyChunk(bytes)
  23018. }
  23019. processEndOfBody()
  23020. } catch (err) {
  23021. processBodyError(err)
  23022. }
  23023. })()
  23024. }
  23025. try {
  23026. // socket is only provided for websockets
  23027. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  23028. if (socket) {
  23029. response = makeResponse({ status, statusText, headersList, socket })
  23030. } else {
  23031. const iterator = body[Symbol.asyncIterator]()
  23032. fetchParams.controller.next = () => iterator.next()
  23033. response = makeResponse({ status, statusText, headersList })
  23034. }
  23035. } catch (err) {
  23036. // 10. If aborted, then:
  23037. if (err.name === 'AbortError') {
  23038. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23039. fetchParams.controller.connection.destroy()
  23040. // 2. Return the appropriate network error for fetchParams.
  23041. return makeAppropriateNetworkError(fetchParams, err)
  23042. }
  23043. return makeNetworkError(err)
  23044. }
  23045. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  23046. // if it is suspended.
  23047. const pullAlgorithm = () => {
  23048. fetchParams.controller.resume()
  23049. }
  23050. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  23051. // controller with reason, given reason.
  23052. const cancelAlgorithm = (reason) => {
  23053. fetchParams.controller.abort(reason)
  23054. }
  23055. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  23056. // the user agent.
  23057. // TODO
  23058. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  23059. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  23060. // TODO
  23061. // 15. Let stream be a new ReadableStream.
  23062. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  23063. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  23064. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  23065. if (!ReadableStream) {
  23066. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  23067. }
  23068. const stream = new ReadableStream(
  23069. {
  23070. async start (controller) {
  23071. fetchParams.controller.controller = controller
  23072. },
  23073. async pull (controller) {
  23074. await pullAlgorithm(controller)
  23075. },
  23076. async cancel (reason) {
  23077. await cancelAlgorithm(reason)
  23078. }
  23079. },
  23080. {
  23081. highWaterMark: 0,
  23082. size () {
  23083. return 1
  23084. }
  23085. }
  23086. )
  23087. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  23088. // 1. Set response’s body to a new body whose stream is stream.
  23089. response.body = { stream }
  23090. // 2. If response is not a network error and request’s cache mode is
  23091. // not "no-store", then update response in httpCache for request.
  23092. // TODO
  23093. // 3. If includeCredentials is true and the user agent is not configured
  23094. // to block cookies for request (see section 7 of [COOKIES]), then run the
  23095. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  23096. // the value of each header whose name is a byte-case-insensitive match for
  23097. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  23098. // TODO
  23099. // 18. If aborted, then:
  23100. // TODO
  23101. // 19. Run these steps in parallel:
  23102. // 1. Run these steps, but abort when fetchParams is canceled:
  23103. fetchParams.controller.on('terminated', onAborted)
  23104. fetchParams.controller.resume = async () => {
  23105. // 1. While true
  23106. while (true) {
  23107. // 1-3. See onData...
  23108. // 4. Set bytes to the result of handling content codings given
  23109. // codings and bytes.
  23110. let bytes
  23111. let isFailure
  23112. try {
  23113. const { done, value } = await fetchParams.controller.next()
  23114. if (isAborted(fetchParams)) {
  23115. break
  23116. }
  23117. bytes = done ? undefined : value
  23118. } catch (err) {
  23119. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  23120. // zlib doesn't like empty streams.
  23121. bytes = undefined
  23122. } else {
  23123. bytes = err
  23124. // err may be propagated from the result of calling readablestream.cancel,
  23125. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  23126. isFailure = true
  23127. }
  23128. }
  23129. if (bytes === undefined) {
  23130. // 2. Otherwise, if the bytes transmission for response’s message
  23131. // body is done normally and stream is readable, then close
  23132. // stream, finalize response for fetchParams and response, and
  23133. // abort these in-parallel steps.
  23134. readableStreamClose(fetchParams.controller.controller)
  23135. finalizeResponse(fetchParams, response)
  23136. return
  23137. }
  23138. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  23139. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  23140. // 6. If bytes is failure, then terminate fetchParams’s controller.
  23141. if (isFailure) {
  23142. fetchParams.controller.terminate(bytes)
  23143. return
  23144. }
  23145. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  23146. // into stream.
  23147. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  23148. // 8. If stream is errored, then terminate the ongoing fetch.
  23149. if (isErrored(stream)) {
  23150. fetchParams.controller.terminate()
  23151. return
  23152. }
  23153. // 9. If stream doesn’t need more data ask the user agent to suspend
  23154. // the ongoing fetch.
  23155. if (!fetchParams.controller.controller.desiredSize) {
  23156. return
  23157. }
  23158. }
  23159. }
  23160. // 2. If aborted, then:
  23161. function onAborted (reason) {
  23162. // 2. If fetchParams is aborted, then:
  23163. if (isAborted(fetchParams)) {
  23164. // 1. Set response’s aborted flag.
  23165. response.aborted = true
  23166. // 2. If stream is readable, then error stream with the result of
  23167. // deserialize a serialized abort reason given fetchParams’s
  23168. // controller’s serialized abort reason and an
  23169. // implementation-defined realm.
  23170. if (isReadable(stream)) {
  23171. fetchParams.controller.controller.error(
  23172. fetchParams.controller.serializedAbortReason
  23173. )
  23174. }
  23175. } else {
  23176. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  23177. if (isReadable(stream)) {
  23178. fetchParams.controller.controller.error(new TypeError('terminated', {
  23179. cause: isErrorLike(reason) ? reason : undefined
  23180. }))
  23181. }
  23182. }
  23183. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23184. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  23185. fetchParams.controller.connection.destroy()
  23186. }
  23187. // 20. Return response.
  23188. return response
  23189. async function dispatch ({ body }) {
  23190. const url = requestCurrentURL(request)
  23191. /** @type {import('../..').Agent} */
  23192. const agent = fetchParams.controller.dispatcher
  23193. return new Promise((resolve, reject) => agent.dispatch(
  23194. {
  23195. path: url.pathname + url.search,
  23196. origin: url.origin,
  23197. method: request.method,
  23198. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  23199. headers: request.headersList.entries,
  23200. maxRedirections: 0,
  23201. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  23202. },
  23203. {
  23204. body: null,
  23205. abort: null,
  23206. onConnect (abort) {
  23207. // TODO (fix): Do we need connection here?
  23208. const { connection } = fetchParams.controller
  23209. if (connection.destroyed) {
  23210. abort(new DOMException('The operation was aborted.', 'AbortError'))
  23211. } else {
  23212. fetchParams.controller.on('terminated', abort)
  23213. this.abort = connection.abort = abort
  23214. }
  23215. },
  23216. onHeaders (status, headersList, resume, statusText) {
  23217. if (status < 200) {
  23218. return
  23219. }
  23220. let codings = []
  23221. let location = ''
  23222. const headers = new Headers()
  23223. // For H2, the headers are a plain JS object
  23224. // We distinguish between them and iterate accordingly
  23225. if (Array.isArray(headersList)) {
  23226. for (let n = 0; n < headersList.length; n += 2) {
  23227. const key = headersList[n + 0].toString('latin1')
  23228. const val = headersList[n + 1].toString('latin1')
  23229. if (key.toLowerCase() === 'content-encoding') {
  23230. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23231. // "All content-coding values are case-insensitive..."
  23232. codings = val.toLowerCase().split(',').map((x) => x.trim())
  23233. } else if (key.toLowerCase() === 'location') {
  23234. location = val
  23235. }
  23236. headers[kHeadersList].append(key, val)
  23237. }
  23238. } else {
  23239. const keys = Object.keys(headersList)
  23240. for (const key of keys) {
  23241. const val = headersList[key]
  23242. if (key.toLowerCase() === 'content-encoding') {
  23243. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23244. // "All content-coding values are case-insensitive..."
  23245. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  23246. } else if (key.toLowerCase() === 'location') {
  23247. location = val
  23248. }
  23249. headers[kHeadersList].append(key, val)
  23250. }
  23251. }
  23252. this.body = new Readable({ read: resume })
  23253. const decoders = []
  23254. const willFollow = request.redirect === 'follow' &&
  23255. location &&
  23256. redirectStatusSet.has(status)
  23257. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23258. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23259. for (const coding of codings) {
  23260. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23261. if (coding === 'x-gzip' || coding === 'gzip') {
  23262. decoders.push(zlib.createGunzip({
  23263. // Be less strict when decoding compressed responses, since sometimes
  23264. // servers send slightly invalid responses that are still accepted
  23265. // by common browsers.
  23266. // Always using Z_SYNC_FLUSH is what cURL does.
  23267. flush: zlib.constants.Z_SYNC_FLUSH,
  23268. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23269. }))
  23270. } else if (coding === 'deflate') {
  23271. decoders.push(zlib.createInflate())
  23272. } else if (coding === 'br') {
  23273. decoders.push(zlib.createBrotliDecompress())
  23274. } else {
  23275. decoders.length = 0
  23276. break
  23277. }
  23278. }
  23279. }
  23280. resolve({
  23281. status,
  23282. statusText,
  23283. headersList: headers[kHeadersList],
  23284. body: decoders.length
  23285. ? pipeline(this.body, ...decoders, () => { })
  23286. : this.body.on('error', () => {})
  23287. })
  23288. return true
  23289. },
  23290. onData (chunk) {
  23291. if (fetchParams.controller.dump) {
  23292. return
  23293. }
  23294. // 1. If one or more bytes have been transmitted from response’s
  23295. // message body, then:
  23296. // 1. Let bytes be the transmitted bytes.
  23297. const bytes = chunk
  23298. // 2. Let codings be the result of extracting header list values
  23299. // given `Content-Encoding` and response’s header list.
  23300. // See pullAlgorithm.
  23301. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23302. timingInfo.encodedBodySize += bytes.byteLength
  23303. // 4. See pullAlgorithm...
  23304. return this.body.push(bytes)
  23305. },
  23306. onComplete () {
  23307. if (this.abort) {
  23308. fetchParams.controller.off('terminated', this.abort)
  23309. }
  23310. fetchParams.controller.ended = true
  23311. this.body.push(null)
  23312. },
  23313. onError (error) {
  23314. if (this.abort) {
  23315. fetchParams.controller.off('terminated', this.abort)
  23316. }
  23317. this.body?.destroy(error)
  23318. fetchParams.controller.terminate(error)
  23319. reject(error)
  23320. },
  23321. onUpgrade (status, headersList, socket) {
  23322. if (status !== 101) {
  23323. return
  23324. }
  23325. const headers = new Headers()
  23326. for (let n = 0; n < headersList.length; n += 2) {
  23327. const key = headersList[n + 0].toString('latin1')
  23328. const val = headersList[n + 1].toString('latin1')
  23329. headers[kHeadersList].append(key, val)
  23330. }
  23331. resolve({
  23332. status,
  23333. statusText: STATUS_CODES[status],
  23334. headersList: headers[kHeadersList],
  23335. socket
  23336. })
  23337. return true
  23338. }
  23339. }
  23340. ))
  23341. }
  23342. }
  23343. module.exports = {
  23344. fetch,
  23345. Fetch,
  23346. fetching,
  23347. finalizeAndReportTiming
  23348. }
  23349. /***/ }),
  23350. /***/ 8359:
  23351. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23352. "use strict";
  23353. /* globals AbortController */
  23354. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23355. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23356. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23357. const util = __nccwpck_require__(3983)
  23358. const {
  23359. isValidHTTPToken,
  23360. sameOrigin,
  23361. normalizeMethod,
  23362. makePolicyContainer,
  23363. normalizeMethodRecord
  23364. } = __nccwpck_require__(2538)
  23365. const {
  23366. forbiddenMethodsSet,
  23367. corsSafeListedMethodsSet,
  23368. referrerPolicy,
  23369. requestRedirect,
  23370. requestMode,
  23371. requestCredentials,
  23372. requestCache,
  23373. requestDuplex
  23374. } = __nccwpck_require__(1037)
  23375. const { kEnumerableProperty } = util
  23376. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23377. const { webidl } = __nccwpck_require__(1744)
  23378. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23379. const { URLSerializer } = __nccwpck_require__(685)
  23380. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23381. const assert = __nccwpck_require__(9491)
  23382. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23383. let TransformStream = globalThis.TransformStream
  23384. const kAbortController = Symbol('abortController')
  23385. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23386. signal.removeEventListener('abort', abort)
  23387. })
  23388. // https://fetch.spec.whatwg.org/#request-class
  23389. class Request {
  23390. // https://fetch.spec.whatwg.org/#dom-request
  23391. constructor (input, init = {}) {
  23392. if (input === kConstruct) {
  23393. return
  23394. }
  23395. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23396. input = webidl.converters.RequestInfo(input)
  23397. init = webidl.converters.RequestInit(init)
  23398. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23399. this[kRealm] = {
  23400. settingsObject: {
  23401. baseUrl: getGlobalOrigin(),
  23402. get origin () {
  23403. return this.baseUrl?.origin
  23404. },
  23405. policyContainer: makePolicyContainer()
  23406. }
  23407. }
  23408. // 1. Let request be null.
  23409. let request = null
  23410. // 2. Let fallbackMode be null.
  23411. let fallbackMode = null
  23412. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23413. const baseUrl = this[kRealm].settingsObject.baseUrl
  23414. // 4. Let signal be null.
  23415. let signal = null
  23416. // 5. If input is a string, then:
  23417. if (typeof input === 'string') {
  23418. // 1. Let parsedURL be the result of parsing input with baseURL.
  23419. // 2. If parsedURL is failure, then throw a TypeError.
  23420. let parsedURL
  23421. try {
  23422. parsedURL = new URL(input, baseUrl)
  23423. } catch (err) {
  23424. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23425. }
  23426. // 3. If parsedURL includes credentials, then throw a TypeError.
  23427. if (parsedURL.username || parsedURL.password) {
  23428. throw new TypeError(
  23429. 'Request cannot be constructed from a URL that includes credentials: ' +
  23430. input
  23431. )
  23432. }
  23433. // 4. Set request to a new request whose URL is parsedURL.
  23434. request = makeRequest({ urlList: [parsedURL] })
  23435. // 5. Set fallbackMode to "cors".
  23436. fallbackMode = 'cors'
  23437. } else {
  23438. // 6. Otherwise:
  23439. // 7. Assert: input is a Request object.
  23440. assert(input instanceof Request)
  23441. // 8. Set request to input’s request.
  23442. request = input[kState]
  23443. // 9. Set signal to input’s signal.
  23444. signal = input[kSignal]
  23445. }
  23446. // 7. Let origin be this’s relevant settings object’s origin.
  23447. const origin = this[kRealm].settingsObject.origin
  23448. // 8. Let window be "client".
  23449. let window = 'client'
  23450. // 9. If request’s window is an environment settings object and its origin
  23451. // is same origin with origin, then set window to request’s window.
  23452. if (
  23453. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23454. sameOrigin(request.window, origin)
  23455. ) {
  23456. window = request.window
  23457. }
  23458. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23459. if (init.window != null) {
  23460. throw new TypeError(`'window' option '${window}' must be null`)
  23461. }
  23462. // 11. If init["window"] exists, then set window to "no-window".
  23463. if ('window' in init) {
  23464. window = 'no-window'
  23465. }
  23466. // 12. Set request to a new request with the following properties:
  23467. request = makeRequest({
  23468. // URL request’s URL.
  23469. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23470. // method request’s method.
  23471. method: request.method,
  23472. // header list A copy of request’s header list.
  23473. // undici implementation note: headersList is cloned in makeRequest
  23474. headersList: request.headersList,
  23475. // unsafe-request flag Set.
  23476. unsafeRequest: request.unsafeRequest,
  23477. // client This’s relevant settings object.
  23478. client: this[kRealm].settingsObject,
  23479. // window window.
  23480. window,
  23481. // priority request’s priority.
  23482. priority: request.priority,
  23483. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23484. // being handled by a service worker. In this scenario a request can have an origin that is different
  23485. // from the current client.
  23486. origin: request.origin,
  23487. // referrer request’s referrer.
  23488. referrer: request.referrer,
  23489. // referrer policy request’s referrer policy.
  23490. referrerPolicy: request.referrerPolicy,
  23491. // mode request’s mode.
  23492. mode: request.mode,
  23493. // credentials mode request’s credentials mode.
  23494. credentials: request.credentials,
  23495. // cache mode request’s cache mode.
  23496. cache: request.cache,
  23497. // redirect mode request’s redirect mode.
  23498. redirect: request.redirect,
  23499. // integrity metadata request’s integrity metadata.
  23500. integrity: request.integrity,
  23501. // keepalive request’s keepalive.
  23502. keepalive: request.keepalive,
  23503. // reload-navigation flag request’s reload-navigation flag.
  23504. reloadNavigation: request.reloadNavigation,
  23505. // history-navigation flag request’s history-navigation flag.
  23506. historyNavigation: request.historyNavigation,
  23507. // URL list A clone of request’s URL list.
  23508. urlList: [...request.urlList]
  23509. })
  23510. const initHasKey = Object.keys(init).length !== 0
  23511. // 13. If init is not empty, then:
  23512. if (initHasKey) {
  23513. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23514. if (request.mode === 'navigate') {
  23515. request.mode = 'same-origin'
  23516. }
  23517. // 2. Unset request’s reload-navigation flag.
  23518. request.reloadNavigation = false
  23519. // 3. Unset request’s history-navigation flag.
  23520. request.historyNavigation = false
  23521. // 4. Set request’s origin to "client".
  23522. request.origin = 'client'
  23523. // 5. Set request’s referrer to "client"
  23524. request.referrer = 'client'
  23525. // 6. Set request’s referrer policy to the empty string.
  23526. request.referrerPolicy = ''
  23527. // 7. Set request’s URL to request’s current URL.
  23528. request.url = request.urlList[request.urlList.length - 1]
  23529. // 8. Set request’s URL list to « request’s URL ».
  23530. request.urlList = [request.url]
  23531. }
  23532. // 14. If init["referrer"] exists, then:
  23533. if (init.referrer !== undefined) {
  23534. // 1. Let referrer be init["referrer"].
  23535. const referrer = init.referrer
  23536. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23537. if (referrer === '') {
  23538. request.referrer = 'no-referrer'
  23539. } else {
  23540. // 1. Let parsedReferrer be the result of parsing referrer with
  23541. // baseURL.
  23542. // 2. If parsedReferrer is failure, then throw a TypeError.
  23543. let parsedReferrer
  23544. try {
  23545. parsedReferrer = new URL(referrer, baseUrl)
  23546. } catch (err) {
  23547. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23548. }
  23549. // 3. If one of the following is true
  23550. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23551. // - parsedReferrer’s origin is not same origin with origin
  23552. // then set request’s referrer to "client".
  23553. if (
  23554. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23555. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23556. ) {
  23557. request.referrer = 'client'
  23558. } else {
  23559. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23560. request.referrer = parsedReferrer
  23561. }
  23562. }
  23563. }
  23564. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23565. // to it.
  23566. if (init.referrerPolicy !== undefined) {
  23567. request.referrerPolicy = init.referrerPolicy
  23568. }
  23569. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23570. let mode
  23571. if (init.mode !== undefined) {
  23572. mode = init.mode
  23573. } else {
  23574. mode = fallbackMode
  23575. }
  23576. // 17. If mode is "navigate", then throw a TypeError.
  23577. if (mode === 'navigate') {
  23578. throw webidl.errors.exception({
  23579. header: 'Request constructor',
  23580. message: 'invalid request mode navigate.'
  23581. })
  23582. }
  23583. // 18. If mode is non-null, set request’s mode to mode.
  23584. if (mode != null) {
  23585. request.mode = mode
  23586. }
  23587. // 19. If init["credentials"] exists, then set request’s credentials mode
  23588. // to it.
  23589. if (init.credentials !== undefined) {
  23590. request.credentials = init.credentials
  23591. }
  23592. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23593. if (init.cache !== undefined) {
  23594. request.cache = init.cache
  23595. }
  23596. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23597. // not "same-origin", then throw a TypeError.
  23598. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23599. throw new TypeError(
  23600. "'only-if-cached' can be set only with 'same-origin' mode"
  23601. )
  23602. }
  23603. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23604. if (init.redirect !== undefined) {
  23605. request.redirect = init.redirect
  23606. }
  23607. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23608. if (init.integrity != null) {
  23609. request.integrity = String(init.integrity)
  23610. }
  23611. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23612. if (init.keepalive !== undefined) {
  23613. request.keepalive = Boolean(init.keepalive)
  23614. }
  23615. // 25. If init["method"] exists, then:
  23616. if (init.method !== undefined) {
  23617. // 1. Let method be init["method"].
  23618. let method = init.method
  23619. // 2. If method is not a method or method is a forbidden method, then
  23620. // throw a TypeError.
  23621. if (!isValidHTTPToken(method)) {
  23622. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23623. }
  23624. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23625. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23626. }
  23627. // 3. Normalize method.
  23628. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23629. // 4. Set request’s method to method.
  23630. request.method = method
  23631. }
  23632. // 26. If init["signal"] exists, then set signal to it.
  23633. if (init.signal !== undefined) {
  23634. signal = init.signal
  23635. }
  23636. // 27. Set this’s request to request.
  23637. this[kState] = request
  23638. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23639. // Realm.
  23640. // TODO: could this be simplified with AbortSignal.any
  23641. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23642. const ac = new AbortController()
  23643. this[kSignal] = ac.signal
  23644. this[kSignal][kRealm] = this[kRealm]
  23645. // 29. If signal is not null, then make this’s signal follow signal.
  23646. if (signal != null) {
  23647. if (
  23648. !signal ||
  23649. typeof signal.aborted !== 'boolean' ||
  23650. typeof signal.addEventListener !== 'function'
  23651. ) {
  23652. throw new TypeError(
  23653. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23654. )
  23655. }
  23656. if (signal.aborted) {
  23657. ac.abort(signal.reason)
  23658. } else {
  23659. // Keep a strong ref to ac while request object
  23660. // is alive. This is needed to prevent AbortController
  23661. // from being prematurely garbage collected.
  23662. // See, https://github.com/nodejs/undici/issues/1926.
  23663. this[kAbortController] = ac
  23664. const acRef = new WeakRef(ac)
  23665. const abort = function () {
  23666. const ac = acRef.deref()
  23667. if (ac !== undefined) {
  23668. ac.abort(this.reason)
  23669. }
  23670. }
  23671. // Third-party AbortControllers may not work with these.
  23672. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23673. try {
  23674. // If the max amount of listeners is equal to the default, increase it
  23675. // This is only available in node >= v19.9.0
  23676. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23677. setMaxListeners(100, signal)
  23678. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23679. setMaxListeners(100, signal)
  23680. }
  23681. } catch {}
  23682. util.addAbortListener(signal, abort)
  23683. requestFinalizer.register(ac, { signal, abort })
  23684. }
  23685. }
  23686. // 30. Set this’s headers to a new Headers object with this’s relevant
  23687. // Realm, whose header list is request’s header list and guard is
  23688. // "request".
  23689. this[kHeaders] = new Headers(kConstruct)
  23690. this[kHeaders][kHeadersList] = request.headersList
  23691. this[kHeaders][kGuard] = 'request'
  23692. this[kHeaders][kRealm] = this[kRealm]
  23693. // 31. If this’s request’s mode is "no-cors", then:
  23694. if (mode === 'no-cors') {
  23695. // 1. If this’s request’s method is not a CORS-safelisted method,
  23696. // then throw a TypeError.
  23697. if (!corsSafeListedMethodsSet.has(request.method)) {
  23698. throw new TypeError(
  23699. `'${request.method} is unsupported in no-cors mode.`
  23700. )
  23701. }
  23702. // 2. Set this’s headers’s guard to "request-no-cors".
  23703. this[kHeaders][kGuard] = 'request-no-cors'
  23704. }
  23705. // 32. If init is not empty, then:
  23706. if (initHasKey) {
  23707. /** @type {HeadersList} */
  23708. const headersList = this[kHeaders][kHeadersList]
  23709. // 1. Let headers be a copy of this’s headers and its associated header
  23710. // list.
  23711. // 2. If init["headers"] exists, then set headers to init["headers"].
  23712. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23713. // 3. Empty this’s headers’s header list.
  23714. headersList.clear()
  23715. // 4. If headers is a Headers object, then for each header in its header
  23716. // list, append header’s name/header’s value to this’s headers.
  23717. if (headers instanceof HeadersList) {
  23718. for (const [key, val] of headers) {
  23719. headersList.append(key, val)
  23720. }
  23721. // Note: Copy the `set-cookie` meta-data.
  23722. headersList.cookies = headers.cookies
  23723. } else {
  23724. // 5. Otherwise, fill this’s headers with headers.
  23725. fillHeaders(this[kHeaders], headers)
  23726. }
  23727. }
  23728. // 33. Let inputBody be input’s request’s body if input is a Request
  23729. // object; otherwise null.
  23730. const inputBody = input instanceof Request ? input[kState].body : null
  23731. // 34. If either init["body"] exists and is non-null or inputBody is
  23732. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23733. // TypeError.
  23734. if (
  23735. (init.body != null || inputBody != null) &&
  23736. (request.method === 'GET' || request.method === 'HEAD')
  23737. ) {
  23738. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23739. }
  23740. // 35. Let initBody be null.
  23741. let initBody = null
  23742. // 36. If init["body"] exists and is non-null, then:
  23743. if (init.body != null) {
  23744. // 1. Let Content-Type be null.
  23745. // 2. Set initBody and Content-Type to the result of extracting
  23746. // init["body"], with keepalive set to request’s keepalive.
  23747. const [extractedBody, contentType] = extractBody(
  23748. init.body,
  23749. request.keepalive
  23750. )
  23751. initBody = extractedBody
  23752. // 3, If Content-Type is non-null and this’s headers’s header list does
  23753. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23754. // this’s headers.
  23755. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23756. this[kHeaders].append('content-type', contentType)
  23757. }
  23758. }
  23759. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23760. // inputBody.
  23761. const inputOrInitBody = initBody ?? inputBody
  23762. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23763. // null, then:
  23764. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23765. // 1. If initBody is non-null and init["duplex"] does not exist,
  23766. // then throw a TypeError.
  23767. if (initBody != null && init.duplex == null) {
  23768. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23769. }
  23770. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23771. // then throw a TypeError.
  23772. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23773. throw new TypeError(
  23774. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23775. )
  23776. }
  23777. // 3. Set this’s request’s use-CORS-preflight flag.
  23778. request.useCORSPreflightFlag = true
  23779. }
  23780. // 39. Let finalBody be inputOrInitBody.
  23781. let finalBody = inputOrInitBody
  23782. // 40. If initBody is null and inputBody is non-null, then:
  23783. if (initBody == null && inputBody != null) {
  23784. // 1. If input is unusable, then throw a TypeError.
  23785. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23786. throw new TypeError(
  23787. 'Cannot construct a Request with a Request object that has already been used.'
  23788. )
  23789. }
  23790. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23791. if (!TransformStream) {
  23792. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23793. }
  23794. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23795. const identityTransform = new TransformStream()
  23796. inputBody.stream.pipeThrough(identityTransform)
  23797. finalBody = {
  23798. source: inputBody.source,
  23799. length: inputBody.length,
  23800. stream: identityTransform.readable
  23801. }
  23802. }
  23803. // 41. Set this’s request’s body to finalBody.
  23804. this[kState].body = finalBody
  23805. }
  23806. // Returns request’s HTTP method, which is "GET" by default.
  23807. get method () {
  23808. webidl.brandCheck(this, Request)
  23809. // The method getter steps are to return this’s request’s method.
  23810. return this[kState].method
  23811. }
  23812. // Returns the URL of request as a string.
  23813. get url () {
  23814. webidl.brandCheck(this, Request)
  23815. // The url getter steps are to return this’s request’s URL, serialized.
  23816. return URLSerializer(this[kState].url)
  23817. }
  23818. // Returns a Headers object consisting of the headers associated with request.
  23819. // Note that headers added in the network layer by the user agent will not
  23820. // be accounted for in this object, e.g., the "Host" header.
  23821. get headers () {
  23822. webidl.brandCheck(this, Request)
  23823. // The headers getter steps are to return this’s headers.
  23824. return this[kHeaders]
  23825. }
  23826. // Returns the kind of resource requested by request, e.g., "document"
  23827. // or "script".
  23828. get destination () {
  23829. webidl.brandCheck(this, Request)
  23830. // The destination getter are to return this’s request’s destination.
  23831. return this[kState].destination
  23832. }
  23833. // Returns the referrer of request. Its value can be a same-origin URL if
  23834. // explicitly set in init, the empty string to indicate no referrer, and
  23835. // "about:client" when defaulting to the global’s default. This is used
  23836. // during fetching to determine the value of the `Referer` header of the
  23837. // request being made.
  23838. get referrer () {
  23839. webidl.brandCheck(this, Request)
  23840. // 1. If this’s request’s referrer is "no-referrer", then return the
  23841. // empty string.
  23842. if (this[kState].referrer === 'no-referrer') {
  23843. return ''
  23844. }
  23845. // 2. If this’s request’s referrer is "client", then return
  23846. // "about:client".
  23847. if (this[kState].referrer === 'client') {
  23848. return 'about:client'
  23849. }
  23850. // Return this’s request’s referrer, serialized.
  23851. return this[kState].referrer.toString()
  23852. }
  23853. // Returns the referrer policy associated with request.
  23854. // This is used during fetching to compute the value of the request’s
  23855. // referrer.
  23856. get referrerPolicy () {
  23857. webidl.brandCheck(this, Request)
  23858. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23859. return this[kState].referrerPolicy
  23860. }
  23861. // Returns the mode associated with request, which is a string indicating
  23862. // whether the request will use CORS, or will be restricted to same-origin
  23863. // URLs.
  23864. get mode () {
  23865. webidl.brandCheck(this, Request)
  23866. // The mode getter steps are to return this’s request’s mode.
  23867. return this[kState].mode
  23868. }
  23869. // Returns the credentials mode associated with request,
  23870. // which is a string indicating whether credentials will be sent with the
  23871. // request always, never, or only when sent to a same-origin URL.
  23872. get credentials () {
  23873. // The credentials getter steps are to return this’s request’s credentials mode.
  23874. return this[kState].credentials
  23875. }
  23876. // Returns the cache mode associated with request,
  23877. // which is a string indicating how the request will
  23878. // interact with the browser’s cache when fetching.
  23879. get cache () {
  23880. webidl.brandCheck(this, Request)
  23881. // The cache getter steps are to return this’s request’s cache mode.
  23882. return this[kState].cache
  23883. }
  23884. // Returns the redirect mode associated with request,
  23885. // which is a string indicating how redirects for the
  23886. // request will be handled during fetching. A request
  23887. // will follow redirects by default.
  23888. get redirect () {
  23889. webidl.brandCheck(this, Request)
  23890. // The redirect getter steps are to return this’s request’s redirect mode.
  23891. return this[kState].redirect
  23892. }
  23893. // Returns request’s subresource integrity metadata, which is a
  23894. // cryptographic hash of the resource being fetched. Its value
  23895. // consists of multiple hashes separated by whitespace. [SRI]
  23896. get integrity () {
  23897. webidl.brandCheck(this, Request)
  23898. // The integrity getter steps are to return this’s request’s integrity
  23899. // metadata.
  23900. return this[kState].integrity
  23901. }
  23902. // Returns a boolean indicating whether or not request can outlive the
  23903. // global in which it was created.
  23904. get keepalive () {
  23905. webidl.brandCheck(this, Request)
  23906. // The keepalive getter steps are to return this’s request’s keepalive.
  23907. return this[kState].keepalive
  23908. }
  23909. // Returns a boolean indicating whether or not request is for a reload
  23910. // navigation.
  23911. get isReloadNavigation () {
  23912. webidl.brandCheck(this, Request)
  23913. // The isReloadNavigation getter steps are to return true if this’s
  23914. // request’s reload-navigation flag is set; otherwise false.
  23915. return this[kState].reloadNavigation
  23916. }
  23917. // Returns a boolean indicating whether or not request is for a history
  23918. // navigation (a.k.a. back-foward navigation).
  23919. get isHistoryNavigation () {
  23920. webidl.brandCheck(this, Request)
  23921. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23922. // history-navigation flag is set; otherwise false.
  23923. return this[kState].historyNavigation
  23924. }
  23925. // Returns the signal associated with request, which is an AbortSignal
  23926. // object indicating whether or not request has been aborted, and its
  23927. // abort event handler.
  23928. get signal () {
  23929. webidl.brandCheck(this, Request)
  23930. // The signal getter steps are to return this’s signal.
  23931. return this[kSignal]
  23932. }
  23933. get body () {
  23934. webidl.brandCheck(this, Request)
  23935. return this[kState].body ? this[kState].body.stream : null
  23936. }
  23937. get bodyUsed () {
  23938. webidl.brandCheck(this, Request)
  23939. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23940. }
  23941. get duplex () {
  23942. webidl.brandCheck(this, Request)
  23943. return 'half'
  23944. }
  23945. // Returns a clone of request.
  23946. clone () {
  23947. webidl.brandCheck(this, Request)
  23948. // 1. If this is unusable, then throw a TypeError.
  23949. if (this.bodyUsed || this.body?.locked) {
  23950. throw new TypeError('unusable')
  23951. }
  23952. // 2. Let clonedRequest be the result of cloning this’s request.
  23953. const clonedRequest = cloneRequest(this[kState])
  23954. // 3. Let clonedRequestObject be the result of creating a Request object,
  23955. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23956. const clonedRequestObject = new Request(kConstruct)
  23957. clonedRequestObject[kState] = clonedRequest
  23958. clonedRequestObject[kRealm] = this[kRealm]
  23959. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23960. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23961. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23962. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23963. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23964. const ac = new AbortController()
  23965. if (this.signal.aborted) {
  23966. ac.abort(this.signal.reason)
  23967. } else {
  23968. util.addAbortListener(
  23969. this.signal,
  23970. () => {
  23971. ac.abort(this.signal.reason)
  23972. }
  23973. )
  23974. }
  23975. clonedRequestObject[kSignal] = ac.signal
  23976. // 4. Return clonedRequestObject.
  23977. return clonedRequestObject
  23978. }
  23979. }
  23980. mixinBody(Request)
  23981. function makeRequest (init) {
  23982. // https://fetch.spec.whatwg.org/#requests
  23983. const request = {
  23984. method: 'GET',
  23985. localURLsOnly: false,
  23986. unsafeRequest: false,
  23987. body: null,
  23988. client: null,
  23989. reservedClient: null,
  23990. replacesClientId: '',
  23991. window: 'client',
  23992. keepalive: false,
  23993. serviceWorkers: 'all',
  23994. initiator: '',
  23995. destination: '',
  23996. priority: null,
  23997. origin: 'client',
  23998. policyContainer: 'client',
  23999. referrer: 'client',
  24000. referrerPolicy: '',
  24001. mode: 'no-cors',
  24002. useCORSPreflightFlag: false,
  24003. credentials: 'same-origin',
  24004. useCredentials: false,
  24005. cache: 'default',
  24006. redirect: 'follow',
  24007. integrity: '',
  24008. cryptoGraphicsNonceMetadata: '',
  24009. parserMetadata: '',
  24010. reloadNavigation: false,
  24011. historyNavigation: false,
  24012. userActivation: false,
  24013. taintedOrigin: false,
  24014. redirectCount: 0,
  24015. responseTainting: 'basic',
  24016. preventNoCacheCacheControlHeaderModification: false,
  24017. done: false,
  24018. timingAllowFailed: false,
  24019. ...init,
  24020. headersList: init.headersList
  24021. ? new HeadersList(init.headersList)
  24022. : new HeadersList()
  24023. }
  24024. request.url = request.urlList[0]
  24025. return request
  24026. }
  24027. // https://fetch.spec.whatwg.org/#concept-request-clone
  24028. function cloneRequest (request) {
  24029. // To clone a request request, run these steps:
  24030. // 1. Let newRequest be a copy of request, except for its body.
  24031. const newRequest = makeRequest({ ...request, body: null })
  24032. // 2. If request’s body is non-null, set newRequest’s body to the
  24033. // result of cloning request’s body.
  24034. if (request.body != null) {
  24035. newRequest.body = cloneBody(request.body)
  24036. }
  24037. // 3. Return newRequest.
  24038. return newRequest
  24039. }
  24040. Object.defineProperties(Request.prototype, {
  24041. method: kEnumerableProperty,
  24042. url: kEnumerableProperty,
  24043. headers: kEnumerableProperty,
  24044. redirect: kEnumerableProperty,
  24045. clone: kEnumerableProperty,
  24046. signal: kEnumerableProperty,
  24047. duplex: kEnumerableProperty,
  24048. destination: kEnumerableProperty,
  24049. body: kEnumerableProperty,
  24050. bodyUsed: kEnumerableProperty,
  24051. isHistoryNavigation: kEnumerableProperty,
  24052. isReloadNavigation: kEnumerableProperty,
  24053. keepalive: kEnumerableProperty,
  24054. integrity: kEnumerableProperty,
  24055. cache: kEnumerableProperty,
  24056. credentials: kEnumerableProperty,
  24057. attribute: kEnumerableProperty,
  24058. referrerPolicy: kEnumerableProperty,
  24059. referrer: kEnumerableProperty,
  24060. mode: kEnumerableProperty,
  24061. [Symbol.toStringTag]: {
  24062. value: 'Request',
  24063. configurable: true
  24064. }
  24065. })
  24066. webidl.converters.Request = webidl.interfaceConverter(
  24067. Request
  24068. )
  24069. // https://fetch.spec.whatwg.org/#requestinfo
  24070. webidl.converters.RequestInfo = function (V) {
  24071. if (typeof V === 'string') {
  24072. return webidl.converters.USVString(V)
  24073. }
  24074. if (V instanceof Request) {
  24075. return webidl.converters.Request(V)
  24076. }
  24077. return webidl.converters.USVString(V)
  24078. }
  24079. webidl.converters.AbortSignal = webidl.interfaceConverter(
  24080. AbortSignal
  24081. )
  24082. // https://fetch.spec.whatwg.org/#requestinit
  24083. webidl.converters.RequestInit = webidl.dictionaryConverter([
  24084. {
  24085. key: 'method',
  24086. converter: webidl.converters.ByteString
  24087. },
  24088. {
  24089. key: 'headers',
  24090. converter: webidl.converters.HeadersInit
  24091. },
  24092. {
  24093. key: 'body',
  24094. converter: webidl.nullableConverter(
  24095. webidl.converters.BodyInit
  24096. )
  24097. },
  24098. {
  24099. key: 'referrer',
  24100. converter: webidl.converters.USVString
  24101. },
  24102. {
  24103. key: 'referrerPolicy',
  24104. converter: webidl.converters.DOMString,
  24105. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  24106. allowedValues: referrerPolicy
  24107. },
  24108. {
  24109. key: 'mode',
  24110. converter: webidl.converters.DOMString,
  24111. // https://fetch.spec.whatwg.org/#concept-request-mode
  24112. allowedValues: requestMode
  24113. },
  24114. {
  24115. key: 'credentials',
  24116. converter: webidl.converters.DOMString,
  24117. // https://fetch.spec.whatwg.org/#requestcredentials
  24118. allowedValues: requestCredentials
  24119. },
  24120. {
  24121. key: 'cache',
  24122. converter: webidl.converters.DOMString,
  24123. // https://fetch.spec.whatwg.org/#requestcache
  24124. allowedValues: requestCache
  24125. },
  24126. {
  24127. key: 'redirect',
  24128. converter: webidl.converters.DOMString,
  24129. // https://fetch.spec.whatwg.org/#requestredirect
  24130. allowedValues: requestRedirect
  24131. },
  24132. {
  24133. key: 'integrity',
  24134. converter: webidl.converters.DOMString
  24135. },
  24136. {
  24137. key: 'keepalive',
  24138. converter: webidl.converters.boolean
  24139. },
  24140. {
  24141. key: 'signal',
  24142. converter: webidl.nullableConverter(
  24143. (signal) => webidl.converters.AbortSignal(
  24144. signal,
  24145. { strict: false }
  24146. )
  24147. )
  24148. },
  24149. {
  24150. key: 'window',
  24151. converter: webidl.converters.any
  24152. },
  24153. {
  24154. key: 'duplex',
  24155. converter: webidl.converters.DOMString,
  24156. allowedValues: requestDuplex
  24157. }
  24158. ])
  24159. module.exports = { Request, makeRequest }
  24160. /***/ }),
  24161. /***/ 7823:
  24162. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24163. "use strict";
  24164. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  24165. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  24166. const util = __nccwpck_require__(3983)
  24167. const { kEnumerableProperty } = util
  24168. const {
  24169. isValidReasonPhrase,
  24170. isCancelled,
  24171. isAborted,
  24172. isBlobLike,
  24173. serializeJavascriptValueToJSONString,
  24174. isErrorLike,
  24175. isomorphicEncode
  24176. } = __nccwpck_require__(2538)
  24177. const {
  24178. redirectStatusSet,
  24179. nullBodyStatus,
  24180. DOMException
  24181. } = __nccwpck_require__(1037)
  24182. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  24183. const { webidl } = __nccwpck_require__(1744)
  24184. const { FormData } = __nccwpck_require__(2015)
  24185. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24186. const { URLSerializer } = __nccwpck_require__(685)
  24187. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  24188. const assert = __nccwpck_require__(9491)
  24189. const { types } = __nccwpck_require__(3837)
  24190. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  24191. const textEncoder = new TextEncoder('utf-8')
  24192. // https://fetch.spec.whatwg.org/#response-class
  24193. class Response {
  24194. // Creates network error Response.
  24195. static error () {
  24196. // TODO
  24197. const relevantRealm = { settingsObject: {} }
  24198. // The static error() method steps are to return the result of creating a
  24199. // Response object, given a new network error, "immutable", and this’s
  24200. // relevant Realm.
  24201. const responseObject = new Response()
  24202. responseObject[kState] = makeNetworkError()
  24203. responseObject[kRealm] = relevantRealm
  24204. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  24205. responseObject[kHeaders][kGuard] = 'immutable'
  24206. responseObject[kHeaders][kRealm] = relevantRealm
  24207. return responseObject
  24208. }
  24209. // https://fetch.spec.whatwg.org/#dom-response-json
  24210. static json (data, init = {}) {
  24211. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  24212. if (init !== null) {
  24213. init = webidl.converters.ResponseInit(init)
  24214. }
  24215. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  24216. const bytes = textEncoder.encode(
  24217. serializeJavascriptValueToJSONString(data)
  24218. )
  24219. // 2. Let body be the result of extracting bytes.
  24220. const body = extractBody(bytes)
  24221. // 3. Let responseObject be the result of creating a Response object, given a new response,
  24222. // "response", and this’s relevant Realm.
  24223. const relevantRealm = { settingsObject: {} }
  24224. const responseObject = new Response()
  24225. responseObject[kRealm] = relevantRealm
  24226. responseObject[kHeaders][kGuard] = 'response'
  24227. responseObject[kHeaders][kRealm] = relevantRealm
  24228. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  24229. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  24230. // 5. Return responseObject.
  24231. return responseObject
  24232. }
  24233. // Creates a redirect Response that redirects to url with status status.
  24234. static redirect (url, status = 302) {
  24235. const relevantRealm = { settingsObject: {} }
  24236. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  24237. url = webidl.converters.USVString(url)
  24238. status = webidl.converters['unsigned short'](status)
  24239. // 1. Let parsedURL be the result of parsing url with current settings
  24240. // object’s API base URL.
  24241. // 2. If parsedURL is failure, then throw a TypeError.
  24242. // TODO: base-URL?
  24243. let parsedURL
  24244. try {
  24245. parsedURL = new URL(url, getGlobalOrigin())
  24246. } catch (err) {
  24247. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  24248. cause: err
  24249. })
  24250. }
  24251. // 3. If status is not a redirect status, then throw a RangeError.
  24252. if (!redirectStatusSet.has(status)) {
  24253. throw new RangeError('Invalid status code ' + status)
  24254. }
  24255. // 4. Let responseObject be the result of creating a Response object,
  24256. // given a new response, "immutable", and this’s relevant Realm.
  24257. const responseObject = new Response()
  24258. responseObject[kRealm] = relevantRealm
  24259. responseObject[kHeaders][kGuard] = 'immutable'
  24260. responseObject[kHeaders][kRealm] = relevantRealm
  24261. // 5. Set responseObject’s response’s status to status.
  24262. responseObject[kState].status = status
  24263. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24264. const value = isomorphicEncode(URLSerializer(parsedURL))
  24265. // 7. Append `Location`/value to responseObject’s response’s header list.
  24266. responseObject[kState].headersList.append('location', value)
  24267. // 8. Return responseObject.
  24268. return responseObject
  24269. }
  24270. // https://fetch.spec.whatwg.org/#dom-response
  24271. constructor (body = null, init = {}) {
  24272. if (body !== null) {
  24273. body = webidl.converters.BodyInit(body)
  24274. }
  24275. init = webidl.converters.ResponseInit(init)
  24276. // TODO
  24277. this[kRealm] = { settingsObject: {} }
  24278. // 1. Set this’s response to a new response.
  24279. this[kState] = makeResponse({})
  24280. // 2. Set this’s headers to a new Headers object with this’s relevant
  24281. // Realm, whose header list is this’s response’s header list and guard
  24282. // is "response".
  24283. this[kHeaders] = new Headers(kConstruct)
  24284. this[kHeaders][kGuard] = 'response'
  24285. this[kHeaders][kHeadersList] = this[kState].headersList
  24286. this[kHeaders][kRealm] = this[kRealm]
  24287. // 3. Let bodyWithType be null.
  24288. let bodyWithType = null
  24289. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24290. if (body != null) {
  24291. const [extractedBody, type] = extractBody(body)
  24292. bodyWithType = { body: extractedBody, type }
  24293. }
  24294. // 5. Perform initialize a response given this, init, and bodyWithType.
  24295. initializeResponse(this, init, bodyWithType)
  24296. }
  24297. // Returns response’s type, e.g., "cors".
  24298. get type () {
  24299. webidl.brandCheck(this, Response)
  24300. // The type getter steps are to return this’s response’s type.
  24301. return this[kState].type
  24302. }
  24303. // Returns response’s URL, if it has one; otherwise the empty string.
  24304. get url () {
  24305. webidl.brandCheck(this, Response)
  24306. const urlList = this[kState].urlList
  24307. // The url getter steps are to return the empty string if this’s
  24308. // response’s URL is null; otherwise this’s response’s URL,
  24309. // serialized with exclude fragment set to true.
  24310. const url = urlList[urlList.length - 1] ?? null
  24311. if (url === null) {
  24312. return ''
  24313. }
  24314. return URLSerializer(url, true)
  24315. }
  24316. // Returns whether response was obtained through a redirect.
  24317. get redirected () {
  24318. webidl.brandCheck(this, Response)
  24319. // The redirected getter steps are to return true if this’s response’s URL
  24320. // list has more than one item; otherwise false.
  24321. return this[kState].urlList.length > 1
  24322. }
  24323. // Returns response’s status.
  24324. get status () {
  24325. webidl.brandCheck(this, Response)
  24326. // The status getter steps are to return this’s response’s status.
  24327. return this[kState].status
  24328. }
  24329. // Returns whether response’s status is an ok status.
  24330. get ok () {
  24331. webidl.brandCheck(this, Response)
  24332. // The ok getter steps are to return true if this’s response’s status is an
  24333. // ok status; otherwise false.
  24334. return this[kState].status >= 200 && this[kState].status <= 299
  24335. }
  24336. // Returns response’s status message.
  24337. get statusText () {
  24338. webidl.brandCheck(this, Response)
  24339. // The statusText getter steps are to return this’s response’s status
  24340. // message.
  24341. return this[kState].statusText
  24342. }
  24343. // Returns response’s headers as Headers.
  24344. get headers () {
  24345. webidl.brandCheck(this, Response)
  24346. // The headers getter steps are to return this’s headers.
  24347. return this[kHeaders]
  24348. }
  24349. get body () {
  24350. webidl.brandCheck(this, Response)
  24351. return this[kState].body ? this[kState].body.stream : null
  24352. }
  24353. get bodyUsed () {
  24354. webidl.brandCheck(this, Response)
  24355. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24356. }
  24357. // Returns a clone of response.
  24358. clone () {
  24359. webidl.brandCheck(this, Response)
  24360. // 1. If this is unusable, then throw a TypeError.
  24361. if (this.bodyUsed || (this.body && this.body.locked)) {
  24362. throw webidl.errors.exception({
  24363. header: 'Response.clone',
  24364. message: 'Body has already been consumed.'
  24365. })
  24366. }
  24367. // 2. Let clonedResponse be the result of cloning this’s response.
  24368. const clonedResponse = cloneResponse(this[kState])
  24369. // 3. Return the result of creating a Response object, given
  24370. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24371. const clonedResponseObject = new Response()
  24372. clonedResponseObject[kState] = clonedResponse
  24373. clonedResponseObject[kRealm] = this[kRealm]
  24374. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24375. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24376. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24377. return clonedResponseObject
  24378. }
  24379. }
  24380. mixinBody(Response)
  24381. Object.defineProperties(Response.prototype, {
  24382. type: kEnumerableProperty,
  24383. url: kEnumerableProperty,
  24384. status: kEnumerableProperty,
  24385. ok: kEnumerableProperty,
  24386. redirected: kEnumerableProperty,
  24387. statusText: kEnumerableProperty,
  24388. headers: kEnumerableProperty,
  24389. clone: kEnumerableProperty,
  24390. body: kEnumerableProperty,
  24391. bodyUsed: kEnumerableProperty,
  24392. [Symbol.toStringTag]: {
  24393. value: 'Response',
  24394. configurable: true
  24395. }
  24396. })
  24397. Object.defineProperties(Response, {
  24398. json: kEnumerableProperty,
  24399. redirect: kEnumerableProperty,
  24400. error: kEnumerableProperty
  24401. })
  24402. // https://fetch.spec.whatwg.org/#concept-response-clone
  24403. function cloneResponse (response) {
  24404. // To clone a response response, run these steps:
  24405. // 1. If response is a filtered response, then return a new identical
  24406. // filtered response whose internal response is a clone of response’s
  24407. // internal response.
  24408. if (response.internalResponse) {
  24409. return filterResponse(
  24410. cloneResponse(response.internalResponse),
  24411. response.type
  24412. )
  24413. }
  24414. // 2. Let newResponse be a copy of response, except for its body.
  24415. const newResponse = makeResponse({ ...response, body: null })
  24416. // 3. If response’s body is non-null, then set newResponse’s body to the
  24417. // result of cloning response’s body.
  24418. if (response.body != null) {
  24419. newResponse.body = cloneBody(response.body)
  24420. }
  24421. // 4. Return newResponse.
  24422. return newResponse
  24423. }
  24424. function makeResponse (init) {
  24425. return {
  24426. aborted: false,
  24427. rangeRequested: false,
  24428. timingAllowPassed: false,
  24429. requestIncludesCredentials: false,
  24430. type: 'default',
  24431. status: 200,
  24432. timingInfo: null,
  24433. cacheState: '',
  24434. statusText: '',
  24435. ...init,
  24436. headersList: init.headersList
  24437. ? new HeadersList(init.headersList)
  24438. : new HeadersList(),
  24439. urlList: init.urlList ? [...init.urlList] : []
  24440. }
  24441. }
  24442. function makeNetworkError (reason) {
  24443. const isError = isErrorLike(reason)
  24444. return makeResponse({
  24445. type: 'error',
  24446. status: 0,
  24447. error: isError
  24448. ? reason
  24449. : new Error(reason ? String(reason) : reason),
  24450. aborted: reason && reason.name === 'AbortError'
  24451. })
  24452. }
  24453. function makeFilteredResponse (response, state) {
  24454. state = {
  24455. internalResponse: response,
  24456. ...state
  24457. }
  24458. return new Proxy(response, {
  24459. get (target, p) {
  24460. return p in state ? state[p] : target[p]
  24461. },
  24462. set (target, p, value) {
  24463. assert(!(p in state))
  24464. target[p] = value
  24465. return true
  24466. }
  24467. })
  24468. }
  24469. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24470. function filterResponse (response, type) {
  24471. // Set response to the following filtered response with response as its
  24472. // internal response, depending on request’s response tainting:
  24473. if (type === 'basic') {
  24474. // A basic filtered response is a filtered response whose type is "basic"
  24475. // and header list excludes any headers in internal response’s header list
  24476. // whose name is a forbidden response-header name.
  24477. // Note: undici does not implement forbidden response-header names
  24478. return makeFilteredResponse(response, {
  24479. type: 'basic',
  24480. headersList: response.headersList
  24481. })
  24482. } else if (type === 'cors') {
  24483. // A CORS filtered response is a filtered response whose type is "cors"
  24484. // and header list excludes any headers in internal response’s header
  24485. // list whose name is not a CORS-safelisted response-header name, given
  24486. // internal response’s CORS-exposed header-name list.
  24487. // Note: undici does not implement CORS-safelisted response-header names
  24488. return makeFilteredResponse(response, {
  24489. type: 'cors',
  24490. headersList: response.headersList
  24491. })
  24492. } else if (type === 'opaque') {
  24493. // An opaque filtered response is a filtered response whose type is
  24494. // "opaque", URL list is the empty list, status is 0, status message
  24495. // is the empty byte sequence, header list is empty, and body is null.
  24496. return makeFilteredResponse(response, {
  24497. type: 'opaque',
  24498. urlList: Object.freeze([]),
  24499. status: 0,
  24500. statusText: '',
  24501. body: null
  24502. })
  24503. } else if (type === 'opaqueredirect') {
  24504. // An opaque-redirect filtered response is a filtered response whose type
  24505. // is "opaqueredirect", status is 0, status message is the empty byte
  24506. // sequence, header list is empty, and body is null.
  24507. return makeFilteredResponse(response, {
  24508. type: 'opaqueredirect',
  24509. status: 0,
  24510. statusText: '',
  24511. headersList: [],
  24512. body: null
  24513. })
  24514. } else {
  24515. assert(false)
  24516. }
  24517. }
  24518. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24519. function makeAppropriateNetworkError (fetchParams, err = null) {
  24520. // 1. Assert: fetchParams is canceled.
  24521. assert(isCancelled(fetchParams))
  24522. // 2. Return an aborted network error if fetchParams is aborted;
  24523. // otherwise return a network error.
  24524. return isAborted(fetchParams)
  24525. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24526. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24527. }
  24528. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24529. function initializeResponse (response, init, body) {
  24530. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24531. // throw a RangeError.
  24532. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24533. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24534. }
  24535. // 2. If init["statusText"] does not match the reason-phrase token production,
  24536. // then throw a TypeError.
  24537. if ('statusText' in init && init.statusText != null) {
  24538. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24539. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24540. if (!isValidReasonPhrase(String(init.statusText))) {
  24541. throw new TypeError('Invalid statusText')
  24542. }
  24543. }
  24544. // 3. Set response’s response’s status to init["status"].
  24545. if ('status' in init && init.status != null) {
  24546. response[kState].status = init.status
  24547. }
  24548. // 4. Set response’s response’s status message to init["statusText"].
  24549. if ('statusText' in init && init.statusText != null) {
  24550. response[kState].statusText = init.statusText
  24551. }
  24552. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24553. if ('headers' in init && init.headers != null) {
  24554. fill(response[kHeaders], init.headers)
  24555. }
  24556. // 6. If body was given, then:
  24557. if (body) {
  24558. // 1. If response's status is a null body status, then throw a TypeError.
  24559. if (nullBodyStatus.includes(response.status)) {
  24560. throw webidl.errors.exception({
  24561. header: 'Response constructor',
  24562. message: 'Invalid response status code ' + response.status
  24563. })
  24564. }
  24565. // 2. Set response's body to body's body.
  24566. response[kState].body = body.body
  24567. // 3. If body's type is non-null and response's header list does not contain
  24568. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24569. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24570. response[kState].headersList.append('content-type', body.type)
  24571. }
  24572. }
  24573. }
  24574. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24575. ReadableStream
  24576. )
  24577. webidl.converters.FormData = webidl.interfaceConverter(
  24578. FormData
  24579. )
  24580. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24581. URLSearchParams
  24582. )
  24583. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24584. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24585. if (typeof V === 'string') {
  24586. return webidl.converters.USVString(V)
  24587. }
  24588. if (isBlobLike(V)) {
  24589. return webidl.converters.Blob(V, { strict: false })
  24590. }
  24591. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24592. return webidl.converters.BufferSource(V)
  24593. }
  24594. if (util.isFormDataLike(V)) {
  24595. return webidl.converters.FormData(V, { strict: false })
  24596. }
  24597. if (V instanceof URLSearchParams) {
  24598. return webidl.converters.URLSearchParams(V)
  24599. }
  24600. return webidl.converters.DOMString(V)
  24601. }
  24602. // https://fetch.spec.whatwg.org/#bodyinit
  24603. webidl.converters.BodyInit = function (V) {
  24604. if (V instanceof ReadableStream) {
  24605. return webidl.converters.ReadableStream(V)
  24606. }
  24607. // Note: the spec doesn't include async iterables,
  24608. // this is an undici extension.
  24609. if (V?.[Symbol.asyncIterator]) {
  24610. return V
  24611. }
  24612. return webidl.converters.XMLHttpRequestBodyInit(V)
  24613. }
  24614. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24615. {
  24616. key: 'status',
  24617. converter: webidl.converters['unsigned short'],
  24618. defaultValue: 200
  24619. },
  24620. {
  24621. key: 'statusText',
  24622. converter: webidl.converters.ByteString,
  24623. defaultValue: ''
  24624. },
  24625. {
  24626. key: 'headers',
  24627. converter: webidl.converters.HeadersInit
  24628. }
  24629. ])
  24630. module.exports = {
  24631. makeNetworkError,
  24632. makeResponse,
  24633. makeAppropriateNetworkError,
  24634. filterResponse,
  24635. Response,
  24636. cloneResponse
  24637. }
  24638. /***/ }),
  24639. /***/ 5861:
  24640. /***/ ((module) => {
  24641. "use strict";
  24642. module.exports = {
  24643. kUrl: Symbol('url'),
  24644. kHeaders: Symbol('headers'),
  24645. kSignal: Symbol('signal'),
  24646. kState: Symbol('state'),
  24647. kGuard: Symbol('guard'),
  24648. kRealm: Symbol('realm')
  24649. }
  24650. /***/ }),
  24651. /***/ 2538:
  24652. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24653. "use strict";
  24654. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24655. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24656. const { performance } = __nccwpck_require__(4074)
  24657. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24658. const assert = __nccwpck_require__(9491)
  24659. const { isUint8Array } = __nccwpck_require__(9830)
  24660. let supportedHashes = []
  24661. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24662. /** @type {import('crypto')|undefined} */
  24663. let crypto
  24664. try {
  24665. crypto = __nccwpck_require__(6113)
  24666. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24667. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24668. /* c8 ignore next 3 */
  24669. } catch {
  24670. }
  24671. function responseURL (response) {
  24672. // https://fetch.spec.whatwg.org/#responses
  24673. // A response has an associated URL. It is a pointer to the last URL
  24674. // in response’s URL list and null if response’s URL list is empty.
  24675. const urlList = response.urlList
  24676. const length = urlList.length
  24677. return length === 0 ? null : urlList[length - 1].toString()
  24678. }
  24679. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24680. function responseLocationURL (response, requestFragment) {
  24681. // 1. If response’s status is not a redirect status, then return null.
  24682. if (!redirectStatusSet.has(response.status)) {
  24683. return null
  24684. }
  24685. // 2. Let location be the result of extracting header list values given
  24686. // `Location` and response’s header list.
  24687. let location = response.headersList.get('location')
  24688. // 3. If location is a header value, then set location to the result of
  24689. // parsing location with response’s URL.
  24690. if (location !== null && isValidHeaderValue(location)) {
  24691. location = new URL(location, responseURL(response))
  24692. }
  24693. // 4. If location is a URL whose fragment is null, then set location’s
  24694. // fragment to requestFragment.
  24695. if (location && !location.hash) {
  24696. location.hash = requestFragment
  24697. }
  24698. // 5. Return location.
  24699. return location
  24700. }
  24701. /** @returns {URL} */
  24702. function requestCurrentURL (request) {
  24703. return request.urlList[request.urlList.length - 1]
  24704. }
  24705. function requestBadPort (request) {
  24706. // 1. Let url be request’s current URL.
  24707. const url = requestCurrentURL(request)
  24708. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24709. // then return blocked.
  24710. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24711. return 'blocked'
  24712. }
  24713. // 3. Return allowed.
  24714. return 'allowed'
  24715. }
  24716. function isErrorLike (object) {
  24717. return object instanceof Error || (
  24718. object?.constructor?.name === 'Error' ||
  24719. object?.constructor?.name === 'DOMException'
  24720. )
  24721. }
  24722. // Check whether |statusText| is a ByteString and
  24723. // matches the Reason-Phrase token production.
  24724. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24725. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24726. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24727. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24728. function isValidReasonPhrase (statusText) {
  24729. for (let i = 0; i < statusText.length; ++i) {
  24730. const c = statusText.charCodeAt(i)
  24731. if (
  24732. !(
  24733. (
  24734. c === 0x09 || // HTAB
  24735. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24736. (c >= 0x80 && c <= 0xff)
  24737. ) // obs-text
  24738. )
  24739. ) {
  24740. return false
  24741. }
  24742. }
  24743. return true
  24744. }
  24745. /**
  24746. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24747. * @param {number} c
  24748. */
  24749. function isTokenCharCode (c) {
  24750. switch (c) {
  24751. case 0x22:
  24752. case 0x28:
  24753. case 0x29:
  24754. case 0x2c:
  24755. case 0x2f:
  24756. case 0x3a:
  24757. case 0x3b:
  24758. case 0x3c:
  24759. case 0x3d:
  24760. case 0x3e:
  24761. case 0x3f:
  24762. case 0x40:
  24763. case 0x5b:
  24764. case 0x5c:
  24765. case 0x5d:
  24766. case 0x7b:
  24767. case 0x7d:
  24768. // DQUOTE and "(),/:;<=>?@[\]{}"
  24769. return false
  24770. default:
  24771. // VCHAR %x21-7E
  24772. return c >= 0x21 && c <= 0x7e
  24773. }
  24774. }
  24775. /**
  24776. * @param {string} characters
  24777. */
  24778. function isValidHTTPToken (characters) {
  24779. if (characters.length === 0) {
  24780. return false
  24781. }
  24782. for (let i = 0; i < characters.length; ++i) {
  24783. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24784. return false
  24785. }
  24786. }
  24787. return true
  24788. }
  24789. /**
  24790. * @see https://fetch.spec.whatwg.org/#header-name
  24791. * @param {string} potentialValue
  24792. */
  24793. function isValidHeaderName (potentialValue) {
  24794. return isValidHTTPToken(potentialValue)
  24795. }
  24796. /**
  24797. * @see https://fetch.spec.whatwg.org/#header-value
  24798. * @param {string} potentialValue
  24799. */
  24800. function isValidHeaderValue (potentialValue) {
  24801. // - Has no leading or trailing HTTP tab or space bytes.
  24802. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24803. if (
  24804. potentialValue.startsWith('\t') ||
  24805. potentialValue.startsWith(' ') ||
  24806. potentialValue.endsWith('\t') ||
  24807. potentialValue.endsWith(' ')
  24808. ) {
  24809. return false
  24810. }
  24811. if (
  24812. potentialValue.includes('\0') ||
  24813. potentialValue.includes('\r') ||
  24814. potentialValue.includes('\n')
  24815. ) {
  24816. return false
  24817. }
  24818. return true
  24819. }
  24820. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24821. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24822. // Given a request request and a response actualResponse, this algorithm
  24823. // updates request’s referrer policy according to the Referrer-Policy
  24824. // header (if any) in actualResponse.
  24825. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24826. // from a Referrer-Policy header on actualResponse.
  24827. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24828. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24829. const { headersList } = actualResponse
  24830. // 2. Let policy be the empty string.
  24831. // 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.
  24832. // 4. Return policy.
  24833. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24834. // Note: As the referrer-policy can contain multiple policies
  24835. // separated by comma, we need to loop through all of them
  24836. // and pick the first valid one.
  24837. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24838. let policy = ''
  24839. if (policyHeader.length > 0) {
  24840. // The right-most policy takes precedence.
  24841. // The left-most policy is the fallback.
  24842. for (let i = policyHeader.length; i !== 0; i--) {
  24843. const token = policyHeader[i - 1].trim()
  24844. if (referrerPolicyTokens.has(token)) {
  24845. policy = token
  24846. break
  24847. }
  24848. }
  24849. }
  24850. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24851. if (policy !== '') {
  24852. request.referrerPolicy = policy
  24853. }
  24854. }
  24855. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24856. function crossOriginResourcePolicyCheck () {
  24857. // TODO
  24858. return 'allowed'
  24859. }
  24860. // https://fetch.spec.whatwg.org/#concept-cors-check
  24861. function corsCheck () {
  24862. // TODO
  24863. return 'success'
  24864. }
  24865. // https://fetch.spec.whatwg.org/#concept-tao-check
  24866. function TAOCheck () {
  24867. // TODO
  24868. return 'success'
  24869. }
  24870. function appendFetchMetadata (httpRequest) {
  24871. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24872. // TODO
  24873. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24874. // 1. Assert: r’s url is a potentially trustworthy URL.
  24875. // TODO
  24876. // 2. Let header be a Structured Header whose value is a token.
  24877. let header = null
  24878. // 3. Set header’s value to r’s mode.
  24879. header = httpRequest.mode
  24880. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24881. httpRequest.headersList.set('sec-fetch-mode', header)
  24882. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24883. // TODO
  24884. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24885. // TODO
  24886. }
  24887. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24888. function appendRequestOriginHeader (request) {
  24889. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24890. let serializedOrigin = request.origin
  24891. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24892. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24893. if (serializedOrigin) {
  24894. request.headersList.append('origin', serializedOrigin)
  24895. }
  24896. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24897. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24898. // 1. Switch on request’s referrer policy:
  24899. switch (request.referrerPolicy) {
  24900. case 'no-referrer':
  24901. // Set serializedOrigin to `null`.
  24902. serializedOrigin = null
  24903. break
  24904. case 'no-referrer-when-downgrade':
  24905. case 'strict-origin':
  24906. case 'strict-origin-when-cross-origin':
  24907. // 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`.
  24908. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24909. serializedOrigin = null
  24910. }
  24911. break
  24912. case 'same-origin':
  24913. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24914. if (!sameOrigin(request, requestCurrentURL(request))) {
  24915. serializedOrigin = null
  24916. }
  24917. break
  24918. default:
  24919. // Do nothing.
  24920. }
  24921. if (serializedOrigin) {
  24922. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24923. request.headersList.append('origin', serializedOrigin)
  24924. }
  24925. }
  24926. }
  24927. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24928. // TODO
  24929. return performance.now()
  24930. }
  24931. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24932. function createOpaqueTimingInfo (timingInfo) {
  24933. return {
  24934. startTime: timingInfo.startTime ?? 0,
  24935. redirectStartTime: 0,
  24936. redirectEndTime: 0,
  24937. postRedirectStartTime: timingInfo.startTime ?? 0,
  24938. finalServiceWorkerStartTime: 0,
  24939. finalNetworkResponseStartTime: 0,
  24940. finalNetworkRequestStartTime: 0,
  24941. endTime: 0,
  24942. encodedBodySize: 0,
  24943. decodedBodySize: 0,
  24944. finalConnectionTimingInfo: null
  24945. }
  24946. }
  24947. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24948. function makePolicyContainer () {
  24949. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24950. return {
  24951. referrerPolicy: 'strict-origin-when-cross-origin'
  24952. }
  24953. }
  24954. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24955. function clonePolicyContainer (policyContainer) {
  24956. return {
  24957. referrerPolicy: policyContainer.referrerPolicy
  24958. }
  24959. }
  24960. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24961. function determineRequestsReferrer (request) {
  24962. // 1. Let policy be request's referrer policy.
  24963. const policy = request.referrerPolicy
  24964. // Note: policy cannot (shouldn't) be null or an empty string.
  24965. assert(policy)
  24966. // 2. Let environment be request’s client.
  24967. let referrerSource = null
  24968. // 3. Switch on request’s referrer:
  24969. if (request.referrer === 'client') {
  24970. // Note: node isn't a browser and doesn't implement document/iframes,
  24971. // so we bypass this step and replace it with our own.
  24972. const globalOrigin = getGlobalOrigin()
  24973. if (!globalOrigin || globalOrigin.origin === 'null') {
  24974. return 'no-referrer'
  24975. }
  24976. // note: we need to clone it as it's mutated
  24977. referrerSource = new URL(globalOrigin)
  24978. } else if (request.referrer instanceof URL) {
  24979. // Let referrerSource be request’s referrer.
  24980. referrerSource = request.referrer
  24981. }
  24982. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24983. // use as a referrer.
  24984. let referrerURL = stripURLForReferrer(referrerSource)
  24985. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  24986. // a referrer, with the origin-only flag set to true.
  24987. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  24988. // 6. If the result of serializing referrerURL is a string whose length is
  24989. // greater than 4096, set referrerURL to referrerOrigin.
  24990. if (referrerURL.toString().length > 4096) {
  24991. referrerURL = referrerOrigin
  24992. }
  24993. const areSameOrigin = sameOrigin(request, referrerURL)
  24994. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  24995. !isURLPotentiallyTrustworthy(request.url)
  24996. // 8. Execute the switch statements corresponding to the value of policy:
  24997. switch (policy) {
  24998. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  24999. case 'unsafe-url': return referrerURL
  25000. case 'same-origin':
  25001. return areSameOrigin ? referrerOrigin : 'no-referrer'
  25002. case 'origin-when-cross-origin':
  25003. return areSameOrigin ? referrerURL : referrerOrigin
  25004. case 'strict-origin-when-cross-origin': {
  25005. const currentURL = requestCurrentURL(request)
  25006. // 1. If the origin of referrerURL and the origin of request’s current
  25007. // URL are the same, then return referrerURL.
  25008. if (sameOrigin(referrerURL, currentURL)) {
  25009. return referrerURL
  25010. }
  25011. // 2. If referrerURL is a potentially trustworthy URL and request’s
  25012. // current URL is not a potentially trustworthy URL, then return no
  25013. // referrer.
  25014. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  25015. return 'no-referrer'
  25016. }
  25017. // 3. Return referrerOrigin.
  25018. return referrerOrigin
  25019. }
  25020. case 'strict-origin': // eslint-disable-line
  25021. /**
  25022. * 1. If referrerURL is a potentially trustworthy URL and
  25023. * request’s current URL is not a potentially trustworthy URL,
  25024. * then return no referrer.
  25025. * 2. Return referrerOrigin
  25026. */
  25027. case 'no-referrer-when-downgrade': // eslint-disable-line
  25028. /**
  25029. * 1. If referrerURL is a potentially trustworthy URL and
  25030. * request’s current URL is not a potentially trustworthy URL,
  25031. * then return no referrer.
  25032. * 2. Return referrerOrigin
  25033. */
  25034. default: // eslint-disable-line
  25035. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  25036. }
  25037. }
  25038. /**
  25039. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  25040. * @param {URL} url
  25041. * @param {boolean|undefined} originOnly
  25042. */
  25043. function stripURLForReferrer (url, originOnly) {
  25044. // 1. Assert: url is a URL.
  25045. assert(url instanceof URL)
  25046. // 2. If url’s scheme is a local scheme, then return no referrer.
  25047. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  25048. return 'no-referrer'
  25049. }
  25050. // 3. Set url’s username to the empty string.
  25051. url.username = ''
  25052. // 4. Set url’s password to the empty string.
  25053. url.password = ''
  25054. // 5. Set url’s fragment to null.
  25055. url.hash = ''
  25056. // 6. If the origin-only flag is true, then:
  25057. if (originOnly) {
  25058. // 1. Set url’s path to « the empty string ».
  25059. url.pathname = ''
  25060. // 2. Set url’s query to null.
  25061. url.search = ''
  25062. }
  25063. // 7. Return url.
  25064. return url
  25065. }
  25066. function isURLPotentiallyTrustworthy (url) {
  25067. if (!(url instanceof URL)) {
  25068. return false
  25069. }
  25070. // If child of about, return true
  25071. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  25072. return true
  25073. }
  25074. // If scheme is data, return true
  25075. if (url.protocol === 'data:') return true
  25076. // If file, return true
  25077. if (url.protocol === 'file:') return true
  25078. return isOriginPotentiallyTrustworthy(url.origin)
  25079. function isOriginPotentiallyTrustworthy (origin) {
  25080. // If origin is explicitly null, return false
  25081. if (origin == null || origin === 'null') return false
  25082. const originAsURL = new URL(origin)
  25083. // If secure, return true
  25084. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  25085. return true
  25086. }
  25087. // If localhost or variants, return true
  25088. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  25089. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  25090. (originAsURL.hostname.endsWith('.localhost'))) {
  25091. return true
  25092. }
  25093. // If any other, return false
  25094. return false
  25095. }
  25096. }
  25097. /**
  25098. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  25099. * @param {Uint8Array} bytes
  25100. * @param {string} metadataList
  25101. */
  25102. function bytesMatch (bytes, metadataList) {
  25103. // If node is not built with OpenSSL support, we cannot check
  25104. // a request's integrity, so allow it by default (the spec will
  25105. // allow requests if an invalid hash is given, as precedence).
  25106. /* istanbul ignore if: only if node is built with --without-ssl */
  25107. if (crypto === undefined) {
  25108. return true
  25109. }
  25110. // 1. Let parsedMetadata be the result of parsing metadataList.
  25111. const parsedMetadata = parseMetadata(metadataList)
  25112. // 2. If parsedMetadata is no metadata, return true.
  25113. if (parsedMetadata === 'no metadata') {
  25114. return true
  25115. }
  25116. // 3. If response is not eligible for integrity validation, return false.
  25117. // TODO
  25118. // 4. If parsedMetadata is the empty set, return true.
  25119. if (parsedMetadata.length === 0) {
  25120. return true
  25121. }
  25122. // 5. Let metadata be the result of getting the strongest
  25123. // metadata from parsedMetadata.
  25124. const strongest = getStrongestMetadata(parsedMetadata)
  25125. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  25126. // 6. For each item in metadata:
  25127. for (const item of metadata) {
  25128. // 1. Let algorithm be the alg component of item.
  25129. const algorithm = item.algo
  25130. // 2. Let expectedValue be the val component of item.
  25131. const expectedValue = item.hash
  25132. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  25133. // "be liberal with padding". This is annoying, and it's not even in the spec.
  25134. // 3. Let actualValue be the result of applying algorithm to bytes.
  25135. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  25136. if (actualValue[actualValue.length - 1] === '=') {
  25137. if (actualValue[actualValue.length - 2] === '=') {
  25138. actualValue = actualValue.slice(0, -2)
  25139. } else {
  25140. actualValue = actualValue.slice(0, -1)
  25141. }
  25142. }
  25143. // 4. If actualValue is a case-sensitive match for expectedValue,
  25144. // return true.
  25145. if (compareBase64Mixed(actualValue, expectedValue)) {
  25146. return true
  25147. }
  25148. }
  25149. // 7. Return false.
  25150. return false
  25151. }
  25152. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  25153. // https://www.w3.org/TR/CSP2/#source-list-syntax
  25154. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  25155. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  25156. /**
  25157. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  25158. * @param {string} metadata
  25159. */
  25160. function parseMetadata (metadata) {
  25161. // 1. Let result be the empty set.
  25162. /** @type {{ algo: string, hash: string }[]} */
  25163. const result = []
  25164. // 2. Let empty be equal to true.
  25165. let empty = true
  25166. // 3. For each token returned by splitting metadata on spaces:
  25167. for (const token of metadata.split(' ')) {
  25168. // 1. Set empty to false.
  25169. empty = false
  25170. // 2. Parse token as a hash-with-options.
  25171. const parsedToken = parseHashWithOptions.exec(token)
  25172. // 3. If token does not parse, continue to the next token.
  25173. if (
  25174. parsedToken === null ||
  25175. parsedToken.groups === undefined ||
  25176. parsedToken.groups.algo === undefined
  25177. ) {
  25178. // Note: Chromium blocks the request at this point, but Firefox
  25179. // gives a warning that an invalid integrity was given. The
  25180. // correct behavior is to ignore these, and subsequently not
  25181. // check the integrity of the resource.
  25182. continue
  25183. }
  25184. // 4. Let algorithm be the hash-algo component of token.
  25185. const algorithm = parsedToken.groups.algo.toLowerCase()
  25186. // 5. If algorithm is a hash function recognized by the user
  25187. // agent, add the parsed token to result.
  25188. if (supportedHashes.includes(algorithm)) {
  25189. result.push(parsedToken.groups)
  25190. }
  25191. }
  25192. // 4. Return no metadata if empty is true, otherwise return result.
  25193. if (empty === true) {
  25194. return 'no metadata'
  25195. }
  25196. return result
  25197. }
  25198. /**
  25199. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  25200. */
  25201. function getStrongestMetadata (metadataList) {
  25202. // Let algorithm be the algo component of the first item in metadataList.
  25203. // Can be sha256
  25204. let algorithm = metadataList[0].algo
  25205. // If the algorithm is sha512, then it is the strongest
  25206. // and we can return immediately
  25207. if (algorithm[3] === '5') {
  25208. return algorithm
  25209. }
  25210. for (let i = 1; i < metadataList.length; ++i) {
  25211. const metadata = metadataList[i]
  25212. // If the algorithm is sha512, then it is the strongest
  25213. // and we can break the loop immediately
  25214. if (metadata.algo[3] === '5') {
  25215. algorithm = 'sha512'
  25216. break
  25217. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  25218. } else if (algorithm[3] === '3') {
  25219. continue
  25220. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  25221. // the strongest
  25222. } else if (metadata.algo[3] === '3') {
  25223. algorithm = 'sha384'
  25224. }
  25225. }
  25226. return algorithm
  25227. }
  25228. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  25229. if (metadataList.length === 1) {
  25230. return metadataList
  25231. }
  25232. let pos = 0
  25233. for (let i = 0; i < metadataList.length; ++i) {
  25234. if (metadataList[i].algo === algorithm) {
  25235. metadataList[pos++] = metadataList[i]
  25236. }
  25237. }
  25238. metadataList.length = pos
  25239. return metadataList
  25240. }
  25241. /**
  25242. * Compares two base64 strings, allowing for base64url
  25243. * in the second string.
  25244. *
  25245. * @param {string} actualValue always base64
  25246. * @param {string} expectedValue base64 or base64url
  25247. * @returns {boolean}
  25248. */
  25249. function compareBase64Mixed (actualValue, expectedValue) {
  25250. if (actualValue.length !== expectedValue.length) {
  25251. return false
  25252. }
  25253. for (let i = 0; i < actualValue.length; ++i) {
  25254. if (actualValue[i] !== expectedValue[i]) {
  25255. if (
  25256. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25257. (actualValue[i] === '/' && expectedValue[i] === '_')
  25258. ) {
  25259. continue
  25260. }
  25261. return false
  25262. }
  25263. }
  25264. return true
  25265. }
  25266. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25267. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25268. // TODO
  25269. }
  25270. /**
  25271. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25272. * @param {URL} A
  25273. * @param {URL} B
  25274. */
  25275. function sameOrigin (A, B) {
  25276. // 1. If A and B are the same opaque origin, then return true.
  25277. if (A.origin === B.origin && A.origin === 'null') {
  25278. return true
  25279. }
  25280. // 2. If A and B are both tuple origins and their schemes,
  25281. // hosts, and port are identical, then return true.
  25282. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25283. return true
  25284. }
  25285. // 3. Return false.
  25286. return false
  25287. }
  25288. function createDeferredPromise () {
  25289. let res
  25290. let rej
  25291. const promise = new Promise((resolve, reject) => {
  25292. res = resolve
  25293. rej = reject
  25294. })
  25295. return { promise, resolve: res, reject: rej }
  25296. }
  25297. function isAborted (fetchParams) {
  25298. return fetchParams.controller.state === 'aborted'
  25299. }
  25300. function isCancelled (fetchParams) {
  25301. return fetchParams.controller.state === 'aborted' ||
  25302. fetchParams.controller.state === 'terminated'
  25303. }
  25304. const normalizeMethodRecord = {
  25305. delete: 'DELETE',
  25306. DELETE: 'DELETE',
  25307. get: 'GET',
  25308. GET: 'GET',
  25309. head: 'HEAD',
  25310. HEAD: 'HEAD',
  25311. options: 'OPTIONS',
  25312. OPTIONS: 'OPTIONS',
  25313. post: 'POST',
  25314. POST: 'POST',
  25315. put: 'PUT',
  25316. PUT: 'PUT'
  25317. }
  25318. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25319. Object.setPrototypeOf(normalizeMethodRecord, null)
  25320. /**
  25321. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25322. * @param {string} method
  25323. */
  25324. function normalizeMethod (method) {
  25325. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25326. }
  25327. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25328. function serializeJavascriptValueToJSONString (value) {
  25329. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25330. const result = JSON.stringify(value)
  25331. // 2. If result is undefined, then throw a TypeError.
  25332. if (result === undefined) {
  25333. throw new TypeError('Value is not JSON serializable')
  25334. }
  25335. // 3. Assert: result is a string.
  25336. assert(typeof result === 'string')
  25337. // 4. Return result.
  25338. return result
  25339. }
  25340. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25341. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25342. /**
  25343. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25344. * @param {() => unknown[]} iterator
  25345. * @param {string} name name of the instance
  25346. * @param {'key'|'value'|'key+value'} kind
  25347. */
  25348. function makeIterator (iterator, name, kind) {
  25349. const object = {
  25350. index: 0,
  25351. kind,
  25352. target: iterator
  25353. }
  25354. const i = {
  25355. next () {
  25356. // 1. Let interface be the interface for which the iterator prototype object exists.
  25357. // 2. Let thisValue be the this value.
  25358. // 3. Let object be ? ToObject(thisValue).
  25359. // 4. If object is a platform object, then perform a security
  25360. // check, passing:
  25361. // 5. If object is not a default iterator object for interface,
  25362. // then throw a TypeError.
  25363. if (Object.getPrototypeOf(this) !== i) {
  25364. throw new TypeError(
  25365. `'next' called on an object that does not implement interface ${name} Iterator.`
  25366. )
  25367. }
  25368. // 6. Let index be object’s index.
  25369. // 7. Let kind be object’s kind.
  25370. // 8. Let values be object’s target's value pairs to iterate over.
  25371. const { index, kind, target } = object
  25372. const values = target()
  25373. // 9. Let len be the length of values.
  25374. const len = values.length
  25375. // 10. If index is greater than or equal to len, then return
  25376. // CreateIterResultObject(undefined, true).
  25377. if (index >= len) {
  25378. return { value: undefined, done: true }
  25379. }
  25380. // 11. Let pair be the entry in values at index index.
  25381. const pair = values[index]
  25382. // 12. Set object’s index to index + 1.
  25383. object.index = index + 1
  25384. // 13. Return the iterator result for pair and kind.
  25385. return iteratorResult(pair, kind)
  25386. },
  25387. // The class string of an iterator prototype object for a given interface is the
  25388. // result of concatenating the identifier of the interface and the string " Iterator".
  25389. [Symbol.toStringTag]: `${name} Iterator`
  25390. }
  25391. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25392. Object.setPrototypeOf(i, esIteratorPrototype)
  25393. // esIteratorPrototype needs to be the prototype of i
  25394. // which is the prototype of an empty object. Yes, it's confusing.
  25395. return Object.setPrototypeOf({}, i)
  25396. }
  25397. // https://webidl.spec.whatwg.org/#iterator-result
  25398. function iteratorResult (pair, kind) {
  25399. let result
  25400. // 1. Let result be a value determined by the value of kind:
  25401. switch (kind) {
  25402. case 'key': {
  25403. // 1. Let idlKey be pair’s key.
  25404. // 2. Let key be the result of converting idlKey to an
  25405. // ECMAScript value.
  25406. // 3. result is key.
  25407. result = pair[0]
  25408. break
  25409. }
  25410. case 'value': {
  25411. // 1. Let idlValue be pair’s value.
  25412. // 2. Let value be the result of converting idlValue to
  25413. // an ECMAScript value.
  25414. // 3. result is value.
  25415. result = pair[1]
  25416. break
  25417. }
  25418. case 'key+value': {
  25419. // 1. Let idlKey be pair’s key.
  25420. // 2. Let idlValue be pair’s value.
  25421. // 3. Let key be the result of converting idlKey to an
  25422. // ECMAScript value.
  25423. // 4. Let value be the result of converting idlValue to
  25424. // an ECMAScript value.
  25425. // 5. Let array be ! ArrayCreate(2).
  25426. // 6. Call ! CreateDataProperty(array, "0", key).
  25427. // 7. Call ! CreateDataProperty(array, "1", value).
  25428. // 8. result is array.
  25429. result = pair
  25430. break
  25431. }
  25432. }
  25433. // 2. Return CreateIterResultObject(result, false).
  25434. return { value: result, done: false }
  25435. }
  25436. /**
  25437. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25438. */
  25439. async function fullyReadBody (body, processBody, processBodyError) {
  25440. // 1. If taskDestination is null, then set taskDestination to
  25441. // the result of starting a new parallel queue.
  25442. // 2. Let successSteps given a byte sequence bytes be to queue a
  25443. // fetch task to run processBody given bytes, with taskDestination.
  25444. const successSteps = processBody
  25445. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25446. // with taskDestination.
  25447. const errorSteps = processBodyError
  25448. // 4. Let reader be the result of getting a reader for body’s stream.
  25449. // If that threw an exception, then run errorSteps with that
  25450. // exception and return.
  25451. let reader
  25452. try {
  25453. reader = body.stream.getReader()
  25454. } catch (e) {
  25455. errorSteps(e)
  25456. return
  25457. }
  25458. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25459. try {
  25460. const result = await readAllBytes(reader)
  25461. successSteps(result)
  25462. } catch (e) {
  25463. errorSteps(e)
  25464. }
  25465. }
  25466. /** @type {ReadableStream} */
  25467. let ReadableStream = globalThis.ReadableStream
  25468. function isReadableStreamLike (stream) {
  25469. if (!ReadableStream) {
  25470. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25471. }
  25472. return stream instanceof ReadableStream || (
  25473. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25474. typeof stream.tee === 'function'
  25475. )
  25476. }
  25477. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25478. /**
  25479. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25480. * @param {number[]|Uint8Array} input
  25481. */
  25482. function isomorphicDecode (input) {
  25483. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25484. // length is equal to input’s length and whose code points have the same values
  25485. // as the values of input’s bytes, in the same order.
  25486. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25487. return String.fromCharCode(...input)
  25488. }
  25489. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25490. }
  25491. /**
  25492. * @param {ReadableStreamController<Uint8Array>} controller
  25493. */
  25494. function readableStreamClose (controller) {
  25495. try {
  25496. controller.close()
  25497. } catch (err) {
  25498. // TODO: add comment explaining why this error occurs.
  25499. if (!err.message.includes('Controller is already closed')) {
  25500. throw err
  25501. }
  25502. }
  25503. }
  25504. /**
  25505. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25506. * @param {string} input
  25507. */
  25508. function isomorphicEncode (input) {
  25509. // 1. Assert: input contains no code points greater than U+00FF.
  25510. for (let i = 0; i < input.length; i++) {
  25511. assert(input.charCodeAt(i) <= 0xFF)
  25512. }
  25513. // 2. Return a byte sequence whose length is equal to input’s code
  25514. // point length and whose bytes have the same values as the
  25515. // values of input’s code points, in the same order
  25516. return input
  25517. }
  25518. /**
  25519. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25520. * @see https://streams.spec.whatwg.org/#read-loop
  25521. * @param {ReadableStreamDefaultReader} reader
  25522. */
  25523. async function readAllBytes (reader) {
  25524. const bytes = []
  25525. let byteLength = 0
  25526. while (true) {
  25527. const { done, value: chunk } = await reader.read()
  25528. if (done) {
  25529. // 1. Call successSteps with bytes.
  25530. return Buffer.concat(bytes, byteLength)
  25531. }
  25532. // 1. If chunk is not a Uint8Array object, call failureSteps
  25533. // with a TypeError and abort these steps.
  25534. if (!isUint8Array(chunk)) {
  25535. throw new TypeError('Received non-Uint8Array chunk')
  25536. }
  25537. // 2. Append the bytes represented by chunk to bytes.
  25538. bytes.push(chunk)
  25539. byteLength += chunk.length
  25540. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25541. }
  25542. }
  25543. /**
  25544. * @see https://fetch.spec.whatwg.org/#is-local
  25545. * @param {URL} url
  25546. */
  25547. function urlIsLocal (url) {
  25548. assert('protocol' in url) // ensure it's a url object
  25549. const protocol = url.protocol
  25550. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25551. }
  25552. /**
  25553. * @param {string|URL} url
  25554. */
  25555. function urlHasHttpsScheme (url) {
  25556. if (typeof url === 'string') {
  25557. return url.startsWith('https:')
  25558. }
  25559. return url.protocol === 'https:'
  25560. }
  25561. /**
  25562. * @see https://fetch.spec.whatwg.org/#http-scheme
  25563. * @param {URL} url
  25564. */
  25565. function urlIsHttpHttpsScheme (url) {
  25566. assert('protocol' in url) // ensure it's a url object
  25567. const protocol = url.protocol
  25568. return protocol === 'http:' || protocol === 'https:'
  25569. }
  25570. /**
  25571. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25572. */
  25573. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25574. module.exports = {
  25575. isAborted,
  25576. isCancelled,
  25577. createDeferredPromise,
  25578. ReadableStreamFrom,
  25579. toUSVString,
  25580. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25581. coarsenedSharedCurrentTime,
  25582. determineRequestsReferrer,
  25583. makePolicyContainer,
  25584. clonePolicyContainer,
  25585. appendFetchMetadata,
  25586. appendRequestOriginHeader,
  25587. TAOCheck,
  25588. corsCheck,
  25589. crossOriginResourcePolicyCheck,
  25590. createOpaqueTimingInfo,
  25591. setRequestReferrerPolicyOnRedirect,
  25592. isValidHTTPToken,
  25593. requestBadPort,
  25594. requestCurrentURL,
  25595. responseURL,
  25596. responseLocationURL,
  25597. isBlobLike,
  25598. isURLPotentiallyTrustworthy,
  25599. isValidReasonPhrase,
  25600. sameOrigin,
  25601. normalizeMethod,
  25602. serializeJavascriptValueToJSONString,
  25603. makeIterator,
  25604. isValidHeaderName,
  25605. isValidHeaderValue,
  25606. hasOwn,
  25607. isErrorLike,
  25608. fullyReadBody,
  25609. bytesMatch,
  25610. isReadableStreamLike,
  25611. readableStreamClose,
  25612. isomorphicEncode,
  25613. isomorphicDecode,
  25614. urlIsLocal,
  25615. urlHasHttpsScheme,
  25616. urlIsHttpHttpsScheme,
  25617. readAllBytes,
  25618. normalizeMethodRecord,
  25619. parseMetadata
  25620. }
  25621. /***/ }),
  25622. /***/ 1744:
  25623. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25624. "use strict";
  25625. const { types } = __nccwpck_require__(3837)
  25626. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25627. /** @type {import('../../types/webidl').Webidl} */
  25628. const webidl = {}
  25629. webidl.converters = {}
  25630. webidl.util = {}
  25631. webidl.errors = {}
  25632. webidl.errors.exception = function (message) {
  25633. return new TypeError(`${message.header}: ${message.message}`)
  25634. }
  25635. webidl.errors.conversionFailed = function (context) {
  25636. const plural = context.types.length === 1 ? '' : ' one of'
  25637. const message =
  25638. `${context.argument} could not be converted to` +
  25639. `${plural}: ${context.types.join(', ')}.`
  25640. return webidl.errors.exception({
  25641. header: context.prefix,
  25642. message
  25643. })
  25644. }
  25645. webidl.errors.invalidArgument = function (context) {
  25646. return webidl.errors.exception({
  25647. header: context.prefix,
  25648. message: `"${context.value}" is an invalid ${context.type}.`
  25649. })
  25650. }
  25651. // https://webidl.spec.whatwg.org/#implements
  25652. webidl.brandCheck = function (V, I, opts = undefined) {
  25653. if (opts?.strict !== false && !(V instanceof I)) {
  25654. throw new TypeError('Illegal invocation')
  25655. } else {
  25656. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25657. }
  25658. }
  25659. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25660. if (length < min) {
  25661. throw webidl.errors.exception({
  25662. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25663. `but${length ? ' only' : ''} ${length} found.`,
  25664. ...ctx
  25665. })
  25666. }
  25667. }
  25668. webidl.illegalConstructor = function () {
  25669. throw webidl.errors.exception({
  25670. header: 'TypeError',
  25671. message: 'Illegal constructor'
  25672. })
  25673. }
  25674. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25675. webidl.util.Type = function (V) {
  25676. switch (typeof V) {
  25677. case 'undefined': return 'Undefined'
  25678. case 'boolean': return 'Boolean'
  25679. case 'string': return 'String'
  25680. case 'symbol': return 'Symbol'
  25681. case 'number': return 'Number'
  25682. case 'bigint': return 'BigInt'
  25683. case 'function':
  25684. case 'object': {
  25685. if (V === null) {
  25686. return 'Null'
  25687. }
  25688. return 'Object'
  25689. }
  25690. }
  25691. }
  25692. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25693. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25694. let upperBound
  25695. let lowerBound
  25696. // 1. If bitLength is 64, then:
  25697. if (bitLength === 64) {
  25698. // 1. Let upperBound be 2^53 − 1.
  25699. upperBound = Math.pow(2, 53) - 1
  25700. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25701. if (signedness === 'unsigned') {
  25702. lowerBound = 0
  25703. } else {
  25704. // 3. Otherwise let lowerBound be −2^53 + 1.
  25705. lowerBound = Math.pow(-2, 53) + 1
  25706. }
  25707. } else if (signedness === 'unsigned') {
  25708. // 2. Otherwise, if signedness is "unsigned", then:
  25709. // 1. Let lowerBound be 0.
  25710. lowerBound = 0
  25711. // 2. Let upperBound be 2^bitLength − 1.
  25712. upperBound = Math.pow(2, bitLength) - 1
  25713. } else {
  25714. // 3. Otherwise:
  25715. // 1. Let lowerBound be -2^bitLength − 1.
  25716. lowerBound = Math.pow(-2, bitLength) - 1
  25717. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25718. upperBound = Math.pow(2, bitLength - 1) - 1
  25719. }
  25720. // 4. Let x be ? ToNumber(V).
  25721. let x = Number(V)
  25722. // 5. If x is −0, then set x to +0.
  25723. if (x === 0) {
  25724. x = 0
  25725. }
  25726. // 6. If the conversion is to an IDL type associated
  25727. // with the [EnforceRange] extended attribute, then:
  25728. if (opts.enforceRange === true) {
  25729. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25730. if (
  25731. Number.isNaN(x) ||
  25732. x === Number.POSITIVE_INFINITY ||
  25733. x === Number.NEGATIVE_INFINITY
  25734. ) {
  25735. throw webidl.errors.exception({
  25736. header: 'Integer conversion',
  25737. message: `Could not convert ${V} to an integer.`
  25738. })
  25739. }
  25740. // 2. Set x to IntegerPart(x).
  25741. x = webidl.util.IntegerPart(x)
  25742. // 3. If x < lowerBound or x > upperBound, then
  25743. // throw a TypeError.
  25744. if (x < lowerBound || x > upperBound) {
  25745. throw webidl.errors.exception({
  25746. header: 'Integer conversion',
  25747. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25748. })
  25749. }
  25750. // 4. Return x.
  25751. return x
  25752. }
  25753. // 7. If x is not NaN and the conversion is to an IDL
  25754. // type associated with the [Clamp] extended
  25755. // attribute, then:
  25756. if (!Number.isNaN(x) && opts.clamp === true) {
  25757. // 1. Set x to min(max(x, lowerBound), upperBound).
  25758. x = Math.min(Math.max(x, lowerBound), upperBound)
  25759. // 2. Round x to the nearest integer, choosing the
  25760. // even integer if it lies halfway between two,
  25761. // and choosing +0 rather than −0.
  25762. if (Math.floor(x) % 2 === 0) {
  25763. x = Math.floor(x)
  25764. } else {
  25765. x = Math.ceil(x)
  25766. }
  25767. // 3. Return x.
  25768. return x
  25769. }
  25770. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25771. if (
  25772. Number.isNaN(x) ||
  25773. (x === 0 && Object.is(0, x)) ||
  25774. x === Number.POSITIVE_INFINITY ||
  25775. x === Number.NEGATIVE_INFINITY
  25776. ) {
  25777. return 0
  25778. }
  25779. // 9. Set x to IntegerPart(x).
  25780. x = webidl.util.IntegerPart(x)
  25781. // 10. Set x to x modulo 2^bitLength.
  25782. x = x % Math.pow(2, bitLength)
  25783. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25784. // then return x − 2^bitLength.
  25785. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25786. return x - Math.pow(2, bitLength)
  25787. }
  25788. // 12. Otherwise, return x.
  25789. return x
  25790. }
  25791. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25792. webidl.util.IntegerPart = function (n) {
  25793. // 1. Let r be floor(abs(n)).
  25794. const r = Math.floor(Math.abs(n))
  25795. // 2. If n < 0, then return -1 × r.
  25796. if (n < 0) {
  25797. return -1 * r
  25798. }
  25799. // 3. Otherwise, return r.
  25800. return r
  25801. }
  25802. // https://webidl.spec.whatwg.org/#es-sequence
  25803. webidl.sequenceConverter = function (converter) {
  25804. return (V) => {
  25805. // 1. If Type(V) is not Object, throw a TypeError.
  25806. if (webidl.util.Type(V) !== 'Object') {
  25807. throw webidl.errors.exception({
  25808. header: 'Sequence',
  25809. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25810. })
  25811. }
  25812. // 2. Let method be ? GetMethod(V, @@iterator).
  25813. /** @type {Generator} */
  25814. const method = V?.[Symbol.iterator]?.()
  25815. const seq = []
  25816. // 3. If method is undefined, throw a TypeError.
  25817. if (
  25818. method === undefined ||
  25819. typeof method.next !== 'function'
  25820. ) {
  25821. throw webidl.errors.exception({
  25822. header: 'Sequence',
  25823. message: 'Object is not an iterator.'
  25824. })
  25825. }
  25826. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25827. while (true) {
  25828. const { done, value } = method.next()
  25829. if (done) {
  25830. break
  25831. }
  25832. seq.push(converter(value))
  25833. }
  25834. return seq
  25835. }
  25836. }
  25837. // https://webidl.spec.whatwg.org/#es-to-record
  25838. webidl.recordConverter = function (keyConverter, valueConverter) {
  25839. return (O) => {
  25840. // 1. If Type(O) is not Object, throw a TypeError.
  25841. if (webidl.util.Type(O) !== 'Object') {
  25842. throw webidl.errors.exception({
  25843. header: 'Record',
  25844. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25845. })
  25846. }
  25847. // 2. Let result be a new empty instance of record<K, V>.
  25848. const result = {}
  25849. if (!types.isProxy(O)) {
  25850. // Object.keys only returns enumerable properties
  25851. const keys = Object.keys(O)
  25852. for (const key of keys) {
  25853. // 1. Let typedKey be key converted to an IDL value of type K.
  25854. const typedKey = keyConverter(key)
  25855. // 2. Let value be ? Get(O, key).
  25856. // 3. Let typedValue be value converted to an IDL value of type V.
  25857. const typedValue = valueConverter(O[key])
  25858. // 4. Set result[typedKey] to typedValue.
  25859. result[typedKey] = typedValue
  25860. }
  25861. // 5. Return result.
  25862. return result
  25863. }
  25864. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25865. const keys = Reflect.ownKeys(O)
  25866. // 4. For each key of keys.
  25867. for (const key of keys) {
  25868. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25869. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25870. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25871. if (desc?.enumerable) {
  25872. // 1. Let typedKey be key converted to an IDL value of type K.
  25873. const typedKey = keyConverter(key)
  25874. // 2. Let value be ? Get(O, key).
  25875. // 3. Let typedValue be value converted to an IDL value of type V.
  25876. const typedValue = valueConverter(O[key])
  25877. // 4. Set result[typedKey] to typedValue.
  25878. result[typedKey] = typedValue
  25879. }
  25880. }
  25881. // 5. Return result.
  25882. return result
  25883. }
  25884. }
  25885. webidl.interfaceConverter = function (i) {
  25886. return (V, opts = {}) => {
  25887. if (opts.strict !== false && !(V instanceof i)) {
  25888. throw webidl.errors.exception({
  25889. header: i.name,
  25890. message: `Expected ${V} to be an instance of ${i.name}.`
  25891. })
  25892. }
  25893. return V
  25894. }
  25895. }
  25896. webidl.dictionaryConverter = function (converters) {
  25897. return (dictionary) => {
  25898. const type = webidl.util.Type(dictionary)
  25899. const dict = {}
  25900. if (type === 'Null' || type === 'Undefined') {
  25901. return dict
  25902. } else if (type !== 'Object') {
  25903. throw webidl.errors.exception({
  25904. header: 'Dictionary',
  25905. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25906. })
  25907. }
  25908. for (const options of converters) {
  25909. const { key, defaultValue, required, converter } = options
  25910. if (required === true) {
  25911. if (!hasOwn(dictionary, key)) {
  25912. throw webidl.errors.exception({
  25913. header: 'Dictionary',
  25914. message: `Missing required key "${key}".`
  25915. })
  25916. }
  25917. }
  25918. let value = dictionary[key]
  25919. const hasDefault = hasOwn(options, 'defaultValue')
  25920. // Only use defaultValue if value is undefined and
  25921. // a defaultValue options was provided.
  25922. if (hasDefault && value !== null) {
  25923. value = value ?? defaultValue
  25924. }
  25925. // A key can be optional and have no default value.
  25926. // When this happens, do not perform a conversion,
  25927. // and do not assign the key a value.
  25928. if (required || hasDefault || value !== undefined) {
  25929. value = converter(value)
  25930. if (
  25931. options.allowedValues &&
  25932. !options.allowedValues.includes(value)
  25933. ) {
  25934. throw webidl.errors.exception({
  25935. header: 'Dictionary',
  25936. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25937. })
  25938. }
  25939. dict[key] = value
  25940. }
  25941. }
  25942. return dict
  25943. }
  25944. }
  25945. webidl.nullableConverter = function (converter) {
  25946. return (V) => {
  25947. if (V === null) {
  25948. return V
  25949. }
  25950. return converter(V)
  25951. }
  25952. }
  25953. // https://webidl.spec.whatwg.org/#es-DOMString
  25954. webidl.converters.DOMString = function (V, opts = {}) {
  25955. // 1. If V is null and the conversion is to an IDL type
  25956. // associated with the [LegacyNullToEmptyString]
  25957. // extended attribute, then return the DOMString value
  25958. // that represents the empty string.
  25959. if (V === null && opts.legacyNullToEmptyString) {
  25960. return ''
  25961. }
  25962. // 2. Let x be ? ToString(V).
  25963. if (typeof V === 'symbol') {
  25964. throw new TypeError('Could not convert argument of type symbol to string.')
  25965. }
  25966. // 3. Return the IDL DOMString value that represents the
  25967. // same sequence of code units as the one the
  25968. // ECMAScript String value x represents.
  25969. return String(V)
  25970. }
  25971. // https://webidl.spec.whatwg.org/#es-ByteString
  25972. webidl.converters.ByteString = function (V) {
  25973. // 1. Let x be ? ToString(V).
  25974. // Note: DOMString converter perform ? ToString(V)
  25975. const x = webidl.converters.DOMString(V)
  25976. // 2. If the value of any element of x is greater than
  25977. // 255, then throw a TypeError.
  25978. for (let index = 0; index < x.length; index++) {
  25979. if (x.charCodeAt(index) > 255) {
  25980. throw new TypeError(
  25981. 'Cannot convert argument to a ByteString because the character at ' +
  25982. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25983. )
  25984. }
  25985. }
  25986. // 3. Return an IDL ByteString value whose length is the
  25987. // length of x, and where the value of each element is
  25988. // the value of the corresponding element of x.
  25989. return x
  25990. }
  25991. // https://webidl.spec.whatwg.org/#es-USVString
  25992. webidl.converters.USVString = toUSVString
  25993. // https://webidl.spec.whatwg.org/#es-boolean
  25994. webidl.converters.boolean = function (V) {
  25995. // 1. Let x be the result of computing ToBoolean(V).
  25996. const x = Boolean(V)
  25997. // 2. Return the IDL boolean value that is the one that represents
  25998. // the same truth value as the ECMAScript Boolean value x.
  25999. return x
  26000. }
  26001. // https://webidl.spec.whatwg.org/#es-any
  26002. webidl.converters.any = function (V) {
  26003. return V
  26004. }
  26005. // https://webidl.spec.whatwg.org/#es-long-long
  26006. webidl.converters['long long'] = function (V) {
  26007. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  26008. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  26009. // 2. Return the IDL long long value that represents
  26010. // the same numeric value as x.
  26011. return x
  26012. }
  26013. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  26014. webidl.converters['unsigned long long'] = function (V) {
  26015. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  26016. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  26017. // 2. Return the IDL unsigned long long value that
  26018. // represents the same numeric value as x.
  26019. return x
  26020. }
  26021. // https://webidl.spec.whatwg.org/#es-unsigned-long
  26022. webidl.converters['unsigned long'] = function (V) {
  26023. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  26024. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  26025. // 2. Return the IDL unsigned long value that
  26026. // represents the same numeric value as x.
  26027. return x
  26028. }
  26029. // https://webidl.spec.whatwg.org/#es-unsigned-short
  26030. webidl.converters['unsigned short'] = function (V, opts) {
  26031. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  26032. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  26033. // 2. Return the IDL unsigned short value that represents
  26034. // the same numeric value as x.
  26035. return x
  26036. }
  26037. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  26038. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  26039. // 1. If Type(V) is not Object, or V does not have an
  26040. // [[ArrayBufferData]] internal slot, then throw a
  26041. // TypeError.
  26042. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  26043. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  26044. if (
  26045. webidl.util.Type(V) !== 'Object' ||
  26046. !types.isAnyArrayBuffer(V)
  26047. ) {
  26048. throw webidl.errors.conversionFailed({
  26049. prefix: `${V}`,
  26050. argument: `${V}`,
  26051. types: ['ArrayBuffer']
  26052. })
  26053. }
  26054. // 2. If the conversion is not to an IDL type associated
  26055. // with the [AllowShared] extended attribute, and
  26056. // IsSharedArrayBuffer(V) is true, then throw a
  26057. // TypeError.
  26058. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  26059. throw webidl.errors.exception({
  26060. header: 'ArrayBuffer',
  26061. message: 'SharedArrayBuffer is not allowed.'
  26062. })
  26063. }
  26064. // 3. If the conversion is not to an IDL type associated
  26065. // with the [AllowResizable] extended attribute, and
  26066. // IsResizableArrayBuffer(V) is true, then throw a
  26067. // TypeError.
  26068. // Note: resizable ArrayBuffers are currently a proposal.
  26069. // 4. Return the IDL ArrayBuffer value that is a
  26070. // reference to the same object as V.
  26071. return V
  26072. }
  26073. webidl.converters.TypedArray = function (V, T, opts = {}) {
  26074. // 1. Let T be the IDL type V is being converted to.
  26075. // 2. If Type(V) is not Object, or V does not have a
  26076. // [[TypedArrayName]] internal slot with a value
  26077. // equal to T’s name, then throw a TypeError.
  26078. if (
  26079. webidl.util.Type(V) !== 'Object' ||
  26080. !types.isTypedArray(V) ||
  26081. V.constructor.name !== T.name
  26082. ) {
  26083. throw webidl.errors.conversionFailed({
  26084. prefix: `${T.name}`,
  26085. argument: `${V}`,
  26086. types: [T.name]
  26087. })
  26088. }
  26089. // 3. If the conversion is not to an IDL type associated
  26090. // with the [AllowShared] extended attribute, and
  26091. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26092. // true, then throw a TypeError.
  26093. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26094. throw webidl.errors.exception({
  26095. header: 'ArrayBuffer',
  26096. message: 'SharedArrayBuffer is not allowed.'
  26097. })
  26098. }
  26099. // 4. If the conversion is not to an IDL type associated
  26100. // with the [AllowResizable] extended attribute, and
  26101. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26102. // true, then throw a TypeError.
  26103. // Note: resizable array buffers are currently a proposal
  26104. // 5. Return the IDL value of type T that is a reference
  26105. // to the same object as V.
  26106. return V
  26107. }
  26108. webidl.converters.DataView = function (V, opts = {}) {
  26109. // 1. If Type(V) is not Object, or V does not have a
  26110. // [[DataView]] internal slot, then throw a TypeError.
  26111. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  26112. throw webidl.errors.exception({
  26113. header: 'DataView',
  26114. message: 'Object is not a DataView.'
  26115. })
  26116. }
  26117. // 2. If the conversion is not to an IDL type associated
  26118. // with the [AllowShared] extended attribute, and
  26119. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  26120. // then throw a TypeError.
  26121. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26122. throw webidl.errors.exception({
  26123. header: 'ArrayBuffer',
  26124. message: 'SharedArrayBuffer is not allowed.'
  26125. })
  26126. }
  26127. // 3. If the conversion is not to an IDL type associated
  26128. // with the [AllowResizable] extended attribute, and
  26129. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26130. // true, then throw a TypeError.
  26131. // Note: resizable ArrayBuffers are currently a proposal
  26132. // 4. Return the IDL DataView value that is a reference
  26133. // to the same object as V.
  26134. return V
  26135. }
  26136. // https://webidl.spec.whatwg.org/#BufferSource
  26137. webidl.converters.BufferSource = function (V, opts = {}) {
  26138. if (types.isAnyArrayBuffer(V)) {
  26139. return webidl.converters.ArrayBuffer(V, opts)
  26140. }
  26141. if (types.isTypedArray(V)) {
  26142. return webidl.converters.TypedArray(V, V.constructor)
  26143. }
  26144. if (types.isDataView(V)) {
  26145. return webidl.converters.DataView(V, opts)
  26146. }
  26147. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  26148. }
  26149. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  26150. webidl.converters.ByteString
  26151. )
  26152. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  26153. webidl.converters['sequence<ByteString>']
  26154. )
  26155. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  26156. webidl.converters.ByteString,
  26157. webidl.converters.ByteString
  26158. )
  26159. module.exports = {
  26160. webidl
  26161. }
  26162. /***/ }),
  26163. /***/ 4854:
  26164. /***/ ((module) => {
  26165. "use strict";
  26166. /**
  26167. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  26168. * @param {string|undefined} label
  26169. */
  26170. function getEncoding (label) {
  26171. if (!label) {
  26172. return 'failure'
  26173. }
  26174. // 1. Remove any leading and trailing ASCII whitespace from label.
  26175. // 2. If label is an ASCII case-insensitive match for any of the
  26176. // labels listed in the table below, then return the
  26177. // corresponding encoding; otherwise return failure.
  26178. switch (label.trim().toLowerCase()) {
  26179. case 'unicode-1-1-utf-8':
  26180. case 'unicode11utf8':
  26181. case 'unicode20utf8':
  26182. case 'utf-8':
  26183. case 'utf8':
  26184. case 'x-unicode20utf8':
  26185. return 'UTF-8'
  26186. case '866':
  26187. case 'cp866':
  26188. case 'csibm866':
  26189. case 'ibm866':
  26190. return 'IBM866'
  26191. case 'csisolatin2':
  26192. case 'iso-8859-2':
  26193. case 'iso-ir-101':
  26194. case 'iso8859-2':
  26195. case 'iso88592':
  26196. case 'iso_8859-2':
  26197. case 'iso_8859-2:1987':
  26198. case 'l2':
  26199. case 'latin2':
  26200. return 'ISO-8859-2'
  26201. case 'csisolatin3':
  26202. case 'iso-8859-3':
  26203. case 'iso-ir-109':
  26204. case 'iso8859-3':
  26205. case 'iso88593':
  26206. case 'iso_8859-3':
  26207. case 'iso_8859-3:1988':
  26208. case 'l3':
  26209. case 'latin3':
  26210. return 'ISO-8859-3'
  26211. case 'csisolatin4':
  26212. case 'iso-8859-4':
  26213. case 'iso-ir-110':
  26214. case 'iso8859-4':
  26215. case 'iso88594':
  26216. case 'iso_8859-4':
  26217. case 'iso_8859-4:1988':
  26218. case 'l4':
  26219. case 'latin4':
  26220. return 'ISO-8859-4'
  26221. case 'csisolatincyrillic':
  26222. case 'cyrillic':
  26223. case 'iso-8859-5':
  26224. case 'iso-ir-144':
  26225. case 'iso8859-5':
  26226. case 'iso88595':
  26227. case 'iso_8859-5':
  26228. case 'iso_8859-5:1988':
  26229. return 'ISO-8859-5'
  26230. case 'arabic':
  26231. case 'asmo-708':
  26232. case 'csiso88596e':
  26233. case 'csiso88596i':
  26234. case 'csisolatinarabic':
  26235. case 'ecma-114':
  26236. case 'iso-8859-6':
  26237. case 'iso-8859-6-e':
  26238. case 'iso-8859-6-i':
  26239. case 'iso-ir-127':
  26240. case 'iso8859-6':
  26241. case 'iso88596':
  26242. case 'iso_8859-6':
  26243. case 'iso_8859-6:1987':
  26244. return 'ISO-8859-6'
  26245. case 'csisolatingreek':
  26246. case 'ecma-118':
  26247. case 'elot_928':
  26248. case 'greek':
  26249. case 'greek8':
  26250. case 'iso-8859-7':
  26251. case 'iso-ir-126':
  26252. case 'iso8859-7':
  26253. case 'iso88597':
  26254. case 'iso_8859-7':
  26255. case 'iso_8859-7:1987':
  26256. case 'sun_eu_greek':
  26257. return 'ISO-8859-7'
  26258. case 'csiso88598e':
  26259. case 'csisolatinhebrew':
  26260. case 'hebrew':
  26261. case 'iso-8859-8':
  26262. case 'iso-8859-8-e':
  26263. case 'iso-ir-138':
  26264. case 'iso8859-8':
  26265. case 'iso88598':
  26266. case 'iso_8859-8':
  26267. case 'iso_8859-8:1988':
  26268. case 'visual':
  26269. return 'ISO-8859-8'
  26270. case 'csiso88598i':
  26271. case 'iso-8859-8-i':
  26272. case 'logical':
  26273. return 'ISO-8859-8-I'
  26274. case 'csisolatin6':
  26275. case 'iso-8859-10':
  26276. case 'iso-ir-157':
  26277. case 'iso8859-10':
  26278. case 'iso885910':
  26279. case 'l6':
  26280. case 'latin6':
  26281. return 'ISO-8859-10'
  26282. case 'iso-8859-13':
  26283. case 'iso8859-13':
  26284. case 'iso885913':
  26285. return 'ISO-8859-13'
  26286. case 'iso-8859-14':
  26287. case 'iso8859-14':
  26288. case 'iso885914':
  26289. return 'ISO-8859-14'
  26290. case 'csisolatin9':
  26291. case 'iso-8859-15':
  26292. case 'iso8859-15':
  26293. case 'iso885915':
  26294. case 'iso_8859-15':
  26295. case 'l9':
  26296. return 'ISO-8859-15'
  26297. case 'iso-8859-16':
  26298. return 'ISO-8859-16'
  26299. case 'cskoi8r':
  26300. case 'koi':
  26301. case 'koi8':
  26302. case 'koi8-r':
  26303. case 'koi8_r':
  26304. return 'KOI8-R'
  26305. case 'koi8-ru':
  26306. case 'koi8-u':
  26307. return 'KOI8-U'
  26308. case 'csmacintosh':
  26309. case 'mac':
  26310. case 'macintosh':
  26311. case 'x-mac-roman':
  26312. return 'macintosh'
  26313. case 'iso-8859-11':
  26314. case 'iso8859-11':
  26315. case 'iso885911':
  26316. case 'tis-620':
  26317. case 'windows-874':
  26318. return 'windows-874'
  26319. case 'cp1250':
  26320. case 'windows-1250':
  26321. case 'x-cp1250':
  26322. return 'windows-1250'
  26323. case 'cp1251':
  26324. case 'windows-1251':
  26325. case 'x-cp1251':
  26326. return 'windows-1251'
  26327. case 'ansi_x3.4-1968':
  26328. case 'ascii':
  26329. case 'cp1252':
  26330. case 'cp819':
  26331. case 'csisolatin1':
  26332. case 'ibm819':
  26333. case 'iso-8859-1':
  26334. case 'iso-ir-100':
  26335. case 'iso8859-1':
  26336. case 'iso88591':
  26337. case 'iso_8859-1':
  26338. case 'iso_8859-1:1987':
  26339. case 'l1':
  26340. case 'latin1':
  26341. case 'us-ascii':
  26342. case 'windows-1252':
  26343. case 'x-cp1252':
  26344. return 'windows-1252'
  26345. case 'cp1253':
  26346. case 'windows-1253':
  26347. case 'x-cp1253':
  26348. return 'windows-1253'
  26349. case 'cp1254':
  26350. case 'csisolatin5':
  26351. case 'iso-8859-9':
  26352. case 'iso-ir-148':
  26353. case 'iso8859-9':
  26354. case 'iso88599':
  26355. case 'iso_8859-9':
  26356. case 'iso_8859-9:1989':
  26357. case 'l5':
  26358. case 'latin5':
  26359. case 'windows-1254':
  26360. case 'x-cp1254':
  26361. return 'windows-1254'
  26362. case 'cp1255':
  26363. case 'windows-1255':
  26364. case 'x-cp1255':
  26365. return 'windows-1255'
  26366. case 'cp1256':
  26367. case 'windows-1256':
  26368. case 'x-cp1256':
  26369. return 'windows-1256'
  26370. case 'cp1257':
  26371. case 'windows-1257':
  26372. case 'x-cp1257':
  26373. return 'windows-1257'
  26374. case 'cp1258':
  26375. case 'windows-1258':
  26376. case 'x-cp1258':
  26377. return 'windows-1258'
  26378. case 'x-mac-cyrillic':
  26379. case 'x-mac-ukrainian':
  26380. return 'x-mac-cyrillic'
  26381. case 'chinese':
  26382. case 'csgb2312':
  26383. case 'csiso58gb231280':
  26384. case 'gb2312':
  26385. case 'gb_2312':
  26386. case 'gb_2312-80':
  26387. case 'gbk':
  26388. case 'iso-ir-58':
  26389. case 'x-gbk':
  26390. return 'GBK'
  26391. case 'gb18030':
  26392. return 'gb18030'
  26393. case 'big5':
  26394. case 'big5-hkscs':
  26395. case 'cn-big5':
  26396. case 'csbig5':
  26397. case 'x-x-big5':
  26398. return 'Big5'
  26399. case 'cseucpkdfmtjapanese':
  26400. case 'euc-jp':
  26401. case 'x-euc-jp':
  26402. return 'EUC-JP'
  26403. case 'csiso2022jp':
  26404. case 'iso-2022-jp':
  26405. return 'ISO-2022-JP'
  26406. case 'csshiftjis':
  26407. case 'ms932':
  26408. case 'ms_kanji':
  26409. case 'shift-jis':
  26410. case 'shift_jis':
  26411. case 'sjis':
  26412. case 'windows-31j':
  26413. case 'x-sjis':
  26414. return 'Shift_JIS'
  26415. case 'cseuckr':
  26416. case 'csksc56011987':
  26417. case 'euc-kr':
  26418. case 'iso-ir-149':
  26419. case 'korean':
  26420. case 'ks_c_5601-1987':
  26421. case 'ks_c_5601-1989':
  26422. case 'ksc5601':
  26423. case 'ksc_5601':
  26424. case 'windows-949':
  26425. return 'EUC-KR'
  26426. case 'csiso2022kr':
  26427. case 'hz-gb-2312':
  26428. case 'iso-2022-cn':
  26429. case 'iso-2022-cn-ext':
  26430. case 'iso-2022-kr':
  26431. case 'replacement':
  26432. return 'replacement'
  26433. case 'unicodefffe':
  26434. case 'utf-16be':
  26435. return 'UTF-16BE'
  26436. case 'csunicode':
  26437. case 'iso-10646-ucs-2':
  26438. case 'ucs-2':
  26439. case 'unicode':
  26440. case 'unicodefeff':
  26441. case 'utf-16':
  26442. case 'utf-16le':
  26443. return 'UTF-16LE'
  26444. case 'x-user-defined':
  26445. return 'x-user-defined'
  26446. default: return 'failure'
  26447. }
  26448. }
  26449. module.exports = {
  26450. getEncoding
  26451. }
  26452. /***/ }),
  26453. /***/ 1446:
  26454. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26455. "use strict";
  26456. const {
  26457. staticPropertyDescriptors,
  26458. readOperation,
  26459. fireAProgressEvent
  26460. } = __nccwpck_require__(7530)
  26461. const {
  26462. kState,
  26463. kError,
  26464. kResult,
  26465. kEvents,
  26466. kAborted
  26467. } = __nccwpck_require__(9054)
  26468. const { webidl } = __nccwpck_require__(1744)
  26469. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26470. class FileReader extends EventTarget {
  26471. constructor () {
  26472. super()
  26473. this[kState] = 'empty'
  26474. this[kResult] = null
  26475. this[kError] = null
  26476. this[kEvents] = {
  26477. loadend: null,
  26478. error: null,
  26479. abort: null,
  26480. load: null,
  26481. progress: null,
  26482. loadstart: null
  26483. }
  26484. }
  26485. /**
  26486. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26487. * @param {import('buffer').Blob} blob
  26488. */
  26489. readAsArrayBuffer (blob) {
  26490. webidl.brandCheck(this, FileReader)
  26491. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26492. blob = webidl.converters.Blob(blob, { strict: false })
  26493. // The readAsArrayBuffer(blob) method, when invoked,
  26494. // must initiate a read operation for blob with ArrayBuffer.
  26495. readOperation(this, blob, 'ArrayBuffer')
  26496. }
  26497. /**
  26498. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26499. * @param {import('buffer').Blob} blob
  26500. */
  26501. readAsBinaryString (blob) {
  26502. webidl.brandCheck(this, FileReader)
  26503. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26504. blob = webidl.converters.Blob(blob, { strict: false })
  26505. // The readAsBinaryString(blob) method, when invoked,
  26506. // must initiate a read operation for blob with BinaryString.
  26507. readOperation(this, blob, 'BinaryString')
  26508. }
  26509. /**
  26510. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26511. * @param {import('buffer').Blob} blob
  26512. * @param {string?} encoding
  26513. */
  26514. readAsText (blob, encoding = undefined) {
  26515. webidl.brandCheck(this, FileReader)
  26516. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26517. blob = webidl.converters.Blob(blob, { strict: false })
  26518. if (encoding !== undefined) {
  26519. encoding = webidl.converters.DOMString(encoding)
  26520. }
  26521. // The readAsText(blob, encoding) method, when invoked,
  26522. // must initiate a read operation for blob with Text and encoding.
  26523. readOperation(this, blob, 'Text', encoding)
  26524. }
  26525. /**
  26526. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26527. * @param {import('buffer').Blob} blob
  26528. */
  26529. readAsDataURL (blob) {
  26530. webidl.brandCheck(this, FileReader)
  26531. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26532. blob = webidl.converters.Blob(blob, { strict: false })
  26533. // The readAsDataURL(blob) method, when invoked, must
  26534. // initiate a read operation for blob with DataURL.
  26535. readOperation(this, blob, 'DataURL')
  26536. }
  26537. /**
  26538. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26539. */
  26540. abort () {
  26541. // 1. If this's state is "empty" or if this's state is
  26542. // "done" set this's result to null and terminate
  26543. // this algorithm.
  26544. if (this[kState] === 'empty' || this[kState] === 'done') {
  26545. this[kResult] = null
  26546. return
  26547. }
  26548. // 2. If this's state is "loading" set this's state to
  26549. // "done" and set this's result to null.
  26550. if (this[kState] === 'loading') {
  26551. this[kState] = 'done'
  26552. this[kResult] = null
  26553. }
  26554. // 3. If there are any tasks from this on the file reading
  26555. // task source in an affiliated task queue, then remove
  26556. // those tasks from that task queue.
  26557. this[kAborted] = true
  26558. // 4. Terminate the algorithm for the read method being processed.
  26559. // TODO
  26560. // 5. Fire a progress event called abort at this.
  26561. fireAProgressEvent('abort', this)
  26562. // 6. If this's state is not "loading", fire a progress
  26563. // event called loadend at this.
  26564. if (this[kState] !== 'loading') {
  26565. fireAProgressEvent('loadend', this)
  26566. }
  26567. }
  26568. /**
  26569. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26570. */
  26571. get readyState () {
  26572. webidl.brandCheck(this, FileReader)
  26573. switch (this[kState]) {
  26574. case 'empty': return this.EMPTY
  26575. case 'loading': return this.LOADING
  26576. case 'done': return this.DONE
  26577. }
  26578. }
  26579. /**
  26580. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26581. */
  26582. get result () {
  26583. webidl.brandCheck(this, FileReader)
  26584. // The result attribute’s getter, when invoked, must return
  26585. // this's result.
  26586. return this[kResult]
  26587. }
  26588. /**
  26589. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26590. */
  26591. get error () {
  26592. webidl.brandCheck(this, FileReader)
  26593. // The error attribute’s getter, when invoked, must return
  26594. // this's error.
  26595. return this[kError]
  26596. }
  26597. get onloadend () {
  26598. webidl.brandCheck(this, FileReader)
  26599. return this[kEvents].loadend
  26600. }
  26601. set onloadend (fn) {
  26602. webidl.brandCheck(this, FileReader)
  26603. if (this[kEvents].loadend) {
  26604. this.removeEventListener('loadend', this[kEvents].loadend)
  26605. }
  26606. if (typeof fn === 'function') {
  26607. this[kEvents].loadend = fn
  26608. this.addEventListener('loadend', fn)
  26609. } else {
  26610. this[kEvents].loadend = null
  26611. }
  26612. }
  26613. get onerror () {
  26614. webidl.brandCheck(this, FileReader)
  26615. return this[kEvents].error
  26616. }
  26617. set onerror (fn) {
  26618. webidl.brandCheck(this, FileReader)
  26619. if (this[kEvents].error) {
  26620. this.removeEventListener('error', this[kEvents].error)
  26621. }
  26622. if (typeof fn === 'function') {
  26623. this[kEvents].error = fn
  26624. this.addEventListener('error', fn)
  26625. } else {
  26626. this[kEvents].error = null
  26627. }
  26628. }
  26629. get onloadstart () {
  26630. webidl.brandCheck(this, FileReader)
  26631. return this[kEvents].loadstart
  26632. }
  26633. set onloadstart (fn) {
  26634. webidl.brandCheck(this, FileReader)
  26635. if (this[kEvents].loadstart) {
  26636. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26637. }
  26638. if (typeof fn === 'function') {
  26639. this[kEvents].loadstart = fn
  26640. this.addEventListener('loadstart', fn)
  26641. } else {
  26642. this[kEvents].loadstart = null
  26643. }
  26644. }
  26645. get onprogress () {
  26646. webidl.brandCheck(this, FileReader)
  26647. return this[kEvents].progress
  26648. }
  26649. set onprogress (fn) {
  26650. webidl.brandCheck(this, FileReader)
  26651. if (this[kEvents].progress) {
  26652. this.removeEventListener('progress', this[kEvents].progress)
  26653. }
  26654. if (typeof fn === 'function') {
  26655. this[kEvents].progress = fn
  26656. this.addEventListener('progress', fn)
  26657. } else {
  26658. this[kEvents].progress = null
  26659. }
  26660. }
  26661. get onload () {
  26662. webidl.brandCheck(this, FileReader)
  26663. return this[kEvents].load
  26664. }
  26665. set onload (fn) {
  26666. webidl.brandCheck(this, FileReader)
  26667. if (this[kEvents].load) {
  26668. this.removeEventListener('load', this[kEvents].load)
  26669. }
  26670. if (typeof fn === 'function') {
  26671. this[kEvents].load = fn
  26672. this.addEventListener('load', fn)
  26673. } else {
  26674. this[kEvents].load = null
  26675. }
  26676. }
  26677. get onabort () {
  26678. webidl.brandCheck(this, FileReader)
  26679. return this[kEvents].abort
  26680. }
  26681. set onabort (fn) {
  26682. webidl.brandCheck(this, FileReader)
  26683. if (this[kEvents].abort) {
  26684. this.removeEventListener('abort', this[kEvents].abort)
  26685. }
  26686. if (typeof fn === 'function') {
  26687. this[kEvents].abort = fn
  26688. this.addEventListener('abort', fn)
  26689. } else {
  26690. this[kEvents].abort = null
  26691. }
  26692. }
  26693. }
  26694. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26695. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26696. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26697. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26698. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26699. FileReader.DONE = FileReader.prototype.DONE = 2
  26700. Object.defineProperties(FileReader.prototype, {
  26701. EMPTY: staticPropertyDescriptors,
  26702. LOADING: staticPropertyDescriptors,
  26703. DONE: staticPropertyDescriptors,
  26704. readAsArrayBuffer: kEnumerableProperty,
  26705. readAsBinaryString: kEnumerableProperty,
  26706. readAsText: kEnumerableProperty,
  26707. readAsDataURL: kEnumerableProperty,
  26708. abort: kEnumerableProperty,
  26709. readyState: kEnumerableProperty,
  26710. result: kEnumerableProperty,
  26711. error: kEnumerableProperty,
  26712. onloadstart: kEnumerableProperty,
  26713. onprogress: kEnumerableProperty,
  26714. onload: kEnumerableProperty,
  26715. onabort: kEnumerableProperty,
  26716. onerror: kEnumerableProperty,
  26717. onloadend: kEnumerableProperty,
  26718. [Symbol.toStringTag]: {
  26719. value: 'FileReader',
  26720. writable: false,
  26721. enumerable: false,
  26722. configurable: true
  26723. }
  26724. })
  26725. Object.defineProperties(FileReader, {
  26726. EMPTY: staticPropertyDescriptors,
  26727. LOADING: staticPropertyDescriptors,
  26728. DONE: staticPropertyDescriptors
  26729. })
  26730. module.exports = {
  26731. FileReader
  26732. }
  26733. /***/ }),
  26734. /***/ 5504:
  26735. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26736. "use strict";
  26737. const { webidl } = __nccwpck_require__(1744)
  26738. const kState = Symbol('ProgressEvent state')
  26739. /**
  26740. * @see https://xhr.spec.whatwg.org/#progressevent
  26741. */
  26742. class ProgressEvent extends Event {
  26743. constructor (type, eventInitDict = {}) {
  26744. type = webidl.converters.DOMString(type)
  26745. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26746. super(type, eventInitDict)
  26747. this[kState] = {
  26748. lengthComputable: eventInitDict.lengthComputable,
  26749. loaded: eventInitDict.loaded,
  26750. total: eventInitDict.total
  26751. }
  26752. }
  26753. get lengthComputable () {
  26754. webidl.brandCheck(this, ProgressEvent)
  26755. return this[kState].lengthComputable
  26756. }
  26757. get loaded () {
  26758. webidl.brandCheck(this, ProgressEvent)
  26759. return this[kState].loaded
  26760. }
  26761. get total () {
  26762. webidl.brandCheck(this, ProgressEvent)
  26763. return this[kState].total
  26764. }
  26765. }
  26766. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26767. {
  26768. key: 'lengthComputable',
  26769. converter: webidl.converters.boolean,
  26770. defaultValue: false
  26771. },
  26772. {
  26773. key: 'loaded',
  26774. converter: webidl.converters['unsigned long long'],
  26775. defaultValue: 0
  26776. },
  26777. {
  26778. key: 'total',
  26779. converter: webidl.converters['unsigned long long'],
  26780. defaultValue: 0
  26781. },
  26782. {
  26783. key: 'bubbles',
  26784. converter: webidl.converters.boolean,
  26785. defaultValue: false
  26786. },
  26787. {
  26788. key: 'cancelable',
  26789. converter: webidl.converters.boolean,
  26790. defaultValue: false
  26791. },
  26792. {
  26793. key: 'composed',
  26794. converter: webidl.converters.boolean,
  26795. defaultValue: false
  26796. }
  26797. ])
  26798. module.exports = {
  26799. ProgressEvent
  26800. }
  26801. /***/ }),
  26802. /***/ 9054:
  26803. /***/ ((module) => {
  26804. "use strict";
  26805. module.exports = {
  26806. kState: Symbol('FileReader state'),
  26807. kResult: Symbol('FileReader result'),
  26808. kError: Symbol('FileReader error'),
  26809. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26810. kEvents: Symbol('FileReader events'),
  26811. kAborted: Symbol('FileReader aborted')
  26812. }
  26813. /***/ }),
  26814. /***/ 7530:
  26815. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26816. "use strict";
  26817. const {
  26818. kState,
  26819. kError,
  26820. kResult,
  26821. kAborted,
  26822. kLastProgressEventFired
  26823. } = __nccwpck_require__(9054)
  26824. const { ProgressEvent } = __nccwpck_require__(5504)
  26825. const { getEncoding } = __nccwpck_require__(4854)
  26826. const { DOMException } = __nccwpck_require__(1037)
  26827. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26828. const { types } = __nccwpck_require__(3837)
  26829. const { StringDecoder } = __nccwpck_require__(1576)
  26830. const { btoa } = __nccwpck_require__(4300)
  26831. /** @type {PropertyDescriptor} */
  26832. const staticPropertyDescriptors = {
  26833. enumerable: true,
  26834. writable: false,
  26835. configurable: false
  26836. }
  26837. /**
  26838. * @see https://w3c.github.io/FileAPI/#readOperation
  26839. * @param {import('./filereader').FileReader} fr
  26840. * @param {import('buffer').Blob} blob
  26841. * @param {string} type
  26842. * @param {string?} encodingName
  26843. */
  26844. function readOperation (fr, blob, type, encodingName) {
  26845. // 1. If fr’s state is "loading", throw an InvalidStateError
  26846. // DOMException.
  26847. if (fr[kState] === 'loading') {
  26848. throw new DOMException('Invalid state', 'InvalidStateError')
  26849. }
  26850. // 2. Set fr’s state to "loading".
  26851. fr[kState] = 'loading'
  26852. // 3. Set fr’s result to null.
  26853. fr[kResult] = null
  26854. // 4. Set fr’s error to null.
  26855. fr[kError] = null
  26856. // 5. Let stream be the result of calling get stream on blob.
  26857. /** @type {import('stream/web').ReadableStream} */
  26858. const stream = blob.stream()
  26859. // 6. Let reader be the result of getting a reader from stream.
  26860. const reader = stream.getReader()
  26861. // 7. Let bytes be an empty byte sequence.
  26862. /** @type {Uint8Array[]} */
  26863. const bytes = []
  26864. // 8. Let chunkPromise be the result of reading a chunk from
  26865. // stream with reader.
  26866. let chunkPromise = reader.read()
  26867. // 9. Let isFirstChunk be true.
  26868. let isFirstChunk = true
  26869. // 10. In parallel, while true:
  26870. // Note: "In parallel" just means non-blocking
  26871. // Note 2: readOperation itself cannot be async as double
  26872. // reading the body would then reject the promise, instead
  26873. // of throwing an error.
  26874. ;(async () => {
  26875. while (!fr[kAborted]) {
  26876. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26877. try {
  26878. const { done, value } = await chunkPromise
  26879. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26880. // true, queue a task to fire a progress event called
  26881. // loadstart at fr.
  26882. if (isFirstChunk && !fr[kAborted]) {
  26883. queueMicrotask(() => {
  26884. fireAProgressEvent('loadstart', fr)
  26885. })
  26886. }
  26887. // 3. Set isFirstChunk to false.
  26888. isFirstChunk = false
  26889. // 4. If chunkPromise is fulfilled with an object whose
  26890. // done property is false and whose value property is
  26891. // a Uint8Array object, run these steps:
  26892. if (!done && types.isUint8Array(value)) {
  26893. // 1. Let bs be the byte sequence represented by the
  26894. // Uint8Array object.
  26895. // 2. Append bs to bytes.
  26896. bytes.push(value)
  26897. // 3. If roughly 50ms have passed since these steps
  26898. // were last invoked, queue a task to fire a
  26899. // progress event called progress at fr.
  26900. if (
  26901. (
  26902. fr[kLastProgressEventFired] === undefined ||
  26903. Date.now() - fr[kLastProgressEventFired] >= 50
  26904. ) &&
  26905. !fr[kAborted]
  26906. ) {
  26907. fr[kLastProgressEventFired] = Date.now()
  26908. queueMicrotask(() => {
  26909. fireAProgressEvent('progress', fr)
  26910. })
  26911. }
  26912. // 4. Set chunkPromise to the result of reading a
  26913. // chunk from stream with reader.
  26914. chunkPromise = reader.read()
  26915. } else if (done) {
  26916. // 5. Otherwise, if chunkPromise is fulfilled with an
  26917. // object whose done property is true, queue a task
  26918. // to run the following steps and abort this algorithm:
  26919. queueMicrotask(() => {
  26920. // 1. Set fr’s state to "done".
  26921. fr[kState] = 'done'
  26922. // 2. Let result be the result of package data given
  26923. // bytes, type, blob’s type, and encodingName.
  26924. try {
  26925. const result = packageData(bytes, type, blob.type, encodingName)
  26926. // 4. Else:
  26927. if (fr[kAborted]) {
  26928. return
  26929. }
  26930. // 1. Set fr’s result to result.
  26931. fr[kResult] = result
  26932. // 2. Fire a progress event called load at the fr.
  26933. fireAProgressEvent('load', fr)
  26934. } catch (error) {
  26935. // 3. If package data threw an exception error:
  26936. // 1. Set fr’s error to error.
  26937. fr[kError] = error
  26938. // 2. Fire a progress event called error at fr.
  26939. fireAProgressEvent('error', fr)
  26940. }
  26941. // 5. If fr’s state is not "loading", fire a progress
  26942. // event called loadend at the fr.
  26943. if (fr[kState] !== 'loading') {
  26944. fireAProgressEvent('loadend', fr)
  26945. }
  26946. })
  26947. break
  26948. }
  26949. } catch (error) {
  26950. if (fr[kAborted]) {
  26951. return
  26952. }
  26953. // 6. Otherwise, if chunkPromise is rejected with an
  26954. // error error, queue a task to run the following
  26955. // steps and abort this algorithm:
  26956. queueMicrotask(() => {
  26957. // 1. Set fr’s state to "done".
  26958. fr[kState] = 'done'
  26959. // 2. Set fr’s error to error.
  26960. fr[kError] = error
  26961. // 3. Fire a progress event called error at fr.
  26962. fireAProgressEvent('error', fr)
  26963. // 4. If fr’s state is not "loading", fire a progress
  26964. // event called loadend at fr.
  26965. if (fr[kState] !== 'loading') {
  26966. fireAProgressEvent('loadend', fr)
  26967. }
  26968. })
  26969. break
  26970. }
  26971. }
  26972. })()
  26973. }
  26974. /**
  26975. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26976. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26977. * @param {string} e The name of the event
  26978. * @param {import('./filereader').FileReader} reader
  26979. */
  26980. function fireAProgressEvent (e, reader) {
  26981. // The progress event e does not bubble. e.bubbles must be false
  26982. // The progress event e is NOT cancelable. e.cancelable must be false
  26983. const event = new ProgressEvent(e, {
  26984. bubbles: false,
  26985. cancelable: false
  26986. })
  26987. reader.dispatchEvent(event)
  26988. }
  26989. /**
  26990. * @see https://w3c.github.io/FileAPI/#blob-package-data
  26991. * @param {Uint8Array[]} bytes
  26992. * @param {string} type
  26993. * @param {string?} mimeType
  26994. * @param {string?} encodingName
  26995. */
  26996. function packageData (bytes, type, mimeType, encodingName) {
  26997. // 1. A Blob has an associated package data algorithm, given
  26998. // bytes, a type, a optional mimeType, and a optional
  26999. // encodingName, which switches on type and runs the
  27000. // associated steps:
  27001. switch (type) {
  27002. case 'DataURL': {
  27003. // 1. Return bytes as a DataURL [RFC2397] subject to
  27004. // the considerations below:
  27005. // * Use mimeType as part of the Data URL if it is
  27006. // available in keeping with the Data URL
  27007. // specification [RFC2397].
  27008. // * If mimeType is not available return a Data URL
  27009. // without a media-type. [RFC2397].
  27010. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  27011. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  27012. // mediatype := [ type "/" subtype ] *( ";" parameter )
  27013. // data := *urlchar
  27014. // parameter := attribute "=" value
  27015. let dataURL = 'data:'
  27016. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  27017. if (parsed !== 'failure') {
  27018. dataURL += serializeAMimeType(parsed)
  27019. }
  27020. dataURL += ';base64,'
  27021. const decoder = new StringDecoder('latin1')
  27022. for (const chunk of bytes) {
  27023. dataURL += btoa(decoder.write(chunk))
  27024. }
  27025. dataURL += btoa(decoder.end())
  27026. return dataURL
  27027. }
  27028. case 'Text': {
  27029. // 1. Let encoding be failure
  27030. let encoding = 'failure'
  27031. // 2. If the encodingName is present, set encoding to the
  27032. // result of getting an encoding from encodingName.
  27033. if (encodingName) {
  27034. encoding = getEncoding(encodingName)
  27035. }
  27036. // 3. If encoding is failure, and mimeType is present:
  27037. if (encoding === 'failure' && mimeType) {
  27038. // 1. Let type be the result of parse a MIME type
  27039. // given mimeType.
  27040. const type = parseMIMEType(mimeType)
  27041. // 2. If type is not failure, set encoding to the result
  27042. // of getting an encoding from type’s parameters["charset"].
  27043. if (type !== 'failure') {
  27044. encoding = getEncoding(type.parameters.get('charset'))
  27045. }
  27046. }
  27047. // 4. If encoding is failure, then set encoding to UTF-8.
  27048. if (encoding === 'failure') {
  27049. encoding = 'UTF-8'
  27050. }
  27051. // 5. Decode bytes using fallback encoding encoding, and
  27052. // return the result.
  27053. return decode(bytes, encoding)
  27054. }
  27055. case 'ArrayBuffer': {
  27056. // Return a new ArrayBuffer whose contents are bytes.
  27057. const sequence = combineByteSequences(bytes)
  27058. return sequence.buffer
  27059. }
  27060. case 'BinaryString': {
  27061. // Return bytes as a binary string, in which every byte
  27062. // is represented by a code unit of equal value [0..255].
  27063. let binaryString = ''
  27064. const decoder = new StringDecoder('latin1')
  27065. for (const chunk of bytes) {
  27066. binaryString += decoder.write(chunk)
  27067. }
  27068. binaryString += decoder.end()
  27069. return binaryString
  27070. }
  27071. }
  27072. }
  27073. /**
  27074. * @see https://encoding.spec.whatwg.org/#decode
  27075. * @param {Uint8Array[]} ioQueue
  27076. * @param {string} encoding
  27077. */
  27078. function decode (ioQueue, encoding) {
  27079. const bytes = combineByteSequences(ioQueue)
  27080. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  27081. const BOMEncoding = BOMSniffing(bytes)
  27082. let slice = 0
  27083. // 2. If BOMEncoding is non-null:
  27084. if (BOMEncoding !== null) {
  27085. // 1. Set encoding to BOMEncoding.
  27086. encoding = BOMEncoding
  27087. // 2. Read three bytes from ioQueue, if BOMEncoding is
  27088. // UTF-8; otherwise read two bytes.
  27089. // (Do nothing with those bytes.)
  27090. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  27091. }
  27092. // 3. Process a queue with an instance of encoding’s
  27093. // decoder, ioQueue, output, and "replacement".
  27094. // 4. Return output.
  27095. const sliced = bytes.slice(slice)
  27096. return new TextDecoder(encoding).decode(sliced)
  27097. }
  27098. /**
  27099. * @see https://encoding.spec.whatwg.org/#bom-sniff
  27100. * @param {Uint8Array} ioQueue
  27101. */
  27102. function BOMSniffing (ioQueue) {
  27103. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  27104. // converted to a byte sequence.
  27105. const [a, b, c] = ioQueue
  27106. // 2. For each of the rows in the table below, starting with
  27107. // the first one and going down, if BOM starts with the
  27108. // bytes given in the first column, then return the
  27109. // encoding given in the cell in the second column of that
  27110. // row. Otherwise, return null.
  27111. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  27112. return 'UTF-8'
  27113. } else if (a === 0xFE && b === 0xFF) {
  27114. return 'UTF-16BE'
  27115. } else if (a === 0xFF && b === 0xFE) {
  27116. return 'UTF-16LE'
  27117. }
  27118. return null
  27119. }
  27120. /**
  27121. * @param {Uint8Array[]} sequences
  27122. */
  27123. function combineByteSequences (sequences) {
  27124. const size = sequences.reduce((a, b) => {
  27125. return a + b.byteLength
  27126. }, 0)
  27127. let offset = 0
  27128. return sequences.reduce((a, b) => {
  27129. a.set(b, offset)
  27130. offset += b.byteLength
  27131. return a
  27132. }, new Uint8Array(size))
  27133. }
  27134. module.exports = {
  27135. staticPropertyDescriptors,
  27136. readOperation,
  27137. fireAProgressEvent
  27138. }
  27139. /***/ }),
  27140. /***/ 1892:
  27141. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27142. "use strict";
  27143. // We include a version number for the Dispatcher API. In case of breaking changes,
  27144. // this version number must be increased to avoid conflicts.
  27145. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  27146. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27147. const Agent = __nccwpck_require__(7890)
  27148. if (getGlobalDispatcher() === undefined) {
  27149. setGlobalDispatcher(new Agent())
  27150. }
  27151. function setGlobalDispatcher (agent) {
  27152. if (!agent || typeof agent.dispatch !== 'function') {
  27153. throw new InvalidArgumentError('Argument agent must implement Agent')
  27154. }
  27155. Object.defineProperty(globalThis, globalDispatcher, {
  27156. value: agent,
  27157. writable: true,
  27158. enumerable: false,
  27159. configurable: false
  27160. })
  27161. }
  27162. function getGlobalDispatcher () {
  27163. return globalThis[globalDispatcher]
  27164. }
  27165. module.exports = {
  27166. setGlobalDispatcher,
  27167. getGlobalDispatcher
  27168. }
  27169. /***/ }),
  27170. /***/ 6930:
  27171. /***/ ((module) => {
  27172. "use strict";
  27173. module.exports = class DecoratorHandler {
  27174. constructor (handler) {
  27175. this.handler = handler
  27176. }
  27177. onConnect (...args) {
  27178. return this.handler.onConnect(...args)
  27179. }
  27180. onError (...args) {
  27181. return this.handler.onError(...args)
  27182. }
  27183. onUpgrade (...args) {
  27184. return this.handler.onUpgrade(...args)
  27185. }
  27186. onHeaders (...args) {
  27187. return this.handler.onHeaders(...args)
  27188. }
  27189. onData (...args) {
  27190. return this.handler.onData(...args)
  27191. }
  27192. onComplete (...args) {
  27193. return this.handler.onComplete(...args)
  27194. }
  27195. onBodySent (...args) {
  27196. return this.handler.onBodySent(...args)
  27197. }
  27198. }
  27199. /***/ }),
  27200. /***/ 2860:
  27201. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27202. "use strict";
  27203. const util = __nccwpck_require__(3983)
  27204. const { kBodyUsed } = __nccwpck_require__(2785)
  27205. const assert = __nccwpck_require__(9491)
  27206. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27207. const EE = __nccwpck_require__(2361)
  27208. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  27209. const kBody = Symbol('body')
  27210. class BodyAsyncIterable {
  27211. constructor (body) {
  27212. this[kBody] = body
  27213. this[kBodyUsed] = false
  27214. }
  27215. async * [Symbol.asyncIterator] () {
  27216. assert(!this[kBodyUsed], 'disturbed')
  27217. this[kBodyUsed] = true
  27218. yield * this[kBody]
  27219. }
  27220. }
  27221. class RedirectHandler {
  27222. constructor (dispatch, maxRedirections, opts, handler) {
  27223. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  27224. throw new InvalidArgumentError('maxRedirections must be a positive number')
  27225. }
  27226. util.validateHandler(handler, opts.method, opts.upgrade)
  27227. this.dispatch = dispatch
  27228. this.location = null
  27229. this.abort = null
  27230. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  27231. this.maxRedirections = maxRedirections
  27232. this.handler = handler
  27233. this.history = []
  27234. if (util.isStream(this.opts.body)) {
  27235. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  27236. // so that it can be dispatched again?
  27237. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  27238. if (util.bodyLength(this.opts.body) === 0) {
  27239. this.opts.body
  27240. .on('data', function () {
  27241. assert(false)
  27242. })
  27243. }
  27244. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  27245. this.opts.body[kBodyUsed] = false
  27246. EE.prototype.on.call(this.opts.body, 'data', function () {
  27247. this[kBodyUsed] = true
  27248. })
  27249. }
  27250. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  27251. // TODO (fix): We can't access ReadableStream internal state
  27252. // to determine whether or not it has been disturbed. This is just
  27253. // a workaround.
  27254. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27255. } else if (
  27256. this.opts.body &&
  27257. typeof this.opts.body !== 'string' &&
  27258. !ArrayBuffer.isView(this.opts.body) &&
  27259. util.isIterable(this.opts.body)
  27260. ) {
  27261. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27262. // or through some other flag?
  27263. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27264. }
  27265. }
  27266. onConnect (abort) {
  27267. this.abort = abort
  27268. this.handler.onConnect(abort, { history: this.history })
  27269. }
  27270. onUpgrade (statusCode, headers, socket) {
  27271. this.handler.onUpgrade(statusCode, headers, socket)
  27272. }
  27273. onError (error) {
  27274. this.handler.onError(error)
  27275. }
  27276. onHeaders (statusCode, headers, resume, statusText) {
  27277. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27278. ? null
  27279. : parseLocation(statusCode, headers)
  27280. if (this.opts.origin) {
  27281. this.history.push(new URL(this.opts.path, this.opts.origin))
  27282. }
  27283. if (!this.location) {
  27284. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27285. }
  27286. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27287. const path = search ? `${pathname}${search}` : pathname
  27288. // Remove headers referring to the original URL.
  27289. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27290. // https://tools.ietf.org/html/rfc7231#section-6.4
  27291. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27292. this.opts.path = path
  27293. this.opts.origin = origin
  27294. this.opts.maxRedirections = 0
  27295. this.opts.query = null
  27296. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27297. // In case of HTTP 303, always replace method to be either HEAD or GET
  27298. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27299. this.opts.method = 'GET'
  27300. this.opts.body = null
  27301. }
  27302. }
  27303. onData (chunk) {
  27304. if (this.location) {
  27305. /*
  27306. https://tools.ietf.org/html/rfc7231#section-6.4
  27307. TLDR: undici always ignores 3xx response bodies.
  27308. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27309. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27310. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27311. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27312. the Location response header, so the body can be ignored safely.
  27313. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27314. response header AND a response body with the other possible location to follow.
  27315. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27316. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27317. */
  27318. } else {
  27319. return this.handler.onData(chunk)
  27320. }
  27321. }
  27322. onComplete (trailers) {
  27323. if (this.location) {
  27324. /*
  27325. https://tools.ietf.org/html/rfc7231#section-6.4
  27326. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27327. and neither are useful if present.
  27328. See comment on onData method above for more detailed informations.
  27329. */
  27330. this.location = null
  27331. this.abort = null
  27332. this.dispatch(this.opts, this)
  27333. } else {
  27334. this.handler.onComplete(trailers)
  27335. }
  27336. }
  27337. onBodySent (chunk) {
  27338. if (this.handler.onBodySent) {
  27339. this.handler.onBodySent(chunk)
  27340. }
  27341. }
  27342. }
  27343. function parseLocation (statusCode, headers) {
  27344. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27345. return null
  27346. }
  27347. for (let i = 0; i < headers.length; i += 2) {
  27348. if (headers[i].toString().toLowerCase() === 'location') {
  27349. return headers[i + 1]
  27350. }
  27351. }
  27352. }
  27353. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27354. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27355. if (header.length === 4) {
  27356. return util.headerNameToString(header) === 'host'
  27357. }
  27358. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27359. return true
  27360. }
  27361. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27362. const name = util.headerNameToString(header)
  27363. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27364. }
  27365. return false
  27366. }
  27367. // https://tools.ietf.org/html/rfc7231#section-6.4
  27368. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27369. const ret = []
  27370. if (Array.isArray(headers)) {
  27371. for (let i = 0; i < headers.length; i += 2) {
  27372. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27373. ret.push(headers[i], headers[i + 1])
  27374. }
  27375. }
  27376. } else if (headers && typeof headers === 'object') {
  27377. for (const key of Object.keys(headers)) {
  27378. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27379. ret.push(key, headers[key])
  27380. }
  27381. }
  27382. } else {
  27383. assert(headers == null, 'headers must be an object or an array')
  27384. }
  27385. return ret
  27386. }
  27387. module.exports = RedirectHandler
  27388. /***/ }),
  27389. /***/ 2286:
  27390. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27391. const assert = __nccwpck_require__(9491)
  27392. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27393. const { RequestRetryError } = __nccwpck_require__(8045)
  27394. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27395. function calculateRetryAfterHeader (retryAfter) {
  27396. const current = Date.now()
  27397. const diff = new Date(retryAfter).getTime() - current
  27398. return diff
  27399. }
  27400. class RetryHandler {
  27401. constructor (opts, handlers) {
  27402. const { retryOptions, ...dispatchOpts } = opts
  27403. const {
  27404. // Retry scoped
  27405. retry: retryFn,
  27406. maxRetries,
  27407. maxTimeout,
  27408. minTimeout,
  27409. timeoutFactor,
  27410. // Response scoped
  27411. methods,
  27412. errorCodes,
  27413. retryAfter,
  27414. statusCodes
  27415. } = retryOptions ?? {}
  27416. this.dispatch = handlers.dispatch
  27417. this.handler = handlers.handler
  27418. this.opts = dispatchOpts
  27419. this.abort = null
  27420. this.aborted = false
  27421. this.retryOpts = {
  27422. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27423. retryAfter: retryAfter ?? true,
  27424. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27425. timeout: minTimeout ?? 500, // .5s
  27426. timeoutFactor: timeoutFactor ?? 2,
  27427. maxRetries: maxRetries ?? 5,
  27428. // What errors we should retry
  27429. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27430. // Indicates which errors to retry
  27431. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27432. // List of errors to retry
  27433. errorCodes: errorCodes ?? [
  27434. 'ECONNRESET',
  27435. 'ECONNREFUSED',
  27436. 'ENOTFOUND',
  27437. 'ENETDOWN',
  27438. 'ENETUNREACH',
  27439. 'EHOSTDOWN',
  27440. 'EHOSTUNREACH',
  27441. 'EPIPE'
  27442. ]
  27443. }
  27444. this.retryCount = 0
  27445. this.start = 0
  27446. this.end = null
  27447. this.etag = null
  27448. this.resume = null
  27449. // Handle possible onConnect duplication
  27450. this.handler.onConnect(reason => {
  27451. this.aborted = true
  27452. if (this.abort) {
  27453. this.abort(reason)
  27454. } else {
  27455. this.reason = reason
  27456. }
  27457. })
  27458. }
  27459. onRequestSent () {
  27460. if (this.handler.onRequestSent) {
  27461. this.handler.onRequestSent()
  27462. }
  27463. }
  27464. onUpgrade (statusCode, headers, socket) {
  27465. if (this.handler.onUpgrade) {
  27466. this.handler.onUpgrade(statusCode, headers, socket)
  27467. }
  27468. }
  27469. onConnect (abort) {
  27470. if (this.aborted) {
  27471. abort(this.reason)
  27472. } else {
  27473. this.abort = abort
  27474. }
  27475. }
  27476. onBodySent (chunk) {
  27477. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27478. }
  27479. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27480. const { statusCode, code, headers } = err
  27481. const { method, retryOptions } = opts
  27482. const {
  27483. maxRetries,
  27484. timeout,
  27485. maxTimeout,
  27486. timeoutFactor,
  27487. statusCodes,
  27488. errorCodes,
  27489. methods
  27490. } = retryOptions
  27491. let { counter, currentTimeout } = state
  27492. currentTimeout =
  27493. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27494. // Any code that is not a Undici's originated and allowed to retry
  27495. if (
  27496. code &&
  27497. code !== 'UND_ERR_REQ_RETRY' &&
  27498. code !== 'UND_ERR_SOCKET' &&
  27499. !errorCodes.includes(code)
  27500. ) {
  27501. cb(err)
  27502. return
  27503. }
  27504. // If a set of method are provided and the current method is not in the list
  27505. if (Array.isArray(methods) && !methods.includes(method)) {
  27506. cb(err)
  27507. return
  27508. }
  27509. // If a set of status code are provided and the current status code is not in the list
  27510. if (
  27511. statusCode != null &&
  27512. Array.isArray(statusCodes) &&
  27513. !statusCodes.includes(statusCode)
  27514. ) {
  27515. cb(err)
  27516. return
  27517. }
  27518. // If we reached the max number of retries
  27519. if (counter > maxRetries) {
  27520. cb(err)
  27521. return
  27522. }
  27523. let retryAfterHeader = headers != null && headers['retry-after']
  27524. if (retryAfterHeader) {
  27525. retryAfterHeader = Number(retryAfterHeader)
  27526. retryAfterHeader = isNaN(retryAfterHeader)
  27527. ? calculateRetryAfterHeader(retryAfterHeader)
  27528. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27529. }
  27530. const retryTimeout =
  27531. retryAfterHeader > 0
  27532. ? Math.min(retryAfterHeader, maxTimeout)
  27533. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27534. state.currentTimeout = retryTimeout
  27535. setTimeout(() => cb(null), retryTimeout)
  27536. }
  27537. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27538. const headers = parseHeaders(rawHeaders)
  27539. this.retryCount += 1
  27540. if (statusCode >= 300) {
  27541. this.abort(
  27542. new RequestRetryError('Request failed', statusCode, {
  27543. headers,
  27544. count: this.retryCount
  27545. })
  27546. )
  27547. return false
  27548. }
  27549. // Checkpoint for resume from where we left it
  27550. if (this.resume != null) {
  27551. this.resume = null
  27552. if (statusCode !== 206) {
  27553. return true
  27554. }
  27555. const contentRange = parseRangeHeader(headers['content-range'])
  27556. // If no content range
  27557. if (!contentRange) {
  27558. this.abort(
  27559. new RequestRetryError('Content-Range mismatch', statusCode, {
  27560. headers,
  27561. count: this.retryCount
  27562. })
  27563. )
  27564. return false
  27565. }
  27566. // Let's start with a weak etag check
  27567. if (this.etag != null && this.etag !== headers.etag) {
  27568. this.abort(
  27569. new RequestRetryError('ETag mismatch', statusCode, {
  27570. headers,
  27571. count: this.retryCount
  27572. })
  27573. )
  27574. return false
  27575. }
  27576. const { start, size, end = size } = contentRange
  27577. assert(this.start === start, 'content-range mismatch')
  27578. assert(this.end == null || this.end === end, 'content-range mismatch')
  27579. this.resume = resume
  27580. return true
  27581. }
  27582. if (this.end == null) {
  27583. if (statusCode === 206) {
  27584. // First time we receive 206
  27585. const range = parseRangeHeader(headers['content-range'])
  27586. if (range == null) {
  27587. return this.handler.onHeaders(
  27588. statusCode,
  27589. rawHeaders,
  27590. resume,
  27591. statusMessage
  27592. )
  27593. }
  27594. const { start, size, end = size } = range
  27595. assert(
  27596. start != null && Number.isFinite(start) && this.start !== start,
  27597. 'content-range mismatch'
  27598. )
  27599. assert(Number.isFinite(start))
  27600. assert(
  27601. end != null && Number.isFinite(end) && this.end !== end,
  27602. 'invalid content-length'
  27603. )
  27604. this.start = start
  27605. this.end = end
  27606. }
  27607. // We make our best to checkpoint the body for further range headers
  27608. if (this.end == null) {
  27609. const contentLength = headers['content-length']
  27610. this.end = contentLength != null ? Number(contentLength) : null
  27611. }
  27612. assert(Number.isFinite(this.start))
  27613. assert(
  27614. this.end == null || Number.isFinite(this.end),
  27615. 'invalid content-length'
  27616. )
  27617. this.resume = resume
  27618. this.etag = headers.etag != null ? headers.etag : null
  27619. return this.handler.onHeaders(
  27620. statusCode,
  27621. rawHeaders,
  27622. resume,
  27623. statusMessage
  27624. )
  27625. }
  27626. const err = new RequestRetryError('Request failed', statusCode, {
  27627. headers,
  27628. count: this.retryCount
  27629. })
  27630. this.abort(err)
  27631. return false
  27632. }
  27633. onData (chunk) {
  27634. this.start += chunk.length
  27635. return this.handler.onData(chunk)
  27636. }
  27637. onComplete (rawTrailers) {
  27638. this.retryCount = 0
  27639. return this.handler.onComplete(rawTrailers)
  27640. }
  27641. onError (err) {
  27642. if (this.aborted || isDisturbed(this.opts.body)) {
  27643. return this.handler.onError(err)
  27644. }
  27645. this.retryOpts.retry(
  27646. err,
  27647. {
  27648. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27649. opts: { retryOptions: this.retryOpts, ...this.opts }
  27650. },
  27651. onRetry.bind(this)
  27652. )
  27653. function onRetry (err) {
  27654. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27655. return this.handler.onError(err)
  27656. }
  27657. if (this.start !== 0) {
  27658. this.opts = {
  27659. ...this.opts,
  27660. headers: {
  27661. ...this.opts.headers,
  27662. range: `bytes=${this.start}-${this.end ?? ''}`
  27663. }
  27664. }
  27665. }
  27666. try {
  27667. this.dispatch(this.opts, this)
  27668. } catch (err) {
  27669. this.handler.onError(err)
  27670. }
  27671. }
  27672. }
  27673. }
  27674. module.exports = RetryHandler
  27675. /***/ }),
  27676. /***/ 8861:
  27677. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27678. "use strict";
  27679. const RedirectHandler = __nccwpck_require__(2860)
  27680. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27681. return (dispatch) => {
  27682. return function Intercept (opts, handler) {
  27683. const { maxRedirections = defaultMaxRedirections } = opts
  27684. if (!maxRedirections) {
  27685. return dispatch(opts, handler)
  27686. }
  27687. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27688. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27689. return dispatch(opts, redirectHandler)
  27690. }
  27691. }
  27692. }
  27693. module.exports = createRedirectInterceptor
  27694. /***/ }),
  27695. /***/ 953:
  27696. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27697. "use strict";
  27698. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27699. 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;
  27700. const utils_1 = __nccwpck_require__(1891);
  27701. // C headers
  27702. var ERROR;
  27703. (function (ERROR) {
  27704. ERROR[ERROR["OK"] = 0] = "OK";
  27705. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27706. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27707. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27708. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27709. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27710. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27711. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27712. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27713. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27714. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27715. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27716. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27717. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27718. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27719. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27720. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27721. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27722. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27723. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27724. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27725. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27726. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27727. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27728. ERROR[ERROR["USER"] = 24] = "USER";
  27729. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27730. var TYPE;
  27731. (function (TYPE) {
  27732. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27733. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27734. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27735. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27736. var FLAGS;
  27737. (function (FLAGS) {
  27738. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27739. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27740. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27741. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27742. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27743. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27744. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27745. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27746. // 1 << 8 is unused
  27747. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27748. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27749. var LENIENT_FLAGS;
  27750. (function (LENIENT_FLAGS) {
  27751. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27752. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27753. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27754. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27755. var METHODS;
  27756. (function (METHODS) {
  27757. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27758. METHODS[METHODS["GET"] = 1] = "GET";
  27759. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27760. METHODS[METHODS["POST"] = 3] = "POST";
  27761. METHODS[METHODS["PUT"] = 4] = "PUT";
  27762. /* pathological */
  27763. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27764. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27765. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27766. /* WebDAV */
  27767. METHODS[METHODS["COPY"] = 8] = "COPY";
  27768. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27769. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27770. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27771. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27772. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27773. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27774. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27775. METHODS[METHODS["BIND"] = 16] = "BIND";
  27776. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27777. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27778. METHODS[METHODS["ACL"] = 19] = "ACL";
  27779. /* subversion */
  27780. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27781. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27782. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27783. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27784. /* upnp */
  27785. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27786. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27787. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27788. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27789. /* RFC-5789 */
  27790. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27791. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27792. /* CalDAV */
  27793. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27794. /* RFC-2068, section 19.6.1.2 */
  27795. METHODS[METHODS["LINK"] = 31] = "LINK";
  27796. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27797. /* icecast */
  27798. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27799. /* RFC-7540, section 11.6 */
  27800. METHODS[METHODS["PRI"] = 34] = "PRI";
  27801. /* RFC-2326 RTSP */
  27802. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27803. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27804. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27805. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27806. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27807. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27808. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27809. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27810. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27811. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27812. /* RAOP */
  27813. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27814. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27815. exports.METHODS_HTTP = [
  27816. METHODS.DELETE,
  27817. METHODS.GET,
  27818. METHODS.HEAD,
  27819. METHODS.POST,
  27820. METHODS.PUT,
  27821. METHODS.CONNECT,
  27822. METHODS.OPTIONS,
  27823. METHODS.TRACE,
  27824. METHODS.COPY,
  27825. METHODS.LOCK,
  27826. METHODS.MKCOL,
  27827. METHODS.MOVE,
  27828. METHODS.PROPFIND,
  27829. METHODS.PROPPATCH,
  27830. METHODS.SEARCH,
  27831. METHODS.UNLOCK,
  27832. METHODS.BIND,
  27833. METHODS.REBIND,
  27834. METHODS.UNBIND,
  27835. METHODS.ACL,
  27836. METHODS.REPORT,
  27837. METHODS.MKACTIVITY,
  27838. METHODS.CHECKOUT,
  27839. METHODS.MERGE,
  27840. METHODS['M-SEARCH'],
  27841. METHODS.NOTIFY,
  27842. METHODS.SUBSCRIBE,
  27843. METHODS.UNSUBSCRIBE,
  27844. METHODS.PATCH,
  27845. METHODS.PURGE,
  27846. METHODS.MKCALENDAR,
  27847. METHODS.LINK,
  27848. METHODS.UNLINK,
  27849. METHODS.PRI,
  27850. // TODO(indutny): should we allow it with HTTP?
  27851. METHODS.SOURCE,
  27852. ];
  27853. exports.METHODS_ICE = [
  27854. METHODS.SOURCE,
  27855. ];
  27856. exports.METHODS_RTSP = [
  27857. METHODS.OPTIONS,
  27858. METHODS.DESCRIBE,
  27859. METHODS.ANNOUNCE,
  27860. METHODS.SETUP,
  27861. METHODS.PLAY,
  27862. METHODS.PAUSE,
  27863. METHODS.TEARDOWN,
  27864. METHODS.GET_PARAMETER,
  27865. METHODS.SET_PARAMETER,
  27866. METHODS.REDIRECT,
  27867. METHODS.RECORD,
  27868. METHODS.FLUSH,
  27869. // For AirPlay
  27870. METHODS.GET,
  27871. METHODS.POST,
  27872. ];
  27873. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27874. exports.H_METHOD_MAP = {};
  27875. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27876. if (/^H/.test(key)) {
  27877. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27878. }
  27879. });
  27880. var FINISH;
  27881. (function (FINISH) {
  27882. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27883. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27884. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27885. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27886. exports.ALPHA = [];
  27887. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27888. // Upper case
  27889. exports.ALPHA.push(String.fromCharCode(i));
  27890. // Lower case
  27891. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27892. }
  27893. exports.NUM_MAP = {
  27894. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27895. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27896. };
  27897. exports.HEX_MAP = {
  27898. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27899. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27900. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27901. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27902. };
  27903. exports.NUM = [
  27904. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27905. ];
  27906. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27907. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27908. exports.USERINFO_CHARS = exports.ALPHANUM
  27909. .concat(exports.MARK)
  27910. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27911. // TODO(indutny): use RFC
  27912. exports.STRICT_URL_CHAR = [
  27913. '!', '"', '$', '%', '&', '\'',
  27914. '(', ')', '*', '+', ',', '-', '.', '/',
  27915. ':', ';', '<', '=', '>',
  27916. '@', '[', '\\', ']', '^', '_',
  27917. '`',
  27918. '{', '|', '}', '~',
  27919. ].concat(exports.ALPHANUM);
  27920. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27921. .concat(['\t', '\f']);
  27922. // All characters with 0x80 bit set to 1
  27923. for (let i = 0x80; i <= 0xff; i++) {
  27924. exports.URL_CHAR.push(i);
  27925. }
  27926. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27927. /* Tokens as defined by rfc 2616. Also lowercases them.
  27928. * token = 1*<any CHAR except CTLs or separators>
  27929. * separators = "(" | ")" | "<" | ">" | "@"
  27930. * | "," | ";" | ":" | "\" | <">
  27931. * | "/" | "[" | "]" | "?" | "="
  27932. * | "{" | "}" | SP | HT
  27933. */
  27934. exports.STRICT_TOKEN = [
  27935. '!', '#', '$', '%', '&', '\'',
  27936. '*', '+', '-', '.',
  27937. '^', '_', '`',
  27938. '|', '~',
  27939. ].concat(exports.ALPHANUM);
  27940. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27941. /*
  27942. * Verify that a char is a valid visible (printable) US-ASCII
  27943. * character or %x80-FF
  27944. */
  27945. exports.HEADER_CHARS = ['\t'];
  27946. for (let i = 32; i <= 255; i++) {
  27947. if (i !== 127) {
  27948. exports.HEADER_CHARS.push(i);
  27949. }
  27950. }
  27951. // ',' = \x44
  27952. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27953. exports.MAJOR = exports.NUM_MAP;
  27954. exports.MINOR = exports.MAJOR;
  27955. var HEADER_STATE;
  27956. (function (HEADER_STATE) {
  27957. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27958. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27959. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27960. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27961. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27962. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27963. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27964. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27965. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27966. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27967. exports.SPECIAL_HEADERS = {
  27968. 'connection': HEADER_STATE.CONNECTION,
  27969. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27970. 'proxy-connection': HEADER_STATE.CONNECTION,
  27971. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27972. 'upgrade': HEADER_STATE.UPGRADE,
  27973. };
  27974. //# sourceMappingURL=constants.js.map
  27975. /***/ }),
  27976. /***/ 1145:
  27977. /***/ ((module) => {
  27978. module.exports = 'AGFzbQ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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyU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hESAQIQEgEC0AAEFQag435wHmAQECAwQFBgcIAAAAAAAAAAkKCwwNDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELA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ECAAQRo2AgxBACEQDLQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxUCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAM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ICQCAAQf///wdLDQAgAEEIdiICIAJBgP4/akEQdkEIcSICdCIEIARBgOAfakEQdkEEcSIEdCIGIAZBgIAPakEQdkECcSIGdEEPdiACIARyIAZyayICQQF0IAAgAkEVanZBAXFyQRxqIQILIAEgAjYCHCABQgA3AhAgAkECdEG40oCAAGohBAJAAkBBACgCjNCAgAAiBkEBIAJ0IgNxDQAgBCABNgIAQQAgBiADcjYCjNCAgAAgASAENgIYIAEgATYCCCABIAE2AgwMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgBCgCACEGAkADQCAGIgQoAgRBeHEgAEYNASACQR12IQYgAkEBdCECIAQgBkEEcWpBEGoiAygCACIGDQALIAMgATYCACABIAQ2AhggASABNgIMIAEgATYCCAwBCyAEKAIIIgAgATYCDCAEIAE2AgggAUEANgIYIAEgBDYCDCABIAA2AggLQQBBACgCqNCAgABBf2oiAUF/IAEbNgKo0ICAAAsLBAAAAAtOAAJAIAANAD8AQRB0DwsCQCAAQf//A3ENACAAQX9MDQACQCAAQRB2QAAiAEF/Rw0AQQBBMDYC+NOAgABBfw8LIABBEHQPCxDKgICAAAAL8gICA38BfgJAIAJFDQAgACABOgAAIAIgAGoiA0F/aiABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBfWogAToAACADQX5qIAE6AAAgAkEHSQ0AIAAgAToAAyADQXxqIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIFayICQSBJDQAgAa1CgYCAgBB+IQYgAyAFaiEBA0AgASAGNwMYIAEgBjcDECABIAY3AwggASAGNwMAIAFBIGohASACQWBqIgJBH0sNAAsLIAALC45IAQ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CwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh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ACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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EiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQ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wANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdI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VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  27983. /***/ }),
  27984. /***/ 1891:
  27985. /***/ ((__unused_webpack_module, exports) => {
  27986. "use strict";
  27987. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27988. exports.enumToMap = void 0;
  27989. function enumToMap(obj) {
  27990. const res = {};
  27991. Object.keys(obj).forEach((key) => {
  27992. const value = obj[key];
  27993. if (typeof value === 'number') {
  27994. res[key] = value;
  27995. }
  27996. });
  27997. return res;
  27998. }
  27999. exports.enumToMap = enumToMap;
  28000. //# sourceMappingURL=utils.js.map
  28001. /***/ }),
  28002. /***/ 6771:
  28003. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28004. "use strict";
  28005. const { kClients } = __nccwpck_require__(2785)
  28006. const Agent = __nccwpck_require__(7890)
  28007. const {
  28008. kAgent,
  28009. kMockAgentSet,
  28010. kMockAgentGet,
  28011. kDispatches,
  28012. kIsMockActive,
  28013. kNetConnect,
  28014. kGetNetConnect,
  28015. kOptions,
  28016. kFactory
  28017. } = __nccwpck_require__(4347)
  28018. const MockClient = __nccwpck_require__(8687)
  28019. const MockPool = __nccwpck_require__(6193)
  28020. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  28021. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  28022. const Dispatcher = __nccwpck_require__(412)
  28023. const Pluralizer = __nccwpck_require__(8891)
  28024. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  28025. class FakeWeakRef {
  28026. constructor (value) {
  28027. this.value = value
  28028. }
  28029. deref () {
  28030. return this.value
  28031. }
  28032. }
  28033. class MockAgent extends Dispatcher {
  28034. constructor (opts) {
  28035. super(opts)
  28036. this[kNetConnect] = true
  28037. this[kIsMockActive] = true
  28038. // Instantiate Agent and encapsulate
  28039. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  28040. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28041. }
  28042. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  28043. this[kAgent] = agent
  28044. this[kClients] = agent[kClients]
  28045. this[kOptions] = buildMockOptions(opts)
  28046. }
  28047. get (origin) {
  28048. let dispatcher = this[kMockAgentGet](origin)
  28049. if (!dispatcher) {
  28050. dispatcher = this[kFactory](origin)
  28051. this[kMockAgentSet](origin, dispatcher)
  28052. }
  28053. return dispatcher
  28054. }
  28055. dispatch (opts, handler) {
  28056. // Call MockAgent.get to perform additional setup before dispatching as normal
  28057. this.get(opts.origin)
  28058. return this[kAgent].dispatch(opts, handler)
  28059. }
  28060. async close () {
  28061. await this[kAgent].close()
  28062. this[kClients].clear()
  28063. }
  28064. deactivate () {
  28065. this[kIsMockActive] = false
  28066. }
  28067. activate () {
  28068. this[kIsMockActive] = true
  28069. }
  28070. enableNetConnect (matcher) {
  28071. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  28072. if (Array.isArray(this[kNetConnect])) {
  28073. this[kNetConnect].push(matcher)
  28074. } else {
  28075. this[kNetConnect] = [matcher]
  28076. }
  28077. } else if (typeof matcher === 'undefined') {
  28078. this[kNetConnect] = true
  28079. } else {
  28080. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  28081. }
  28082. }
  28083. disableNetConnect () {
  28084. this[kNetConnect] = false
  28085. }
  28086. // This is required to bypass issues caused by using global symbols - see:
  28087. // https://github.com/nodejs/undici/issues/1447
  28088. get isMockActive () {
  28089. return this[kIsMockActive]
  28090. }
  28091. [kMockAgentSet] (origin, dispatcher) {
  28092. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  28093. }
  28094. [kFactory] (origin) {
  28095. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  28096. return this[kOptions] && this[kOptions].connections === 1
  28097. ? new MockClient(origin, mockOptions)
  28098. : new MockPool(origin, mockOptions)
  28099. }
  28100. [kMockAgentGet] (origin) {
  28101. // First check if we can immediately find it
  28102. const ref = this[kClients].get(origin)
  28103. if (ref) {
  28104. return ref.deref()
  28105. }
  28106. // If the origin is not a string create a dummy parent pool and return to user
  28107. if (typeof origin !== 'string') {
  28108. const dispatcher = this[kFactory]('http://localhost:9999')
  28109. this[kMockAgentSet](origin, dispatcher)
  28110. return dispatcher
  28111. }
  28112. // If we match, create a pool and assign the same dispatches
  28113. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  28114. const nonExplicitDispatcher = nonExplicitRef.deref()
  28115. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  28116. const dispatcher = this[kFactory](origin)
  28117. this[kMockAgentSet](origin, dispatcher)
  28118. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  28119. return dispatcher
  28120. }
  28121. }
  28122. }
  28123. [kGetNetConnect] () {
  28124. return this[kNetConnect]
  28125. }
  28126. pendingInterceptors () {
  28127. const mockAgentClients = this[kClients]
  28128. return Array.from(mockAgentClients.entries())
  28129. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  28130. .filter(({ pending }) => pending)
  28131. }
  28132. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  28133. const pending = this.pendingInterceptors()
  28134. if (pending.length === 0) {
  28135. return
  28136. }
  28137. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  28138. throw new UndiciError(`
  28139. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  28140. ${pendingInterceptorsFormatter.format(pending)}
  28141. `.trim())
  28142. }
  28143. }
  28144. module.exports = MockAgent
  28145. /***/ }),
  28146. /***/ 8687:
  28147. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28148. "use strict";
  28149. const { promisify } = __nccwpck_require__(3837)
  28150. const Client = __nccwpck_require__(3598)
  28151. const { buildMockDispatch } = __nccwpck_require__(9323)
  28152. const {
  28153. kDispatches,
  28154. kMockAgent,
  28155. kClose,
  28156. kOriginalClose,
  28157. kOrigin,
  28158. kOriginalDispatch,
  28159. kConnected
  28160. } = __nccwpck_require__(4347)
  28161. const { MockInterceptor } = __nccwpck_require__(410)
  28162. const Symbols = __nccwpck_require__(2785)
  28163. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28164. /**
  28165. * MockClient provides an API that extends the Client to influence the mockDispatches.
  28166. */
  28167. class MockClient extends Client {
  28168. constructor (origin, opts) {
  28169. super(origin, opts)
  28170. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28171. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28172. }
  28173. this[kMockAgent] = opts.agent
  28174. this[kOrigin] = origin
  28175. this[kDispatches] = []
  28176. this[kConnected] = 1
  28177. this[kOriginalDispatch] = this.dispatch
  28178. this[kOriginalClose] = this.close.bind(this)
  28179. this.dispatch = buildMockDispatch.call(this)
  28180. this.close = this[kClose]
  28181. }
  28182. get [Symbols.kConnected] () {
  28183. return this[kConnected]
  28184. }
  28185. /**
  28186. * Sets up the base interceptor for mocking replies from undici.
  28187. */
  28188. intercept (opts) {
  28189. return new MockInterceptor(opts, this[kDispatches])
  28190. }
  28191. async [kClose] () {
  28192. await promisify(this[kOriginalClose])()
  28193. this[kConnected] = 0
  28194. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28195. }
  28196. }
  28197. module.exports = MockClient
  28198. /***/ }),
  28199. /***/ 888:
  28200. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28201. "use strict";
  28202. const { UndiciError } = __nccwpck_require__(8045)
  28203. class MockNotMatchedError extends UndiciError {
  28204. constructor (message) {
  28205. super(message)
  28206. Error.captureStackTrace(this, MockNotMatchedError)
  28207. this.name = 'MockNotMatchedError'
  28208. this.message = message || 'The request does not match any registered mock dispatches'
  28209. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  28210. }
  28211. }
  28212. module.exports = {
  28213. MockNotMatchedError
  28214. }
  28215. /***/ }),
  28216. /***/ 410:
  28217. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28218. "use strict";
  28219. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  28220. const {
  28221. kDispatches,
  28222. kDispatchKey,
  28223. kDefaultHeaders,
  28224. kDefaultTrailers,
  28225. kContentLength,
  28226. kMockDispatch
  28227. } = __nccwpck_require__(4347)
  28228. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28229. const { buildURL } = __nccwpck_require__(3983)
  28230. /**
  28231. * Defines the scope API for an interceptor reply
  28232. */
  28233. class MockScope {
  28234. constructor (mockDispatch) {
  28235. this[kMockDispatch] = mockDispatch
  28236. }
  28237. /**
  28238. * Delay a reply by a set amount in ms.
  28239. */
  28240. delay (waitInMs) {
  28241. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  28242. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  28243. }
  28244. this[kMockDispatch].delay = waitInMs
  28245. return this
  28246. }
  28247. /**
  28248. * For a defined reply, never mark as consumed.
  28249. */
  28250. persist () {
  28251. this[kMockDispatch].persist = true
  28252. return this
  28253. }
  28254. /**
  28255. * Allow one to define a reply for a set amount of matching requests.
  28256. */
  28257. times (repeatTimes) {
  28258. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28259. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28260. }
  28261. this[kMockDispatch].times = repeatTimes
  28262. return this
  28263. }
  28264. }
  28265. /**
  28266. * Defines an interceptor for a Mock
  28267. */
  28268. class MockInterceptor {
  28269. constructor (opts, mockDispatches) {
  28270. if (typeof opts !== 'object') {
  28271. throw new InvalidArgumentError('opts must be an object')
  28272. }
  28273. if (typeof opts.path === 'undefined') {
  28274. throw new InvalidArgumentError('opts.path must be defined')
  28275. }
  28276. if (typeof opts.method === 'undefined') {
  28277. opts.method = 'GET'
  28278. }
  28279. // See https://github.com/nodejs/undici/issues/1245
  28280. // As per RFC 3986, clients are not supposed to send URI
  28281. // fragments to servers when they retrieve a document,
  28282. if (typeof opts.path === 'string') {
  28283. if (opts.query) {
  28284. opts.path = buildURL(opts.path, opts.query)
  28285. } else {
  28286. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28287. const parsedURL = new URL(opts.path, 'data://')
  28288. opts.path = parsedURL.pathname + parsedURL.search
  28289. }
  28290. }
  28291. if (typeof opts.method === 'string') {
  28292. opts.method = opts.method.toUpperCase()
  28293. }
  28294. this[kDispatchKey] = buildKey(opts)
  28295. this[kDispatches] = mockDispatches
  28296. this[kDefaultHeaders] = {}
  28297. this[kDefaultTrailers] = {}
  28298. this[kContentLength] = false
  28299. }
  28300. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28301. const responseData = getResponseData(data)
  28302. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28303. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28304. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28305. return { statusCode, data, headers, trailers }
  28306. }
  28307. validateReplyParameters (statusCode, data, responseOptions) {
  28308. if (typeof statusCode === 'undefined') {
  28309. throw new InvalidArgumentError('statusCode must be defined')
  28310. }
  28311. if (typeof data === 'undefined') {
  28312. throw new InvalidArgumentError('data must be defined')
  28313. }
  28314. if (typeof responseOptions !== 'object') {
  28315. throw new InvalidArgumentError('responseOptions must be an object')
  28316. }
  28317. }
  28318. /**
  28319. * Mock an undici request with a defined reply.
  28320. */
  28321. reply (replyData) {
  28322. // Values of reply aren't available right now as they
  28323. // can only be available when the reply callback is invoked.
  28324. if (typeof replyData === 'function') {
  28325. // We'll first wrap the provided callback in another function,
  28326. // this function will properly resolve the data from the callback
  28327. // when invoked.
  28328. const wrappedDefaultsCallback = (opts) => {
  28329. // Our reply options callback contains the parameter for statusCode, data and options.
  28330. const resolvedData = replyData(opts)
  28331. // Check if it is in the right format
  28332. if (typeof resolvedData !== 'object') {
  28333. throw new InvalidArgumentError('reply options callback must return an object')
  28334. }
  28335. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28336. this.validateReplyParameters(statusCode, data, responseOptions)
  28337. // Since the values can be obtained immediately we return them
  28338. // from this higher order function that will be resolved later.
  28339. return {
  28340. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28341. }
  28342. }
  28343. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28344. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28345. return new MockScope(newMockDispatch)
  28346. }
  28347. // We can have either one or three parameters, if we get here,
  28348. // we should have 1-3 parameters. So we spread the arguments of
  28349. // this function to obtain the parameters, since replyData will always
  28350. // just be the statusCode.
  28351. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28352. this.validateReplyParameters(statusCode, data, responseOptions)
  28353. // Send in-already provided data like usual
  28354. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28355. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28356. return new MockScope(newMockDispatch)
  28357. }
  28358. /**
  28359. * Mock an undici request with a defined error.
  28360. */
  28361. replyWithError (error) {
  28362. if (typeof error === 'undefined') {
  28363. throw new InvalidArgumentError('error must be defined')
  28364. }
  28365. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28366. return new MockScope(newMockDispatch)
  28367. }
  28368. /**
  28369. * Set default reply headers on the interceptor for subsequent replies
  28370. */
  28371. defaultReplyHeaders (headers) {
  28372. if (typeof headers === 'undefined') {
  28373. throw new InvalidArgumentError('headers must be defined')
  28374. }
  28375. this[kDefaultHeaders] = headers
  28376. return this
  28377. }
  28378. /**
  28379. * Set default reply trailers on the interceptor for subsequent replies
  28380. */
  28381. defaultReplyTrailers (trailers) {
  28382. if (typeof trailers === 'undefined') {
  28383. throw new InvalidArgumentError('trailers must be defined')
  28384. }
  28385. this[kDefaultTrailers] = trailers
  28386. return this
  28387. }
  28388. /**
  28389. * Set reply content length header for replies on the interceptor
  28390. */
  28391. replyContentLength () {
  28392. this[kContentLength] = true
  28393. return this
  28394. }
  28395. }
  28396. module.exports.MockInterceptor = MockInterceptor
  28397. module.exports.MockScope = MockScope
  28398. /***/ }),
  28399. /***/ 6193:
  28400. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28401. "use strict";
  28402. const { promisify } = __nccwpck_require__(3837)
  28403. const Pool = __nccwpck_require__(4634)
  28404. const { buildMockDispatch } = __nccwpck_require__(9323)
  28405. const {
  28406. kDispatches,
  28407. kMockAgent,
  28408. kClose,
  28409. kOriginalClose,
  28410. kOrigin,
  28411. kOriginalDispatch,
  28412. kConnected
  28413. } = __nccwpck_require__(4347)
  28414. const { MockInterceptor } = __nccwpck_require__(410)
  28415. const Symbols = __nccwpck_require__(2785)
  28416. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28417. /**
  28418. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28419. */
  28420. class MockPool extends Pool {
  28421. constructor (origin, opts) {
  28422. super(origin, opts)
  28423. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28424. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28425. }
  28426. this[kMockAgent] = opts.agent
  28427. this[kOrigin] = origin
  28428. this[kDispatches] = []
  28429. this[kConnected] = 1
  28430. this[kOriginalDispatch] = this.dispatch
  28431. this[kOriginalClose] = this.close.bind(this)
  28432. this.dispatch = buildMockDispatch.call(this)
  28433. this.close = this[kClose]
  28434. }
  28435. get [Symbols.kConnected] () {
  28436. return this[kConnected]
  28437. }
  28438. /**
  28439. * Sets up the base interceptor for mocking replies from undici.
  28440. */
  28441. intercept (opts) {
  28442. return new MockInterceptor(opts, this[kDispatches])
  28443. }
  28444. async [kClose] () {
  28445. await promisify(this[kOriginalClose])()
  28446. this[kConnected] = 0
  28447. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28448. }
  28449. }
  28450. module.exports = MockPool
  28451. /***/ }),
  28452. /***/ 4347:
  28453. /***/ ((module) => {
  28454. "use strict";
  28455. module.exports = {
  28456. kAgent: Symbol('agent'),
  28457. kOptions: Symbol('options'),
  28458. kFactory: Symbol('factory'),
  28459. kDispatches: Symbol('dispatches'),
  28460. kDispatchKey: Symbol('dispatch key'),
  28461. kDefaultHeaders: Symbol('default headers'),
  28462. kDefaultTrailers: Symbol('default trailers'),
  28463. kContentLength: Symbol('content length'),
  28464. kMockAgent: Symbol('mock agent'),
  28465. kMockAgentSet: Symbol('mock agent set'),
  28466. kMockAgentGet: Symbol('mock agent get'),
  28467. kMockDispatch: Symbol('mock dispatch'),
  28468. kClose: Symbol('close'),
  28469. kOriginalClose: Symbol('original agent close'),
  28470. kOrigin: Symbol('origin'),
  28471. kIsMockActive: Symbol('is mock active'),
  28472. kNetConnect: Symbol('net connect'),
  28473. kGetNetConnect: Symbol('get net connect'),
  28474. kConnected: Symbol('connected')
  28475. }
  28476. /***/ }),
  28477. /***/ 9323:
  28478. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28479. "use strict";
  28480. const { MockNotMatchedError } = __nccwpck_require__(888)
  28481. const {
  28482. kDispatches,
  28483. kMockAgent,
  28484. kOriginalDispatch,
  28485. kOrigin,
  28486. kGetNetConnect
  28487. } = __nccwpck_require__(4347)
  28488. const { buildURL, nop } = __nccwpck_require__(3983)
  28489. const { STATUS_CODES } = __nccwpck_require__(3685)
  28490. const {
  28491. types: {
  28492. isPromise
  28493. }
  28494. } = __nccwpck_require__(3837)
  28495. function matchValue (match, value) {
  28496. if (typeof match === 'string') {
  28497. return match === value
  28498. }
  28499. if (match instanceof RegExp) {
  28500. return match.test(value)
  28501. }
  28502. if (typeof match === 'function') {
  28503. return match(value) === true
  28504. }
  28505. return false
  28506. }
  28507. function lowerCaseEntries (headers) {
  28508. return Object.fromEntries(
  28509. Object.entries(headers).map(([headerName, headerValue]) => {
  28510. return [headerName.toLocaleLowerCase(), headerValue]
  28511. })
  28512. )
  28513. }
  28514. /**
  28515. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28516. * @param {string} key
  28517. */
  28518. function getHeaderByName (headers, key) {
  28519. if (Array.isArray(headers)) {
  28520. for (let i = 0; i < headers.length; i += 2) {
  28521. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28522. return headers[i + 1]
  28523. }
  28524. }
  28525. return undefined
  28526. } else if (typeof headers.get === 'function') {
  28527. return headers.get(key)
  28528. } else {
  28529. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28530. }
  28531. }
  28532. /** @param {string[]} headers */
  28533. function buildHeadersFromArray (headers) { // fetch HeadersList
  28534. const clone = headers.slice()
  28535. const entries = []
  28536. for (let index = 0; index < clone.length; index += 2) {
  28537. entries.push([clone[index], clone[index + 1]])
  28538. }
  28539. return Object.fromEntries(entries)
  28540. }
  28541. function matchHeaders (mockDispatch, headers) {
  28542. if (typeof mockDispatch.headers === 'function') {
  28543. if (Array.isArray(headers)) { // fetch HeadersList
  28544. headers = buildHeadersFromArray(headers)
  28545. }
  28546. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28547. }
  28548. if (typeof mockDispatch.headers === 'undefined') {
  28549. return true
  28550. }
  28551. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28552. return false
  28553. }
  28554. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28555. const headerValue = getHeaderByName(headers, matchHeaderName)
  28556. if (!matchValue(matchHeaderValue, headerValue)) {
  28557. return false
  28558. }
  28559. }
  28560. return true
  28561. }
  28562. function safeUrl (path) {
  28563. if (typeof path !== 'string') {
  28564. return path
  28565. }
  28566. const pathSegments = path.split('?')
  28567. if (pathSegments.length !== 2) {
  28568. return path
  28569. }
  28570. const qp = new URLSearchParams(pathSegments.pop())
  28571. qp.sort()
  28572. return [...pathSegments, qp.toString()].join('?')
  28573. }
  28574. function matchKey (mockDispatch, { path, method, body, headers }) {
  28575. const pathMatch = matchValue(mockDispatch.path, path)
  28576. const methodMatch = matchValue(mockDispatch.method, method)
  28577. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28578. const headersMatch = matchHeaders(mockDispatch, headers)
  28579. return pathMatch && methodMatch && bodyMatch && headersMatch
  28580. }
  28581. function getResponseData (data) {
  28582. if (Buffer.isBuffer(data)) {
  28583. return data
  28584. } else if (typeof data === 'object') {
  28585. return JSON.stringify(data)
  28586. } else {
  28587. return data.toString()
  28588. }
  28589. }
  28590. function getMockDispatch (mockDispatches, key) {
  28591. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28592. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28593. // Match path
  28594. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28595. if (matchedMockDispatches.length === 0) {
  28596. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28597. }
  28598. // Match method
  28599. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28600. if (matchedMockDispatches.length === 0) {
  28601. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28602. }
  28603. // Match body
  28604. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28605. if (matchedMockDispatches.length === 0) {
  28606. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28607. }
  28608. // Match headers
  28609. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28610. if (matchedMockDispatches.length === 0) {
  28611. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28612. }
  28613. return matchedMockDispatches[0]
  28614. }
  28615. function addMockDispatch (mockDispatches, key, data) {
  28616. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28617. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28618. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28619. mockDispatches.push(newMockDispatch)
  28620. return newMockDispatch
  28621. }
  28622. function deleteMockDispatch (mockDispatches, key) {
  28623. const index = mockDispatches.findIndex(dispatch => {
  28624. if (!dispatch.consumed) {
  28625. return false
  28626. }
  28627. return matchKey(dispatch, key)
  28628. })
  28629. if (index !== -1) {
  28630. mockDispatches.splice(index, 1)
  28631. }
  28632. }
  28633. function buildKey (opts) {
  28634. const { path, method, body, headers, query } = opts
  28635. return {
  28636. path,
  28637. method,
  28638. body,
  28639. headers,
  28640. query
  28641. }
  28642. }
  28643. function generateKeyValues (data) {
  28644. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28645. ...keyValuePairs,
  28646. Buffer.from(`${key}`),
  28647. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28648. ], [])
  28649. }
  28650. /**
  28651. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28652. * @param {number} statusCode
  28653. */
  28654. function getStatusText (statusCode) {
  28655. return STATUS_CODES[statusCode] || 'unknown'
  28656. }
  28657. async function getResponse (body) {
  28658. const buffers = []
  28659. for await (const data of body) {
  28660. buffers.push(data)
  28661. }
  28662. return Buffer.concat(buffers).toString('utf8')
  28663. }
  28664. /**
  28665. * Mock dispatch function used to simulate undici dispatches
  28666. */
  28667. function mockDispatch (opts, handler) {
  28668. // Get mock dispatch from built key
  28669. const key = buildKey(opts)
  28670. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28671. mockDispatch.timesInvoked++
  28672. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28673. if (mockDispatch.data.callback) {
  28674. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28675. }
  28676. // Parse mockDispatch data
  28677. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28678. const { timesInvoked, times } = mockDispatch
  28679. // If it's used up and not persistent, mark as consumed
  28680. mockDispatch.consumed = !persist && timesInvoked >= times
  28681. mockDispatch.pending = timesInvoked < times
  28682. // If specified, trigger dispatch error
  28683. if (error !== null) {
  28684. deleteMockDispatch(this[kDispatches], key)
  28685. handler.onError(error)
  28686. return true
  28687. }
  28688. // Handle the request with a delay if necessary
  28689. if (typeof delay === 'number' && delay > 0) {
  28690. setTimeout(() => {
  28691. handleReply(this[kDispatches])
  28692. }, delay)
  28693. } else {
  28694. handleReply(this[kDispatches])
  28695. }
  28696. function handleReply (mockDispatches, _data = data) {
  28697. // fetch's HeadersList is a 1D string array
  28698. const optsHeaders = Array.isArray(opts.headers)
  28699. ? buildHeadersFromArray(opts.headers)
  28700. : opts.headers
  28701. const body = typeof _data === 'function'
  28702. ? _data({ ...opts, headers: optsHeaders })
  28703. : _data
  28704. // util.types.isPromise is likely needed for jest.
  28705. if (isPromise(body)) {
  28706. // If handleReply is asynchronous, throwing an error
  28707. // in the callback will reject the promise, rather than
  28708. // synchronously throw the error, which breaks some tests.
  28709. // Rather, we wait for the callback to resolve if it is a
  28710. // promise, and then re-run handleReply with the new body.
  28711. body.then((newData) => handleReply(mockDispatches, newData))
  28712. return
  28713. }
  28714. const responseData = getResponseData(body)
  28715. const responseHeaders = generateKeyValues(headers)
  28716. const responseTrailers = generateKeyValues(trailers)
  28717. handler.abort = nop
  28718. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28719. handler.onData(Buffer.from(responseData))
  28720. handler.onComplete(responseTrailers)
  28721. deleteMockDispatch(mockDispatches, key)
  28722. }
  28723. function resume () {}
  28724. return true
  28725. }
  28726. function buildMockDispatch () {
  28727. const agent = this[kMockAgent]
  28728. const origin = this[kOrigin]
  28729. const originalDispatch = this[kOriginalDispatch]
  28730. return function dispatch (opts, handler) {
  28731. if (agent.isMockActive) {
  28732. try {
  28733. mockDispatch.call(this, opts, handler)
  28734. } catch (error) {
  28735. if (error instanceof MockNotMatchedError) {
  28736. const netConnect = agent[kGetNetConnect]()
  28737. if (netConnect === false) {
  28738. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28739. }
  28740. if (checkNetConnect(netConnect, origin)) {
  28741. originalDispatch.call(this, opts, handler)
  28742. } else {
  28743. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28744. }
  28745. } else {
  28746. throw error
  28747. }
  28748. }
  28749. } else {
  28750. originalDispatch.call(this, opts, handler)
  28751. }
  28752. }
  28753. }
  28754. function checkNetConnect (netConnect, origin) {
  28755. const url = new URL(origin)
  28756. if (netConnect === true) {
  28757. return true
  28758. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28759. return true
  28760. }
  28761. return false
  28762. }
  28763. function buildMockOptions (opts) {
  28764. if (opts) {
  28765. const { agent, ...mockOptions } = opts
  28766. return mockOptions
  28767. }
  28768. }
  28769. module.exports = {
  28770. getResponseData,
  28771. getMockDispatch,
  28772. addMockDispatch,
  28773. deleteMockDispatch,
  28774. buildKey,
  28775. generateKeyValues,
  28776. matchValue,
  28777. getResponse,
  28778. getStatusText,
  28779. mockDispatch,
  28780. buildMockDispatch,
  28781. checkNetConnect,
  28782. buildMockOptions,
  28783. getHeaderByName
  28784. }
  28785. /***/ }),
  28786. /***/ 6823:
  28787. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28788. "use strict";
  28789. const { Transform } = __nccwpck_require__(2781)
  28790. const { Console } = __nccwpck_require__(6206)
  28791. /**
  28792. * Gets the output of `console.table(…)` as a string.
  28793. */
  28794. module.exports = class PendingInterceptorsFormatter {
  28795. constructor ({ disableColors } = {}) {
  28796. this.transform = new Transform({
  28797. transform (chunk, _enc, cb) {
  28798. cb(null, chunk)
  28799. }
  28800. })
  28801. this.logger = new Console({
  28802. stdout: this.transform,
  28803. inspectOptions: {
  28804. colors: !disableColors && !process.env.CI
  28805. }
  28806. })
  28807. }
  28808. format (pendingInterceptors) {
  28809. const withPrettyHeaders = pendingInterceptors.map(
  28810. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28811. Method: method,
  28812. Origin: origin,
  28813. Path: path,
  28814. 'Status code': statusCode,
  28815. Persistent: persist ? '✅' : '❌',
  28816. Invocations: timesInvoked,
  28817. Remaining: persist ? Infinity : times - timesInvoked
  28818. }))
  28819. this.logger.table(withPrettyHeaders)
  28820. return this.transform.read().toString()
  28821. }
  28822. }
  28823. /***/ }),
  28824. /***/ 8891:
  28825. /***/ ((module) => {
  28826. "use strict";
  28827. const singulars = {
  28828. pronoun: 'it',
  28829. is: 'is',
  28830. was: 'was',
  28831. this: 'this'
  28832. }
  28833. const plurals = {
  28834. pronoun: 'they',
  28835. is: 'are',
  28836. was: 'were',
  28837. this: 'these'
  28838. }
  28839. module.exports = class Pluralizer {
  28840. constructor (singular, plural) {
  28841. this.singular = singular
  28842. this.plural = plural
  28843. }
  28844. pluralize (count) {
  28845. const one = count === 1
  28846. const keys = one ? singulars : plurals
  28847. const noun = one ? this.singular : this.plural
  28848. return { ...keys, count, noun }
  28849. }
  28850. }
  28851. /***/ }),
  28852. /***/ 8266:
  28853. /***/ ((module) => {
  28854. "use strict";
  28855. /* eslint-disable */
  28856. // Extracted from node/lib/internal/fixed_queue.js
  28857. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28858. const kSize = 2048;
  28859. const kMask = kSize - 1;
  28860. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28861. // circular buffers. It looks something like this:
  28862. //
  28863. // head tail
  28864. // | |
  28865. // v v
  28866. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28867. // | [null] | \----- | next | \------- | next |
  28868. // +-----------+ +-----------+ +-----------+
  28869. // | item | <-- bottom | item | <-- bottom | [empty] |
  28870. // | item | | item | | [empty] |
  28871. // | item | | item | | [empty] |
  28872. // | item | | item | | [empty] |
  28873. // | item | | item | bottom --> | item |
  28874. // | item | | item | | item |
  28875. // | ... | | ... | | ... |
  28876. // | item | | item | | item |
  28877. // | item | | item | | item |
  28878. // | [empty] | <-- top | item | | item |
  28879. // | [empty] | | item | | item |
  28880. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28881. // +-----------+ +-----------+ +-----------+
  28882. //
  28883. // Or, if there is only one circular buffer, it looks something
  28884. // like either of these:
  28885. //
  28886. // head tail head tail
  28887. // | | | |
  28888. // v v v v
  28889. // +-----------+ +-----------+
  28890. // | [null] | | [null] |
  28891. // +-----------+ +-----------+
  28892. // | [empty] | | item |
  28893. // | [empty] | | item |
  28894. // | item | <-- bottom top --> | [empty] |
  28895. // | item | | [empty] |
  28896. // | [empty] | <-- top bottom --> | item |
  28897. // | [empty] | | item |
  28898. // +-----------+ +-----------+
  28899. //
  28900. // Adding a value means moving `top` forward by one, removing means
  28901. // moving `bottom` forward by one. After reaching the end, the queue
  28902. // wraps around.
  28903. //
  28904. // When `top === bottom` the current queue is empty and when
  28905. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28906. // but allows much quicker checks.
  28907. class FixedCircularBuffer {
  28908. constructor() {
  28909. this.bottom = 0;
  28910. this.top = 0;
  28911. this.list = new Array(kSize);
  28912. this.next = null;
  28913. }
  28914. isEmpty() {
  28915. return this.top === this.bottom;
  28916. }
  28917. isFull() {
  28918. return ((this.top + 1) & kMask) === this.bottom;
  28919. }
  28920. push(data) {
  28921. this.list[this.top] = data;
  28922. this.top = (this.top + 1) & kMask;
  28923. }
  28924. shift() {
  28925. const nextItem = this.list[this.bottom];
  28926. if (nextItem === undefined)
  28927. return null;
  28928. this.list[this.bottom] = undefined;
  28929. this.bottom = (this.bottom + 1) & kMask;
  28930. return nextItem;
  28931. }
  28932. }
  28933. module.exports = class FixedQueue {
  28934. constructor() {
  28935. this.head = this.tail = new FixedCircularBuffer();
  28936. }
  28937. isEmpty() {
  28938. return this.head.isEmpty();
  28939. }
  28940. push(data) {
  28941. if (this.head.isFull()) {
  28942. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28943. // and sets it as the new main queue.
  28944. this.head = this.head.next = new FixedCircularBuffer();
  28945. }
  28946. this.head.push(data);
  28947. }
  28948. shift() {
  28949. const tail = this.tail;
  28950. const next = tail.shift();
  28951. if (tail.isEmpty() && tail.next !== null) {
  28952. // If there is another queue, it forms the new tail.
  28953. this.tail = tail.next;
  28954. }
  28955. return next;
  28956. }
  28957. };
  28958. /***/ }),
  28959. /***/ 3198:
  28960. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28961. "use strict";
  28962. const DispatcherBase = __nccwpck_require__(4839)
  28963. const FixedQueue = __nccwpck_require__(8266)
  28964. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28965. const PoolStats = __nccwpck_require__(9689)
  28966. const kClients = Symbol('clients')
  28967. const kNeedDrain = Symbol('needDrain')
  28968. const kQueue = Symbol('queue')
  28969. const kClosedResolve = Symbol('closed resolve')
  28970. const kOnDrain = Symbol('onDrain')
  28971. const kOnConnect = Symbol('onConnect')
  28972. const kOnDisconnect = Symbol('onDisconnect')
  28973. const kOnConnectionError = Symbol('onConnectionError')
  28974. const kGetDispatcher = Symbol('get dispatcher')
  28975. const kAddClient = Symbol('add client')
  28976. const kRemoveClient = Symbol('remove client')
  28977. const kStats = Symbol('stats')
  28978. class PoolBase extends DispatcherBase {
  28979. constructor () {
  28980. super()
  28981. this[kQueue] = new FixedQueue()
  28982. this[kClients] = []
  28983. this[kQueued] = 0
  28984. const pool = this
  28985. this[kOnDrain] = function onDrain (origin, targets) {
  28986. const queue = pool[kQueue]
  28987. let needDrain = false
  28988. while (!needDrain) {
  28989. const item = queue.shift()
  28990. if (!item) {
  28991. break
  28992. }
  28993. pool[kQueued]--
  28994. needDrain = !this.dispatch(item.opts, item.handler)
  28995. }
  28996. this[kNeedDrain] = needDrain
  28997. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  28998. pool[kNeedDrain] = false
  28999. pool.emit('drain', origin, [pool, ...targets])
  29000. }
  29001. if (pool[kClosedResolve] && queue.isEmpty()) {
  29002. Promise
  29003. .all(pool[kClients].map(c => c.close()))
  29004. .then(pool[kClosedResolve])
  29005. }
  29006. }
  29007. this[kOnConnect] = (origin, targets) => {
  29008. pool.emit('connect', origin, [pool, ...targets])
  29009. }
  29010. this[kOnDisconnect] = (origin, targets, err) => {
  29011. pool.emit('disconnect', origin, [pool, ...targets], err)
  29012. }
  29013. this[kOnConnectionError] = (origin, targets, err) => {
  29014. pool.emit('connectionError', origin, [pool, ...targets], err)
  29015. }
  29016. this[kStats] = new PoolStats(this)
  29017. }
  29018. get [kBusy] () {
  29019. return this[kNeedDrain]
  29020. }
  29021. get [kConnected] () {
  29022. return this[kClients].filter(client => client[kConnected]).length
  29023. }
  29024. get [kFree] () {
  29025. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  29026. }
  29027. get [kPending] () {
  29028. let ret = this[kQueued]
  29029. for (const { [kPending]: pending } of this[kClients]) {
  29030. ret += pending
  29031. }
  29032. return ret
  29033. }
  29034. get [kRunning] () {
  29035. let ret = 0
  29036. for (const { [kRunning]: running } of this[kClients]) {
  29037. ret += running
  29038. }
  29039. return ret
  29040. }
  29041. get [kSize] () {
  29042. let ret = this[kQueued]
  29043. for (const { [kSize]: size } of this[kClients]) {
  29044. ret += size
  29045. }
  29046. return ret
  29047. }
  29048. get stats () {
  29049. return this[kStats]
  29050. }
  29051. async [kClose] () {
  29052. if (this[kQueue].isEmpty()) {
  29053. return Promise.all(this[kClients].map(c => c.close()))
  29054. } else {
  29055. return new Promise((resolve) => {
  29056. this[kClosedResolve] = resolve
  29057. })
  29058. }
  29059. }
  29060. async [kDestroy] (err) {
  29061. while (true) {
  29062. const item = this[kQueue].shift()
  29063. if (!item) {
  29064. break
  29065. }
  29066. item.handler.onError(err)
  29067. }
  29068. return Promise.all(this[kClients].map(c => c.destroy(err)))
  29069. }
  29070. [kDispatch] (opts, handler) {
  29071. const dispatcher = this[kGetDispatcher]()
  29072. if (!dispatcher) {
  29073. this[kNeedDrain] = true
  29074. this[kQueue].push({ opts, handler })
  29075. this[kQueued]++
  29076. } else if (!dispatcher.dispatch(opts, handler)) {
  29077. dispatcher[kNeedDrain] = true
  29078. this[kNeedDrain] = !this[kGetDispatcher]()
  29079. }
  29080. return !this[kNeedDrain]
  29081. }
  29082. [kAddClient] (client) {
  29083. client
  29084. .on('drain', this[kOnDrain])
  29085. .on('connect', this[kOnConnect])
  29086. .on('disconnect', this[kOnDisconnect])
  29087. .on('connectionError', this[kOnConnectionError])
  29088. this[kClients].push(client)
  29089. if (this[kNeedDrain]) {
  29090. process.nextTick(() => {
  29091. if (this[kNeedDrain]) {
  29092. this[kOnDrain](client[kUrl], [this, client])
  29093. }
  29094. })
  29095. }
  29096. return this
  29097. }
  29098. [kRemoveClient] (client) {
  29099. client.close(() => {
  29100. const idx = this[kClients].indexOf(client)
  29101. if (idx !== -1) {
  29102. this[kClients].splice(idx, 1)
  29103. }
  29104. })
  29105. this[kNeedDrain] = this[kClients].some(dispatcher => (
  29106. !dispatcher[kNeedDrain] &&
  29107. dispatcher.closed !== true &&
  29108. dispatcher.destroyed !== true
  29109. ))
  29110. }
  29111. }
  29112. module.exports = {
  29113. PoolBase,
  29114. kClients,
  29115. kNeedDrain,
  29116. kAddClient,
  29117. kRemoveClient,
  29118. kGetDispatcher
  29119. }
  29120. /***/ }),
  29121. /***/ 9689:
  29122. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29123. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  29124. const kPool = Symbol('pool')
  29125. class PoolStats {
  29126. constructor (pool) {
  29127. this[kPool] = pool
  29128. }
  29129. get connected () {
  29130. return this[kPool][kConnected]
  29131. }
  29132. get free () {
  29133. return this[kPool][kFree]
  29134. }
  29135. get pending () {
  29136. return this[kPool][kPending]
  29137. }
  29138. get queued () {
  29139. return this[kPool][kQueued]
  29140. }
  29141. get running () {
  29142. return this[kPool][kRunning]
  29143. }
  29144. get size () {
  29145. return this[kPool][kSize]
  29146. }
  29147. }
  29148. module.exports = PoolStats
  29149. /***/ }),
  29150. /***/ 4634:
  29151. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29152. "use strict";
  29153. const {
  29154. PoolBase,
  29155. kClients,
  29156. kNeedDrain,
  29157. kAddClient,
  29158. kGetDispatcher
  29159. } = __nccwpck_require__(3198)
  29160. const Client = __nccwpck_require__(3598)
  29161. const {
  29162. InvalidArgumentError
  29163. } = __nccwpck_require__(8045)
  29164. const util = __nccwpck_require__(3983)
  29165. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  29166. const buildConnector = __nccwpck_require__(2067)
  29167. const kOptions = Symbol('options')
  29168. const kConnections = Symbol('connections')
  29169. const kFactory = Symbol('factory')
  29170. function defaultFactory (origin, opts) {
  29171. return new Client(origin, opts)
  29172. }
  29173. class Pool extends PoolBase {
  29174. constructor (origin, {
  29175. connections,
  29176. factory = defaultFactory,
  29177. connect,
  29178. connectTimeout,
  29179. tls,
  29180. maxCachedSessions,
  29181. socketPath,
  29182. autoSelectFamily,
  29183. autoSelectFamilyAttemptTimeout,
  29184. allowH2,
  29185. ...options
  29186. } = {}) {
  29187. super()
  29188. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  29189. throw new InvalidArgumentError('invalid connections')
  29190. }
  29191. if (typeof factory !== 'function') {
  29192. throw new InvalidArgumentError('factory must be a function.')
  29193. }
  29194. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  29195. throw new InvalidArgumentError('connect must be a function or an object')
  29196. }
  29197. if (typeof connect !== 'function') {
  29198. connect = buildConnector({
  29199. ...tls,
  29200. maxCachedSessions,
  29201. allowH2,
  29202. socketPath,
  29203. timeout: connectTimeout,
  29204. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  29205. ...connect
  29206. })
  29207. }
  29208. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  29209. ? options.interceptors.Pool
  29210. : []
  29211. this[kConnections] = connections || null
  29212. this[kUrl] = util.parseOrigin(origin)
  29213. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  29214. this[kOptions].interceptors = options.interceptors
  29215. ? { ...options.interceptors }
  29216. : undefined
  29217. this[kFactory] = factory
  29218. this.on('connectionError', (origin, targets, error) => {
  29219. // If a connection error occurs, we remove the client from the pool,
  29220. // and emit a connectionError event. They will not be re-used.
  29221. // Fixes https://github.com/nodejs/undici/issues/3895
  29222. for (const target of targets) {
  29223. // Do not use kRemoveClient here, as it will close the client,
  29224. // but the client cannot be closed in this state.
  29225. const idx = this[kClients].indexOf(target)
  29226. if (idx !== -1) {
  29227. this[kClients].splice(idx, 1)
  29228. }
  29229. }
  29230. })
  29231. }
  29232. [kGetDispatcher] () {
  29233. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  29234. if (dispatcher) {
  29235. return dispatcher
  29236. }
  29237. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  29238. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  29239. this[kAddClient](dispatcher)
  29240. }
  29241. return dispatcher
  29242. }
  29243. }
  29244. module.exports = Pool
  29245. /***/ }),
  29246. /***/ 7858:
  29247. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29248. "use strict";
  29249. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  29250. const { URL } = __nccwpck_require__(7310)
  29251. const Agent = __nccwpck_require__(7890)
  29252. const Pool = __nccwpck_require__(4634)
  29253. const DispatcherBase = __nccwpck_require__(4839)
  29254. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  29255. const buildConnector = __nccwpck_require__(2067)
  29256. const kAgent = Symbol('proxy agent')
  29257. const kClient = Symbol('proxy client')
  29258. const kProxyHeaders = Symbol('proxy headers')
  29259. const kRequestTls = Symbol('request tls settings')
  29260. const kProxyTls = Symbol('proxy tls settings')
  29261. const kConnectEndpoint = Symbol('connect endpoint function')
  29262. function defaultProtocolPort (protocol) {
  29263. return protocol === 'https:' ? 443 : 80
  29264. }
  29265. function buildProxyOptions (opts) {
  29266. if (typeof opts === 'string') {
  29267. opts = { uri: opts }
  29268. }
  29269. if (!opts || !opts.uri) {
  29270. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29271. }
  29272. return {
  29273. uri: opts.uri,
  29274. protocol: opts.protocol || 'https'
  29275. }
  29276. }
  29277. function defaultFactory (origin, opts) {
  29278. return new Pool(origin, opts)
  29279. }
  29280. class ProxyAgent extends DispatcherBase {
  29281. constructor (opts) {
  29282. super(opts)
  29283. this[kProxy] = buildProxyOptions(opts)
  29284. this[kAgent] = new Agent(opts)
  29285. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29286. ? opts.interceptors.ProxyAgent
  29287. : []
  29288. if (typeof opts === 'string') {
  29289. opts = { uri: opts }
  29290. }
  29291. if (!opts || !opts.uri) {
  29292. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29293. }
  29294. const { clientFactory = defaultFactory } = opts
  29295. if (typeof clientFactory !== 'function') {
  29296. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29297. }
  29298. this[kRequestTls] = opts.requestTls
  29299. this[kProxyTls] = opts.proxyTls
  29300. this[kProxyHeaders] = opts.headers || {}
  29301. const resolvedUrl = new URL(opts.uri)
  29302. const { origin, port, host, username, password } = resolvedUrl
  29303. if (opts.auth && opts.token) {
  29304. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29305. } else if (opts.auth) {
  29306. /* @deprecated in favour of opts.token */
  29307. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29308. } else if (opts.token) {
  29309. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29310. } else if (username && password) {
  29311. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29312. }
  29313. const connect = buildConnector({ ...opts.proxyTls })
  29314. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29315. this[kClient] = clientFactory(resolvedUrl, { connect })
  29316. this[kAgent] = new Agent({
  29317. ...opts,
  29318. connect: async (opts, callback) => {
  29319. let requestedHost = opts.host
  29320. if (!opts.port) {
  29321. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29322. }
  29323. try {
  29324. const { socket, statusCode } = await this[kClient].connect({
  29325. origin,
  29326. port,
  29327. path: requestedHost,
  29328. signal: opts.signal,
  29329. headers: {
  29330. ...this[kProxyHeaders],
  29331. host
  29332. }
  29333. })
  29334. if (statusCode !== 200) {
  29335. socket.on('error', () => {}).destroy()
  29336. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29337. }
  29338. if (opts.protocol !== 'https:') {
  29339. callback(null, socket)
  29340. return
  29341. }
  29342. let servername
  29343. if (this[kRequestTls]) {
  29344. servername = this[kRequestTls].servername
  29345. } else {
  29346. servername = opts.servername
  29347. }
  29348. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29349. } catch (err) {
  29350. callback(err)
  29351. }
  29352. }
  29353. })
  29354. }
  29355. dispatch (opts, handler) {
  29356. const { host } = new URL(opts.origin)
  29357. const headers = buildHeaders(opts.headers)
  29358. throwIfProxyAuthIsSent(headers)
  29359. return this[kAgent].dispatch(
  29360. {
  29361. ...opts,
  29362. headers: {
  29363. ...headers,
  29364. host
  29365. }
  29366. },
  29367. handler
  29368. )
  29369. }
  29370. async [kClose] () {
  29371. await this[kAgent].close()
  29372. await this[kClient].close()
  29373. }
  29374. async [kDestroy] () {
  29375. await this[kAgent].destroy()
  29376. await this[kClient].destroy()
  29377. }
  29378. }
  29379. /**
  29380. * @param {string[] | Record<string, string>} headers
  29381. * @returns {Record<string, string>}
  29382. */
  29383. function buildHeaders (headers) {
  29384. // When using undici.fetch, the headers list is stored
  29385. // as an array.
  29386. if (Array.isArray(headers)) {
  29387. /** @type {Record<string, string>} */
  29388. const headersPair = {}
  29389. for (let i = 0; i < headers.length; i += 2) {
  29390. headersPair[headers[i]] = headers[i + 1]
  29391. }
  29392. return headersPair
  29393. }
  29394. return headers
  29395. }
  29396. /**
  29397. * @param {Record<string, string>} headers
  29398. *
  29399. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29400. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29401. * this check was created.
  29402. * It should be removed in the next major version for performance reasons
  29403. */
  29404. function throwIfProxyAuthIsSent (headers) {
  29405. const existProxyAuth = headers && Object.keys(headers)
  29406. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29407. if (existProxyAuth) {
  29408. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29409. }
  29410. }
  29411. module.exports = ProxyAgent
  29412. /***/ }),
  29413. /***/ 9459:
  29414. /***/ ((module) => {
  29415. "use strict";
  29416. let fastNow = Date.now()
  29417. let fastNowTimeout
  29418. const fastTimers = []
  29419. function onTimeout () {
  29420. fastNow = Date.now()
  29421. let len = fastTimers.length
  29422. let idx = 0
  29423. while (idx < len) {
  29424. const timer = fastTimers[idx]
  29425. if (timer.state === 0) {
  29426. timer.state = fastNow + timer.delay
  29427. } else if (timer.state > 0 && fastNow >= timer.state) {
  29428. timer.state = -1
  29429. timer.callback(timer.opaque)
  29430. }
  29431. if (timer.state === -1) {
  29432. timer.state = -2
  29433. if (idx !== len - 1) {
  29434. fastTimers[idx] = fastTimers.pop()
  29435. } else {
  29436. fastTimers.pop()
  29437. }
  29438. len -= 1
  29439. } else {
  29440. idx += 1
  29441. }
  29442. }
  29443. if (fastTimers.length > 0) {
  29444. refreshTimeout()
  29445. }
  29446. }
  29447. function refreshTimeout () {
  29448. if (fastNowTimeout && fastNowTimeout.refresh) {
  29449. fastNowTimeout.refresh()
  29450. } else {
  29451. clearTimeout(fastNowTimeout)
  29452. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29453. if (fastNowTimeout.unref) {
  29454. fastNowTimeout.unref()
  29455. }
  29456. }
  29457. }
  29458. class Timeout {
  29459. constructor (callback, delay, opaque) {
  29460. this.callback = callback
  29461. this.delay = delay
  29462. this.opaque = opaque
  29463. // -2 not in timer list
  29464. // -1 in timer list but inactive
  29465. // 0 in timer list waiting for time
  29466. // > 0 in timer list waiting for time to expire
  29467. this.state = -2
  29468. this.refresh()
  29469. }
  29470. refresh () {
  29471. if (this.state === -2) {
  29472. fastTimers.push(this)
  29473. if (!fastNowTimeout || fastTimers.length === 1) {
  29474. refreshTimeout()
  29475. }
  29476. }
  29477. this.state = 0
  29478. }
  29479. clear () {
  29480. this.state = -1
  29481. }
  29482. }
  29483. module.exports = {
  29484. setTimeout (callback, delay, opaque) {
  29485. return delay < 1e3
  29486. ? setTimeout(callback, delay, opaque)
  29487. : new Timeout(callback, delay, opaque)
  29488. },
  29489. clearTimeout (timeout) {
  29490. if (timeout instanceof Timeout) {
  29491. timeout.clear()
  29492. } else {
  29493. clearTimeout(timeout)
  29494. }
  29495. }
  29496. }
  29497. /***/ }),
  29498. /***/ 5354:
  29499. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29500. "use strict";
  29501. const diagnosticsChannel = __nccwpck_require__(7643)
  29502. const { uid, states } = __nccwpck_require__(9188)
  29503. const {
  29504. kReadyState,
  29505. kSentClose,
  29506. kByteParser,
  29507. kReceivedClose
  29508. } = __nccwpck_require__(7578)
  29509. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29510. const { CloseEvent } = __nccwpck_require__(2611)
  29511. const { makeRequest } = __nccwpck_require__(8359)
  29512. const { fetching } = __nccwpck_require__(4881)
  29513. const { Headers } = __nccwpck_require__(554)
  29514. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29515. const { kHeadersList } = __nccwpck_require__(2785)
  29516. const channels = {}
  29517. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29518. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29519. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29520. /** @type {import('crypto')} */
  29521. let crypto
  29522. try {
  29523. crypto = __nccwpck_require__(6113)
  29524. } catch {
  29525. }
  29526. /**
  29527. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29528. * @param {URL} url
  29529. * @param {string|string[]} protocols
  29530. * @param {import('./websocket').WebSocket} ws
  29531. * @param {(response: any) => void} onEstablish
  29532. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29533. */
  29534. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29535. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29536. // scheme is "ws", and to "https" otherwise.
  29537. const requestURL = url
  29538. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29539. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29540. // service-workers mode is "none", referrer is "no-referrer", mode is
  29541. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29542. // and redirect mode is "error".
  29543. const request = makeRequest({
  29544. urlList: [requestURL],
  29545. serviceWorkers: 'none',
  29546. referrer: 'no-referrer',
  29547. mode: 'websocket',
  29548. credentials: 'include',
  29549. cache: 'no-store',
  29550. redirect: 'error'
  29551. })
  29552. // Note: undici extension, allow setting custom headers.
  29553. if (options.headers) {
  29554. const headersList = new Headers(options.headers)[kHeadersList]
  29555. request.headersList = headersList
  29556. }
  29557. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29558. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29559. // Note: both of these are handled by undici currently.
  29560. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29561. // 5. Let keyValue be a nonce consisting of a randomly selected
  29562. // 16-byte value that has been forgiving-base64-encoded and
  29563. // isomorphic encoded.
  29564. const keyValue = crypto.randomBytes(16).toString('base64')
  29565. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29566. // header list.
  29567. request.headersList.append('sec-websocket-key', keyValue)
  29568. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29569. // header list.
  29570. request.headersList.append('sec-websocket-version', '13')
  29571. // 8. For each protocol in protocols, combine
  29572. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29573. // list.
  29574. for (const protocol of protocols) {
  29575. request.headersList.append('sec-websocket-protocol', protocol)
  29576. }
  29577. // 9. Let permessageDeflate be a user-agent defined
  29578. // "permessage-deflate" extension header value.
  29579. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29580. // TODO: enable once permessage-deflate is supported
  29581. const permessageDeflate = '' // 'permessage-deflate; 15'
  29582. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29583. // request’s header list.
  29584. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29585. // 11. Fetch request with useParallelQueue set to true, and
  29586. // processResponse given response being these steps:
  29587. const controller = fetching({
  29588. request,
  29589. useParallelQueue: true,
  29590. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29591. processResponse (response) {
  29592. // 1. If response is a network error or its status is not 101,
  29593. // fail the WebSocket connection.
  29594. if (response.type === 'error' || response.status !== 101) {
  29595. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29596. return
  29597. }
  29598. // 2. If protocols is not the empty list and extracting header
  29599. // list values given `Sec-WebSocket-Protocol` and response’s
  29600. // header list results in null, failure, or the empty byte
  29601. // sequence, then fail the WebSocket connection.
  29602. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29603. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29604. return
  29605. }
  29606. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29607. // of the last set of steps in section 4.1 of The WebSocket
  29608. // Protocol to validate response. This either results in fail
  29609. // the WebSocket connection or the WebSocket connection is
  29610. // established.
  29611. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29612. // header field contains a value that is not an ASCII case-
  29613. // insensitive match for the value "websocket", the client MUST
  29614. // _Fail the WebSocket Connection_.
  29615. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29616. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29617. return
  29618. }
  29619. // 3. If the response lacks a |Connection| header field or the
  29620. // |Connection| header field doesn't contain a token that is an
  29621. // ASCII case-insensitive match for the value "Upgrade", the client
  29622. // MUST _Fail the WebSocket Connection_.
  29623. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29624. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29625. return
  29626. }
  29627. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29628. // the |Sec-WebSocket-Accept| contains a value other than the
  29629. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29630. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29631. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29632. // trailing whitespace, the client MUST _Fail the WebSocket
  29633. // Connection_.
  29634. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29635. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29636. if (secWSAccept !== digest) {
  29637. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29638. return
  29639. }
  29640. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29641. // field and this header field indicates the use of an extension
  29642. // that was not present in the client's handshake (the server has
  29643. // indicated an extension not requested by the client), the client
  29644. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29645. // header field to determine which extensions are requested is
  29646. // discussed in Section 9.1.)
  29647. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29648. if (secExtension !== null && secExtension !== permessageDeflate) {
  29649. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29650. return
  29651. }
  29652. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29653. // and this header field indicates the use of a subprotocol that was
  29654. // not present in the client's handshake (the server has indicated a
  29655. // subprotocol not requested by the client), the client MUST _Fail
  29656. // the WebSocket Connection_.
  29657. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29658. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29659. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29660. return
  29661. }
  29662. response.socket.on('data', onSocketData)
  29663. response.socket.on('close', onSocketClose)
  29664. response.socket.on('error', onSocketError)
  29665. if (channels.open.hasSubscribers) {
  29666. channels.open.publish({
  29667. address: response.socket.address(),
  29668. protocol: secProtocol,
  29669. extensions: secExtension
  29670. })
  29671. }
  29672. onEstablish(response)
  29673. }
  29674. })
  29675. return controller
  29676. }
  29677. /**
  29678. * @param {Buffer} chunk
  29679. */
  29680. function onSocketData (chunk) {
  29681. if (!this.ws[kByteParser].write(chunk)) {
  29682. this.pause()
  29683. }
  29684. }
  29685. /**
  29686. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29687. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29688. */
  29689. function onSocketClose () {
  29690. const { ws } = this
  29691. // If the TCP connection was closed after the
  29692. // WebSocket closing handshake was completed, the WebSocket connection
  29693. // is said to have been closed _cleanly_.
  29694. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29695. let code = 1005
  29696. let reason = ''
  29697. const result = ws[kByteParser].closingInfo
  29698. if (result) {
  29699. code = result.code ?? 1005
  29700. reason = result.reason
  29701. } else if (!ws[kSentClose]) {
  29702. // If _The WebSocket
  29703. // Connection is Closed_ and no Close control frame was received by the
  29704. // endpoint (such as could occur if the underlying transport connection
  29705. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29706. // 1006.
  29707. code = 1006
  29708. }
  29709. // 1. Change the ready state to CLOSED (3).
  29710. ws[kReadyState] = states.CLOSED
  29711. // 2. If the user agent was required to fail the WebSocket
  29712. // connection, or if the WebSocket connection was closed
  29713. // after being flagged as full, fire an event named error
  29714. // at the WebSocket object.
  29715. // TODO
  29716. // 3. Fire an event named close at the WebSocket object,
  29717. // using CloseEvent, with the wasClean attribute
  29718. // initialized to true if the connection closed cleanly
  29719. // and false otherwise, the code attribute initialized to
  29720. // the WebSocket connection close code, and the reason
  29721. // attribute initialized to the result of applying UTF-8
  29722. // decode without BOM to the WebSocket connection close
  29723. // reason.
  29724. fireEvent('close', ws, CloseEvent, {
  29725. wasClean, code, reason
  29726. })
  29727. if (channels.close.hasSubscribers) {
  29728. channels.close.publish({
  29729. websocket: ws,
  29730. code,
  29731. reason
  29732. })
  29733. }
  29734. }
  29735. function onSocketError (error) {
  29736. const { ws } = this
  29737. ws[kReadyState] = states.CLOSING
  29738. if (channels.socketError.hasSubscribers) {
  29739. channels.socketError.publish(error)
  29740. }
  29741. this.destroy()
  29742. }
  29743. module.exports = {
  29744. establishWebSocketConnection
  29745. }
  29746. /***/ }),
  29747. /***/ 9188:
  29748. /***/ ((module) => {
  29749. "use strict";
  29750. // This is a Globally Unique Identifier unique used
  29751. // to validate that the endpoint accepts websocket
  29752. // connections.
  29753. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29754. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29755. /** @type {PropertyDescriptor} */
  29756. const staticPropertyDescriptors = {
  29757. enumerable: true,
  29758. writable: false,
  29759. configurable: false
  29760. }
  29761. const states = {
  29762. CONNECTING: 0,
  29763. OPEN: 1,
  29764. CLOSING: 2,
  29765. CLOSED: 3
  29766. }
  29767. const opcodes = {
  29768. CONTINUATION: 0x0,
  29769. TEXT: 0x1,
  29770. BINARY: 0x2,
  29771. CLOSE: 0x8,
  29772. PING: 0x9,
  29773. PONG: 0xA
  29774. }
  29775. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29776. const parserStates = {
  29777. INFO: 0,
  29778. PAYLOADLENGTH_16: 2,
  29779. PAYLOADLENGTH_64: 3,
  29780. READ_DATA: 4
  29781. }
  29782. const emptyBuffer = Buffer.allocUnsafe(0)
  29783. module.exports = {
  29784. uid,
  29785. staticPropertyDescriptors,
  29786. states,
  29787. opcodes,
  29788. maxUnsigned16Bit,
  29789. parserStates,
  29790. emptyBuffer
  29791. }
  29792. /***/ }),
  29793. /***/ 2611:
  29794. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29795. "use strict";
  29796. const { webidl } = __nccwpck_require__(1744)
  29797. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29798. const { MessagePort } = __nccwpck_require__(1267)
  29799. /**
  29800. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29801. */
  29802. class MessageEvent extends Event {
  29803. #eventInit
  29804. constructor (type, eventInitDict = {}) {
  29805. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29806. type = webidl.converters.DOMString(type)
  29807. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29808. super(type, eventInitDict)
  29809. this.#eventInit = eventInitDict
  29810. }
  29811. get data () {
  29812. webidl.brandCheck(this, MessageEvent)
  29813. return this.#eventInit.data
  29814. }
  29815. get origin () {
  29816. webidl.brandCheck(this, MessageEvent)
  29817. return this.#eventInit.origin
  29818. }
  29819. get lastEventId () {
  29820. webidl.brandCheck(this, MessageEvent)
  29821. return this.#eventInit.lastEventId
  29822. }
  29823. get source () {
  29824. webidl.brandCheck(this, MessageEvent)
  29825. return this.#eventInit.source
  29826. }
  29827. get ports () {
  29828. webidl.brandCheck(this, MessageEvent)
  29829. if (!Object.isFrozen(this.#eventInit.ports)) {
  29830. Object.freeze(this.#eventInit.ports)
  29831. }
  29832. return this.#eventInit.ports
  29833. }
  29834. initMessageEvent (
  29835. type,
  29836. bubbles = false,
  29837. cancelable = false,
  29838. data = null,
  29839. origin = '',
  29840. lastEventId = '',
  29841. source = null,
  29842. ports = []
  29843. ) {
  29844. webidl.brandCheck(this, MessageEvent)
  29845. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29846. return new MessageEvent(type, {
  29847. bubbles, cancelable, data, origin, lastEventId, source, ports
  29848. })
  29849. }
  29850. }
  29851. /**
  29852. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29853. */
  29854. class CloseEvent extends Event {
  29855. #eventInit
  29856. constructor (type, eventInitDict = {}) {
  29857. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29858. type = webidl.converters.DOMString(type)
  29859. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29860. super(type, eventInitDict)
  29861. this.#eventInit = eventInitDict
  29862. }
  29863. get wasClean () {
  29864. webidl.brandCheck(this, CloseEvent)
  29865. return this.#eventInit.wasClean
  29866. }
  29867. get code () {
  29868. webidl.brandCheck(this, CloseEvent)
  29869. return this.#eventInit.code
  29870. }
  29871. get reason () {
  29872. webidl.brandCheck(this, CloseEvent)
  29873. return this.#eventInit.reason
  29874. }
  29875. }
  29876. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29877. class ErrorEvent extends Event {
  29878. #eventInit
  29879. constructor (type, eventInitDict) {
  29880. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29881. super(type, eventInitDict)
  29882. type = webidl.converters.DOMString(type)
  29883. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29884. this.#eventInit = eventInitDict
  29885. }
  29886. get message () {
  29887. webidl.brandCheck(this, ErrorEvent)
  29888. return this.#eventInit.message
  29889. }
  29890. get filename () {
  29891. webidl.brandCheck(this, ErrorEvent)
  29892. return this.#eventInit.filename
  29893. }
  29894. get lineno () {
  29895. webidl.brandCheck(this, ErrorEvent)
  29896. return this.#eventInit.lineno
  29897. }
  29898. get colno () {
  29899. webidl.brandCheck(this, ErrorEvent)
  29900. return this.#eventInit.colno
  29901. }
  29902. get error () {
  29903. webidl.brandCheck(this, ErrorEvent)
  29904. return this.#eventInit.error
  29905. }
  29906. }
  29907. Object.defineProperties(MessageEvent.prototype, {
  29908. [Symbol.toStringTag]: {
  29909. value: 'MessageEvent',
  29910. configurable: true
  29911. },
  29912. data: kEnumerableProperty,
  29913. origin: kEnumerableProperty,
  29914. lastEventId: kEnumerableProperty,
  29915. source: kEnumerableProperty,
  29916. ports: kEnumerableProperty,
  29917. initMessageEvent: kEnumerableProperty
  29918. })
  29919. Object.defineProperties(CloseEvent.prototype, {
  29920. [Symbol.toStringTag]: {
  29921. value: 'CloseEvent',
  29922. configurable: true
  29923. },
  29924. reason: kEnumerableProperty,
  29925. code: kEnumerableProperty,
  29926. wasClean: kEnumerableProperty
  29927. })
  29928. Object.defineProperties(ErrorEvent.prototype, {
  29929. [Symbol.toStringTag]: {
  29930. value: 'ErrorEvent',
  29931. configurable: true
  29932. },
  29933. message: kEnumerableProperty,
  29934. filename: kEnumerableProperty,
  29935. lineno: kEnumerableProperty,
  29936. colno: kEnumerableProperty,
  29937. error: kEnumerableProperty
  29938. })
  29939. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29940. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29941. webidl.converters.MessagePort
  29942. )
  29943. const eventInit = [
  29944. {
  29945. key: 'bubbles',
  29946. converter: webidl.converters.boolean,
  29947. defaultValue: false
  29948. },
  29949. {
  29950. key: 'cancelable',
  29951. converter: webidl.converters.boolean,
  29952. defaultValue: false
  29953. },
  29954. {
  29955. key: 'composed',
  29956. converter: webidl.converters.boolean,
  29957. defaultValue: false
  29958. }
  29959. ]
  29960. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29961. ...eventInit,
  29962. {
  29963. key: 'data',
  29964. converter: webidl.converters.any,
  29965. defaultValue: null
  29966. },
  29967. {
  29968. key: 'origin',
  29969. converter: webidl.converters.USVString,
  29970. defaultValue: ''
  29971. },
  29972. {
  29973. key: 'lastEventId',
  29974. converter: webidl.converters.DOMString,
  29975. defaultValue: ''
  29976. },
  29977. {
  29978. key: 'source',
  29979. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29980. // valid value for source is a MessagePort.
  29981. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29982. defaultValue: null
  29983. },
  29984. {
  29985. key: 'ports',
  29986. converter: webidl.converters['sequence<MessagePort>'],
  29987. get defaultValue () {
  29988. return []
  29989. }
  29990. }
  29991. ])
  29992. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  29993. ...eventInit,
  29994. {
  29995. key: 'wasClean',
  29996. converter: webidl.converters.boolean,
  29997. defaultValue: false
  29998. },
  29999. {
  30000. key: 'code',
  30001. converter: webidl.converters['unsigned short'],
  30002. defaultValue: 0
  30003. },
  30004. {
  30005. key: 'reason',
  30006. converter: webidl.converters.USVString,
  30007. defaultValue: ''
  30008. }
  30009. ])
  30010. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  30011. ...eventInit,
  30012. {
  30013. key: 'message',
  30014. converter: webidl.converters.DOMString,
  30015. defaultValue: ''
  30016. },
  30017. {
  30018. key: 'filename',
  30019. converter: webidl.converters.USVString,
  30020. defaultValue: ''
  30021. },
  30022. {
  30023. key: 'lineno',
  30024. converter: webidl.converters['unsigned long'],
  30025. defaultValue: 0
  30026. },
  30027. {
  30028. key: 'colno',
  30029. converter: webidl.converters['unsigned long'],
  30030. defaultValue: 0
  30031. },
  30032. {
  30033. key: 'error',
  30034. converter: webidl.converters.any
  30035. }
  30036. ])
  30037. module.exports = {
  30038. MessageEvent,
  30039. CloseEvent,
  30040. ErrorEvent
  30041. }
  30042. /***/ }),
  30043. /***/ 5444:
  30044. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30045. "use strict";
  30046. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  30047. /** @type {import('crypto')} */
  30048. let crypto
  30049. try {
  30050. crypto = __nccwpck_require__(6113)
  30051. } catch {
  30052. }
  30053. class WebsocketFrameSend {
  30054. /**
  30055. * @param {Buffer|undefined} data
  30056. */
  30057. constructor (data) {
  30058. this.frameData = data
  30059. this.maskKey = crypto.randomBytes(4)
  30060. }
  30061. createFrame (opcode) {
  30062. const bodyLength = this.frameData?.byteLength ?? 0
  30063. /** @type {number} */
  30064. let payloadLength = bodyLength // 0-125
  30065. let offset = 6
  30066. if (bodyLength > maxUnsigned16Bit) {
  30067. offset += 8 // payload length is next 8 bytes
  30068. payloadLength = 127
  30069. } else if (bodyLength > 125) {
  30070. offset += 2 // payload length is next 2 bytes
  30071. payloadLength = 126
  30072. }
  30073. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  30074. // Clear first 2 bytes, everything else is overwritten
  30075. buffer[0] = buffer[1] = 0
  30076. buffer[0] |= 0x80 // FIN
  30077. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  30078. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  30079. buffer[offset - 4] = this.maskKey[0]
  30080. buffer[offset - 3] = this.maskKey[1]
  30081. buffer[offset - 2] = this.maskKey[2]
  30082. buffer[offset - 1] = this.maskKey[3]
  30083. buffer[1] = payloadLength
  30084. if (payloadLength === 126) {
  30085. buffer.writeUInt16BE(bodyLength, 2)
  30086. } else if (payloadLength === 127) {
  30087. // Clear extended payload length
  30088. buffer[2] = buffer[3] = 0
  30089. buffer.writeUIntBE(bodyLength, 4, 6)
  30090. }
  30091. buffer[1] |= 0x80 // MASK
  30092. // mask body
  30093. for (let i = 0; i < bodyLength; i++) {
  30094. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  30095. }
  30096. return buffer
  30097. }
  30098. }
  30099. module.exports = {
  30100. WebsocketFrameSend
  30101. }
  30102. /***/ }),
  30103. /***/ 1688:
  30104. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30105. "use strict";
  30106. const { Writable } = __nccwpck_require__(2781)
  30107. const diagnosticsChannel = __nccwpck_require__(7643)
  30108. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  30109. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  30110. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  30111. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30112. // This code was influenced by ws released under the MIT license.
  30113. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  30114. // Copyright (c) 2013 Arnout Kazemier and contributors
  30115. // Copyright (c) 2016 Luigi Pinca and contributors
  30116. const channels = {}
  30117. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  30118. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  30119. class ByteParser extends Writable {
  30120. #buffers = []
  30121. #byteOffset = 0
  30122. #state = parserStates.INFO
  30123. #info = {}
  30124. #fragments = []
  30125. constructor (ws) {
  30126. super()
  30127. this.ws = ws
  30128. }
  30129. /**
  30130. * @param {Buffer} chunk
  30131. * @param {() => void} callback
  30132. */
  30133. _write (chunk, _, callback) {
  30134. this.#buffers.push(chunk)
  30135. this.#byteOffset += chunk.length
  30136. this.run(callback)
  30137. }
  30138. /**
  30139. * Runs whenever a new chunk is received.
  30140. * Callback is called whenever there are no more chunks buffering,
  30141. * or not enough bytes are buffered to parse.
  30142. */
  30143. run (callback) {
  30144. while (true) {
  30145. if (this.#state === parserStates.INFO) {
  30146. // If there aren't enough bytes to parse the payload length, etc.
  30147. if (this.#byteOffset < 2) {
  30148. return callback()
  30149. }
  30150. const buffer = this.consume(2)
  30151. this.#info.fin = (buffer[0] & 0x80) !== 0
  30152. this.#info.opcode = buffer[0] & 0x0F
  30153. // If we receive a fragmented message, we use the type of the first
  30154. // frame to parse the full message as binary/text, when it's terminated
  30155. this.#info.originalOpcode ??= this.#info.opcode
  30156. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  30157. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  30158. // Only text and binary frames can be fragmented
  30159. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  30160. return
  30161. }
  30162. const payloadLength = buffer[1] & 0x7F
  30163. if (payloadLength <= 125) {
  30164. this.#info.payloadLength = payloadLength
  30165. this.#state = parserStates.READ_DATA
  30166. } else if (payloadLength === 126) {
  30167. this.#state = parserStates.PAYLOADLENGTH_16
  30168. } else if (payloadLength === 127) {
  30169. this.#state = parserStates.PAYLOADLENGTH_64
  30170. }
  30171. if (this.#info.fragmented && payloadLength > 125) {
  30172. // A fragmented frame can't be fragmented itself
  30173. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  30174. return
  30175. } else if (
  30176. (this.#info.opcode === opcodes.PING ||
  30177. this.#info.opcode === opcodes.PONG ||
  30178. this.#info.opcode === opcodes.CLOSE) &&
  30179. payloadLength > 125
  30180. ) {
  30181. // Control frames can have a payload length of 125 bytes MAX
  30182. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  30183. return
  30184. } else if (this.#info.opcode === opcodes.CLOSE) {
  30185. if (payloadLength === 1) {
  30186. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  30187. return
  30188. }
  30189. const body = this.consume(payloadLength)
  30190. this.#info.closeInfo = this.parseCloseBody(false, body)
  30191. if (!this.ws[kSentClose]) {
  30192. // If an endpoint receives a Close frame and did not previously send a
  30193. // Close frame, the endpoint MUST send a Close frame in response. (When
  30194. // sending a Close frame in response, the endpoint typically echos the
  30195. // status code it received.)
  30196. const body = Buffer.allocUnsafe(2)
  30197. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  30198. const closeFrame = new WebsocketFrameSend(body)
  30199. this.ws[kResponse].socket.write(
  30200. closeFrame.createFrame(opcodes.CLOSE),
  30201. (err) => {
  30202. if (!err) {
  30203. this.ws[kSentClose] = true
  30204. }
  30205. }
  30206. )
  30207. }
  30208. // Upon either sending or receiving a Close control frame, it is said
  30209. // that _The WebSocket Closing Handshake is Started_ and that the
  30210. // WebSocket connection is in the CLOSING state.
  30211. this.ws[kReadyState] = states.CLOSING
  30212. this.ws[kReceivedClose] = true
  30213. this.end()
  30214. return
  30215. } else if (this.#info.opcode === opcodes.PING) {
  30216. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  30217. // response, unless it already received a Close frame.
  30218. // A Pong frame sent in response to a Ping frame must have identical
  30219. // "Application data"
  30220. const body = this.consume(payloadLength)
  30221. if (!this.ws[kReceivedClose]) {
  30222. const frame = new WebsocketFrameSend(body)
  30223. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  30224. if (channels.ping.hasSubscribers) {
  30225. channels.ping.publish({
  30226. payload: body
  30227. })
  30228. }
  30229. }
  30230. this.#state = parserStates.INFO
  30231. if (this.#byteOffset > 0) {
  30232. continue
  30233. } else {
  30234. callback()
  30235. return
  30236. }
  30237. } else if (this.#info.opcode === opcodes.PONG) {
  30238. // A Pong frame MAY be sent unsolicited. This serves as a
  30239. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  30240. // not expected.
  30241. const body = this.consume(payloadLength)
  30242. if (channels.pong.hasSubscribers) {
  30243. channels.pong.publish({
  30244. payload: body
  30245. })
  30246. }
  30247. if (this.#byteOffset > 0) {
  30248. continue
  30249. } else {
  30250. callback()
  30251. return
  30252. }
  30253. }
  30254. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  30255. if (this.#byteOffset < 2) {
  30256. return callback()
  30257. }
  30258. const buffer = this.consume(2)
  30259. this.#info.payloadLength = buffer.readUInt16BE(0)
  30260. this.#state = parserStates.READ_DATA
  30261. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  30262. if (this.#byteOffset < 8) {
  30263. return callback()
  30264. }
  30265. const buffer = this.consume(8)
  30266. const upper = buffer.readUInt32BE(0)
  30267. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30268. // on 32-bit systems. Although, on 64-bit systems, this is
  30269. // 2^53-1 bytes.
  30270. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30271. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30272. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30273. if (upper > 2 ** 31 - 1) {
  30274. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30275. return
  30276. }
  30277. const lower = buffer.readUInt32BE(4)
  30278. this.#info.payloadLength = (upper << 8) + lower
  30279. this.#state = parserStates.READ_DATA
  30280. } else if (this.#state === parserStates.READ_DATA) {
  30281. if (this.#byteOffset < this.#info.payloadLength) {
  30282. // If there is still more data in this chunk that needs to be read
  30283. return callback()
  30284. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30285. // If the server sent multiple frames in a single chunk
  30286. const body = this.consume(this.#info.payloadLength)
  30287. this.#fragments.push(body)
  30288. // If the frame is unfragmented, or a fragmented frame was terminated,
  30289. // a message was received
  30290. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30291. const fullMessage = Buffer.concat(this.#fragments)
  30292. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30293. this.#info = {}
  30294. this.#fragments.length = 0
  30295. }
  30296. this.#state = parserStates.INFO
  30297. }
  30298. }
  30299. if (this.#byteOffset > 0) {
  30300. continue
  30301. } else {
  30302. callback()
  30303. break
  30304. }
  30305. }
  30306. }
  30307. /**
  30308. * Take n bytes from the buffered Buffers
  30309. * @param {number} n
  30310. * @returns {Buffer|null}
  30311. */
  30312. consume (n) {
  30313. if (n > this.#byteOffset) {
  30314. return null
  30315. } else if (n === 0) {
  30316. return emptyBuffer
  30317. }
  30318. if (this.#buffers[0].length === n) {
  30319. this.#byteOffset -= this.#buffers[0].length
  30320. return this.#buffers.shift()
  30321. }
  30322. const buffer = Buffer.allocUnsafe(n)
  30323. let offset = 0
  30324. while (offset !== n) {
  30325. const next = this.#buffers[0]
  30326. const { length } = next
  30327. if (length + offset === n) {
  30328. buffer.set(this.#buffers.shift(), offset)
  30329. break
  30330. } else if (length + offset > n) {
  30331. buffer.set(next.subarray(0, n - offset), offset)
  30332. this.#buffers[0] = next.subarray(n - offset)
  30333. break
  30334. } else {
  30335. buffer.set(this.#buffers.shift(), offset)
  30336. offset += next.length
  30337. }
  30338. }
  30339. this.#byteOffset -= n
  30340. return buffer
  30341. }
  30342. parseCloseBody (onlyCode, data) {
  30343. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30344. /** @type {number|undefined} */
  30345. let code
  30346. if (data.length >= 2) {
  30347. // _The WebSocket Connection Close Code_ is
  30348. // defined as the status code (Section 7.4) contained in the first Close
  30349. // control frame received by the application
  30350. code = data.readUInt16BE(0)
  30351. }
  30352. if (onlyCode) {
  30353. if (!isValidStatusCode(code)) {
  30354. return null
  30355. }
  30356. return { code }
  30357. }
  30358. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30359. /** @type {Buffer} */
  30360. let reason = data.subarray(2)
  30361. // Remove BOM
  30362. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30363. reason = reason.subarray(3)
  30364. }
  30365. if (code !== undefined && !isValidStatusCode(code)) {
  30366. return null
  30367. }
  30368. try {
  30369. // TODO: optimize this
  30370. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30371. } catch {
  30372. return null
  30373. }
  30374. return { code, reason }
  30375. }
  30376. get closingInfo () {
  30377. return this.#info.closeInfo
  30378. }
  30379. }
  30380. module.exports = {
  30381. ByteParser
  30382. }
  30383. /***/ }),
  30384. /***/ 7578:
  30385. /***/ ((module) => {
  30386. "use strict";
  30387. module.exports = {
  30388. kWebSocketURL: Symbol('url'),
  30389. kReadyState: Symbol('ready state'),
  30390. kController: Symbol('controller'),
  30391. kResponse: Symbol('response'),
  30392. kBinaryType: Symbol('binary type'),
  30393. kSentClose: Symbol('sent close'),
  30394. kReceivedClose: Symbol('received close'),
  30395. kByteParser: Symbol('byte parser')
  30396. }
  30397. /***/ }),
  30398. /***/ 5515:
  30399. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30400. "use strict";
  30401. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30402. const { states, opcodes } = __nccwpck_require__(9188)
  30403. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30404. /* globals Blob */
  30405. /**
  30406. * @param {import('./websocket').WebSocket} ws
  30407. */
  30408. function isEstablished (ws) {
  30409. // If the server's response is validated as provided for above, it is
  30410. // said that _The WebSocket Connection is Established_ and that the
  30411. // WebSocket Connection is in the OPEN state.
  30412. return ws[kReadyState] === states.OPEN
  30413. }
  30414. /**
  30415. * @param {import('./websocket').WebSocket} ws
  30416. */
  30417. function isClosing (ws) {
  30418. // Upon either sending or receiving a Close control frame, it is said
  30419. // that _The WebSocket Closing Handshake is Started_ and that the
  30420. // WebSocket connection is in the CLOSING state.
  30421. return ws[kReadyState] === states.CLOSING
  30422. }
  30423. /**
  30424. * @param {import('./websocket').WebSocket} ws
  30425. */
  30426. function isClosed (ws) {
  30427. return ws[kReadyState] === states.CLOSED
  30428. }
  30429. /**
  30430. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30431. * @param {string} e
  30432. * @param {EventTarget} target
  30433. * @param {EventInit | undefined} eventInitDict
  30434. */
  30435. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30436. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30437. // 2. Let event be the result of creating an event given eventConstructor,
  30438. // in the relevant realm of target.
  30439. // 3. Initialize event’s type attribute to e.
  30440. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30441. // 4. Initialize any other IDL attributes of event as described in the
  30442. // invocation of this algorithm.
  30443. // 5. Return the result of dispatching event at target, with legacy target
  30444. // override flag set if set.
  30445. target.dispatchEvent(event)
  30446. }
  30447. /**
  30448. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30449. * @param {import('./websocket').WebSocket} ws
  30450. * @param {number} type Opcode
  30451. * @param {Buffer} data application data
  30452. */
  30453. function websocketMessageReceived (ws, type, data) {
  30454. // 1. If ready state is not OPEN (1), then return.
  30455. if (ws[kReadyState] !== states.OPEN) {
  30456. return
  30457. }
  30458. // 2. Let dataForEvent be determined by switching on type and binary type:
  30459. let dataForEvent
  30460. if (type === opcodes.TEXT) {
  30461. // -> type indicates that the data is Text
  30462. // a new DOMString containing data
  30463. try {
  30464. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30465. } catch {
  30466. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30467. return
  30468. }
  30469. } else if (type === opcodes.BINARY) {
  30470. if (ws[kBinaryType] === 'blob') {
  30471. // -> type indicates that the data is Binary and binary type is "blob"
  30472. // a new Blob object, created in the relevant Realm of the WebSocket
  30473. // object, that represents data as its raw data
  30474. dataForEvent = new Blob([data])
  30475. } else {
  30476. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30477. // a new ArrayBuffer object, created in the relevant Realm of the
  30478. // WebSocket object, whose contents are data
  30479. dataForEvent = new Uint8Array(data).buffer
  30480. }
  30481. }
  30482. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30483. // with the origin attribute initialized to the serialization of the WebSocket
  30484. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30485. fireEvent('message', ws, MessageEvent, {
  30486. origin: ws[kWebSocketURL].origin,
  30487. data: dataForEvent
  30488. })
  30489. }
  30490. /**
  30491. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30492. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30493. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30494. * @param {string} protocol
  30495. */
  30496. function isValidSubprotocol (protocol) {
  30497. // If present, this value indicates one
  30498. // or more comma-separated subprotocol the client wishes to speak,
  30499. // ordered by preference. The elements that comprise this value
  30500. // MUST be non-empty strings with characters in the range U+0021 to
  30501. // U+007E not including separator characters as defined in
  30502. // [RFC2616] and MUST all be unique strings.
  30503. if (protocol.length === 0) {
  30504. return false
  30505. }
  30506. for (const char of protocol) {
  30507. const code = char.charCodeAt(0)
  30508. if (
  30509. code < 0x21 ||
  30510. code > 0x7E ||
  30511. char === '(' ||
  30512. char === ')' ||
  30513. char === '<' ||
  30514. char === '>' ||
  30515. char === '@' ||
  30516. char === ',' ||
  30517. char === ';' ||
  30518. char === ':' ||
  30519. char === '\\' ||
  30520. char === '"' ||
  30521. char === '/' ||
  30522. char === '[' ||
  30523. char === ']' ||
  30524. char === '?' ||
  30525. char === '=' ||
  30526. char === '{' ||
  30527. char === '}' ||
  30528. code === 32 || // SP
  30529. code === 9 // HT
  30530. ) {
  30531. return false
  30532. }
  30533. }
  30534. return true
  30535. }
  30536. /**
  30537. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30538. * @param {number} code
  30539. */
  30540. function isValidStatusCode (code) {
  30541. if (code >= 1000 && code < 1015) {
  30542. return (
  30543. code !== 1004 && // reserved
  30544. code !== 1005 && // "MUST NOT be set as a status code"
  30545. code !== 1006 // "MUST NOT be set as a status code"
  30546. )
  30547. }
  30548. return code >= 3000 && code <= 4999
  30549. }
  30550. /**
  30551. * @param {import('./websocket').WebSocket} ws
  30552. * @param {string|undefined} reason
  30553. */
  30554. function failWebsocketConnection (ws, reason) {
  30555. const { [kController]: controller, [kResponse]: response } = ws
  30556. controller.abort()
  30557. if (response?.socket && !response.socket.destroyed) {
  30558. response.socket.destroy()
  30559. }
  30560. if (reason) {
  30561. fireEvent('error', ws, ErrorEvent, {
  30562. error: new Error(reason)
  30563. })
  30564. }
  30565. }
  30566. module.exports = {
  30567. isEstablished,
  30568. isClosing,
  30569. isClosed,
  30570. fireEvent,
  30571. isValidSubprotocol,
  30572. isValidStatusCode,
  30573. failWebsocketConnection,
  30574. websocketMessageReceived
  30575. }
  30576. /***/ }),
  30577. /***/ 4284:
  30578. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30579. "use strict";
  30580. const { webidl } = __nccwpck_require__(1744)
  30581. const { DOMException } = __nccwpck_require__(1037)
  30582. const { URLSerializer } = __nccwpck_require__(685)
  30583. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30584. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30585. const {
  30586. kWebSocketURL,
  30587. kReadyState,
  30588. kController,
  30589. kBinaryType,
  30590. kResponse,
  30591. kSentClose,
  30592. kByteParser
  30593. } = __nccwpck_require__(7578)
  30594. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30595. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30596. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30597. const { ByteParser } = __nccwpck_require__(1688)
  30598. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30599. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30600. const { types } = __nccwpck_require__(3837)
  30601. let experimentalWarned = false
  30602. // https://websockets.spec.whatwg.org/#interface-definition
  30603. class WebSocket extends EventTarget {
  30604. #events = {
  30605. open: null,
  30606. error: null,
  30607. close: null,
  30608. message: null
  30609. }
  30610. #bufferedAmount = 0
  30611. #protocol = ''
  30612. #extensions = ''
  30613. /**
  30614. * @param {string} url
  30615. * @param {string|string[]} protocols
  30616. */
  30617. constructor (url, protocols = []) {
  30618. super()
  30619. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30620. if (!experimentalWarned) {
  30621. experimentalWarned = true
  30622. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30623. code: 'UNDICI-WS'
  30624. })
  30625. }
  30626. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30627. url = webidl.converters.USVString(url)
  30628. protocols = options.protocols
  30629. // 1. Let baseURL be this's relevant settings object's API base URL.
  30630. const baseURL = getGlobalOrigin()
  30631. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30632. let urlRecord
  30633. try {
  30634. urlRecord = new URL(url, baseURL)
  30635. } catch (e) {
  30636. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30637. throw new DOMException(e, 'SyntaxError')
  30638. }
  30639. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30640. if (urlRecord.protocol === 'http:') {
  30641. urlRecord.protocol = 'ws:'
  30642. } else if (urlRecord.protocol === 'https:') {
  30643. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30644. urlRecord.protocol = 'wss:'
  30645. }
  30646. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30647. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30648. throw new DOMException(
  30649. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30650. 'SyntaxError'
  30651. )
  30652. }
  30653. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30654. // DOMException.
  30655. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30656. throw new DOMException('Got fragment', 'SyntaxError')
  30657. }
  30658. // 8. If protocols is a string, set protocols to a sequence consisting
  30659. // of just that string.
  30660. if (typeof protocols === 'string') {
  30661. protocols = [protocols]
  30662. }
  30663. // 9. If any of the values in protocols occur more than once or otherwise
  30664. // fail to match the requirements for elements that comprise the value
  30665. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30666. // protocol, then throw a "SyntaxError" DOMException.
  30667. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30668. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30669. }
  30670. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30671. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30672. }
  30673. // 10. Set this's url to urlRecord.
  30674. this[kWebSocketURL] = new URL(urlRecord.href)
  30675. // 11. Let client be this's relevant settings object.
  30676. // 12. Run this step in parallel:
  30677. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30678. // and client.
  30679. this[kController] = establishWebSocketConnection(
  30680. urlRecord,
  30681. protocols,
  30682. this,
  30683. (response) => this.#onConnectionEstablished(response),
  30684. options
  30685. )
  30686. // Each WebSocket object has an associated ready state, which is a
  30687. // number representing the state of the connection. Initially it must
  30688. // be CONNECTING (0).
  30689. this[kReadyState] = WebSocket.CONNECTING
  30690. // The extensions attribute must initially return the empty string.
  30691. // The protocol attribute must initially return the empty string.
  30692. // Each WebSocket object has an associated binary type, which is a
  30693. // BinaryType. Initially it must be "blob".
  30694. this[kBinaryType] = 'blob'
  30695. }
  30696. /**
  30697. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30698. * @param {number|undefined} code
  30699. * @param {string|undefined} reason
  30700. */
  30701. close (code = undefined, reason = undefined) {
  30702. webidl.brandCheck(this, WebSocket)
  30703. if (code !== undefined) {
  30704. code = webidl.converters['unsigned short'](code, { clamp: true })
  30705. }
  30706. if (reason !== undefined) {
  30707. reason = webidl.converters.USVString(reason)
  30708. }
  30709. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30710. // integer in the range 3000 to 4999, inclusive, throw an
  30711. // "InvalidAccessError" DOMException.
  30712. if (code !== undefined) {
  30713. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30714. throw new DOMException('invalid code', 'InvalidAccessError')
  30715. }
  30716. }
  30717. let reasonByteLength = 0
  30718. // 2. If reason is present, then run these substeps:
  30719. if (reason !== undefined) {
  30720. // 1. Let reasonBytes be the result of encoding reason.
  30721. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30722. // "SyntaxError" DOMException.
  30723. reasonByteLength = Buffer.byteLength(reason)
  30724. if (reasonByteLength > 123) {
  30725. throw new DOMException(
  30726. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30727. 'SyntaxError'
  30728. )
  30729. }
  30730. }
  30731. // 3. Run the first matching steps from the following list:
  30732. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30733. // If this's ready state is CLOSING (2) or CLOSED (3)
  30734. // Do nothing.
  30735. } else if (!isEstablished(this)) {
  30736. // If the WebSocket connection is not yet established
  30737. // Fail the WebSocket connection and set this's ready state
  30738. // to CLOSING (2).
  30739. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30740. this[kReadyState] = WebSocket.CLOSING
  30741. } else if (!isClosing(this)) {
  30742. // If the WebSocket closing handshake has not yet been started
  30743. // Start the WebSocket closing handshake and set this's ready
  30744. // state to CLOSING (2).
  30745. // - If neither code nor reason is present, the WebSocket Close
  30746. // message must not have a body.
  30747. // - If code is present, then the status code to use in the
  30748. // WebSocket Close message must be the integer given by code.
  30749. // - If reason is also present, then reasonBytes must be
  30750. // provided in the Close message after the status code.
  30751. const frame = new WebsocketFrameSend()
  30752. // If neither code nor reason is present, the WebSocket Close
  30753. // message must not have a body.
  30754. // If code is present, then the status code to use in the
  30755. // WebSocket Close message must be the integer given by code.
  30756. if (code !== undefined && reason === undefined) {
  30757. frame.frameData = Buffer.allocUnsafe(2)
  30758. frame.frameData.writeUInt16BE(code, 0)
  30759. } else if (code !== undefined && reason !== undefined) {
  30760. // If reason is also present, then reasonBytes must be
  30761. // provided in the Close message after the status code.
  30762. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30763. frame.frameData.writeUInt16BE(code, 0)
  30764. // the body MAY contain UTF-8-encoded data with value /reason/
  30765. frame.frameData.write(reason, 2, 'utf-8')
  30766. } else {
  30767. frame.frameData = emptyBuffer
  30768. }
  30769. /** @type {import('stream').Duplex} */
  30770. const socket = this[kResponse].socket
  30771. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30772. if (!err) {
  30773. this[kSentClose] = true
  30774. }
  30775. })
  30776. // Upon either sending or receiving a Close control frame, it is said
  30777. // that _The WebSocket Closing Handshake is Started_ and that the
  30778. // WebSocket connection is in the CLOSING state.
  30779. this[kReadyState] = states.CLOSING
  30780. } else {
  30781. // Otherwise
  30782. // Set this's ready state to CLOSING (2).
  30783. this[kReadyState] = WebSocket.CLOSING
  30784. }
  30785. }
  30786. /**
  30787. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30788. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30789. */
  30790. send (data) {
  30791. webidl.brandCheck(this, WebSocket)
  30792. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30793. data = webidl.converters.WebSocketSendData(data)
  30794. // 1. If this's ready state is CONNECTING, then throw an
  30795. // "InvalidStateError" DOMException.
  30796. if (this[kReadyState] === WebSocket.CONNECTING) {
  30797. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30798. }
  30799. // 2. Run the appropriate set of steps from the following list:
  30800. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30801. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30802. if (!isEstablished(this) || isClosing(this)) {
  30803. return
  30804. }
  30805. /** @type {import('stream').Duplex} */
  30806. const socket = this[kResponse].socket
  30807. // If data is a string
  30808. if (typeof data === 'string') {
  30809. // If the WebSocket connection is established and the WebSocket
  30810. // closing handshake has not yet started, then the user agent
  30811. // must send a WebSocket Message comprised of the data argument
  30812. // using a text frame opcode; if the data cannot be sent, e.g.
  30813. // because it would need to be buffered but the buffer is full,
  30814. // the user agent must flag the WebSocket as full and then close
  30815. // the WebSocket connection. Any invocation of this method with a
  30816. // string argument that does not throw an exception must increase
  30817. // the bufferedAmount attribute by the number of bytes needed to
  30818. // express the argument as UTF-8.
  30819. const value = Buffer.from(data)
  30820. const frame = new WebsocketFrameSend(value)
  30821. const buffer = frame.createFrame(opcodes.TEXT)
  30822. this.#bufferedAmount += value.byteLength
  30823. socket.write(buffer, () => {
  30824. this.#bufferedAmount -= value.byteLength
  30825. })
  30826. } else if (types.isArrayBuffer(data)) {
  30827. // If the WebSocket connection is established, and the WebSocket
  30828. // closing handshake has not yet started, then the user agent must
  30829. // send a WebSocket Message comprised of data using a binary frame
  30830. // opcode; if the data cannot be sent, e.g. because it would need
  30831. // to be buffered but the buffer is full, the user agent must flag
  30832. // the WebSocket as full and then close the WebSocket connection.
  30833. // The data to be sent is the data stored in the buffer described
  30834. // by the ArrayBuffer object. Any invocation of this method with an
  30835. // ArrayBuffer argument that does not throw an exception must
  30836. // increase the bufferedAmount attribute by the length of the
  30837. // ArrayBuffer in bytes.
  30838. const value = Buffer.from(data)
  30839. const frame = new WebsocketFrameSend(value)
  30840. const buffer = frame.createFrame(opcodes.BINARY)
  30841. this.#bufferedAmount += value.byteLength
  30842. socket.write(buffer, () => {
  30843. this.#bufferedAmount -= value.byteLength
  30844. })
  30845. } else if (ArrayBuffer.isView(data)) {
  30846. // If the WebSocket connection is established, and the WebSocket
  30847. // closing handshake has not yet started, then the user agent must
  30848. // send a WebSocket Message comprised of data using a binary frame
  30849. // opcode; if the data cannot be sent, e.g. because it would need to
  30850. // be buffered but the buffer is full, the user agent must flag the
  30851. // WebSocket as full and then close the WebSocket connection. The
  30852. // data to be sent is the data stored in the section of the buffer
  30853. // described by the ArrayBuffer object that data references. Any
  30854. // invocation of this method with this kind of argument that does
  30855. // not throw an exception must increase the bufferedAmount attribute
  30856. // by the length of data’s buffer in bytes.
  30857. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30858. const frame = new WebsocketFrameSend(ab)
  30859. const buffer = frame.createFrame(opcodes.BINARY)
  30860. this.#bufferedAmount += ab.byteLength
  30861. socket.write(buffer, () => {
  30862. this.#bufferedAmount -= ab.byteLength
  30863. })
  30864. } else if (isBlobLike(data)) {
  30865. // If the WebSocket connection is established, and the WebSocket
  30866. // closing handshake has not yet started, then the user agent must
  30867. // send a WebSocket Message comprised of data using a binary frame
  30868. // opcode; if the data cannot be sent, e.g. because it would need to
  30869. // be buffered but the buffer is full, the user agent must flag the
  30870. // WebSocket as full and then close the WebSocket connection. The data
  30871. // to be sent is the raw data represented by the Blob object. Any
  30872. // invocation of this method with a Blob argument that does not throw
  30873. // an exception must increase the bufferedAmount attribute by the size
  30874. // of the Blob object’s raw data, in bytes.
  30875. const frame = new WebsocketFrameSend()
  30876. data.arrayBuffer().then((ab) => {
  30877. const value = Buffer.from(ab)
  30878. frame.frameData = value
  30879. const buffer = frame.createFrame(opcodes.BINARY)
  30880. this.#bufferedAmount += value.byteLength
  30881. socket.write(buffer, () => {
  30882. this.#bufferedAmount -= value.byteLength
  30883. })
  30884. })
  30885. }
  30886. }
  30887. get readyState () {
  30888. webidl.brandCheck(this, WebSocket)
  30889. // The readyState getter steps are to return this's ready state.
  30890. return this[kReadyState]
  30891. }
  30892. get bufferedAmount () {
  30893. webidl.brandCheck(this, WebSocket)
  30894. return this.#bufferedAmount
  30895. }
  30896. get url () {
  30897. webidl.brandCheck(this, WebSocket)
  30898. // The url getter steps are to return this's url, serialized.
  30899. return URLSerializer(this[kWebSocketURL])
  30900. }
  30901. get extensions () {
  30902. webidl.brandCheck(this, WebSocket)
  30903. return this.#extensions
  30904. }
  30905. get protocol () {
  30906. webidl.brandCheck(this, WebSocket)
  30907. return this.#protocol
  30908. }
  30909. get onopen () {
  30910. webidl.brandCheck(this, WebSocket)
  30911. return this.#events.open
  30912. }
  30913. set onopen (fn) {
  30914. webidl.brandCheck(this, WebSocket)
  30915. if (this.#events.open) {
  30916. this.removeEventListener('open', this.#events.open)
  30917. }
  30918. if (typeof fn === 'function') {
  30919. this.#events.open = fn
  30920. this.addEventListener('open', fn)
  30921. } else {
  30922. this.#events.open = null
  30923. }
  30924. }
  30925. get onerror () {
  30926. webidl.brandCheck(this, WebSocket)
  30927. return this.#events.error
  30928. }
  30929. set onerror (fn) {
  30930. webidl.brandCheck(this, WebSocket)
  30931. if (this.#events.error) {
  30932. this.removeEventListener('error', this.#events.error)
  30933. }
  30934. if (typeof fn === 'function') {
  30935. this.#events.error = fn
  30936. this.addEventListener('error', fn)
  30937. } else {
  30938. this.#events.error = null
  30939. }
  30940. }
  30941. get onclose () {
  30942. webidl.brandCheck(this, WebSocket)
  30943. return this.#events.close
  30944. }
  30945. set onclose (fn) {
  30946. webidl.brandCheck(this, WebSocket)
  30947. if (this.#events.close) {
  30948. this.removeEventListener('close', this.#events.close)
  30949. }
  30950. if (typeof fn === 'function') {
  30951. this.#events.close = fn
  30952. this.addEventListener('close', fn)
  30953. } else {
  30954. this.#events.close = null
  30955. }
  30956. }
  30957. get onmessage () {
  30958. webidl.brandCheck(this, WebSocket)
  30959. return this.#events.message
  30960. }
  30961. set onmessage (fn) {
  30962. webidl.brandCheck(this, WebSocket)
  30963. if (this.#events.message) {
  30964. this.removeEventListener('message', this.#events.message)
  30965. }
  30966. if (typeof fn === 'function') {
  30967. this.#events.message = fn
  30968. this.addEventListener('message', fn)
  30969. } else {
  30970. this.#events.message = null
  30971. }
  30972. }
  30973. get binaryType () {
  30974. webidl.brandCheck(this, WebSocket)
  30975. return this[kBinaryType]
  30976. }
  30977. set binaryType (type) {
  30978. webidl.brandCheck(this, WebSocket)
  30979. if (type !== 'blob' && type !== 'arraybuffer') {
  30980. this[kBinaryType] = 'blob'
  30981. } else {
  30982. this[kBinaryType] = type
  30983. }
  30984. }
  30985. /**
  30986. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30987. */
  30988. #onConnectionEstablished (response) {
  30989. // processResponse is called when the "response’s header list has been received and initialized."
  30990. // once this happens, the connection is open
  30991. this[kResponse] = response
  30992. const parser = new ByteParser(this)
  30993. parser.on('drain', function onParserDrain () {
  30994. this.ws[kResponse].socket.resume()
  30995. })
  30996. response.socket.ws = this
  30997. this[kByteParser] = parser
  30998. // 1. Change the ready state to OPEN (1).
  30999. this[kReadyState] = states.OPEN
  31000. // 2. Change the extensions attribute’s value to the extensions in use, if
  31001. // it is not the null value.
  31002. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  31003. const extensions = response.headersList.get('sec-websocket-extensions')
  31004. if (extensions !== null) {
  31005. this.#extensions = extensions
  31006. }
  31007. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  31008. // it is not the null value.
  31009. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  31010. const protocol = response.headersList.get('sec-websocket-protocol')
  31011. if (protocol !== null) {
  31012. this.#protocol = protocol
  31013. }
  31014. // 4. Fire an event named open at the WebSocket object.
  31015. fireEvent('open', this)
  31016. }
  31017. }
  31018. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  31019. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  31020. // https://websockets.spec.whatwg.org/#dom-websocket-open
  31021. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  31022. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  31023. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  31024. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  31025. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  31026. Object.defineProperties(WebSocket.prototype, {
  31027. CONNECTING: staticPropertyDescriptors,
  31028. OPEN: staticPropertyDescriptors,
  31029. CLOSING: staticPropertyDescriptors,
  31030. CLOSED: staticPropertyDescriptors,
  31031. url: kEnumerableProperty,
  31032. readyState: kEnumerableProperty,
  31033. bufferedAmount: kEnumerableProperty,
  31034. onopen: kEnumerableProperty,
  31035. onerror: kEnumerableProperty,
  31036. onclose: kEnumerableProperty,
  31037. close: kEnumerableProperty,
  31038. onmessage: kEnumerableProperty,
  31039. binaryType: kEnumerableProperty,
  31040. send: kEnumerableProperty,
  31041. extensions: kEnumerableProperty,
  31042. protocol: kEnumerableProperty,
  31043. [Symbol.toStringTag]: {
  31044. value: 'WebSocket',
  31045. writable: false,
  31046. enumerable: false,
  31047. configurable: true
  31048. }
  31049. })
  31050. Object.defineProperties(WebSocket, {
  31051. CONNECTING: staticPropertyDescriptors,
  31052. OPEN: staticPropertyDescriptors,
  31053. CLOSING: staticPropertyDescriptors,
  31054. CLOSED: staticPropertyDescriptors
  31055. })
  31056. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  31057. webidl.converters.DOMString
  31058. )
  31059. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  31060. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  31061. return webidl.converters['sequence<DOMString>'](V)
  31062. }
  31063. return webidl.converters.DOMString(V)
  31064. }
  31065. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  31066. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  31067. {
  31068. key: 'protocols',
  31069. converter: webidl.converters['DOMString or sequence<DOMString>'],
  31070. get defaultValue () {
  31071. return []
  31072. }
  31073. },
  31074. {
  31075. key: 'dispatcher',
  31076. converter: (V) => V,
  31077. get defaultValue () {
  31078. return getGlobalDispatcher()
  31079. }
  31080. },
  31081. {
  31082. key: 'headers',
  31083. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  31084. }
  31085. ])
  31086. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  31087. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  31088. return webidl.converters.WebSocketInit(V)
  31089. }
  31090. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  31091. }
  31092. webidl.converters.WebSocketSendData = function (V) {
  31093. if (webidl.util.Type(V) === 'Object') {
  31094. if (isBlobLike(V)) {
  31095. return webidl.converters.Blob(V, { strict: false })
  31096. }
  31097. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  31098. return webidl.converters.BufferSource(V)
  31099. }
  31100. }
  31101. return webidl.converters.USVString(V)
  31102. }
  31103. module.exports = {
  31104. WebSocket
  31105. }
  31106. /***/ }),
  31107. /***/ 5030:
  31108. /***/ ((__unused_webpack_module, exports) => {
  31109. "use strict";
  31110. Object.defineProperty(exports, "__esModule", ({ value: true }));
  31111. function getUserAgent() {
  31112. if (typeof navigator === "object" && "userAgent" in navigator) {
  31113. return navigator.userAgent;
  31114. }
  31115. if (typeof process === "object" && process.version !== undefined) {
  31116. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  31117. }
  31118. return "<environment undetectable>";
  31119. }
  31120. exports.getUserAgent = getUserAgent;
  31121. //# sourceMappingURL=index.js.map
  31122. /***/ }),
  31123. /***/ 5840:
  31124. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31125. "use strict";
  31126. Object.defineProperty(exports, "__esModule", ({
  31127. value: true
  31128. }));
  31129. Object.defineProperty(exports, "NIL", ({
  31130. enumerable: true,
  31131. get: function () {
  31132. return _nil.default;
  31133. }
  31134. }));
  31135. Object.defineProperty(exports, "parse", ({
  31136. enumerable: true,
  31137. get: function () {
  31138. return _parse.default;
  31139. }
  31140. }));
  31141. Object.defineProperty(exports, "stringify", ({
  31142. enumerable: true,
  31143. get: function () {
  31144. return _stringify.default;
  31145. }
  31146. }));
  31147. Object.defineProperty(exports, "v1", ({
  31148. enumerable: true,
  31149. get: function () {
  31150. return _v.default;
  31151. }
  31152. }));
  31153. Object.defineProperty(exports, "v3", ({
  31154. enumerable: true,
  31155. get: function () {
  31156. return _v2.default;
  31157. }
  31158. }));
  31159. Object.defineProperty(exports, "v4", ({
  31160. enumerable: true,
  31161. get: function () {
  31162. return _v3.default;
  31163. }
  31164. }));
  31165. Object.defineProperty(exports, "v5", ({
  31166. enumerable: true,
  31167. get: function () {
  31168. return _v4.default;
  31169. }
  31170. }));
  31171. Object.defineProperty(exports, "validate", ({
  31172. enumerable: true,
  31173. get: function () {
  31174. return _validate.default;
  31175. }
  31176. }));
  31177. Object.defineProperty(exports, "version", ({
  31178. enumerable: true,
  31179. get: function () {
  31180. return _version.default;
  31181. }
  31182. }));
  31183. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  31184. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  31185. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  31186. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  31187. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  31188. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  31189. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31190. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  31191. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31192. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31193. /***/ }),
  31194. /***/ 4569:
  31195. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31196. "use strict";
  31197. Object.defineProperty(exports, "__esModule", ({
  31198. value: true
  31199. }));
  31200. exports["default"] = void 0;
  31201. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31202. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31203. function md5(bytes) {
  31204. if (Array.isArray(bytes)) {
  31205. bytes = Buffer.from(bytes);
  31206. } else if (typeof bytes === 'string') {
  31207. bytes = Buffer.from(bytes, 'utf8');
  31208. }
  31209. return _crypto.default.createHash('md5').update(bytes).digest();
  31210. }
  31211. var _default = md5;
  31212. exports["default"] = _default;
  31213. /***/ }),
  31214. /***/ 2054:
  31215. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31216. "use strict";
  31217. Object.defineProperty(exports, "__esModule", ({
  31218. value: true
  31219. }));
  31220. exports["default"] = void 0;
  31221. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31222. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31223. var _default = {
  31224. randomUUID: _crypto.default.randomUUID
  31225. };
  31226. exports["default"] = _default;
  31227. /***/ }),
  31228. /***/ 5332:
  31229. /***/ ((__unused_webpack_module, exports) => {
  31230. "use strict";
  31231. Object.defineProperty(exports, "__esModule", ({
  31232. value: true
  31233. }));
  31234. exports["default"] = void 0;
  31235. var _default = '00000000-0000-0000-0000-000000000000';
  31236. exports["default"] = _default;
  31237. /***/ }),
  31238. /***/ 2746:
  31239. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31240. "use strict";
  31241. Object.defineProperty(exports, "__esModule", ({
  31242. value: true
  31243. }));
  31244. exports["default"] = void 0;
  31245. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31246. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31247. function parse(uuid) {
  31248. if (!(0, _validate.default)(uuid)) {
  31249. throw TypeError('Invalid UUID');
  31250. }
  31251. let v;
  31252. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  31253. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  31254. arr[1] = v >>> 16 & 0xff;
  31255. arr[2] = v >>> 8 & 0xff;
  31256. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  31257. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  31258. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  31259. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  31260. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  31261. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  31262. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  31263. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  31264. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  31265. arr[11] = v / 0x100000000 & 0xff;
  31266. arr[12] = v >>> 24 & 0xff;
  31267. arr[13] = v >>> 16 & 0xff;
  31268. arr[14] = v >>> 8 & 0xff;
  31269. arr[15] = v & 0xff;
  31270. return arr;
  31271. }
  31272. var _default = parse;
  31273. exports["default"] = _default;
  31274. /***/ }),
  31275. /***/ 814:
  31276. /***/ ((__unused_webpack_module, exports) => {
  31277. "use strict";
  31278. Object.defineProperty(exports, "__esModule", ({
  31279. value: true
  31280. }));
  31281. exports["default"] = void 0;
  31282. 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;
  31283. exports["default"] = _default;
  31284. /***/ }),
  31285. /***/ 807:
  31286. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31287. "use strict";
  31288. Object.defineProperty(exports, "__esModule", ({
  31289. value: true
  31290. }));
  31291. exports["default"] = rng;
  31292. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31293. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31294. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31295. let poolPtr = rnds8Pool.length;
  31296. function rng() {
  31297. if (poolPtr > rnds8Pool.length - 16) {
  31298. _crypto.default.randomFillSync(rnds8Pool);
  31299. poolPtr = 0;
  31300. }
  31301. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31302. }
  31303. /***/ }),
  31304. /***/ 5274:
  31305. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31306. "use strict";
  31307. Object.defineProperty(exports, "__esModule", ({
  31308. value: true
  31309. }));
  31310. exports["default"] = void 0;
  31311. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31312. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31313. function sha1(bytes) {
  31314. if (Array.isArray(bytes)) {
  31315. bytes = Buffer.from(bytes);
  31316. } else if (typeof bytes === 'string') {
  31317. bytes = Buffer.from(bytes, 'utf8');
  31318. }
  31319. return _crypto.default.createHash('sha1').update(bytes).digest();
  31320. }
  31321. var _default = sha1;
  31322. exports["default"] = _default;
  31323. /***/ }),
  31324. /***/ 8950:
  31325. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31326. "use strict";
  31327. Object.defineProperty(exports, "__esModule", ({
  31328. value: true
  31329. }));
  31330. exports["default"] = void 0;
  31331. exports.unsafeStringify = unsafeStringify;
  31332. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31333. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31334. /**
  31335. * Convert array of 16 byte values to UUID string format of the form:
  31336. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31337. */
  31338. const byteToHex = [];
  31339. for (let i = 0; i < 256; ++i) {
  31340. byteToHex.push((i + 0x100).toString(16).slice(1));
  31341. }
  31342. function unsafeStringify(arr, offset = 0) {
  31343. // Note: Be careful editing this code! It's been tuned for performance
  31344. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31345. 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]];
  31346. }
  31347. function stringify(arr, offset = 0) {
  31348. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31349. // of the following:
  31350. // - One or more input array values don't map to a hex octet (leading to
  31351. // "undefined" in the uuid)
  31352. // - Invalid input values for the RFC `version` or `variant` fields
  31353. if (!(0, _validate.default)(uuid)) {
  31354. throw TypeError('Stringified UUID is invalid');
  31355. }
  31356. return uuid;
  31357. }
  31358. var _default = stringify;
  31359. exports["default"] = _default;
  31360. /***/ }),
  31361. /***/ 8628:
  31362. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31363. "use strict";
  31364. Object.defineProperty(exports, "__esModule", ({
  31365. value: true
  31366. }));
  31367. exports["default"] = void 0;
  31368. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31369. var _stringify = __nccwpck_require__(8950);
  31370. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31371. // **`v1()` - Generate time-based UUID**
  31372. //
  31373. // Inspired by https://github.com/LiosK/UUID.js
  31374. // and http://docs.python.org/library/uuid.html
  31375. let _nodeId;
  31376. let _clockseq; // Previous uuid creation time
  31377. let _lastMSecs = 0;
  31378. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31379. function v1(options, buf, offset) {
  31380. let i = buf && offset || 0;
  31381. const b = buf || new Array(16);
  31382. options = options || {};
  31383. let node = options.node || _nodeId;
  31384. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31385. // specified. We do this lazily to minimize issues related to insufficient
  31386. // system entropy. See #189
  31387. if (node == null || clockseq == null) {
  31388. const seedBytes = options.random || (options.rng || _rng.default)();
  31389. if (node == null) {
  31390. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31391. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31392. }
  31393. if (clockseq == null) {
  31394. // Per 4.2.2, randomize (14 bit) clockseq
  31395. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31396. }
  31397. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31398. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31399. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31400. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31401. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31402. // cycle to simulate higher resolution clock
  31403. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31404. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31405. if (dt < 0 && options.clockseq === undefined) {
  31406. clockseq = clockseq + 1 & 0x3fff;
  31407. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31408. // time interval
  31409. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31410. nsecs = 0;
  31411. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31412. if (nsecs >= 10000) {
  31413. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31414. }
  31415. _lastMSecs = msecs;
  31416. _lastNSecs = nsecs;
  31417. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31418. msecs += 12219292800000; // `time_low`
  31419. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31420. b[i++] = tl >>> 24 & 0xff;
  31421. b[i++] = tl >>> 16 & 0xff;
  31422. b[i++] = tl >>> 8 & 0xff;
  31423. b[i++] = tl & 0xff; // `time_mid`
  31424. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31425. b[i++] = tmh >>> 8 & 0xff;
  31426. b[i++] = tmh & 0xff; // `time_high_and_version`
  31427. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31428. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31429. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31430. b[i++] = clockseq & 0xff; // `node`
  31431. for (let n = 0; n < 6; ++n) {
  31432. b[i + n] = node[n];
  31433. }
  31434. return buf || (0, _stringify.unsafeStringify)(b);
  31435. }
  31436. var _default = v1;
  31437. exports["default"] = _default;
  31438. /***/ }),
  31439. /***/ 6409:
  31440. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31441. "use strict";
  31442. Object.defineProperty(exports, "__esModule", ({
  31443. value: true
  31444. }));
  31445. exports["default"] = void 0;
  31446. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31447. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31448. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31449. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31450. var _default = v3;
  31451. exports["default"] = _default;
  31452. /***/ }),
  31453. /***/ 5998:
  31454. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31455. "use strict";
  31456. Object.defineProperty(exports, "__esModule", ({
  31457. value: true
  31458. }));
  31459. exports.URL = exports.DNS = void 0;
  31460. exports["default"] = v35;
  31461. var _stringify = __nccwpck_require__(8950);
  31462. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31463. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31464. function stringToBytes(str) {
  31465. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31466. const bytes = [];
  31467. for (let i = 0; i < str.length; ++i) {
  31468. bytes.push(str.charCodeAt(i));
  31469. }
  31470. return bytes;
  31471. }
  31472. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31473. exports.DNS = DNS;
  31474. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31475. exports.URL = URL;
  31476. function v35(name, version, hashfunc) {
  31477. function generateUUID(value, namespace, buf, offset) {
  31478. var _namespace;
  31479. if (typeof value === 'string') {
  31480. value = stringToBytes(value);
  31481. }
  31482. if (typeof namespace === 'string') {
  31483. namespace = (0, _parse.default)(namespace);
  31484. }
  31485. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31486. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31487. } // Compute hash of namespace and value, Per 4.3
  31488. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31489. // hashfunc([...namespace, ... value])`
  31490. let bytes = new Uint8Array(16 + value.length);
  31491. bytes.set(namespace);
  31492. bytes.set(value, namespace.length);
  31493. bytes = hashfunc(bytes);
  31494. bytes[6] = bytes[6] & 0x0f | version;
  31495. bytes[8] = bytes[8] & 0x3f | 0x80;
  31496. if (buf) {
  31497. offset = offset || 0;
  31498. for (let i = 0; i < 16; ++i) {
  31499. buf[offset + i] = bytes[i];
  31500. }
  31501. return buf;
  31502. }
  31503. return (0, _stringify.unsafeStringify)(bytes);
  31504. } // Function#name is not settable on some platforms (#270)
  31505. try {
  31506. generateUUID.name = name; // eslint-disable-next-line no-empty
  31507. } catch (err) {} // For CommonJS default export support
  31508. generateUUID.DNS = DNS;
  31509. generateUUID.URL = URL;
  31510. return generateUUID;
  31511. }
  31512. /***/ }),
  31513. /***/ 5122:
  31514. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31515. "use strict";
  31516. Object.defineProperty(exports, "__esModule", ({
  31517. value: true
  31518. }));
  31519. exports["default"] = void 0;
  31520. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31521. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31522. var _stringify = __nccwpck_require__(8950);
  31523. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31524. function v4(options, buf, offset) {
  31525. if (_native.default.randomUUID && !buf && !options) {
  31526. return _native.default.randomUUID();
  31527. }
  31528. options = options || {};
  31529. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31530. rnds[6] = rnds[6] & 0x0f | 0x40;
  31531. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31532. if (buf) {
  31533. offset = offset || 0;
  31534. for (let i = 0; i < 16; ++i) {
  31535. buf[offset + i] = rnds[i];
  31536. }
  31537. return buf;
  31538. }
  31539. return (0, _stringify.unsafeStringify)(rnds);
  31540. }
  31541. var _default = v4;
  31542. exports["default"] = _default;
  31543. /***/ }),
  31544. /***/ 9120:
  31545. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31546. "use strict";
  31547. Object.defineProperty(exports, "__esModule", ({
  31548. value: true
  31549. }));
  31550. exports["default"] = void 0;
  31551. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31552. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31553. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31554. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31555. var _default = v5;
  31556. exports["default"] = _default;
  31557. /***/ }),
  31558. /***/ 6900:
  31559. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31560. "use strict";
  31561. Object.defineProperty(exports, "__esModule", ({
  31562. value: true
  31563. }));
  31564. exports["default"] = void 0;
  31565. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31566. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31567. function validate(uuid) {
  31568. return typeof uuid === 'string' && _regex.default.test(uuid);
  31569. }
  31570. var _default = validate;
  31571. exports["default"] = _default;
  31572. /***/ }),
  31573. /***/ 2414:
  31574. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31575. "use strict";
  31576. Object.defineProperty(exports, "__esModule", ({
  31577. value: true
  31578. }));
  31579. exports["default"] = void 0;
  31580. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31581. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31582. function version(uuid) {
  31583. if (!(0, _validate.default)(uuid)) {
  31584. throw TypeError('Invalid UUID');
  31585. }
  31586. return parseInt(uuid.slice(14, 15), 16);
  31587. }
  31588. var _default = version;
  31589. exports["default"] = _default;
  31590. /***/ }),
  31591. /***/ 2940:
  31592. /***/ ((module) => {
  31593. // Returns a wrapper function that returns a wrapped callback
  31594. // The wrapper function should do some stuff, and return a
  31595. // presumably different callback function.
  31596. // This makes sure that own properties are retained, so that
  31597. // decorations and such are not lost along the way.
  31598. module.exports = wrappy
  31599. function wrappy (fn, cb) {
  31600. if (fn && cb) return wrappy(fn)(cb)
  31601. if (typeof fn !== 'function')
  31602. throw new TypeError('need wrapper function')
  31603. Object.keys(fn).forEach(function (k) {
  31604. wrapper[k] = fn[k]
  31605. })
  31606. return wrapper
  31607. function wrapper() {
  31608. var args = new Array(arguments.length)
  31609. for (var i = 0; i < args.length; i++) {
  31610. args[i] = arguments[i]
  31611. }
  31612. var ret = fn.apply(this, args)
  31613. var cb = args[args.length-1]
  31614. if (typeof ret === 'function' && ret !== cb) {
  31615. Object.keys(cb).forEach(function (k) {
  31616. ret[k] = cb[k]
  31617. })
  31618. }
  31619. return ret
  31620. }
  31621. }
  31622. /***/ }),
  31623. /***/ 9491:
  31624. /***/ ((module) => {
  31625. "use strict";
  31626. module.exports = require("assert");
  31627. /***/ }),
  31628. /***/ 852:
  31629. /***/ ((module) => {
  31630. "use strict";
  31631. module.exports = require("async_hooks");
  31632. /***/ }),
  31633. /***/ 4300:
  31634. /***/ ((module) => {
  31635. "use strict";
  31636. module.exports = require("buffer");
  31637. /***/ }),
  31638. /***/ 2081:
  31639. /***/ ((module) => {
  31640. "use strict";
  31641. module.exports = require("child_process");
  31642. /***/ }),
  31643. /***/ 6206:
  31644. /***/ ((module) => {
  31645. "use strict";
  31646. module.exports = require("console");
  31647. /***/ }),
  31648. /***/ 6113:
  31649. /***/ ((module) => {
  31650. "use strict";
  31651. module.exports = require("crypto");
  31652. /***/ }),
  31653. /***/ 7643:
  31654. /***/ ((module) => {
  31655. "use strict";
  31656. module.exports = require("diagnostics_channel");
  31657. /***/ }),
  31658. /***/ 2361:
  31659. /***/ ((module) => {
  31660. "use strict";
  31661. module.exports = require("events");
  31662. /***/ }),
  31663. /***/ 7147:
  31664. /***/ ((module) => {
  31665. "use strict";
  31666. module.exports = require("fs");
  31667. /***/ }),
  31668. /***/ 3685:
  31669. /***/ ((module) => {
  31670. "use strict";
  31671. module.exports = require("http");
  31672. /***/ }),
  31673. /***/ 5158:
  31674. /***/ ((module) => {
  31675. "use strict";
  31676. module.exports = require("http2");
  31677. /***/ }),
  31678. /***/ 5687:
  31679. /***/ ((module) => {
  31680. "use strict";
  31681. module.exports = require("https");
  31682. /***/ }),
  31683. /***/ 1808:
  31684. /***/ ((module) => {
  31685. "use strict";
  31686. module.exports = require("net");
  31687. /***/ }),
  31688. /***/ 6005:
  31689. /***/ ((module) => {
  31690. "use strict";
  31691. module.exports = require("node:crypto");
  31692. /***/ }),
  31693. /***/ 5673:
  31694. /***/ ((module) => {
  31695. "use strict";
  31696. module.exports = require("node:events");
  31697. /***/ }),
  31698. /***/ 4492:
  31699. /***/ ((module) => {
  31700. "use strict";
  31701. module.exports = require("node:stream");
  31702. /***/ }),
  31703. /***/ 7261:
  31704. /***/ ((module) => {
  31705. "use strict";
  31706. module.exports = require("node:util");
  31707. /***/ }),
  31708. /***/ 2037:
  31709. /***/ ((module) => {
  31710. "use strict";
  31711. module.exports = require("os");
  31712. /***/ }),
  31713. /***/ 1017:
  31714. /***/ ((module) => {
  31715. "use strict";
  31716. module.exports = require("path");
  31717. /***/ }),
  31718. /***/ 4074:
  31719. /***/ ((module) => {
  31720. "use strict";
  31721. module.exports = require("perf_hooks");
  31722. /***/ }),
  31723. /***/ 3477:
  31724. /***/ ((module) => {
  31725. "use strict";
  31726. module.exports = require("querystring");
  31727. /***/ }),
  31728. /***/ 2781:
  31729. /***/ ((module) => {
  31730. "use strict";
  31731. module.exports = require("stream");
  31732. /***/ }),
  31733. /***/ 5356:
  31734. /***/ ((module) => {
  31735. "use strict";
  31736. module.exports = require("stream/web");
  31737. /***/ }),
  31738. /***/ 1576:
  31739. /***/ ((module) => {
  31740. "use strict";
  31741. module.exports = require("string_decoder");
  31742. /***/ }),
  31743. /***/ 9512:
  31744. /***/ ((module) => {
  31745. "use strict";
  31746. module.exports = require("timers");
  31747. /***/ }),
  31748. /***/ 4404:
  31749. /***/ ((module) => {
  31750. "use strict";
  31751. module.exports = require("tls");
  31752. /***/ }),
  31753. /***/ 7310:
  31754. /***/ ((module) => {
  31755. "use strict";
  31756. module.exports = require("url");
  31757. /***/ }),
  31758. /***/ 3837:
  31759. /***/ ((module) => {
  31760. "use strict";
  31761. module.exports = require("util");
  31762. /***/ }),
  31763. /***/ 9830:
  31764. /***/ ((module) => {
  31765. "use strict";
  31766. module.exports = require("util/types");
  31767. /***/ }),
  31768. /***/ 1267:
  31769. /***/ ((module) => {
  31770. "use strict";
  31771. module.exports = require("worker_threads");
  31772. /***/ }),
  31773. /***/ 9796:
  31774. /***/ ((module) => {
  31775. "use strict";
  31776. module.exports = require("zlib");
  31777. /***/ }),
  31778. /***/ 2960:
  31779. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31780. "use strict";
  31781. const WritableStream = (__nccwpck_require__(4492).Writable)
  31782. const inherits = (__nccwpck_require__(7261).inherits)
  31783. const StreamSearch = __nccwpck_require__(1142)
  31784. const PartStream = __nccwpck_require__(1620)
  31785. const HeaderParser = __nccwpck_require__(2032)
  31786. const DASH = 45
  31787. const B_ONEDASH = Buffer.from('-')
  31788. const B_CRLF = Buffer.from('\r\n')
  31789. const EMPTY_FN = function () {}
  31790. function Dicer (cfg) {
  31791. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31792. WritableStream.call(this, cfg)
  31793. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31794. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31795. this._headerFirst = cfg.headerFirst
  31796. this._dashes = 0
  31797. this._parts = 0
  31798. this._finished = false
  31799. this._realFinish = false
  31800. this._isPreamble = true
  31801. this._justMatched = false
  31802. this._firstWrite = true
  31803. this._inHeader = true
  31804. this._part = undefined
  31805. this._cb = undefined
  31806. this._ignoreData = false
  31807. this._partOpts = { highWaterMark: cfg.partHwm }
  31808. this._pause = false
  31809. const self = this
  31810. this._hparser = new HeaderParser(cfg)
  31811. this._hparser.on('header', function (header) {
  31812. self._inHeader = false
  31813. self._part.emit('header', header)
  31814. })
  31815. }
  31816. inherits(Dicer, WritableStream)
  31817. Dicer.prototype.emit = function (ev) {
  31818. if (ev === 'finish' && !this._realFinish) {
  31819. if (!this._finished) {
  31820. const self = this
  31821. process.nextTick(function () {
  31822. self.emit('error', new Error('Unexpected end of multipart data'))
  31823. if (self._part && !self._ignoreData) {
  31824. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31825. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31826. self._part.push(null)
  31827. process.nextTick(function () {
  31828. self._realFinish = true
  31829. self.emit('finish')
  31830. self._realFinish = false
  31831. })
  31832. return
  31833. }
  31834. self._realFinish = true
  31835. self.emit('finish')
  31836. self._realFinish = false
  31837. })
  31838. }
  31839. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31840. }
  31841. Dicer.prototype._write = function (data, encoding, cb) {
  31842. // ignore unexpected data (e.g. extra trailer data after finished)
  31843. if (!this._hparser && !this._bparser) { return cb() }
  31844. if (this._headerFirst && this._isPreamble) {
  31845. if (!this._part) {
  31846. this._part = new PartStream(this._partOpts)
  31847. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31848. }
  31849. const r = this._hparser.push(data)
  31850. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31851. }
  31852. // allows for "easier" testing
  31853. if (this._firstWrite) {
  31854. this._bparser.push(B_CRLF)
  31855. this._firstWrite = false
  31856. }
  31857. this._bparser.push(data)
  31858. if (this._pause) { this._cb = cb } else { cb() }
  31859. }
  31860. Dicer.prototype.reset = function () {
  31861. this._part = undefined
  31862. this._bparser = undefined
  31863. this._hparser = undefined
  31864. }
  31865. Dicer.prototype.setBoundary = function (boundary) {
  31866. const self = this
  31867. this._bparser = new StreamSearch('\r\n--' + boundary)
  31868. this._bparser.on('info', function (isMatch, data, start, end) {
  31869. self._oninfo(isMatch, data, start, end)
  31870. })
  31871. }
  31872. Dicer.prototype._ignore = function () {
  31873. if (this._part && !this._ignoreData) {
  31874. this._ignoreData = true
  31875. this._part.on('error', EMPTY_FN)
  31876. // we must perform some kind of read on the stream even though we are
  31877. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31878. // after pushing null to the stream
  31879. this._part.resume()
  31880. }
  31881. }
  31882. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31883. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31884. if (!this._part && this._justMatched && data) {
  31885. while (this._dashes < 2 && (start + i) < end) {
  31886. if (data[start + i] === DASH) {
  31887. ++i
  31888. ++this._dashes
  31889. } else {
  31890. if (this._dashes) { buf = B_ONEDASH }
  31891. this._dashes = 0
  31892. break
  31893. }
  31894. }
  31895. if (this._dashes === 2) {
  31896. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31897. this.reset()
  31898. this._finished = true
  31899. // no more parts will be added
  31900. if (self._parts === 0) {
  31901. self._realFinish = true
  31902. self.emit('finish')
  31903. self._realFinish = false
  31904. }
  31905. }
  31906. if (this._dashes) { return }
  31907. }
  31908. if (this._justMatched) { this._justMatched = false }
  31909. if (!this._part) {
  31910. this._part = new PartStream(this._partOpts)
  31911. this._part._read = function (n) {
  31912. self._unpause()
  31913. }
  31914. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31915. this.emit('preamble', this._part)
  31916. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31917. this.emit('part', this._part)
  31918. } else {
  31919. this._ignore()
  31920. }
  31921. if (!this._isPreamble) { this._inHeader = true }
  31922. }
  31923. if (data && start < end && !this._ignoreData) {
  31924. if (this._isPreamble || !this._inHeader) {
  31925. if (buf) { shouldWriteMore = this._part.push(buf) }
  31926. shouldWriteMore = this._part.push(data.slice(start, end))
  31927. if (!shouldWriteMore) { this._pause = true }
  31928. } else if (!this._isPreamble && this._inHeader) {
  31929. if (buf) { this._hparser.push(buf) }
  31930. r = this._hparser.push(data.slice(start, end))
  31931. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31932. }
  31933. }
  31934. if (isMatch) {
  31935. this._hparser.reset()
  31936. if (this._isPreamble) { this._isPreamble = false } else {
  31937. if (start !== end) {
  31938. ++this._parts
  31939. this._part.on('end', function () {
  31940. if (--self._parts === 0) {
  31941. if (self._finished) {
  31942. self._realFinish = true
  31943. self.emit('finish')
  31944. self._realFinish = false
  31945. } else {
  31946. self._unpause()
  31947. }
  31948. }
  31949. })
  31950. }
  31951. }
  31952. this._part.push(null)
  31953. this._part = undefined
  31954. this._ignoreData = false
  31955. this._justMatched = true
  31956. this._dashes = 0
  31957. }
  31958. }
  31959. Dicer.prototype._unpause = function () {
  31960. if (!this._pause) { return }
  31961. this._pause = false
  31962. if (this._cb) {
  31963. const cb = this._cb
  31964. this._cb = undefined
  31965. cb()
  31966. }
  31967. }
  31968. module.exports = Dicer
  31969. /***/ }),
  31970. /***/ 2032:
  31971. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31972. "use strict";
  31973. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31974. const inherits = (__nccwpck_require__(7261).inherits)
  31975. const getLimit = __nccwpck_require__(1467)
  31976. const StreamSearch = __nccwpck_require__(1142)
  31977. const B_DCRLF = Buffer.from('\r\n\r\n')
  31978. const RE_CRLF = /\r\n/g
  31979. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31980. function HeaderParser (cfg) {
  31981. EventEmitter.call(this)
  31982. cfg = cfg || {}
  31983. const self = this
  31984. this.nread = 0
  31985. this.maxed = false
  31986. this.npairs = 0
  31987. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  31988. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  31989. this.buffer = ''
  31990. this.header = {}
  31991. this.finished = false
  31992. this.ss = new StreamSearch(B_DCRLF)
  31993. this.ss.on('info', function (isMatch, data, start, end) {
  31994. if (data && !self.maxed) {
  31995. if (self.nread + end - start >= self.maxHeaderSize) {
  31996. end = self.maxHeaderSize - self.nread + start
  31997. self.nread = self.maxHeaderSize
  31998. self.maxed = true
  31999. } else { self.nread += (end - start) }
  32000. self.buffer += data.toString('binary', start, end)
  32001. }
  32002. if (isMatch) { self._finish() }
  32003. })
  32004. }
  32005. inherits(HeaderParser, EventEmitter)
  32006. HeaderParser.prototype.push = function (data) {
  32007. const r = this.ss.push(data)
  32008. if (this.finished) { return r }
  32009. }
  32010. HeaderParser.prototype.reset = function () {
  32011. this.finished = false
  32012. this.buffer = ''
  32013. this.header = {}
  32014. this.ss.reset()
  32015. }
  32016. HeaderParser.prototype._finish = function () {
  32017. if (this.buffer) { this._parseHeader() }
  32018. this.ss.matches = this.ss.maxMatches
  32019. const header = this.header
  32020. this.header = {}
  32021. this.buffer = ''
  32022. this.finished = true
  32023. this.nread = this.npairs = 0
  32024. this.maxed = false
  32025. this.emit('header', header)
  32026. }
  32027. HeaderParser.prototype._parseHeader = function () {
  32028. if (this.npairs === this.maxHeaderPairs) { return }
  32029. const lines = this.buffer.split(RE_CRLF)
  32030. const len = lines.length
  32031. let m, h
  32032. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32033. if (lines[i].length === 0) { continue }
  32034. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  32035. // folded header content
  32036. // RFC2822 says to just remove the CRLF and not the whitespace following
  32037. // it, so we follow the RFC and include the leading whitespace ...
  32038. if (h) {
  32039. this.header[h][this.header[h].length - 1] += lines[i]
  32040. continue
  32041. }
  32042. }
  32043. const posColon = lines[i].indexOf(':')
  32044. if (
  32045. posColon === -1 ||
  32046. posColon === 0
  32047. ) {
  32048. return
  32049. }
  32050. m = RE_HDR.exec(lines[i])
  32051. h = m[1].toLowerCase()
  32052. this.header[h] = this.header[h] || []
  32053. this.header[h].push((m[2] || ''))
  32054. if (++this.npairs === this.maxHeaderPairs) { break }
  32055. }
  32056. }
  32057. module.exports = HeaderParser
  32058. /***/ }),
  32059. /***/ 1620:
  32060. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32061. "use strict";
  32062. const inherits = (__nccwpck_require__(7261).inherits)
  32063. const ReadableStream = (__nccwpck_require__(4492).Readable)
  32064. function PartStream (opts) {
  32065. ReadableStream.call(this, opts)
  32066. }
  32067. inherits(PartStream, ReadableStream)
  32068. PartStream.prototype._read = function (n) {}
  32069. module.exports = PartStream
  32070. /***/ }),
  32071. /***/ 1142:
  32072. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32073. "use strict";
  32074. /**
  32075. * Copyright Brian White. All rights reserved.
  32076. *
  32077. * @see https://github.com/mscdex/streamsearch
  32078. *
  32079. * Permission is hereby granted, free of charge, to any person obtaining a copy
  32080. * of this software and associated documentation files (the "Software"), to
  32081. * deal in the Software without restriction, including without limitation the
  32082. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  32083. * sell copies of the Software, and to permit persons to whom the Software is
  32084. * furnished to do so, subject to the following conditions:
  32085. *
  32086. * The above copyright notice and this permission notice shall be included in
  32087. * all copies or substantial portions of the Software.
  32088. *
  32089. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  32090. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  32091. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  32092. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  32093. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  32094. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  32095. * IN THE SOFTWARE.
  32096. *
  32097. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  32098. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  32099. */
  32100. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32101. const inherits = (__nccwpck_require__(7261).inherits)
  32102. function SBMH (needle) {
  32103. if (typeof needle === 'string') {
  32104. needle = Buffer.from(needle)
  32105. }
  32106. if (!Buffer.isBuffer(needle)) {
  32107. throw new TypeError('The needle has to be a String or a Buffer.')
  32108. }
  32109. const needleLength = needle.length
  32110. if (needleLength === 0) {
  32111. throw new Error('The needle cannot be an empty String/Buffer.')
  32112. }
  32113. if (needleLength > 256) {
  32114. throw new Error('The needle cannot have a length bigger than 256.')
  32115. }
  32116. this.maxMatches = Infinity
  32117. this.matches = 0
  32118. this._occ = new Array(256)
  32119. .fill(needleLength) // Initialize occurrence table.
  32120. this._lookbehind_size = 0
  32121. this._needle = needle
  32122. this._bufpos = 0
  32123. this._lookbehind = Buffer.alloc(needleLength)
  32124. // Populate occurrence table with analysis of the needle,
  32125. // ignoring last letter.
  32126. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  32127. this._occ[needle[i]] = needleLength - 1 - i
  32128. }
  32129. }
  32130. inherits(SBMH, EventEmitter)
  32131. SBMH.prototype.reset = function () {
  32132. this._lookbehind_size = 0
  32133. this.matches = 0
  32134. this._bufpos = 0
  32135. }
  32136. SBMH.prototype.push = function (chunk, pos) {
  32137. if (!Buffer.isBuffer(chunk)) {
  32138. chunk = Buffer.from(chunk, 'binary')
  32139. }
  32140. const chlen = chunk.length
  32141. this._bufpos = pos || 0
  32142. let r
  32143. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  32144. return r
  32145. }
  32146. SBMH.prototype._sbmh_feed = function (data) {
  32147. const len = data.length
  32148. const needle = this._needle
  32149. const needleLength = needle.length
  32150. const lastNeedleChar = needle[needleLength - 1]
  32151. // Positive: points to a position in `data`
  32152. // pos == 3 points to data[3]
  32153. // Negative: points to a position in the lookbehind buffer
  32154. // pos == -2 points to lookbehind[lookbehind_size - 2]
  32155. let pos = -this._lookbehind_size
  32156. let ch
  32157. if (pos < 0) {
  32158. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  32159. // search with character lookup code that considers both the
  32160. // lookbehind buffer and the current round's haystack data.
  32161. //
  32162. // Loop until
  32163. // there is a match.
  32164. // or until
  32165. // we've moved past the position that requires the
  32166. // lookbehind buffer. In this case we switch to the
  32167. // optimized loop.
  32168. // or until
  32169. // the character to look at lies outside the haystack.
  32170. while (pos < 0 && pos <= len - needleLength) {
  32171. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  32172. if (
  32173. ch === lastNeedleChar &&
  32174. this._sbmh_memcmp(data, pos, needleLength - 1)
  32175. ) {
  32176. this._lookbehind_size = 0
  32177. ++this.matches
  32178. this.emit('info', true)
  32179. return (this._bufpos = pos + needleLength)
  32180. }
  32181. pos += this._occ[ch]
  32182. }
  32183. // No match.
  32184. if (pos < 0) {
  32185. // There's too few data for Boyer-Moore-Horspool to run,
  32186. // so let's use a different algorithm to skip as much as
  32187. // we can.
  32188. // Forward pos until
  32189. // the trailing part of lookbehind + data
  32190. // looks like the beginning of the needle
  32191. // or until
  32192. // pos == 0
  32193. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  32194. }
  32195. if (pos >= 0) {
  32196. // Discard lookbehind buffer.
  32197. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  32198. this._lookbehind_size = 0
  32199. } else {
  32200. // Cut off part of the lookbehind buffer that has
  32201. // been processed and append the entire haystack
  32202. // into it.
  32203. const bytesToCutOff = this._lookbehind_size + pos
  32204. if (bytesToCutOff > 0) {
  32205. // The cut off data is guaranteed not to contain the needle.
  32206. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  32207. }
  32208. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  32209. this._lookbehind_size - bytesToCutOff)
  32210. this._lookbehind_size -= bytesToCutOff
  32211. data.copy(this._lookbehind, this._lookbehind_size)
  32212. this._lookbehind_size += len
  32213. this._bufpos = len
  32214. return len
  32215. }
  32216. }
  32217. pos += (pos >= 0) * this._bufpos
  32218. // Lookbehind buffer is now empty. We only need to check if the
  32219. // needle is in the haystack.
  32220. if (data.indexOf(needle, pos) !== -1) {
  32221. pos = data.indexOf(needle, pos)
  32222. ++this.matches
  32223. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  32224. return (this._bufpos = pos + needleLength)
  32225. } else {
  32226. pos = len - needleLength
  32227. }
  32228. // There was no match. If there's trailing haystack data that we cannot
  32229. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  32230. // data is less than the needle size) then match using a modified
  32231. // algorithm that starts matching from the beginning instead of the end.
  32232. // Whatever trailing data is left after running this algorithm is added to
  32233. // the lookbehind buffer.
  32234. while (
  32235. pos < len &&
  32236. (
  32237. data[pos] !== needle[0] ||
  32238. (
  32239. (Buffer.compare(
  32240. data.subarray(pos, pos + len - pos),
  32241. needle.subarray(0, len - pos)
  32242. ) !== 0)
  32243. )
  32244. )
  32245. ) {
  32246. ++pos
  32247. }
  32248. if (pos < len) {
  32249. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  32250. this._lookbehind_size = len - pos
  32251. }
  32252. // Everything until pos is guaranteed not to contain needle data.
  32253. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  32254. this._bufpos = len
  32255. return len
  32256. }
  32257. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  32258. return (pos < 0)
  32259. ? this._lookbehind[this._lookbehind_size + pos]
  32260. : data[pos]
  32261. }
  32262. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  32263. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32264. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  32265. }
  32266. return true
  32267. }
  32268. module.exports = SBMH
  32269. /***/ }),
  32270. /***/ 727:
  32271. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32272. "use strict";
  32273. const WritableStream = (__nccwpck_require__(4492).Writable)
  32274. const { inherits } = __nccwpck_require__(7261)
  32275. const Dicer = __nccwpck_require__(2960)
  32276. const MultipartParser = __nccwpck_require__(2183)
  32277. const UrlencodedParser = __nccwpck_require__(8306)
  32278. const parseParams = __nccwpck_require__(1854)
  32279. function Busboy (opts) {
  32280. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32281. if (typeof opts !== 'object') {
  32282. throw new TypeError('Busboy expected an options-Object.')
  32283. }
  32284. if (typeof opts.headers !== 'object') {
  32285. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32286. }
  32287. if (typeof opts.headers['content-type'] !== 'string') {
  32288. throw new TypeError('Missing Content-Type-header.')
  32289. }
  32290. const {
  32291. headers,
  32292. ...streamOptions
  32293. } = opts
  32294. this.opts = {
  32295. autoDestroy: false,
  32296. ...streamOptions
  32297. }
  32298. WritableStream.call(this, this.opts)
  32299. this._done = false
  32300. this._parser = this.getParserByHeaders(headers)
  32301. this._finished = false
  32302. }
  32303. inherits(Busboy, WritableStream)
  32304. Busboy.prototype.emit = function (ev) {
  32305. if (ev === 'finish') {
  32306. if (!this._done) {
  32307. this._parser?.end()
  32308. return
  32309. } else if (this._finished) {
  32310. return
  32311. }
  32312. this._finished = true
  32313. }
  32314. WritableStream.prototype.emit.apply(this, arguments)
  32315. }
  32316. Busboy.prototype.getParserByHeaders = function (headers) {
  32317. const parsed = parseParams(headers['content-type'])
  32318. const cfg = {
  32319. defCharset: this.opts.defCharset,
  32320. fileHwm: this.opts.fileHwm,
  32321. headers,
  32322. highWaterMark: this.opts.highWaterMark,
  32323. isPartAFile: this.opts.isPartAFile,
  32324. limits: this.opts.limits,
  32325. parsedConType: parsed,
  32326. preservePath: this.opts.preservePath
  32327. }
  32328. if (MultipartParser.detect.test(parsed[0])) {
  32329. return new MultipartParser(this, cfg)
  32330. }
  32331. if (UrlencodedParser.detect.test(parsed[0])) {
  32332. return new UrlencodedParser(this, cfg)
  32333. }
  32334. throw new Error('Unsupported Content-Type.')
  32335. }
  32336. Busboy.prototype._write = function (chunk, encoding, cb) {
  32337. this._parser.write(chunk, cb)
  32338. }
  32339. module.exports = Busboy
  32340. module.exports["default"] = Busboy
  32341. module.exports.Busboy = Busboy
  32342. module.exports.Dicer = Dicer
  32343. /***/ }),
  32344. /***/ 2183:
  32345. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32346. "use strict";
  32347. // TODO:
  32348. // * support 1 nested multipart level
  32349. // (see second multipart example here:
  32350. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32351. // * support limits.fieldNameSize
  32352. // -- this will require modifications to utils.parseParams
  32353. const { Readable } = __nccwpck_require__(4492)
  32354. const { inherits } = __nccwpck_require__(7261)
  32355. const Dicer = __nccwpck_require__(2960)
  32356. const parseParams = __nccwpck_require__(1854)
  32357. const decodeText = __nccwpck_require__(4619)
  32358. const basename = __nccwpck_require__(8647)
  32359. const getLimit = __nccwpck_require__(1467)
  32360. const RE_BOUNDARY = /^boundary$/i
  32361. const RE_FIELD = /^form-data$/i
  32362. const RE_CHARSET = /^charset$/i
  32363. const RE_FILENAME = /^filename$/i
  32364. const RE_NAME = /^name$/i
  32365. Multipart.detect = /^multipart\/form-data/i
  32366. function Multipart (boy, cfg) {
  32367. let i
  32368. let len
  32369. const self = this
  32370. let boundary
  32371. const limits = cfg.limits
  32372. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32373. const parsedConType = cfg.parsedConType || []
  32374. const defCharset = cfg.defCharset || 'utf8'
  32375. const preservePath = cfg.preservePath
  32376. const fileOpts = { highWaterMark: cfg.fileHwm }
  32377. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32378. if (Array.isArray(parsedConType[i]) &&
  32379. RE_BOUNDARY.test(parsedConType[i][0])) {
  32380. boundary = parsedConType[i][1]
  32381. break
  32382. }
  32383. }
  32384. function checkFinished () {
  32385. if (nends === 0 && finished && !boy._done) {
  32386. finished = false
  32387. self.end()
  32388. }
  32389. }
  32390. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32391. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32392. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32393. const filesLimit = getLimit(limits, 'files', Infinity)
  32394. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32395. const partsLimit = getLimit(limits, 'parts', Infinity)
  32396. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32397. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32398. let nfiles = 0
  32399. let nfields = 0
  32400. let nends = 0
  32401. let curFile
  32402. let curField
  32403. let finished = false
  32404. this._needDrain = false
  32405. this._pause = false
  32406. this._cb = undefined
  32407. this._nparts = 0
  32408. this._boy = boy
  32409. const parserCfg = {
  32410. boundary,
  32411. maxHeaderPairs: headerPairsLimit,
  32412. maxHeaderSize: headerSizeLimit,
  32413. partHwm: fileOpts.highWaterMark,
  32414. highWaterMark: cfg.highWaterMark
  32415. }
  32416. this.parser = new Dicer(parserCfg)
  32417. this.parser.on('drain', function () {
  32418. self._needDrain = false
  32419. if (self._cb && !self._pause) {
  32420. const cb = self._cb
  32421. self._cb = undefined
  32422. cb()
  32423. }
  32424. }).on('part', function onPart (part) {
  32425. if (++self._nparts > partsLimit) {
  32426. self.parser.removeListener('part', onPart)
  32427. self.parser.on('part', skipPart)
  32428. boy.hitPartsLimit = true
  32429. boy.emit('partsLimit')
  32430. return skipPart(part)
  32431. }
  32432. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32433. // us emit 'end' early since we know the part has ended if we are already
  32434. // seeing the next part
  32435. if (curField) {
  32436. const field = curField
  32437. field.emit('end')
  32438. field.removeAllListeners('end')
  32439. }
  32440. part.on('header', function (header) {
  32441. let contype
  32442. let fieldname
  32443. let parsed
  32444. let charset
  32445. let encoding
  32446. let filename
  32447. let nsize = 0
  32448. if (header['content-type']) {
  32449. parsed = parseParams(header['content-type'][0])
  32450. if (parsed[0]) {
  32451. contype = parsed[0].toLowerCase()
  32452. for (i = 0, len = parsed.length; i < len; ++i) {
  32453. if (RE_CHARSET.test(parsed[i][0])) {
  32454. charset = parsed[i][1].toLowerCase()
  32455. break
  32456. }
  32457. }
  32458. }
  32459. }
  32460. if (contype === undefined) { contype = 'text/plain' }
  32461. if (charset === undefined) { charset = defCharset }
  32462. if (header['content-disposition']) {
  32463. parsed = parseParams(header['content-disposition'][0])
  32464. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32465. for (i = 0, len = parsed.length; i < len; ++i) {
  32466. if (RE_NAME.test(parsed[i][0])) {
  32467. fieldname = parsed[i][1]
  32468. } else if (RE_FILENAME.test(parsed[i][0])) {
  32469. filename = parsed[i][1]
  32470. if (!preservePath) { filename = basename(filename) }
  32471. }
  32472. }
  32473. } else { return skipPart(part) }
  32474. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32475. let onData,
  32476. onEnd
  32477. if (isPartAFile(fieldname, contype, filename)) {
  32478. // file/binary field
  32479. if (nfiles === filesLimit) {
  32480. if (!boy.hitFilesLimit) {
  32481. boy.hitFilesLimit = true
  32482. boy.emit('filesLimit')
  32483. }
  32484. return skipPart(part)
  32485. }
  32486. ++nfiles
  32487. if (boy.listenerCount('file') === 0) {
  32488. self.parser._ignore()
  32489. return
  32490. }
  32491. ++nends
  32492. const file = new FileStream(fileOpts)
  32493. curFile = file
  32494. file.on('end', function () {
  32495. --nends
  32496. self._pause = false
  32497. checkFinished()
  32498. if (self._cb && !self._needDrain) {
  32499. const cb = self._cb
  32500. self._cb = undefined
  32501. cb()
  32502. }
  32503. })
  32504. file._read = function (n) {
  32505. if (!self._pause) { return }
  32506. self._pause = false
  32507. if (self._cb && !self._needDrain) {
  32508. const cb = self._cb
  32509. self._cb = undefined
  32510. cb()
  32511. }
  32512. }
  32513. boy.emit('file', fieldname, file, filename, encoding, contype)
  32514. onData = function (data) {
  32515. if ((nsize += data.length) > fileSizeLimit) {
  32516. const extralen = fileSizeLimit - nsize + data.length
  32517. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32518. file.truncated = true
  32519. file.bytesRead = fileSizeLimit
  32520. part.removeAllListeners('data')
  32521. file.emit('limit')
  32522. return
  32523. } else if (!file.push(data)) { self._pause = true }
  32524. file.bytesRead = nsize
  32525. }
  32526. onEnd = function () {
  32527. curFile = undefined
  32528. file.push(null)
  32529. }
  32530. } else {
  32531. // non-file field
  32532. if (nfields === fieldsLimit) {
  32533. if (!boy.hitFieldsLimit) {
  32534. boy.hitFieldsLimit = true
  32535. boy.emit('fieldsLimit')
  32536. }
  32537. return skipPart(part)
  32538. }
  32539. ++nfields
  32540. ++nends
  32541. let buffer = ''
  32542. let truncated = false
  32543. curField = part
  32544. onData = function (data) {
  32545. if ((nsize += data.length) > fieldSizeLimit) {
  32546. const extralen = (fieldSizeLimit - (nsize - data.length))
  32547. buffer += data.toString('binary', 0, extralen)
  32548. truncated = true
  32549. part.removeAllListeners('data')
  32550. } else { buffer += data.toString('binary') }
  32551. }
  32552. onEnd = function () {
  32553. curField = undefined
  32554. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32555. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32556. --nends
  32557. checkFinished()
  32558. }
  32559. }
  32560. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32561. broken. Streams2/streams3 is a huge black box of confusion, but
  32562. somehow overriding the sync state seems to fix things again (and still
  32563. seems to work for previous node versions).
  32564. */
  32565. part._readableState.sync = false
  32566. part.on('data', onData)
  32567. part.on('end', onEnd)
  32568. }).on('error', function (err) {
  32569. if (curFile) { curFile.emit('error', err) }
  32570. })
  32571. }).on('error', function (err) {
  32572. boy.emit('error', err)
  32573. }).on('finish', function () {
  32574. finished = true
  32575. checkFinished()
  32576. })
  32577. }
  32578. Multipart.prototype.write = function (chunk, cb) {
  32579. const r = this.parser.write(chunk)
  32580. if (r && !this._pause) {
  32581. cb()
  32582. } else {
  32583. this._needDrain = !r
  32584. this._cb = cb
  32585. }
  32586. }
  32587. Multipart.prototype.end = function () {
  32588. const self = this
  32589. if (self.parser.writable) {
  32590. self.parser.end()
  32591. } else if (!self._boy._done) {
  32592. process.nextTick(function () {
  32593. self._boy._done = true
  32594. self._boy.emit('finish')
  32595. })
  32596. }
  32597. }
  32598. function skipPart (part) {
  32599. part.resume()
  32600. }
  32601. function FileStream (opts) {
  32602. Readable.call(this, opts)
  32603. this.bytesRead = 0
  32604. this.truncated = false
  32605. }
  32606. inherits(FileStream, Readable)
  32607. FileStream.prototype._read = function (n) {}
  32608. module.exports = Multipart
  32609. /***/ }),
  32610. /***/ 8306:
  32611. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32612. "use strict";
  32613. const Decoder = __nccwpck_require__(7100)
  32614. const decodeText = __nccwpck_require__(4619)
  32615. const getLimit = __nccwpck_require__(1467)
  32616. const RE_CHARSET = /^charset$/i
  32617. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32618. function UrlEncoded (boy, cfg) {
  32619. const limits = cfg.limits
  32620. const parsedConType = cfg.parsedConType
  32621. this.boy = boy
  32622. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32623. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32624. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32625. let charset
  32626. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32627. if (Array.isArray(parsedConType[i]) &&
  32628. RE_CHARSET.test(parsedConType[i][0])) {
  32629. charset = parsedConType[i][1].toLowerCase()
  32630. break
  32631. }
  32632. }
  32633. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32634. this.decoder = new Decoder()
  32635. this.charset = charset
  32636. this._fields = 0
  32637. this._state = 'key'
  32638. this._checkingBytes = true
  32639. this._bytesKey = 0
  32640. this._bytesVal = 0
  32641. this._key = ''
  32642. this._val = ''
  32643. this._keyTrunc = false
  32644. this._valTrunc = false
  32645. this._hitLimit = false
  32646. }
  32647. UrlEncoded.prototype.write = function (data, cb) {
  32648. if (this._fields === this.fieldsLimit) {
  32649. if (!this.boy.hitFieldsLimit) {
  32650. this.boy.hitFieldsLimit = true
  32651. this.boy.emit('fieldsLimit')
  32652. }
  32653. return cb()
  32654. }
  32655. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32656. while (p < len) {
  32657. if (this._state === 'key') {
  32658. idxeq = idxamp = undefined
  32659. for (i = p; i < len; ++i) {
  32660. if (!this._checkingBytes) { ++p }
  32661. if (data[i] === 0x3D/* = */) {
  32662. idxeq = i
  32663. break
  32664. } else if (data[i] === 0x26/* & */) {
  32665. idxamp = i
  32666. break
  32667. }
  32668. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32669. this._hitLimit = true
  32670. break
  32671. } else if (this._checkingBytes) { ++this._bytesKey }
  32672. }
  32673. if (idxeq !== undefined) {
  32674. // key with assignment
  32675. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32676. this._state = 'val'
  32677. this._hitLimit = false
  32678. this._checkingBytes = true
  32679. this._val = ''
  32680. this._bytesVal = 0
  32681. this._valTrunc = false
  32682. this.decoder.reset()
  32683. p = idxeq + 1
  32684. } else if (idxamp !== undefined) {
  32685. // key with no assignment
  32686. ++this._fields
  32687. let key; const keyTrunc = this._keyTrunc
  32688. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32689. this._hitLimit = false
  32690. this._checkingBytes = true
  32691. this._key = ''
  32692. this._bytesKey = 0
  32693. this._keyTrunc = false
  32694. this.decoder.reset()
  32695. if (key.length) {
  32696. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32697. '',
  32698. keyTrunc,
  32699. false)
  32700. }
  32701. p = idxamp + 1
  32702. if (this._fields === this.fieldsLimit) { return cb() }
  32703. } else if (this._hitLimit) {
  32704. // we may not have hit the actual limit if there are encoded bytes...
  32705. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32706. p = i
  32707. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32708. // yep, we actually did hit the limit
  32709. this._checkingBytes = false
  32710. this._keyTrunc = true
  32711. }
  32712. } else {
  32713. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32714. p = len
  32715. }
  32716. } else {
  32717. idxamp = undefined
  32718. for (i = p; i < len; ++i) {
  32719. if (!this._checkingBytes) { ++p }
  32720. if (data[i] === 0x26/* & */) {
  32721. idxamp = i
  32722. break
  32723. }
  32724. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32725. this._hitLimit = true
  32726. break
  32727. } else if (this._checkingBytes) { ++this._bytesVal }
  32728. }
  32729. if (idxamp !== undefined) {
  32730. ++this._fields
  32731. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32732. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32733. decodeText(this._val, 'binary', this.charset),
  32734. this._keyTrunc,
  32735. this._valTrunc)
  32736. this._state = 'key'
  32737. this._hitLimit = false
  32738. this._checkingBytes = true
  32739. this._key = ''
  32740. this._bytesKey = 0
  32741. this._keyTrunc = false
  32742. this.decoder.reset()
  32743. p = idxamp + 1
  32744. if (this._fields === this.fieldsLimit) { return cb() }
  32745. } else if (this._hitLimit) {
  32746. // we may not have hit the actual limit if there are encoded bytes...
  32747. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32748. p = i
  32749. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32750. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32751. // yep, we actually did hit the limit
  32752. this._checkingBytes = false
  32753. this._valTrunc = true
  32754. }
  32755. } else {
  32756. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32757. p = len
  32758. }
  32759. }
  32760. }
  32761. cb()
  32762. }
  32763. UrlEncoded.prototype.end = function () {
  32764. if (this.boy._done) { return }
  32765. if (this._state === 'key' && this._key.length > 0) {
  32766. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32767. '',
  32768. this._keyTrunc,
  32769. false)
  32770. } else if (this._state === 'val') {
  32771. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32772. decodeText(this._val, 'binary', this.charset),
  32773. this._keyTrunc,
  32774. this._valTrunc)
  32775. }
  32776. this.boy._done = true
  32777. this.boy.emit('finish')
  32778. }
  32779. module.exports = UrlEncoded
  32780. /***/ }),
  32781. /***/ 7100:
  32782. /***/ ((module) => {
  32783. "use strict";
  32784. const RE_PLUS = /\+/g
  32785. const HEX = [
  32786. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32787. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32788. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32789. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32790. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32791. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32792. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32793. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32794. ]
  32795. function Decoder () {
  32796. this.buffer = undefined
  32797. }
  32798. Decoder.prototype.write = function (str) {
  32799. // Replace '+' with ' ' before decoding
  32800. str = str.replace(RE_PLUS, ' ')
  32801. let res = ''
  32802. let i = 0; let p = 0; const len = str.length
  32803. for (; i < len; ++i) {
  32804. if (this.buffer !== undefined) {
  32805. if (!HEX[str.charCodeAt(i)]) {
  32806. res += '%' + this.buffer
  32807. this.buffer = undefined
  32808. --i // retry character
  32809. } else {
  32810. this.buffer += str[i]
  32811. ++p
  32812. if (this.buffer.length === 2) {
  32813. res += String.fromCharCode(parseInt(this.buffer, 16))
  32814. this.buffer = undefined
  32815. }
  32816. }
  32817. } else if (str[i] === '%') {
  32818. if (i > p) {
  32819. res += str.substring(p, i)
  32820. p = i
  32821. }
  32822. this.buffer = ''
  32823. ++p
  32824. }
  32825. }
  32826. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32827. return res
  32828. }
  32829. Decoder.prototype.reset = function () {
  32830. this.buffer = undefined
  32831. }
  32832. module.exports = Decoder
  32833. /***/ }),
  32834. /***/ 8647:
  32835. /***/ ((module) => {
  32836. "use strict";
  32837. module.exports = function basename (path) {
  32838. if (typeof path !== 'string') { return '' }
  32839. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32840. switch (path.charCodeAt(i)) {
  32841. case 0x2F: // '/'
  32842. case 0x5C: // '\'
  32843. path = path.slice(i + 1)
  32844. return (path === '..' || path === '.' ? '' : path)
  32845. }
  32846. }
  32847. return (path === '..' || path === '.' ? '' : path)
  32848. }
  32849. /***/ }),
  32850. /***/ 4619:
  32851. /***/ (function(module) {
  32852. "use strict";
  32853. // Node has always utf-8
  32854. const utf8Decoder = new TextDecoder('utf-8')
  32855. const textDecoders = new Map([
  32856. ['utf-8', utf8Decoder],
  32857. ['utf8', utf8Decoder]
  32858. ])
  32859. function getDecoder (charset) {
  32860. let lc
  32861. while (true) {
  32862. switch (charset) {
  32863. case 'utf-8':
  32864. case 'utf8':
  32865. return decoders.utf8
  32866. case 'latin1':
  32867. case 'ascii': // TODO: Make these a separate, strict decoder?
  32868. case 'us-ascii':
  32869. case 'iso-8859-1':
  32870. case 'iso8859-1':
  32871. case 'iso88591':
  32872. case 'iso_8859-1':
  32873. case 'windows-1252':
  32874. case 'iso_8859-1:1987':
  32875. case 'cp1252':
  32876. case 'x-cp1252':
  32877. return decoders.latin1
  32878. case 'utf16le':
  32879. case 'utf-16le':
  32880. case 'ucs2':
  32881. case 'ucs-2':
  32882. return decoders.utf16le
  32883. case 'base64':
  32884. return decoders.base64
  32885. default:
  32886. if (lc === undefined) {
  32887. lc = true
  32888. charset = charset.toLowerCase()
  32889. continue
  32890. }
  32891. return decoders.other.bind(charset)
  32892. }
  32893. }
  32894. }
  32895. const decoders = {
  32896. utf8: (data, sourceEncoding) => {
  32897. if (data.length === 0) {
  32898. return ''
  32899. }
  32900. if (typeof data === 'string') {
  32901. data = Buffer.from(data, sourceEncoding)
  32902. }
  32903. return data.utf8Slice(0, data.length)
  32904. },
  32905. latin1: (data, sourceEncoding) => {
  32906. if (data.length === 0) {
  32907. return ''
  32908. }
  32909. if (typeof data === 'string') {
  32910. return data
  32911. }
  32912. return data.latin1Slice(0, data.length)
  32913. },
  32914. utf16le: (data, sourceEncoding) => {
  32915. if (data.length === 0) {
  32916. return ''
  32917. }
  32918. if (typeof data === 'string') {
  32919. data = Buffer.from(data, sourceEncoding)
  32920. }
  32921. return data.ucs2Slice(0, data.length)
  32922. },
  32923. base64: (data, sourceEncoding) => {
  32924. if (data.length === 0) {
  32925. return ''
  32926. }
  32927. if (typeof data === 'string') {
  32928. data = Buffer.from(data, sourceEncoding)
  32929. }
  32930. return data.base64Slice(0, data.length)
  32931. },
  32932. other: (data, sourceEncoding) => {
  32933. if (data.length === 0) {
  32934. return ''
  32935. }
  32936. if (typeof data === 'string') {
  32937. data = Buffer.from(data, sourceEncoding)
  32938. }
  32939. if (textDecoders.has(this.toString())) {
  32940. try {
  32941. return textDecoders.get(this).decode(data)
  32942. } catch {}
  32943. }
  32944. return typeof data === 'string'
  32945. ? data
  32946. : data.toString()
  32947. }
  32948. }
  32949. function decodeText (text, sourceEncoding, destEncoding) {
  32950. if (text) {
  32951. return getDecoder(destEncoding)(text, sourceEncoding)
  32952. }
  32953. return text
  32954. }
  32955. module.exports = decodeText
  32956. /***/ }),
  32957. /***/ 1467:
  32958. /***/ ((module) => {
  32959. "use strict";
  32960. module.exports = function getLimit (limits, name, defaultLimit) {
  32961. if (
  32962. !limits ||
  32963. limits[name] === undefined ||
  32964. limits[name] === null
  32965. ) { return defaultLimit }
  32966. if (
  32967. typeof limits[name] !== 'number' ||
  32968. isNaN(limits[name])
  32969. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32970. return limits[name]
  32971. }
  32972. /***/ }),
  32973. /***/ 1854:
  32974. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32975. "use strict";
  32976. /* eslint-disable object-property-newline */
  32977. const decodeText = __nccwpck_require__(4619)
  32978. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32979. const EncodedLookup = {
  32980. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32981. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32982. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32983. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  32984. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  32985. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  32986. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  32987. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  32988. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  32989. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  32990. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  32991. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  32992. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  32993. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  32994. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  32995. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  32996. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  32997. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  32998. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  32999. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  33000. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  33001. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  33002. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  33003. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  33004. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  33005. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  33006. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  33007. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  33008. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  33009. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  33010. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  33011. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  33012. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  33013. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  33014. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  33015. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  33016. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  33017. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  33018. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  33019. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  33020. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  33021. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  33022. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  33023. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  33024. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  33025. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  33026. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  33027. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  33028. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  33029. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  33030. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  33031. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  33032. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  33033. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  33034. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  33035. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  33036. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  33037. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  33038. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  33039. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  33040. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  33041. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  33042. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  33043. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  33044. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  33045. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  33046. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  33047. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  33048. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  33049. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  33050. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  33051. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  33052. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  33053. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  33054. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  33055. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  33056. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  33057. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  33058. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  33059. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  33060. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  33061. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  33062. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  33063. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  33064. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  33065. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  33066. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  33067. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  33068. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  33069. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  33070. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  33071. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  33072. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  33073. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  33074. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  33075. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  33076. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  33077. }
  33078. function encodedReplacer (match) {
  33079. return EncodedLookup[match]
  33080. }
  33081. const STATE_KEY = 0
  33082. const STATE_VALUE = 1
  33083. const STATE_CHARSET = 2
  33084. const STATE_LANG = 3
  33085. function parseParams (str) {
  33086. const res = []
  33087. let state = STATE_KEY
  33088. let charset = ''
  33089. let inquote = false
  33090. let escaping = false
  33091. let p = 0
  33092. let tmp = ''
  33093. const len = str.length
  33094. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  33095. const char = str[i]
  33096. if (char === '\\' && inquote) {
  33097. if (escaping) { escaping = false } else {
  33098. escaping = true
  33099. continue
  33100. }
  33101. } else if (char === '"') {
  33102. if (!escaping) {
  33103. if (inquote) {
  33104. inquote = false
  33105. state = STATE_KEY
  33106. } else { inquote = true }
  33107. continue
  33108. } else { escaping = false }
  33109. } else {
  33110. if (escaping && inquote) { tmp += '\\' }
  33111. escaping = false
  33112. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  33113. if (state === STATE_CHARSET) {
  33114. state = STATE_LANG
  33115. charset = tmp.substring(1)
  33116. } else { state = STATE_VALUE }
  33117. tmp = ''
  33118. continue
  33119. } else if (state === STATE_KEY &&
  33120. (char === '*' || char === '=') &&
  33121. res.length) {
  33122. state = char === '*'
  33123. ? STATE_CHARSET
  33124. : STATE_VALUE
  33125. res[p] = [tmp, undefined]
  33126. tmp = ''
  33127. continue
  33128. } else if (!inquote && char === ';') {
  33129. state = STATE_KEY
  33130. if (charset) {
  33131. if (tmp.length) {
  33132. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33133. 'binary',
  33134. charset)
  33135. }
  33136. charset = ''
  33137. } else if (tmp.length) {
  33138. tmp = decodeText(tmp, 'binary', 'utf8')
  33139. }
  33140. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  33141. tmp = ''
  33142. ++p
  33143. continue
  33144. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  33145. }
  33146. tmp += char
  33147. }
  33148. if (charset && tmp.length) {
  33149. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33150. 'binary',
  33151. charset)
  33152. } else if (tmp) {
  33153. tmp = decodeText(tmp, 'binary', 'utf8')
  33154. }
  33155. if (res[p] === undefined) {
  33156. if (tmp) { res[p] = tmp }
  33157. } else { res[p][1] = tmp }
  33158. return res
  33159. }
  33160. module.exports = parseParams
  33161. /***/ })
  33162. /******/ });
  33163. /************************************************************************/
  33164. /******/ // The module cache
  33165. /******/ var __webpack_module_cache__ = {};
  33166. /******/
  33167. /******/ // The require function
  33168. /******/ function __nccwpck_require__(moduleId) {
  33169. /******/ // Check if module is in cache
  33170. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  33171. /******/ if (cachedModule !== undefined) {
  33172. /******/ return cachedModule.exports;
  33173. /******/ }
  33174. /******/ // Create a new module (and put it into the cache)
  33175. /******/ var module = __webpack_module_cache__[moduleId] = {
  33176. /******/ // no module.id needed
  33177. /******/ // no module.loaded needed
  33178. /******/ exports: {}
  33179. /******/ };
  33180. /******/
  33181. /******/ // Execute the module function
  33182. /******/ var threw = true;
  33183. /******/ try {
  33184. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  33185. /******/ threw = false;
  33186. /******/ } finally {
  33187. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  33188. /******/ }
  33189. /******/
  33190. /******/ // Return the exports of the module
  33191. /******/ return module.exports;
  33192. /******/ }
  33193. /******/
  33194. /************************************************************************/
  33195. /******/ /* webpack/runtime/compat */
  33196. /******/
  33197. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  33198. /******/
  33199. /************************************************************************/
  33200. /******/
  33201. /******/ // startup
  33202. /******/ // Load entry module and return exports
  33203. /******/ // This entry module is referenced by other modules so it can't be inlined
  33204. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  33205. /******/ module.exports = __webpack_exports__;
  33206. /******/
  33207. /******/ })()
  33208. ;